From c7ee6b3dbb8dfad61aa337b2ecf7e4eaeddc4b4b Mon Sep 17 00:00:00 2001 From: "Eugene S. Sobolev" Date: Fri, 14 Feb 2020 11:49:06 +0300 Subject: [PATCH 01/50] network/net-lib.sh: Configure all iBFT interfaces Added boolean command line option rd.iscsi.mp --- dracut.cmdline.7.asc | 3 +++ modules.d/40network/net-lib.sh | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc index 76836856..646f1f03 100644 --- a/dracut.cmdline.7.asc +++ b/dracut.cmdline.7.asc @@ -786,6 +786,9 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30 **rd.iscsi.ibft** **rd.iscsi.ibft=1**: Turn on iBFT autoconfiguration for the interfaces +**rd.iscsi.mp** **rd.iscsi.mp=1**: + Configure all iBFT interfaces, not only used for booting (multipath) + **rd.iscsi.waitnet=0**: Turn off waiting for all interfaces to be up before trying to login to the iSCSI targets. diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh index e33ab548..16730e5b 100755 --- a/modules.d/40network/net-lib.sh +++ b/modules.d/40network/net-lib.sh @@ -251,8 +251,10 @@ ibft_to_cmdline() { [ -e ${iface}/flags ] && flags=$(read a < ${iface}/flags; echo $a) # Skip invalid interfaces (( $flags & 1 )) || continue - # Skip interfaces not used for booting - (( $flags & 2 )) || continue + # Skip interfaces not used for booting unless using multipath + if ! getargbool 0 rd.iscsi.mp ; then + (( $flags & 2 )) || continue + fi [ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a) [ -e ${iface}/origin ] && origin=$(read a < ${iface}/origin; echo $a) [ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a) From 16abea2592d7fee6166660098b647356d5a4cc14 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 18 Feb 2020 15:32:24 +0100 Subject: [PATCH 02/50] systemd: install systemd-tty-ask-password-agent systemd-ask-password fixes https://github.com/dracutdevs/dracut/issues/726 --- modules.d/00systemd/module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh index 2e4274f2..5ebdfc30 100755 --- a/modules.d/00systemd/module-setup.sh +++ b/modules.d/00systemd/module-setup.sh @@ -154,6 +154,7 @@ install() { mount umount reboot poweroff \ systemd-run systemd-escape \ systemd-cgls systemd-tmpfiles \ + systemd-ask-password systemd-tty-ask-password-agent \ /etc/udev/udev.hwdb \ ${NULL} @@ -254,4 +255,3 @@ install() { systemctl -q --root "$initdir" set-default multi-user.target } - From 4237aeb040c276722b528001bdea31e6eb994d06 Mon Sep 17 00:00:00 2001 From: Donovan Tremura Date: Sat, 15 Feb 2020 05:18:19 +0000 Subject: [PATCH 03/50] Support the EFI Stub loader's splash image feature. Checks if `uefi_splash_image` exists in `dracutsysroot` if not unset `uefi_splash_image`. Alternate Value parameter expansion adds section-vma for splash image to EFI stub loader when the path to image is valid and not an empty file. I did not test on other distributions, but on Arch Linux the `systemd` package includes a splash image at the path `/usr/share/systemd/bootctl/splash-arch.bmp`. Perhaps, if this is a common practice, a default image could be gathered from that directory. It is required that the image be in bitmap (`.bmp`) format according to `splash.c`. The code for `stub.c` and `splash.c` can be found at: https://github.com/systemd/systemd/blob/master/src/boot/efi/stub.c https://github.com/systemd/systemd/blob/master/src/boot/efi/splash.c --- dracut.8.asc | 4 ++++ dracut.conf.5.asc | 3 +++ dracut.sh | 12 +++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/dracut.8.asc b/dracut.8.asc index d3f135db..a873611e 100644 --- a/dracut.8.asc +++ b/dracut.8.asc @@ -517,6 +517,10 @@ will not be able to boot. _$prefix/lib/systemd/boot/efi/linux.efi.stub_ or _$prefix/lib/gummiboot/linux.efi.stub_ +**--uefi-splash-image __**:: + Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image + format. + **--kernel-image __**:: Specifies the kernel image, which to include in the UEFI executable. The default is _/lib/modules//vmlinuz_ or _/boot/vmlinuz-_ diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc index b3bf6f44..937f5423 100644 --- a/dracut.conf.5.asc +++ b/dracut.conf.5.asc @@ -205,6 +205,9 @@ provide a valid _/etc/fstab_. _/lib/systemd/boot/efi/linux.efi.stub_ or _/usr/lib/gummiboot/linux.efi.stub_ +*uefi_splash_image=*"__":: + Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image format. + *uefi_secureboot_cert=*"__", *uefi_secureboot_key=*"__":: Specifies a certificate and corresponding key, which are used to sign the created UEFI executable. Requires both certificate and key need to be specified and _sbsign_ to be installed. diff --git a/dracut.sh b/dracut.sh index 6738dc91..908d3448 100755 --- a/dracut.sh +++ b/dracut.sh @@ -236,6 +236,9 @@ Creates initial ramdisk images for preloading modules --uefi Create an UEFI executable with the kernel cmdline and kernel combined --uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable + --uefi-splash-image [FILE] + Use [FILE] as a splash image when creating an UEFI + executable --kernel-image [FILE] location of the kernel image If [LIST] has multiple arguments, then you have to put these in quotes. @@ -398,6 +401,7 @@ rearrange_params() --long loginstall: \ --long uefi \ --long uefi-stub: \ + --long uefi-splash-image: \ --long kernel-image: \ --long no-hostonly-i18n \ --long hostonly-i18n \ @@ -596,6 +600,8 @@ while :; do --uefi) uefi="yes";; --uefi-stub) uefi_stub_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;; + --uefi-splash-image) + uefi_splash_image_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;; --kernel-image) kernel_image_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;; --no-machineid) @@ -772,6 +778,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l)) [[ $reproducible_l ]] && reproducible="$reproducible_l" [[ $loginstall_l ]] && loginstall="$loginstall_l" [[ $uefi_stub_l ]] && uefi_stub="$uefi_stub_l" +[[ $uefi_splash_image_l ]] && uefi_splash_image="$uefi_splash_image_l" [[ $kernel_image_l ]] && kernel_image="$kernel_image_l" [[ $machine_id_l ]] && machine_id="$machine_id_l" @@ -2018,11 +2025,14 @@ if [[ $uefi = yes ]]; then [[ -s $dracutsysrootdir/usr/lib/os-release ]] && uefi_osrelease="$dracutsysrootdir/usr/lib/os-release" [[ -s $dracutsysrootdir/etc/os-release ]] && uefi_osrelease="$dracutsysrootdir/etc/os-release" + [[ -s "${dracutsysrootdir}${uefi_splash_image}" ]] && \ + uefi_splash_image="${dracutsysroot}${uefi_splash_image}" || unset uefi_splash_image if objcopy \ ${uefi_osrelease:+--add-section .osrel=$uefi_osrelease --change-section-vma .osrel=0x20000} \ --add-section .cmdline="${uefi_outdir}/cmdline.txt" --change-section-vma .cmdline=0x30000 \ - --add-section .linux="$kernel_image" --change-section-vma .linux=0x40000 \ + ${uefi_splash_image:+--add-section .splash="$uefi_splash_image" --change-section-vma .splash=0x40000} \ + --add-section .linux="$kernel_image" --change-section-vma .linux=0x2000000 \ --add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd=0x3000000 \ "$uefi_stub" "${uefi_outdir}/linux.efi"; then if [[ -n "${uefi_secureboot_key}" && -n "${uefi_secureboot_cert}" ]]; then \ From 150cea0336e2edf04450d0477895821c2d531c1f Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 25 Feb 2020 14:01:13 +0100 Subject: [PATCH 04/50] github workflow --- .github/workflows/build.yml | 31 +++++++++++++++++++++++ .travis.yml | 49 ------------------------------------- 2 files changed, 31 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..0eb35cd6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: Rust + +on: + push: + branches: + - 'master' + tags: + - '*' + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 15 + container: registry.fedoraproject.org/fedora:latest + + steps: + - name: "Checkout Repository" + uses: actions/checkout@v2 + + - name: "Print Versions" + run: | + sudo modprobe kvm-intel nested=1 || : + sudo modprobe kvm-amd nested=1 || : + dmesg | tail || : + git fetch --tags --unshallow + git describe --abbrev=0 --tags || : + git describe --tags || : + + - name: "TEST-01" + run: ./fedora-test.sh "TEST-01" "01" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 40c8d1f6..00000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -language: generic -dist: bionic -sudo: required -services: -- docker -env: - matrix: - - IMAGE=latest - - IMAGE=latest TESTS=01 - - IMAGE=latest TESTS=12 - - IMAGE=latest TESTS=20 - - IMAGE=latest TESTS=50 - - IMAGE=latest TESTS=30 - - IMAGE=latest TESTS=31 - - IMAGE=latest TESTS=60 - - IMAGE=latest TESTS=70 - - IMAGE=latest TESTS=99 - - IMAGE=latest TESTS=02 - - IMAGE=latest TESTS=03 - - IMAGE=latest TESTS=04 - - IMAGE=latest TESTS=10 - - IMAGE=latest TESTS=11 - - IMAGE=latest TESTS=13 - - IMAGE=latest TESTS=14 - - IMAGE=latest TESTS=15 - - IMAGE=latest TESTS=17 - -before_script: - - docker pull fedora:$IMAGE - - | - sudo modprobe kvm-intel nested=1 || : - sudo modprobe kvm-amd nested=1 || : - dmesg | tail || : - - git fetch --tags --unshallow - - | - git describe --abbrev=0 --tags || : - git describe --tags || : - -script: -- docker run --privileged -it -v $(pwd)/:/dracut fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS" - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/effa917ca3e0ed5fd00e - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always - From 2dc0cb50e3189918fb73821b5798e7572288aede Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 25 Feb 2020 14:06:36 +0100 Subject: [PATCH 05/50] Revert "github workflow" This reverts commit 150cea0336e2edf04450d0477895821c2d531c1f. --- .github/workflows/build.yml | 31 ----------------------- .travis.yml | 49 +++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 0eb35cd6..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Rust - -on: - push: - branches: - - 'master' - tags: - - '*' - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 15 - container: registry.fedoraproject.org/fedora:latest - - steps: - - name: "Checkout Repository" - uses: actions/checkout@v2 - - - name: "Print Versions" - run: | - sudo modprobe kvm-intel nested=1 || : - sudo modprobe kvm-amd nested=1 || : - dmesg | tail || : - git fetch --tags --unshallow - git describe --abbrev=0 --tags || : - git describe --tags || : - - - name: "TEST-01" - run: ./fedora-test.sh "TEST-01" "01" diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..40c8d1f6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,49 @@ +language: generic +dist: bionic +sudo: required +services: +- docker +env: + matrix: + - IMAGE=latest + - IMAGE=latest TESTS=01 + - IMAGE=latest TESTS=12 + - IMAGE=latest TESTS=20 + - IMAGE=latest TESTS=50 + - IMAGE=latest TESTS=30 + - IMAGE=latest TESTS=31 + - IMAGE=latest TESTS=60 + - IMAGE=latest TESTS=70 + - IMAGE=latest TESTS=99 + - IMAGE=latest TESTS=02 + - IMAGE=latest TESTS=03 + - IMAGE=latest TESTS=04 + - IMAGE=latest TESTS=10 + - IMAGE=latest TESTS=11 + - IMAGE=latest TESTS=13 + - IMAGE=latest TESTS=14 + - IMAGE=latest TESTS=15 + - IMAGE=latest TESTS=17 + +before_script: + - docker pull fedora:$IMAGE + - | + sudo modprobe kvm-intel nested=1 || : + sudo modprobe kvm-amd nested=1 || : + dmesg | tail || : + - git fetch --tags --unshallow + - | + git describe --abbrev=0 --tags || : + git describe --tags || : + +script: +- docker run --privileged -it -v $(pwd)/:/dracut fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS" + +notifications: + webhooks: + urls: + - https://webhooks.gitter.im/e/effa917ca3e0ed5fd00e + on_success: change # options: [always|never|change] default: always + on_failure: always # options: [always|never|change] default: always + on_start: never # options: [always|never|change] default: always + From 7795fde44c54bfe753cc07999a4c2f9dd7e2820d Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Wed, 19 Feb 2020 11:11:32 -0500 Subject: [PATCH 06/50] network-legacy/ifup: drop redundant if-statement No need to check that `$ret` is 0, we're already running inside an if-statement block which checks this. --- modules.d/35network-legacy/ifup.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh index 1d5a2e89..a3756c5d 100755 --- a/modules.d/35network-legacy/ifup.sh +++ b/modules.d/35network-legacy/ifup.sh @@ -457,12 +457,10 @@ for p in $(getargs ip=); do dhcp|on|any|dhcp6) ;; *) - if [ $ret -eq 0 ]; then - setup_net $netif - source_hook initqueue/online $netif - if [ -z "$manualup" ]; then - /sbin/netroot $netif - fi + setup_net $netif + source_hook initqueue/online $netif + if [ -z "$manualup" ]; then + /sbin/netroot $netif fi ;; esac From 4985aa8c6e89451996e659a39fec7646e9e25f76 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Wed, 19 Feb 2020 10:44:24 -0500 Subject: [PATCH 07/50] network-legacy/ifup: fix ip=dhcp,dhcp6 setup_net logic Previously, we were doing `setup_net` from `ifup` for any setup that wasn't DHCP, since those are already taken care of by `dhclient-script`. The issue is that the case-statement we use to detect this doesn't catch options like `ip=dhcp,dhcp6`. Fix this by reworking the logic here to just check if a `setup_net_$netif.sh` hook exists. If so, then we know that `setup_net` will be called for this interface later. This was causing issues in RHCOS which now ships with `ip=dhcp,dhcp6` to support IPv6 environments[1]. The code here would make us do `setup_net` pre-emptively which IIUC would then cause the initqueue to finish earlier even if we had more udev netif events to process. [1] https://github.com/coreos/coreos-assembler/pull/1067 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1803926 --- modules.d/35network-legacy/ifup.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh index a3756c5d..c05ccc1b 100755 --- a/modules.d/35network-legacy/ifup.sh +++ b/modules.d/35network-legacy/ifup.sh @@ -453,17 +453,15 @@ for p in $(getargs ip=); do > /tmp/net.$(cat /sys/class/net/${netif}/address).up fi - case $autoconf in - dhcp|on|any|dhcp6) - ;; - *) - setup_net $netif - source_hook initqueue/online $netif - if [ -z "$manualup" ]; then - /sbin/netroot $netif - fi - ;; - esac + # and finally, finish interface set up if there isn't already a script + # to do so (which is the case in the dhcp path) + if [ ! -e $hookdir/initqueue/setup_net_$netif.sh ]; then + setup_net $netif + source_hook initqueue/online $netif + if [ -z "$manualup" ]; then + /sbin/netroot $netif + fi + fi if command -v wicked >/dev/null && [ -z "$manualup" ]; then /sbin/netroot $netif From a8ba1c4e25051c3c482bb7a6a754c9d785463917 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 26 Feb 2020 16:53:47 +0100 Subject: [PATCH 08/50] network-legacy/net-genrules.sh: use $name instead of $env{INTERFACE} The original behavior of $env{INTERFACE} was undocumented and changed in the recent udev versions, breaking the ability to bring up networking reliably. Switching to $name directive should fix this issue. Related links: - systemd/systemd#12700 (udev PR) - systemd/systemd#12291 (related udev issue) - systemd/systemd#14935 (this issue, udev side) - #732 (this issue, dracut side) Fixes: #732 --- modules.d/35network-legacy/net-genrules.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules.d/35network-legacy/net-genrules.sh b/modules.d/35network-legacy/net-genrules.sh index d531bb56..41ee93fb 100755 --- a/modules.d/35network-legacy/net-genrules.sh +++ b/modules.d/35network-legacy/net-genrules.sh @@ -65,9 +65,9 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh bootdev=$(cat /tmp/net.bootdev) fi - ifup='/sbin/ifup $env{INTERFACE}' + ifup='/sbin/ifup $name' - runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\"" + runcmd="RUN+=\"/sbin/initqueue --name ifup-\$name --unique --onetime $ifup\"" # We have some specific interfaces to handle if [ -n "${RAW_IFACES}${IFACES}" ]; then From 93be2bc6ab00d40b304d2a3b1ce02fd8a3f31b31 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 27 Feb 2020 13:21:06 +0100 Subject: [PATCH 09/50] add DRACUT_NO_XATTR global environment variable Useful, if you know, that those can't be copied anyway. --- dracut-init.sh | 2 +- install/dracut-install.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dracut-init.sh b/dracut-init.sh index 0ff9b7e5..a8348b79 100644 --- a/dracut-init.sh +++ b/dracut-init.sh @@ -19,7 +19,7 @@ # export LC_MESSAGES=C -if [[ "$EUID" = "0" ]]; then +if [[ "$EUID" = "0" ]] && ! [[ $DRACUT_NO_XATTR ]]; then export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,xattr,links -dfr" else export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,links -dfr" diff --git a/install/dracut-install.c b/install/dracut-install.c index 41938504..5d48e9d5 100644 --- a/install/dracut-install.c +++ b/install/dracut-install.c @@ -59,6 +59,7 @@ static bool arg_modalias = false; static bool arg_resolvelazy = false; static bool arg_resolvedeps = false; static bool arg_hostonly = false; +static bool no_xattr = false; static char *destrootdir = NULL; static char *sysrootdir = NULL; static size_t sysrootdirlen = 0; @@ -310,7 +311,7 @@ static int cp(const char *src, const char *dst) normal_copy: pid = fork(); if (pid == 0) { - if (geteuid() == 0) + if (geteuid() == 0 && no_xattr == false) execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,xattr,timestamps", "-fL", src, dst, NULL); else @@ -322,7 +323,7 @@ static int cp(const char *src, const char *dst) while (waitpid(pid, &ret, 0) < 0) { if (errno != EINTR) { ret = -1; - if (geteuid() == 0) + if (geteuid() == 0 && no_xattr == false) log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,xattr,timestamps -fL %s %s", src, dst); else @@ -1898,6 +1899,7 @@ int main(int argc, char **argv) int r; char *i; char *path = NULL; + char *env_no_xattr = NULL; r = parse_argv(argc, argv); if (r <= 0) @@ -1945,6 +1947,10 @@ int main(int argc, char **argv) ldd = "ldd"; log_debug("LDD=%s", ldd); + env_no_xattr = getenv("DRACUT_NO_XATTR"); + if (env_no_xattr != NULL) + no_xattr = true; + pathdirs = strv_split(path, ":"); umask(0022); From 3aae122c4b492ff70cb3a820a0dccd6756760573 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 25 Feb 2020 14:08:10 +0100 Subject: [PATCH 10/50] Add github workflow --- .github/workflows/fedora-30.yml | 29 ++++++++++++++++++++ .github/workflows/fedora-31.yml | 29 ++++++++++++++++++++ .travis.yml | 4 +-- README.md | 2 ++ fedora-test-github.sh | 28 +++++++++++++++++++ fedora-test.sh | 36 +------------------------ test/TEST-20-NFS/test.sh | 12 +++++++-- test/TEST-30-ISCSI/test.sh | 12 +++++++-- test/TEST-31-ISCSI-MULTI/test.sh | 12 +++++++-- test/TEST-40-NBD/test.sh | 12 +++++++-- test/TEST-50-MULTINIC/test.sh | 12 +++++++-- test/TEST-60-IFCFG/server-init.sh | 2 +- test/TEST-60-IFCFG/test.sh | 14 +++++++--- test/TEST-70-BONDBRIDGETEAMVLAN/test.sh | 14 +++++++--- 14 files changed, 164 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/fedora-30.yml create mode 100644 .github/workflows/fedora-31.yml create mode 100755 fedora-test-github.sh diff --git a/.github/workflows/fedora-30.yml b/.github/workflows/fedora-30.yml new file mode 100644 index 00000000..e8c5321c --- /dev/null +++ b/.github/workflows/fedora-30.yml @@ -0,0 +1,29 @@ +## The test container is created with https://github.com/dracutdevs/fedora-container + +name: Fedora-30 + +on: + push: + branches: + - 'master' + tags: + - '*' + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + #container: quay.io/haraldh/dracut-fedora:30 + timeout-minutes: 30 + strategy: + matrix: + test: [ "01", "02", "03", "04", "10", "11", "12", "13", "14", "15", "17", "20", "30", "31", "40", "50", "60" ] + fail-fast: false + steps: + - name: "Checkout Repository" + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: "TEST-${{ matrix.test }}" + run: docker run --privileged -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:30 /dracut/fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} diff --git a/.github/workflows/fedora-31.yml b/.github/workflows/fedora-31.yml new file mode 100644 index 00000000..d1260f85 --- /dev/null +++ b/.github/workflows/fedora-31.yml @@ -0,0 +1,29 @@ +## The test container is created with https://github.com/dracutdevs/fedora-container + +name: Fedora-31 + +on: + push: + branches: + - 'master' + tags: + - '*' + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + #container: quay.io/haraldh/dracut-fedora:30 + timeout-minutes: 30 + strategy: + matrix: + test: [ "01", "02", "03", "04", "10", "11", "12", "13", "14", "15", "17", "20", "30", "31", "40", "50", "60" ] + fail-fast: false + steps: + - name: "Checkout Repository" + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: "TEST-${{ matrix.test }}" + run: docker run --privileged -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:31 /dracut/fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} diff --git a/.travis.yml b/.travis.yml index 40c8d1f6..1c46062c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,8 @@ env: - IMAGE=latest TESTS=50 - IMAGE=latest TESTS=30 - IMAGE=latest TESTS=31 + - IMAGE=latest TESTS=40 - IMAGE=latest TESTS=60 - - IMAGE=latest TESTS=70 - IMAGE=latest TESTS=99 - IMAGE=latest TESTS=02 - IMAGE=latest TESTS=03 @@ -37,7 +37,7 @@ before_script: git describe --tags || : script: -- docker run --privileged -it -v $(pwd)/:/dracut fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS" +- docker run --privileged -it -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS" notifications: webhooks: diff --git a/README.md b/README.md index 418daa1d..c0ee79e2 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ dracut dracut is an event driven initramfs infrastructure. [![Build Status](https://travis-ci.org/dracutdevs/dracut.svg?branch=master)](https://travis-ci.org/dracutdevs/dracut) +![Fedora-30](https://github.com/dracutdevs/dracut/workflows/Fedora-30/badge.svg?branch=master) +![Fedora-31](https://github.com/dracutdevs/dracut/workflows/Fedora-31/badge.svg?branch=master) dracut (the tool) is used to create an initramfs image by copying tools and files from an installed system and combining it with the diff --git a/fedora-test-github.sh b/fedora-test-github.sh new file mode 100755 index 00000000..01312e2c --- /dev/null +++ b/fedora-test-github.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -ex + +[[ -d ${0%/*} ]] && cd ${0%/*} + +RUN_ID="$1" +TESTS=$2 + +./configure + +NCPU=$(getconf _NPROCESSORS_ONLN) + +if ! [[ $TESTS ]]; then + make -j$NCPU all syncheck rpm logtee +else + make -j$NCPU all logtee + + cd test + + time LOGTEE_TIMEOUT_MS=590000 make \ + KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \ + DRACUT_NO_XATTR=1 \ + TEST_RUN_ID=$RUN_ID \ + ${TESTS:+TESTS="$TESTS"} \ + -k V=1 \ + check +fi diff --git a/fedora-test.sh b/fedora-test.sh index 62725a32..096ed6c4 100755 --- a/fedora-test.sh +++ b/fedora-test.sh @@ -7,41 +7,6 @@ set -ex RUN_ID="$1" TESTS=$2 -dnf -y update --best --allowerasing &>/dev/null - -dnf -y install --best --allowerasing \ - dash \ - asciidoc \ - mdadm \ - lvm2 \ - dmraid \ - cryptsetup \ - nfs-utils \ - nbd \ - dhcp-server \ - scsi-target-utils \ - iscsi-initiator-utils \ - strace \ - btrfs-progs \ - kmod-devel \ - gcc \ - bzip2 \ - xz \ - tar \ - wget \ - rpm-build \ - make \ - git \ - bash-completion \ - sudo \ - kernel \ - dhcp-client \ - /usr/bin/qemu-kvm \ - /usr/bin/qemu-system-$(uname -i) \ - e2fsprogs \ - tcpdump \ - $NULL &>/dev/null - ./configure NCPU=$(getconf _NPROCESSORS_ONLN) @@ -55,6 +20,7 @@ else time sudo LOGTEE_TIMEOUT_MS=590000 make \ KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \ + DRACUT_NO_XATTR=1 \ TEST_RUN_ID=$RUN_ID \ ${TESTS:+TESTS="$TESTS"} \ -k V=2 \ diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 97ee5e7b..6334e229 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -30,8 +30,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 10 seconds to give the server a head start - sleep 10 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } client_test() { diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index e909d373..6e3613a6 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -34,8 +34,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 20 seconds to give the server a head start - sleep 20 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } run_client() { diff --git a/test/TEST-31-ISCSI-MULTI/test.sh b/test/TEST-31-ISCSI-MULTI/test.sh index c9df0fb3..946a198a 100755 --- a/test/TEST-31-ISCSI-MULTI/test.sh +++ b/test/TEST-31-ISCSI-MULTI/test.sh @@ -34,8 +34,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 20 seconds to give the server a head start - sleep 20 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } run_client() { diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index b53992bc..5e0793c9 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -35,8 +35,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 10 seconds to give the server a head start - sleep 10 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } client_test() { diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index 22739071..dfddfbd7 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -32,8 +32,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 10 seconds to give the server a head start - sleep 10 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } client_test() { diff --git a/test/TEST-60-IFCFG/server-init.sh b/test/TEST-60-IFCFG/server-init.sh index 7aae0f13..cff29a3b 100755 --- a/test/TEST-60-IFCFG/server-init.sh +++ b/test/TEST-60-IFCFG/server-init.sh @@ -116,7 +116,7 @@ dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases ens3 ens5 #sh -i #tcpdump -i ens3 # Wait forever for the VM to die -echo "Serving NFS mounts" +echo "Serving" while :; do sleep 10 >/dev/watchdog diff --git a/test/TEST-60-IFCFG/test.sh b/test/TEST-60-IFCFG/test.sh index a766443b..59dc9475 100755 --- a/test/TEST-60-IFCFG/test.sh +++ b/test/TEST-60-IFCFG/test.sh @@ -39,8 +39,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 10 seconds to give the server a head start - sleep 10 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } client_test() { @@ -99,7 +107,7 @@ client_test() { -initrd "$TESTDIR"/initramfs.testing fi - { + { read OK if [[ "$OK" != "OK" ]]; then echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh index 5cb88782..f121d5b5 100755 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh +++ b/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh @@ -39,8 +39,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 10 seconds to give the server a head start - sleep 10 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } client_test() { @@ -99,7 +107,7 @@ client_test() { -initrd "$TESTDIR"/initramfs.testing fi - { + { read OK if [[ "$OK" != "OK" ]]; then echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" From f7b9356c9e21683f5901494be5d8ba86005f6688 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 26 Feb 2020 09:17:34 +0100 Subject: [PATCH 11/50] test: fix server init scripts for network --- test/TEST-20-NFS/server-init.sh | 38 +++++++++++++++- test/TEST-30-ISCSI/server-init.sh | 14 +++--- test/TEST-30-ISCSI/test.sh | 1 + test/TEST-31-ISCSI-MULTI/server-init.sh | 44 ++++++++++++++++--- test/TEST-40-NBD/server-init.sh | 38 +++++++++++++++- test/TEST-50-MULTINIC/server-init.sh | 9 +++- test/TEST-60-IFCFG/server-init.sh | 14 +++--- .../TEST-70-BONDBRIDGETEAMVLAN/server-init.sh | 16 ++++--- 8 files changed, 147 insertions(+), 27 deletions(-) diff --git a/test/TEST-20-NFS/server-init.sh b/test/TEST-20-NFS/server-init.sh index 59b140e0..846bbfd8 100755 --- a/test/TEST-20-NFS/server-init.sh +++ b/test/TEST-20-NFS/server-init.sh @@ -14,6 +14,22 @@ wait_for_if_link() { local li while [ $cnt -lt 600 ]; do li=$(ip -o link show dev $1 2>/dev/null) + [ -n "$li" ] && return 0 + if [[ $2 ]]; then + li=$(ip -o link show dev $2 2>/dev/null) + [ -n "$li" ] && return 0 + fi + sleep 0.1 + cnt=$(($cnt+1)) + done + return 1 +} + +wait_for_if_up() { + local cnt=0 + local li + while [ $cnt -lt 200 ]; do + li=$(ip -o link show up dev $1) [ -n "$li" ] && return 0 sleep 0.1 cnt=$(($cnt+1)) @@ -21,7 +37,24 @@ wait_for_if_link() { return 1 } -wait_for_if_link eth0 +wait_for_route_ok() { + local cnt=0 + while [ $cnt -lt 200 ]; do + li=$(ip route show) + [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0 + sleep 0.1 + cnt=$(($cnt+1)) + done + return 1 +} + +linkup() { + wait_for_if_link $1 2>/dev/null\ + && ip link set $1 up 2>/dev/null\ + && wait_for_if_up $1 2>/dev/null +} + +wait_for_if_link eth0 ens3 ip addr add 127.0.0.1/8 dev lo ip link set lo up @@ -29,7 +62,8 @@ ip link set dev eth0 name ens3 ip addr add 192.168.50.1/24 dev ens3 ip addr add 192.168.50.2/24 dev ens3 ip addr add 192.168.50.3/24 dev ens3 -ip link set ens3 up +linkup ens3 + echo > /dev/watchdog modprobe af_packet echo > /dev/watchdog diff --git a/test/TEST-30-ISCSI/server-init.sh b/test/TEST-30-ISCSI/server-init.sh index 2258fc36..320303e9 100755 --- a/test/TEST-30-ISCSI/server-init.sh +++ b/test/TEST-30-ISCSI/server-init.sh @@ -3,7 +3,7 @@ exec /dev/console 2>&1 set -x export PATH=/sbin:/bin:/usr/sbin:/usr/bin export TERM=linux -export PS1='nfstest-server:\w\$ ' +export PS1='server:\w\$ ' stty sane echo "made it to the rootfs!" echo server > /proc/sys/kernel/hostname @@ -13,15 +13,19 @@ wait_for_if_link() { local li while [ $cnt -lt 600 ]; do li=$(ip -o link show dev $1 2>/dev/null) - [ -n "$li" ] && return 0 + [ -n "$li" ] && return 0 + if [[ $2 ]]; then + li=$(ip -o link show dev $2 2>/dev/null) + [ -n "$li" ] && return 0 + fi sleep 0.1 cnt=$(($cnt+1)) done return 1 } -wait_for_if_link eth0 -wait_for_if_link eth1 +wait_for_if_link eth0 ens3 +wait_for_if_link eth1 ens4 ip addr add 127.0.0.1/8 dev lo ip link set lo up @@ -48,8 +52,8 @@ tgtadm --lld iscsi --mode target --op bind --tid 3 -I 192.168.50.101 # Wait forever for the VM to die -echo "Serving iSCSI" while :; do + echo "Serving iSCSI" [ -n "$(jobs -rp)" ] && echo > /dev/watchdog sleep 10 done diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index 6e3613a6..7424d105 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -38,6 +38,7 @@ run_server() { echo "Waiting for the server to startup" while : ; do grep Serving "$TESTDIR"/server.log && break + echo "Waiting for the server to startup" sleep 1 done else diff --git a/test/TEST-31-ISCSI-MULTI/server-init.sh b/test/TEST-31-ISCSI-MULTI/server-init.sh index 2258fc36..d825e3a7 100755 --- a/test/TEST-31-ISCSI-MULTI/server-init.sh +++ b/test/TEST-31-ISCSI-MULTI/server-init.sh @@ -3,7 +3,7 @@ exec /dev/console 2>&1 set -x export PATH=/sbin:/bin:/usr/sbin:/usr/bin export TERM=linux -export PS1='nfstest-server:\w\$ ' +export PS1='server:\w\$ ' stty sane echo "made it to the rootfs!" echo server > /proc/sys/kernel/hostname @@ -13,6 +13,22 @@ wait_for_if_link() { local li while [ $cnt -lt 600 ]; do li=$(ip -o link show dev $1 2>/dev/null) + [ -n "$li" ] && return 0 + if [[ $2 ]]; then + li=$(ip -o link show dev $2 2>/dev/null) + [ -n "$li" ] && return 0 + fi + sleep 0.1 + cnt=$(($cnt+1)) + done + return 1 +} + +wait_for_if_up() { + local cnt=0 + local li + while [ $cnt -lt 200 ]; do + li=$(ip -o link show up dev $1) [ -n "$li" ] && return 0 sleep 0.1 cnt=$(($cnt+1)) @@ -20,17 +36,35 @@ wait_for_if_link() { return 1 } -wait_for_if_link eth0 -wait_for_if_link eth1 +wait_for_route_ok() { + local cnt=0 + while [ $cnt -lt 200 ]; do + li=$(ip route show) + [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0 + sleep 0.1 + cnt=$(($cnt+1)) + done + return 1 +} + +linkup() { + wait_for_if_link $1 2>/dev/null\ + && ip link set $1 up 2>/dev/null\ + && wait_for_if_up $1 2>/dev/null +} + +wait_for_if_link eth0 ens3 +wait_for_if_link eth1 ens4 ip addr add 127.0.0.1/8 dev lo ip link set lo up ip link set dev eth0 name ens3 ip addr add 192.168.50.1/24 dev ens3 -ip link set ens3 up +linkup ens3 ip link set dev eth1 name ens4 ip addr add 192.168.51.1/24 dev ens4 -ip link set ens4 up +linkup ens4 + >/var/lib/dhcpd/dhcpd.leases chmod 777 /var/lib/dhcpd/dhcpd.leases dhcpd -d -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases & diff --git a/test/TEST-40-NBD/server-init.sh b/test/TEST-40-NBD/server-init.sh index 63755b26..ea1f153f 100755 --- a/test/TEST-40-NBD/server-init.sh +++ b/test/TEST-40-NBD/server-init.sh @@ -13,6 +13,22 @@ wait_for_if_link() { local li while [ $cnt -lt 600 ]; do li=$(ip -o link show dev $1 2>/dev/null) + [ -n "$li" ] && return 0 + if [[ $2 ]]; then + li=$(ip -o link show dev $2 2>/dev/null) + [ -n "$li" ] && return 0 + fi + sleep 0.1 + cnt=$(($cnt+1)) + done + return 1 +} + +wait_for_if_up() { + local cnt=0 + local li + while [ $cnt -lt 200 ]; do + li=$(ip -o link show up dev $1) [ -n "$li" ] && return 0 sleep 0.1 cnt=$(($cnt+1)) @@ -20,13 +36,31 @@ wait_for_if_link() { return 1 } -wait_for_if_link eth0 +wait_for_route_ok() { + local cnt=0 + while [ $cnt -lt 200 ]; do + li=$(ip route show) + [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0 + sleep 0.1 + cnt=$(($cnt+1)) + done + return 1 +} + +linkup() { + wait_for_if_link $1 2>/dev/null\ + && ip link set $1 up 2>/dev/null\ + && wait_for_if_up $1 2>/dev/null +} + +wait_for_if_link eth0 ens3 ip addr add 127.0.0.1/8 dev lo ip link set lo up ip link set dev eth0 name ens3 ip addr add 192.168.50.1/24 dev ens3 -ip link set ens3 up +linkup ens3 + modprobe af_packet nbd-server >/var/lib/dhcpd/dhcpd.leases diff --git a/test/TEST-50-MULTINIC/server-init.sh b/test/TEST-50-MULTINIC/server-init.sh index ed84c5b4..ccabc830 100755 --- a/test/TEST-50-MULTINIC/server-init.sh +++ b/test/TEST-50-MULTINIC/server-init.sh @@ -13,7 +13,11 @@ wait_for_if_link() { local li while [ $cnt -lt 600 ]; do li=$(ip -o link show dev $1 2>/dev/null) - [ -n "$li" ] && return 0 + [ -n "$li" ] && return 0 + if [[ $2 ]]; then + li=$(ip -o link show dev $2 2>/dev/null) + [ -n "$li" ] && return 0 + fi sleep 0.1 cnt=$(($cnt+1)) done @@ -49,7 +53,7 @@ linkup() { && wait_for_if_up $1 2>/dev/null } -wait_for_if_link eth0 +wait_for_if_link eth0 ens3 >/dev/watchdog ip addr add 127.0.0.1/8 dev lo @@ -57,6 +61,7 @@ linkup lo ip link set dev eth0 name ens3 ip addr add 192.168.50.1/24 dev ens3 linkup ens3 + >/dev/watchdog modprobe af_packet > /dev/watchdog diff --git a/test/TEST-60-IFCFG/server-init.sh b/test/TEST-60-IFCFG/server-init.sh index cff29a3b..69fad5dc 100755 --- a/test/TEST-60-IFCFG/server-init.sh +++ b/test/TEST-60-IFCFG/server-init.sh @@ -13,7 +13,11 @@ wait_for_if_link() { local li while [ $cnt -lt 600 ]; do li=$(ip -o link show dev $1 2>/dev/null) - [ -n "$li" ] && return 0 + [ -n "$li" ] && return 0 + if [[ $2 ]]; then + li=$(ip -o link show dev $2 2>/dev/null) + [ -n "$li" ] && return 0 + fi sleep 0.1 cnt=$(($cnt+1)) done @@ -49,10 +53,10 @@ linkup() { && wait_for_if_up $1 2>/dev/null } -wait_for_if_link eth0 -wait_for_if_link eth1 -wait_for_if_link eth2 -wait_for_if_link eth3 +wait_for_if_link eth0 ens3 +wait_for_if_link eth1 ens4 +wait_for_if_link eth2 ens5 +wait_for_if_link eth3 ens6 modprobe --all -b -q 8021q ipvlan macvlan >/dev/watchdog diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh index 7aae0f13..e4e541d3 100755 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh +++ b/test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh @@ -3,7 +3,7 @@ exec /dev/console 2>&1 set -x export PATH=/sbin:/bin:/usr/sbin:/usr/bin export TERM=linux -export PS1='nfstest-server:\w\$ ' +export PS1='server:\w\$ ' stty sane echo "made it to the rootfs!" echo server > /proc/sys/kernel/hostname @@ -13,7 +13,11 @@ wait_for_if_link() { local li while [ $cnt -lt 600 ]; do li=$(ip -o link show dev $1 2>/dev/null) - [ -n "$li" ] && return 0 + [ -n "$li" ] && return 0 + if [[ $2 ]]; then + li=$(ip -o link show dev $2 2>/dev/null) + [ -n "$li" ] && return 0 + fi sleep 0.1 cnt=$(($cnt+1)) done @@ -49,10 +53,10 @@ linkup() { && wait_for_if_up $1 2>/dev/null } -wait_for_if_link eth0 -wait_for_if_link eth1 -wait_for_if_link eth2 -wait_for_if_link eth3 +wait_for_if_link eth0 ens3 +wait_for_if_link eth1 ens4 +wait_for_if_link eth2 ens5 +wait_for_if_link eth3 ens6 modprobe --all -b -q 8021q ipvlan macvlan >/dev/watchdog From 2f78bafa4b1b2b226a2ebebdab221013a5c42d25 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 26 Feb 2020 12:00:35 +0100 Subject: [PATCH 12/50] tests: untabify, reformat --- test/TEST-01-BASIC/test.sh | 96 +++++++------- test/TEST-02-SYSTEMD/test.sh | 26 ++-- test/TEST-03-USR-MOUNT/test.sh | 114 ++++++++--------- test/TEST-04-FULL-SYSTEMD/test.sh | 158 ++++++++++++------------ test/TEST-10-RAID/test.sh | 92 +++++++------- test/TEST-11-LVM/test.sh | 82 ++++++------ test/TEST-13-ENC-RAID-LVM/test.sh | 116 ++++++++--------- test/TEST-14-IMSM/test.sh | 104 ++++++++-------- test/TEST-15-BTRFSRAID/test.sh | 90 +++++++------- test/TEST-16-DMSQUASH/test.sh | 96 +++++++------- test/TEST-17-LVM-THIN/test.sh | 82 ++++++------ test/TEST-20-NFS/test.sh | 64 +++++----- test/TEST-30-ISCSI/test.sh | 40 +++--- test/TEST-31-ISCSI-MULTI/test.sh | 40 +++--- test/TEST-40-NBD/test.sh | 14 +-- test/TEST-60-IFCFG/test.sh | 60 ++++----- test/TEST-70-BONDBRIDGETEAMVLAN/test.sh | 60 ++++----- 17 files changed, 668 insertions(+), 666 deletions(-) diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index a88843d3..06d8c53e 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -9,14 +9,14 @@ KVERSION=${KVERSION-$(uname -r)} test_run() { dd if=/dev/zero of=$TESTDIR/result bs=1M count=1 $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ - -drive format=raw,index=1,media=disk,file=$TESTDIR/result \ - -m 512M -smp 2 -nographic \ - -net none \ - -watchdog i6300esb -watchdog-action poweroff \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ + -drive format=raw,index=1,media=disk,file=$TESTDIR/result \ + -m 512M -smp 2 -nographic \ + -net none \ + -watchdog i6300esb -watchdog-action poweroff \ -no-reboot \ - -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \ - -initrd $TESTDIR/initramfs.testing || return 1 + -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing || return 1 grep -F -m 1 -q dracut-root-block-success $TESTDIR/result || return 1 } @@ -28,10 +28,10 @@ test_setup() { kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay ( - export initdir=$TESTDIR/overlay/source - mkdir -p $initdir - . $basedir/dracut-init.sh - ( + export initdir=$TESTDIR/overlay/source + mkdir -p $initdir + . $basedir/dracut-init.sh + ( cd "$initdir" mkdir -p -- dev sys proc etc var/run tmp mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin @@ -39,68 +39,68 @@ test_setup() { ln -sfnr usr/$i $i done ) - inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient \ - umount strace less setsid - for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do + inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ + mount dmesg dhclient mkdir cp ping dhclient \ + umount strace less setsid + for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break - done - inst_multiple -o ${_terminfodir}/l/linux - inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" - inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" - inst_multiple grep + done + inst_multiple -o ${_terminfodir}/l/linux + inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + inst_multiple grep inst_simple /etc/os-release - inst ./test-init.sh /sbin/init - find_binary plymouth >/dev/null && inst_multiple plymouth - cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + inst ./test-init.sh /sbin/init + find_binary plymouth >/dev/null && inst_multiple plymouth + cp -a /etc/ld.so.conf* $initdir/etc + sudo ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple sfdisk mkfs.ext3 poweroff cp umount sync - inst_hook initqueue 01 ./create-root.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple sfdisk mkfs.ext3 poweroff cp umount sync + inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash udev-rules base rootfs-block fs-lib kernel-modules fs-lib qemu" \ - -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ - --nomdadmconf \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 + -m "dash udev-rules base rootfs-block fs-lib kernel-modules fs-lib qemu" \ + -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ + --nomdadmconf \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ - -m 512M -smp 2 -nographic -net none \ - -append "root=/dev/dracut/root rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ - -initrd $TESTDIR/initramfs.makeroot || return 1 + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ + -m 512M -smp 2 -nographic -net none \ + -append "root=/dev/dracut/root rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1 ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook shutdown-emergency 000 ./hard-off.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -a "debug watchdog" \ - -d "piix ide-gd_mod ata_piix ext3 sd_mod i6300esb ib700wdt" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -a "debug watchdog" \ + -d "piix ide-gd_mod ata_piix ext3 sd_mod i6300esb ib700wdt" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 -# -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm" + # -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm" } test_cleanup() { diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh index c5739a70..52f302b9 100755 --- a/test/TEST-02-SYSTEMD/test.sh +++ b/test/TEST-02-SYSTEMD/test.sh @@ -37,8 +37,8 @@ test_setup() { mkdir -p -- var/lib/nfs/rpc_pipefs ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient \ - umount strace less setsid systemd-analyze + mount dmesg dhclient mkdir cp ping dhclient \ + umount strace less setsid systemd-analyze for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -67,11 +67,11 @@ test_setup() { # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash udev-rules base rootfs-block fs-lib kernel-modules qemu" \ - -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ - --nomdadmconf \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 + -m "dash udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ + --nomdadmconf \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. @@ -93,13 +93,13 @@ test_setup() { inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -a "debug systemd" \ - -o "network kernel-network-modules" \ - -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -a "debug systemd" \ + -o "network kernel-network-modules" \ + -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 -# -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm" + # -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm" } test_cleanup() { diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh index dffcc0a4..53c4a1dc 100755 --- a/test/TEST-03-USR-MOUNT/test.sh +++ b/test/TEST-03-USR-MOUNT/test.sh @@ -15,23 +15,23 @@ client_run() { dd if=/dev/zero of=$TESTDIR/result bs=1M count=1 $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ - -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ - -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ - -m 512M -smp 2 -nographic \ - -net none \ - -watchdog i6300esb -watchdog-action poweroff \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ + -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ + -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ + -m 512M -smp 2 -nographic \ + -net none \ + -watchdog i6300esb -watchdog-action poweroff \ -no-reboot \ - -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ - -initrd $TESTDIR/initramfs.testing + -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing if (($? != 0)); then - echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" + echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" return 1 fi if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/result; then - echo "CLIENT TEST END: $test_name [FAILED]" + echo "CLIENT TEST END: $test_name [FAILED]" return 1 fi echo "CLIENT TEST END: $test_name [OK]" @@ -55,10 +55,10 @@ test_setup() { kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay ( - export initdir=$TESTDIR/overlay/source - mkdir -p $initdir - . $basedir/dracut-init.sh - ( + export initdir=$TESTDIR/overlay/source + mkdir -p $initdir + . $basedir/dracut-init.sh + ( cd "$initdir" mkdir -p -- dev sys proc etc var/run tmp mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin @@ -66,79 +66,79 @@ test_setup() { ln -sfnr usr/$i $i done ) - inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient \ - umount strace less setsid - for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do + inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ + mount dmesg dhclient mkdir cp ping dhclient \ + umount strace less setsid + for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break - done - inst_multiple -o ${_terminfodir}/l/linux - inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" - inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" - inst_multiple grep + done + inst_multiple -o ${_terminfodir}/l/linux + inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + inst_multiple grep inst_simple ./fstab /etc/fstab inst_simple /etc/os-release - inst ./test-init.sh /sbin/init - find_binary plymouth >/dev/null && inst_multiple plymouth - cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + inst ./test-init.sh /sbin/init + find_binary plymouth >/dev/null && inst_multiple plymouth + cp -a /etc/ld.so.conf* $initdir/etc + sudo ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple sfdisk mkfs.btrfs btrfs poweroff cp umount sync - inst_hook initqueue 01 ./create-root.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple sfdisk mkfs.btrfs btrfs poweroff cp umount sync + inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash udev-rules btrfs base rootfs-block fs-lib kernel-modules qemu" \ - -d "piix ide-gd_mod ata_piix btrfs sd_mod" \ - --nomdadmconf \ - --nohardlink \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 + -m "dash udev-rules btrfs base rootfs-block fs-lib kernel-modules qemu" \ + -d "piix ide-gd_mod ata_piix btrfs sd_mod" \ + --nomdadmconf \ + --nohardlink \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 # Invoke KVM and/or QEMU to actually create the target filesystem. -# echo $TESTDIR/overlay -# echo $TESTDIR/initramfs.makeroot -#exit 1 + # echo $TESTDIR/overlay + # echo $TESTDIR/initramfs.makeroot + #exit 1 rm -rf -- $TESTDIR/overlay $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ - -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ - -m 512M -smp 2 -nographic -net none \ - -append "root=/dev/dracut/root rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ - -initrd $TESTDIR/initramfs.makeroot || return 1 + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ + -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ + -m 512M -smp 2 -nographic -net none \ + -append "root=/dev/dracut/root rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs || return 1 ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook shutdown-emergency 000 ./hard-off.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -a "debug watchdog" \ - -o "network kernel-network-modules" \ - -d "piix ide-gd_mod ata_piix btrfs sd_mod i6300esb ib700wdt" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -a "debug watchdog" \ + -o "network kernel-network-modules" \ + -d "piix ide-gd_mod ata_piix btrfs sd_mod i6300esb ib700wdt" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 rm -rf -- $TESTDIR/overlay -# -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm" + # -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm" } test_cleanup() { diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index 1fcbeeb8..337f0219 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -17,22 +17,22 @@ client_run() { dd if=/dev/zero of=$TESTDIR/result bs=1M count=1 $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ - -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ - -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ - -m 512M -smp 2 -nographic \ - -net none \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ + -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ + -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ + -m 512M -smp 2 -nographic \ + -net none \ -no-reboot \ - -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \ - -initrd $TESTDIR/initramfs.testing + -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing if (($? != 0)); then - echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" + echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" return 1 fi if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/result; then - echo "CLIENT TEST END: $test_name [FAILED]" + echo "CLIENT TEST END: $test_name [FAILED]" return 1 fi echo "CLIENT TEST END: $test_name [OK]" @@ -56,9 +56,9 @@ test_setup() { export kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay ( - export initdir=$TESTDIR/overlay/source - mkdir -p $initdir - . $basedir/dracut-init.sh + export initdir=$TESTDIR/overlay/source + mkdir -p $initdir + . $basedir/dracut-init.sh for d in usr/bin usr/sbin bin etc lib "$libdir" sbin tmp usr var var/log dev proc sys sysroot root run; do if [ -L "/$d" ]; then @@ -71,49 +71,47 @@ test_setup() { ln -sfn /run "$initdir/var/run" ln -sfn /run/lock "$initdir/var/lock" - inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient \ - umount strace less setsid tree systemctl reset + inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ + mount dmesg mkdir cp ping \ + umount strace less setsid tree systemctl reset - for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do + for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break - done - inst_multiple -o ${_terminfodir}/l/linux - inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" - inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" - inst_multiple grep + done + inst_multiple -o ${_terminfodir}/l/linux + inst_multiple grep inst_simple ./fstab /etc/fstab rpm -ql systemd | xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} -o -a -l inst /lib/systemd/system/systemd-remount-fs.service inst /lib/systemd/systemd-remount-fs inst /lib/systemd/system/systemd-journal-flush.service inst /etc/sysconfig/init - inst /lib/systemd/system/slices.target - inst /lib/systemd/system/system.slice - inst_multiple -o /lib/systemd/system/dracut* + inst /lib/systemd/system/slices.target + inst /lib/systemd/system/system.slice + inst_multiple -o /lib/systemd/system/dracut* # make a journal directory mkdir -p $initdir/var/log/journal # install some basic config files inst_multiple -o \ - /etc/machine-id \ - /etc/adjtime \ - /etc/sysconfig/init \ - /etc/passwd \ - /etc/shadow \ - /etc/group \ - /etc/shells \ - /etc/nsswitch.conf \ - /etc/pam.conf \ - /etc/securetty \ - /etc/os-release \ - /etc/localtime + /etc/machine-id \ + /etc/adjtime \ + /etc/passwd \ + /etc/shadow \ + /etc/group \ + /etc/shells \ + /etc/nsswitch.conf \ + /etc/pam.conf \ + /etc/securetty \ + /etc/os-release \ + /etc/localtime # we want an empty environment > $initdir/etc/environment # setup the testsuite target + mkdir -p $initdir/etc/systemd/system cat >$initdir/etc/systemd/system/testsuite.target <$initdir/etc/rc.d/rc.local <$initdir/etc/rc.d/rc.local </dev/null && inst_multiple plymouth - cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + inst ./test-init.sh /sbin/init + inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + inst_multiple grep + inst_multiple -o /lib/systemd/systemd-shutdown + find_binary plymouth >/dev/null && inst_multiple plymouth + cp -a /etc/ld.so.conf* $initdir/etc + sudo ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount - inst_hook initqueue 01 ./create-root.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple sfdisk mke2fs poweroff cp umount + inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ - -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ - --nomdadmconf \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 + -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ + --nomdadmconf \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ - -m 512M -smp 2 -nographic -net none \ - -append "root=/dev/cannotreach rw rootfstype=ext2 console=ttyS0,115200n81 selinux=0" \ - -initrd $TESTDIR/initramfs.makeroot || return 1 + -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ + -m 512M -smp 2 -nographic -net none \ + -append "root=/dev/cannotreach rw rootfstype=ext2 console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $DISKIMAGE || return 1 eval $(grep -F -a -m 1 ID_FS_UUID $DISKIMAGE) ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook shutdown-emergency 000 ./hard-off.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh - inst ./cryptroot-ask.sh /sbin/cryptroot-ask + inst ./cryptroot-ask.sh /sbin/cryptroot-ask mkdir -p $initdir/etc echo "testluks UUID=$ID_FS_UUID /etc/key" > $initdir/etc/crypttab #echo "luks-$ID_FS_UUID /dev/md0 none" > $initdir/etc/crypttab echo -n "test" > $initdir/etc/key - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "plymouth network kernel-network-modules" \ - -a "debug" \ - -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -o "plymouth network kernel-network-modules" \ + -a "debug" \ + -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 } test_cleanup() { diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh index 71e8cd29..a0b2eab2 100755 --- a/test/TEST-11-LVM/test.sh +++ b/test/TEST-11-LVM/test.sh @@ -8,12 +8,12 @@ KVERSION=${KVERSION-$(uname -r)} test_run() { $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ - -m 512M -smp 2 -nographic \ - -net none \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -m 512M -smp 2 -nographic \ + -net none \ -no-reboot \ - -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ - -initrd $TESTDIR/initramfs.testing + -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 } @@ -24,8 +24,8 @@ test_setup() { kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay ( - export initdir=$TESTDIR/overlay/source - . $basedir/dracut-init.sh + export initdir=$TESTDIR/overlay/source + . $basedir/dracut-init.sh ( cd "$initdir" mkdir -p -- dev sys proc etc var/run tmp @@ -35,61 +35,61 @@ test_setup() { done mkdir -p -- var/lib/nfs/rpc_pipefs ) - inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient + inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ + mount dmesg dhclient mkdir cp ping dhclient for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do - [ -f ${_terminfodir}/l/linux ] && break - done - inst_multiple -o ${_terminfodir}/l/linux - inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" - inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" - inst_multiple grep + [ -f ${_terminfodir}/l/linux ] && break + done + inst_multiple -o ${_terminfodir}/l/linux + inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + inst_multiple grep inst_simple /etc/os-release - inst ./test-init.sh /sbin/init - find_binary plymouth >/dev/null && inst_multiple plymouth - cp -a /etc/ld.so.conf* $initdir/etc - mkdir $initdir/run - sudo ldconfig -r "$initdir" + inst ./test-init.sh /sbin/init + find_binary plymouth >/dev/null && inst_multiple plymouth + cp -a /etc/ld.so.conf* $initdir/etc + mkdir $initdir/run + sudo ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount - inst_hook initqueue 01 ./create-root.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple sfdisk mke2fs poweroff cp umount + inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ - -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 + -m "dash lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ - -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ - -initrd $TESTDIR/initramfs.makeroot || return 1 + -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook shutdown-emergency 000 ./hard-off.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "plymouth network kernel-network-modules" \ - -a "debug" \ - -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -o "plymouth network kernel-network-modules" \ + -a "debug" \ + -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 } test_cleanup() { diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh index edb71186..757a3e95 100755 --- a/test/TEST-13-ENC-RAID-LVM/test.sh +++ b/test/TEST-13-ENC-RAID-LVM/test.sh @@ -15,13 +15,13 @@ test_run() { echo "CLIENT TEST START: $LUKSARGS" $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ - -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ - -m 1024M -smp 2 -nographic \ - -net none \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ + -m 1024M -smp 2 -nographic \ + -net none \ -no-reboot \ - -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \ - -initrd $TESTDIR/initramfs.testing + -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 echo "CLIENT TEST END: [OK]" @@ -29,13 +29,13 @@ test_run() { echo "CLIENT TEST START: Any LUKS" $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ - -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ - -m 1024M -smp 2 -nographic \ - -net none \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ + -m 1024M -smp 2 -nographic \ + -net none \ -no-reboot \ - -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ - -initrd $TESTDIR/initramfs.testing + -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 echo "CLIENT TEST END: [OK]" @@ -43,13 +43,13 @@ test_run() { echo "CLIENT TEST START: Wrong LUKS UUID" $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ - -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ - -m 1024M -smp 2 -nographic \ - -net none \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ + -m 1024M -smp 2 -nographic \ + -net none \ -no-reboot \ - -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL rd.luks.uuid=failme" \ - -initrd $TESTDIR/initramfs.testing + -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL rd.luks.uuid=failme" \ + -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img && return 1 echo "CLIENT TEST END: [OK]" @@ -64,8 +64,8 @@ test_setup() { kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay ( - export initdir=$TESTDIR/overlay/source - . $basedir/dracut-init.sh + export initdir=$TESTDIR/overlay/source + . $basedir/dracut-init.sh ( cd "$initdir" mkdir -p -- dev sys proc etc var/run tmp @@ -75,76 +75,76 @@ test_setup() { done mkdir -p -- var/lib/nfs/rpc_pipefs ) - inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient + inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ + mount dmesg dhclient mkdir cp ping dhclient for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do - [ -f ${_terminfodir}/l/linux ] && break - done - inst_multiple -o ${_terminfodir}/l/linux - inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" - inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" - inst_multiple grep + [ -f ${_terminfodir}/l/linux ] && break + done + inst_multiple -o ${_terminfodir}/l/linux + inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + inst_multiple grep inst_simple /etc/os-release - inst ./test-init.sh /sbin/init - find_binary plymouth >/dev/null && inst_multiple plymouth - cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + inst ./test-init.sh /sbin/init + find_binary plymouth >/dev/null && inst_multiple plymouth + cp -a /etc/ld.so.conf* $initdir/etc + sudo ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount grep - inst_hook initqueue 01 ./create-root.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple sfdisk mke2fs poweroff cp umount grep + inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ - -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 + -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ - -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ - -initrd $TESTDIR/initramfs.makeroot || return 1 + -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 cryptoUUIDS=$(grep -F --binary-files=text -m 3 ID_FS_UUID $TESTDIR/root.ext2) for uuid in $cryptoUUIDS; do - eval $uuid - printf ' rd.luks.uuid=luks-%s ' $ID_FS_UUID + eval $uuid + printf ' rd.luks.uuid=luks-%s ' $ID_FS_UUID done > $TESTDIR/luks.txt ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook shutdown-emergency 000 ./hard-off.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules - inst ./cryptroot-ask.sh /sbin/cryptroot-ask + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst ./cryptroot-ask.sh /sbin/cryptroot-ask mkdir -p $initdir/etc i=2 for uuid in $cryptoUUIDS; do - eval $uuid - printf 'luks-%s /dev/sda%s /etc/key timeout=0\n' $ID_FS_UUID $i + eval $uuid + printf 'luks-%s /dev/sda%s /etc/key timeout=0\n' $ID_FS_UUID $i ((i+=1)) done > $initdir/etc/crypttab echo -n test > $initdir/etc/key ) sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "plymouth network kernel-network-modules" \ - -a "debug" \ - -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -o "plymouth network kernel-network-modules" \ + -a "debug" \ + -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 } test_cleanup() { diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh index 40ca132e..ba79889f 100755 --- a/test/TEST-14-IMSM/test.sh +++ b/test/TEST-14-IMSM/test.sh @@ -10,17 +10,17 @@ KVERSION=${KVERSION-$(uname -r)} client_run() { echo "CLIENT TEST START: $@" $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ - -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \ - -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ - -m 512M -smp 2 -nographic \ - -net none \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \ + -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ + -m 512M -smp 2 -nographic \ + -net none \ -no-reboot \ - -append "panic=1 systemd.crash_reboot $* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \ - -initrd $TESTDIR/initramfs.testing + -append "panic=1 systemd.crash_reboot $* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then - echo "CLIENT TEST END: $@ [FAIL]" - return 1; + echo "CLIENT TEST END: $@ [FAIL]" + return 1; fi sed -i -e 's#dracut-root-block-success#dracut-root-block-xxxxxxx#' $TESTDIR/root.ext2 @@ -43,7 +43,7 @@ test_run() { client_run rd.md.uuid=$MD_UUID rd.md=0 failme && return 1 # the following test hangs on newer md client_run rd.md.uuid=$MD_UUID rd.dm=0 rd.md.imsm rd.md.conf=0 || return 1 - return 0 + return 0 } test_setup() { @@ -59,9 +59,9 @@ test_setup() { kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay ( - export initdir=$TESTDIR/overlay/source - . $basedir/dracut-init.sh - ( + export initdir=$TESTDIR/overlay/source + . $basedir/dracut-init.sh + ( cd "$initdir" mkdir -p -- dev sys proc etc var/run tmp mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin @@ -69,49 +69,49 @@ test_setup() { ln -sfnr usr/$i $i done ) - inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient + inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ + mount dmesg dhclient mkdir cp ping dhclient for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do - [ -f ${_terminfodir}/l/linux ] && break - done - inst_multiple -o ${_terminfodir}/l/linux - inst_simple /etc/os-release - inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" - inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" - inst_multiple grep - inst ./test-init.sh /sbin/init - find_binary plymouth >/dev/null && inst_multiple plymouth - cp -a /etc/ld.so.conf* $initdir/etc - mkdir $initdir/run - sudo ldconfig -r "$initdir" + [ -f ${_terminfodir}/l/linux ] && break + done + inst_multiple -o ${_terminfodir}/l/linux + inst_simple /etc/os-release + inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + inst_multiple grep + inst ./test-init.sh /sbin/init + find_binary plymouth >/dev/null && inst_multiple plymouth + cp -a /etc/ld.so.conf* $initdir/etc + mkdir $initdir/run + sudo ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount grep - inst_hook initqueue 01 ./create-root.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple sfdisk mke2fs poweroff cp umount grep + inst_hook initqueue 01 ./create-root.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash lvm mdraid dmraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ - -d "piix ide-gd_mod ata_piix ext2 sd_mod dm-multipath dm-crypt dm-round-robin faulty linear multipath raid0 raid10 raid1 raid456" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 + -m "dash lvm mdraid dmraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -d "piix ide-gd_mod ata_piix ext2 sd_mod dm-multipath dm-crypt dm-round-robin faulty linear multipath raid0 raid10 raid1 raid456" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ - -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \ - -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ - -m 512M -nographic -net none \ - -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ - -initrd $TESTDIR/initramfs.makeroot || return 1 + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \ + -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ + -m 512M -nographic -net none \ + -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 eval $(grep -F --binary-files=text -m 1 MD_UUID $TESTDIR/root.ext2) @@ -122,19 +122,19 @@ test_setup() { echo $MD_UUID > $TESTDIR/mduuid ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook shutdown-emergency 000 ./hard-off.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "plymouth network kernel-network-modules" \ - -a "debug" \ - -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -o "plymouth network kernel-network-modules" \ + -a "debug" \ + -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 } test_cleanup() { diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh index cad641e4..b0d8c002 100755 --- a/test/TEST-15-BTRFSRAID/test.sh +++ b/test/TEST-15-BTRFSRAID/test.sh @@ -10,13 +10,13 @@ test_run() { MARKER_DISKIMAGE=$TESTDIR/TEST-15-BTRFSRAID-marker.img dd if=/dev/zero of=$MARKER_DISKIMAGE bs=512 count=10 $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$MARKER_DISKIMAGE \ - -drive format=raw,index=1,media=disk,file=$DISKIMAGE \ - -m 512M -smp 2 -nographic \ - -net none \ + -drive format=raw,index=0,media=disk,file=$MARKER_DISKIMAGE \ + -drive format=raw,index=1,media=disk,file=$DISKIMAGE \ + -m 512M -smp 2 -nographic \ + -net none \ -no-reboot \ - -append "panic=1 systemd.crash_reboot root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ - -initrd $TESTDIR/initramfs.testing + -append "panic=1 systemd.crash_reboot root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $MARKER_DISKIMAGE || return 1 } @@ -29,8 +29,8 @@ test_setup() { kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay ( - export initdir=$TESTDIR/overlay/source - . $basedir/dracut-init.sh + export initdir=$TESTDIR/overlay/source + . $basedir/dracut-init.sh ( cd "$initdir" mkdir -p -- dev sys proc etc var/run tmp @@ -40,67 +40,67 @@ test_setup() { done mkdir -p -- var/lib/nfs/rpc_pipefs ) - inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient sync + inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ + mount dmesg dhclient mkdir cp ping dhclient sync for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do - [ -f ${_terminfodir}/l/linux ] && break - done - inst_multiple -o ${_terminfodir}/l/linux - inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" - inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" - inst_multiple grep - inst ./test-init.sh /sbin/init - inst_simple /etc/os-release - find_binary plymouth >/dev/null && inst_multiple plymouth - cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + [ -f ${_terminfodir}/l/linux ] && break + done + inst_multiple -o ${_terminfodir}/l/linux + inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + inst_multiple grep + inst ./test-init.sh /sbin/init + inst_simple /etc/os-release + find_binary plymouth >/dev/null && inst_multiple plymouth + cp -a /etc/ld.so.conf* $initdir/etc + sudo ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple sfdisk mkfs.btrfs poweroff cp umount - inst_hook initqueue 01 ./create-root.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple sfdisk mkfs.btrfs poweroff cp umount + inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash btrfs udev-rules base rootfs-block fs-lib kernel-modules qemu" \ - -d "piix ide-gd_mod ata_piix btrfs sd_mod" \ - --nomdadmconf \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 + -m "dash btrfs udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -d "piix ide-gd_mod ata_piix btrfs sd_mod" \ + --nomdadmconf \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ - -m 512M -smp 2 -nographic -net none \ - -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ - -initrd $TESTDIR/initramfs.makeroot || return 1 + -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ + -m 512M -smp 2 -nographic -net none \ + -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.makeroot || return 1 dd if=$DISKIMAGE bs=512 count=4 skip=2048 | grep -F -m 1 -q dracut-root-block-created || return 1 - ( + ( export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook shutdown-emergency 000 ./hard-off.sh + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "plymouth network kernel-network-modules" \ - -a "debug" \ - -d "piix ide-gd_mod ata_piix btrfs sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -o "plymouth network kernel-network-modules" \ + -a "debug" \ + -d "piix ide-gd_mod ata_piix btrfs sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 } test_cleanup() { diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh index f244ba1d..5f11aaef 100755 --- a/test/TEST-16-DMSQUASH/test.sh +++ b/test/TEST-16-DMSQUASH/test.sh @@ -14,29 +14,29 @@ test_check() { fi done echo "python-imgcreate not installed" - return 1 + return 1 } test_run() { "$testdir"/run-qemu \ - -boot order=d \ - -drive format=raw,bps=1000000,index=0,media=disk,file="$TESTDIR"/livecd.iso \ - -drive format=raw,index=1,media=disk,file="$TESTDIR"/root.img \ - -m 512M -smp 2 \ - -nographic \ - -net none \ - -no-reboot \ - -append "panic=1 systemd.crash_reboot root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ - -initrd "$TESTDIR"/initramfs.testing + -boot order=d \ + -drive format=raw,bps=1000000,index=0,media=disk,file="$TESTDIR"/livecd.iso \ + -drive format=raw,index=1,media=disk,file="$TESTDIR"/root.img \ + -m 512M -smp 2 \ + -nographic \ + -net none \ + -no-reboot \ + -append "panic=1 systemd.crash_reboot root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ + -initrd "$TESTDIR"/initramfs.testing # mediacheck test with qemu GUI # "$testdir"/run-qemu \ - # -drive format=raw,bps=1000000,index=0,media=disk,file="$TESTDIR"/livecd.iso \ - # -drive format=raw,index=1,media=disk,file="$TESTDIR"/root.img \ - # -m 512M -smp 2 \ - # -net none \ - # -append "root=live:CDLABEL=LiveCD live quiet rhgb selinux=0 rd.live.check" \ - # -initrd "$TESTDIR"/initramfs.testing + # -drive format=raw,bps=1000000,index=0,media=disk,file="$TESTDIR"/livecd.iso \ + # -drive format=raw,index=1,media=disk,file="$TESTDIR"/root.img \ + # -m 512M -smp 2 \ + # -net none \ + # -append "root=live:CDLABEL=LiveCD live quiet rhgb selinux=0 rd.live.check" \ + # -initrd "$TESTDIR"/initramfs.testing grep -F -m 1 -q dracut-root-block-success -- "$TESTDIR"/root.img || return 1 } @@ -44,30 +44,30 @@ test_run() { test_setup() { mkdir -p -- "$TESTDIR"/overlay ( - export initdir="$TESTDIR"/overlay - . "$basedir"/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook shutdown-emergency 000 ./hard-off.sh + export initdir="$TESTDIR"/overlay + . "$basedir"/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) dd if=/dev/zero of="$TESTDIR"/root.img count=100 sudo $basedir/dracut.sh -l -i "$TESTDIR"/overlay / \ - -a "debug dmsquash-live qemu" \ - -o "rngd" \ - -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ - --no-hostonly-cmdline -N \ - -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 + -a "debug dmsquash-live qemu" \ + -o "rngd" \ + -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ + --no-hostonly-cmdline -N \ + -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 mkdir -p -- "$TESTDIR"/root-source kernel="$KVERSION" # Create what will eventually be our root filesystem onto an overlay ( - export initdir="$TESTDIR"/root-source - . "$basedir"/dracut-init.sh - ( + export initdir="$TESTDIR"/root-source + . "$basedir"/dracut-init.sh + ( cd "$initdir" mkdir -p -- dev sys proc etc var/run tmp mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin @@ -75,25 +75,25 @@ test_setup() { ln -sfnr usr/$i $i done ) - inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient \ - umount strace less + inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ + mount dmesg dhclient mkdir cp ping dhclient \ + umount strace less for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do - [[ -f ${_terminfodir}/l/linux ]] && break - done - inst_multiple -o "${_terminfodir}"/l/linux - inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" - inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" - inst_multiple grep syslinux isohybrid - for f in /usr/share/syslinux/*; do - inst_simple "$f" - done + [[ -f ${_terminfodir}/l/linux ]] && break + done + inst_multiple -o "${_terminfodir}"/l/linux + inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + inst_multiple grep syslinux isohybrid + for f in /usr/share/syslinux/*; do + inst_simple "$f" + done inst_simple /etc/os-release - inst ./test-init.sh /sbin/init - inst "$TESTDIR"/initramfs.testing "/boot/initramfs-$KVERSION.img" + inst ./test-init.sh /sbin/init + inst "$TESTDIR"/initramfs.testing "/boot/initramfs-$KVERSION.img" [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id - VMLINUZ="/lib/modules/${KVERSION}/vmlinuz" + VMLINUZ="/lib/modules/${KVERSION}/vmlinuz" if ! [[ -e $VMLINUZ ]]; then if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then VMLINUZ="/boot/${MACHINE_ID}/$KVERSION/linux" @@ -101,10 +101,10 @@ test_setup() { fi [[ -e $VMLINUZ ]] || VMLINUZ="/boot/vmlinuz-${KVERSION}" - inst "$VMLINUZ" "/boot/vmlinuz-${KVERSION}" - find_binary plymouth >/dev/null && inst_multiple plymouth - cp -a -- /etc/ld.so.conf* "$initdir"/etc - sudo ldconfig -r "$initdir" + inst "$VMLINUZ" "/boot/vmlinuz-${KVERSION}" + find_binary plymouth >/dev/null && inst_multiple plymouth + cp -a -- /etc/ld.so.conf* "$initdir"/etc + sudo ldconfig -r "$initdir" ) python create.py -d -c livecd-fedora-minimal.ks return 0 diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh index 8203b0f5..40d6c264 100755 --- a/test/TEST-17-LVM-THIN/test.sh +++ b/test/TEST-17-LVM-THIN/test.sh @@ -8,12 +8,12 @@ KVERSION=${KVERSION-$(uname -r)} test_run() { $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ - -m 512M -smp 2 -nographic \ - -net none \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -m 512M -smp 2 -nographic \ + -net none \ -no-reboot \ - -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ - -initrd $TESTDIR/initramfs.testing + -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 } @@ -24,8 +24,8 @@ test_setup() { kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay ( - export initdir=$TESTDIR/overlay/source - . $basedir/dracut-init.sh + export initdir=$TESTDIR/overlay/source + . $basedir/dracut-init.sh ( cd "$initdir" mkdir -p -- dev sys proc etc var/run tmp @@ -35,61 +35,61 @@ test_setup() { done mkdir -p -- var/lib/nfs/rpc_pipefs ) - inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient + inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ + mount dmesg dhclient mkdir cp ping dhclient for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do - [ -f ${_terminfodir}/l/linux ] && break - done - inst_multiple -o ${_terminfodir}/l/linux - inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" - inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" - inst_multiple grep + [ -f ${_terminfodir}/l/linux ] && break + done + inst_multiple -o ${_terminfodir}/l/linux + inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script" + inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup" + inst_multiple grep inst_simple /etc/os-release - inst ./test-init.sh /sbin/init - find_binary plymouth >/dev/null && inst_multiple plymouth - cp -a /etc/ld.so.conf* $initdir/etc - mkdir $initdir/run - sudo ldconfig -r "$initdir" + inst ./test-init.sh /sbin/init + find_binary plymouth >/dev/null && inst_multiple plymouth + cp -a /etc/ld.so.conf* $initdir/etc + mkdir $initdir/run + sudo ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount grep dmsetup - inst_hook initqueue 01 ./create-root.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple sfdisk mke2fs poweroff cp umount grep dmsetup + inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ - -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 + -m "dash lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ - -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ - -initrd $TESTDIR/initramfs.makeroot || return 1 + -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook shutdown-emergency 000 ./hard-off.sh + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "plymouth network kernel-network-modules" \ - -a "debug" -I lvs \ - -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -o "plymouth network kernel-network-modules" \ + -a "debug" -I lvs \ + -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 } test_cleanup() { diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 6334e229..69d96f7b 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -121,7 +121,7 @@ test_nfsv3() { # NFSv4: last octect starts at 0x80 and works up client_test "NFSv3 root=dhcp DHCP path only" 52:54:00:12:34:00 \ - "root=dhcp" 192.168.50.1 -wsize=4096 || return 1 + "root=dhcp" 192.168.50.1 -wsize=4096 || return 1 if [[ "$(systemctl --version)" != *"systemd 230"* ]] 2>/dev/null; then client_test "NFSv3 Legacy root=/dev/nfs nfsroot=IP:path" 52:54:00:12:34:01 \ @@ -135,38 +135,38 @@ test_nfsv3() { fi client_test "NFSv3 root=dhcp DHCP IP:path" 52:54:00:12:34:01 \ - "root=dhcp" 192.168.50.2 -wsize=4096 || return 1 + "root=dhcp" 192.168.50.2 -wsize=4096 || return 1 client_test "NFSv3 root=dhcp DHCP proto:IP:path" 52:54:00:12:34:02 \ - "root=dhcp" 192.168.50.3 -wsize=4096 || return 1 + "root=dhcp" 192.168.50.3 -wsize=4096 || return 1 client_test "NFSv3 root=dhcp DHCP proto:IP:path:options" 52:54:00:12:34:03 \ - "root=dhcp" 192.168.50.3 wsize=4096 || return 1 + "root=dhcp" 192.168.50.3 wsize=4096 || return 1 client_test "NFSv3 root=nfs:..." 52:54:00:12:34:04 \ - "root=nfs:192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1 + "root=nfs:192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1 client_test "NFSv3 Bridge root=nfs:..." 52:54:00:12:34:04 \ - "root=nfs:192.168.50.1:/nfs/client bridge net.ifnames=0" 192.168.50.1 -wsize=4096 || return 1 + "root=nfs:192.168.50.1:/nfs/client bridge net.ifnames=0" 192.168.50.1 -wsize=4096 || return 1 client_test "NFSv3 Legacy root=IP:path" 52:54:00:12:34:04 \ - "root=192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1 + "root=192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1 # This test must fail: nfsroot= requires root=/dev/nfs client_test "NFSv3 Invalid root=dhcp nfsroot=/nfs/client" 52:54:00:12:34:04 \ - "root=dhcp nfsroot=/nfs/client failme rd.debug" 192.168.50.1 -wsize=4096 && return 1 + "root=dhcp nfsroot=/nfs/client failme rd.debug" 192.168.50.1 -wsize=4096 && return 1 client_test "NFSv3 root=dhcp DHCP path,options" \ - 52:54:00:12:34:05 "root=dhcp" 192.168.50.1 wsize=4096 || return 1 + 52:54:00:12:34:05 "root=dhcp" 192.168.50.1 wsize=4096 || return 1 client_test "NFSv3 Bridge Customized root=dhcp DHCP path,options" \ - 52:54:00:12:34:05 "root=dhcp bridge=foobr0:ens3" 192.168.50.1 wsize=4096 || return 1 + 52:54:00:12:34:05 "root=dhcp bridge=foobr0:ens3" 192.168.50.1 wsize=4096 || return 1 client_test "NFSv3 root=dhcp DHCP IP:path,options" \ - 52:54:00:12:34:06 "root=dhcp" 192.168.50.2 wsize=4096 || return 1 + 52:54:00:12:34:06 "root=dhcp" 192.168.50.2 wsize=4096 || return 1 client_test "NFSv3 root=dhcp DHCP proto:IP:path,options" \ - 52:54:00:12:34:07 "root=dhcp" 192.168.50.3 wsize=4096 || return 1 + 52:54:00:12:34:07 "root=dhcp" 192.168.50.3 wsize=4096 || return 1 return 0 } @@ -177,17 +177,17 @@ test_nfsv4() { # switch_root client_test "NFSv4 root=dhcp DHCP proto:IP:path" 52:54:00:12:34:82 \ - "root=dhcp" 192.168.50.3 -wsize=4096 || return 1 + "root=dhcp" 192.168.50.3 -wsize=4096 || return 1 client_test "NFSv4 root=dhcp DHCP proto:IP:path:options" 52:54:00:12:34:83 \ - "root=dhcp" 192.168.50.3 wsize=4096 || return 1 + "root=dhcp" 192.168.50.3 wsize=4096 || return 1 client_test "NFSv4 root=nfs4:..." 52:54:00:12:34:84 \ - "root=nfs4:192.168.50.1:/client" 192.168.50.1 \ - -wsize=4096 || return 1 + "root=nfs4:192.168.50.1:/client" 192.168.50.1 \ + -wsize=4096 || return 1 client_test "NFSv4 root=dhcp DHCP proto:IP:path,options" \ - 52:54:00:12:34:87 "root=dhcp" 192.168.50.3 wsize=4096 || return 1 + 52:54:00:12:34:87 "root=dhcp" 192.168.50.3 wsize=4096 || return 1 return 0 } @@ -244,9 +244,9 @@ test_setup() { done inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ - dmesg mkdir cp ping exportfs \ - modprobe rpc.nfsd rpc.mountd showmount tcpdump \ - /etc/services sleep mount chmod rm + dmesg mkdir cp ping exportfs \ + modprobe rpc.nfsd rpc.mountd showmount tcpdump \ + /etc/services sleep mount chmod rm for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -270,7 +270,7 @@ test_setup() { inst_libdir_file 'libnfsidmap*.so*' _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ - | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') + | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') _nsslibs=${_nsslibs#|} _nsslibs=${_nsslibs%|} @@ -299,7 +299,7 @@ test_setup() { . $basedir/dracut-init.sh inst_multiple sh shutdown poweroff stty cat ps ln ip \ - mount dmesg mkdir cp ping grep setsid ls vi /etc/virc less cat + mount dmesg mkdir cp ping grep setsid ls vi /etc/virc less cat for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -324,7 +324,7 @@ test_setup() { inst_libdir_file 'libnfsidmap*.so*' _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ - | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') + | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') _nsslibs=${_nsslibs#|} _nsslibs=${_nsslibs%|} @@ -355,18 +355,18 @@ test_setup() { # Make server's dracut image $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash udev-rules base rootfs-block fs-lib debug kernel-modules watchdog qemu" \ - -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod e1000 i6300esb" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.server $KVERSION || return 1 + -m "dash udev-rules base rootfs-block fs-lib debug kernel-modules watchdog qemu" \ + -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod e1000 i6300esb" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.server $KVERSION || return 1 # Make client's dracut image $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "plymouth dash" \ - -a "debug watchdog" \ - -d "af_packet piix ide-gd_mod ata_piix sd_mod e1000 nfs sunrpc i6300esb" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -o "plymouth dash" \ + -a "debug watchdog" \ + -d "af_packet piix ide-gd_mod ata_piix sd_mod e1000 nfs sunrpc i6300esb" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 } test_cleanup() { diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index 7424d105..c0239981 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -64,8 +64,8 @@ run_client() { -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then - echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" - return 1 + echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" + return 1 fi echo "CLIENT TEST END: $test_name [OK]" @@ -144,7 +144,7 @@ test_setup() { mkdir -p -- var/lib/nfs/rpc_pipefs ) inst_multiple sh shutdown poweroff stty cat ps ln ip \ - mount dmesg mkdir cp ping grep setsid + mount dmesg mkdir cp ping grep setsid for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -169,10 +169,10 @@ test_setup() { # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ - -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 + -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay @@ -187,7 +187,7 @@ test_setup() { -drive format=raw,index=1,media=disk,file=$TESTDIR/client.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ - -smp 2 -m 512M -nographic -net none \ + -smp 2 -m 512M -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1 @@ -201,11 +201,11 @@ test_setup() { inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "dash plymouth dmraid nfs" \ - -a "debug" \ - -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -o "dash plymouth dmraid nfs" \ + -a "debug" \ + -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 # Make server root dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=60 @@ -223,9 +223,9 @@ test_setup() { ) inst /etc/passwd /etc/passwd inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ - dmesg mkdir cp ping \ - modprobe tcpdump setsid \ - /etc/services sleep mount chmod + dmesg mkdir cp ping \ + modprobe tcpdump setsid \ + /etc/services sleep mount chmod inst_multiple tgtd tgtadm for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break @@ -252,10 +252,10 @@ test_setup() { # Make server's dracut image $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -a "dash udev-rules base rootfs-block fs-lib debug kernel-modules" \ - -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod e1000 drbg" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.server $KVERSION || return 1 + -a "dash udev-rules base rootfs-block fs-lib debug kernel-modules" \ + -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod e1000 drbg" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.server $KVERSION || return 1 } diff --git a/test/TEST-31-ISCSI-MULTI/test.sh b/test/TEST-31-ISCSI-MULTI/test.sh index 946a198a..2fdc38e2 100755 --- a/test/TEST-31-ISCSI-MULTI/test.sh +++ b/test/TEST-31-ISCSI-MULTI/test.sh @@ -62,8 +62,8 @@ run_client() { -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then - echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" - return 1 + echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" + return 1 fi echo "CLIENT TEST END: $test_name [OK]" @@ -158,7 +158,7 @@ test_setup() { mkdir -p -- var/lib/nfs/rpc_pipefs ) inst_multiple sh shutdown poweroff stty cat ps ln ip \ - mount dmesg mkdir cp ping grep setsid + mount dmesg mkdir cp ping grep setsid for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -183,10 +183,10 @@ test_setup() { # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ - -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 + -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay @@ -201,7 +201,7 @@ test_setup() { -drive format=raw,index=1,media=disk,file=$TESTDIR/client.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ - -smp 2 -m 512M -nographic -net none \ + -smp 2 -m 512M -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1 @@ -215,11 +215,11 @@ test_setup() { inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "dash plymouth dmraid nfs" \ - -a "debug" \ - -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 + -o "dash plymouth dmraid nfs" \ + -a "debug" \ + -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 # Make server root dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=60 @@ -237,9 +237,9 @@ test_setup() { ) inst /etc/passwd /etc/passwd inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ - dmesg mkdir cp ping \ - modprobe tcpdump setsid \ - /etc/services sleep mount chmod + dmesg mkdir cp ping \ + modprobe tcpdump setsid \ + /etc/services sleep mount chmod inst_multiple tgtd tgtadm for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break @@ -266,10 +266,10 @@ test_setup() { # Make server's dracut image $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -a "dash udev-rules base rootfs-block fs-lib debug kernel-modules" \ - -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod e1000 drbg" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.server $KVERSION || return 1 + -a "dash udev-rules base rootfs-block fs-lib debug kernel-modules" \ + -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod e1000 drbg" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.server $KVERSION || return 1 } diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 5e0793c9..922f4e5c 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -211,11 +211,11 @@ make_encrypted_root() { mkdir -p "$initdir" ( cd "$initdir" - mkdir -p dev sys proc etc var tmp run root usr/bin usr/lib usr/lib64 usr/sbin + mkdir -p dev sys proc etc var tmp run root usr/bin usr/lib usr/lib64 usr/sbin for i in bin sbin lib lib64; do ln -sfnr usr/$i $i done - ln -s ../run var/run + ln -s ../run var/run ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ mount dmesg mkdir cp ping @@ -236,11 +236,11 @@ make_encrypted_root() { . $basedir/dracut-init.sh ( cd "$initdir" - mkdir -p dev sys proc etc tmp var run root usr/bin usr/lib usr/lib64 usr/sbin + mkdir -p dev sys proc etc tmp var run root usr/bin usr/lib usr/lib64 usr/sbin for i in bin sbin lib lib64; do ln -sfnr usr/$i $i done - ln -s ../run var/run + ln -s ../run var/run ) inst_multiple mke2fs poweroff cp umount tune2fs inst_hook shutdown-emergency 000 ./hard-off.sh @@ -285,11 +285,11 @@ make_client_root() { mkdir -p "$initdir" ( cd "$initdir" - mkdir -p dev sys proc etc var tmp run root usr/bin usr/lib usr/lib64 usr/sbin + mkdir -p dev sys proc etc var tmp run root usr/bin usr/lib usr/lib64 usr/sbin for i in bin sbin lib lib64; do ln -sfnr usr/$i $i done - ln -s ../run var/run + ln -s ../run var/run ) inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ dmesg mkdir cp ping @@ -328,7 +328,7 @@ make_server_root() { ( cd "$initdir"; mkdir -p run dev sys proc etc var var/lib/dhcpd tmp etc/nbd-server - ln -s ../run var/run + ln -s ../run var/run ) cat > "$initdir/etc/nbd-server/config" < Date: Wed, 26 Feb 2020 14:45:55 +0100 Subject: [PATCH 13/50] test/TEST-60-IFCFG/test.sh: fixed qemu hubport netifs netifs are offset by one if qemu hubport is used --- .../99-default.link | 0 .../99-idesymlinks.rules | 0 .../Makefile | 0 .../client-init.sh | 0 .../dhcpd.conf | 0 .../exports | 0 .../finished-false.sh | 0 .../hard-off.sh | 0 .../hosts | 0 .../server-init.sh | 0 .../test.sh | 51 ++- .../99-default.link | 6 - .../99-idesymlinks.rules | 8 - test/TEST-70-BONDBRIDGETEAMVLAN/Makefile | 1 - .../TEST-70-BONDBRIDGETEAMVLAN/client-init.sh | 18 - test/TEST-70-BONDBRIDGETEAMVLAN/dhcpd.conf | 27 -- test/TEST-70-BONDBRIDGETEAMVLAN/exports | 1 - .../finished-false.sh | 2 - test/TEST-70-BONDBRIDGETEAMVLAN/hard-off.sh | 3 - test/TEST-70-BONDBRIDGETEAMVLAN/hosts | 5 - .../TEST-70-BONDBRIDGETEAMVLAN/server-init.sh | 129 ------- test/TEST-70-BONDBRIDGETEAMVLAN/test.sh | 345 ------------------ 22 files changed, 48 insertions(+), 548 deletions(-) rename test/{TEST-60-IFCFG => TEST-60-BONDBRIDGEVLANIFCFG}/99-default.link (100%) rename test/{TEST-60-IFCFG => TEST-60-BONDBRIDGEVLANIFCFG}/99-idesymlinks.rules (100%) rename test/{TEST-60-IFCFG => TEST-60-BONDBRIDGEVLANIFCFG}/Makefile (100%) rename test/{TEST-60-IFCFG => TEST-60-BONDBRIDGEVLANIFCFG}/client-init.sh (100%) rename test/{TEST-60-IFCFG => TEST-60-BONDBRIDGEVLANIFCFG}/dhcpd.conf (100%) rename test/{TEST-60-IFCFG => TEST-60-BONDBRIDGEVLANIFCFG}/exports (100%) rename test/{TEST-60-IFCFG => TEST-60-BONDBRIDGEVLANIFCFG}/finished-false.sh (100%) rename test/{TEST-60-IFCFG => TEST-60-BONDBRIDGEVLANIFCFG}/hard-off.sh (100%) rename test/{TEST-60-IFCFG => TEST-60-BONDBRIDGEVLANIFCFG}/hosts (100%) rename test/{TEST-60-IFCFG => TEST-60-BONDBRIDGEVLANIFCFG}/server-init.sh (100%) rename test/{TEST-60-IFCFG => TEST-60-BONDBRIDGEVLANIFCFG}/test.sh (76%) delete mode 100644 test/TEST-70-BONDBRIDGETEAMVLAN/99-default.link delete mode 100644 test/TEST-70-BONDBRIDGETEAMVLAN/99-idesymlinks.rules delete mode 100644 test/TEST-70-BONDBRIDGETEAMVLAN/Makefile delete mode 100755 test/TEST-70-BONDBRIDGETEAMVLAN/client-init.sh delete mode 100644 test/TEST-70-BONDBRIDGETEAMVLAN/dhcpd.conf delete mode 100644 test/TEST-70-BONDBRIDGETEAMVLAN/exports delete mode 100755 test/TEST-70-BONDBRIDGETEAMVLAN/finished-false.sh delete mode 100755 test/TEST-70-BONDBRIDGETEAMVLAN/hard-off.sh delete mode 100644 test/TEST-70-BONDBRIDGETEAMVLAN/hosts delete mode 100755 test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh delete mode 100755 test/TEST-70-BONDBRIDGETEAMVLAN/test.sh diff --git a/test/TEST-60-IFCFG/99-default.link b/test/TEST-60-BONDBRIDGEVLANIFCFG/99-default.link similarity index 100% rename from test/TEST-60-IFCFG/99-default.link rename to test/TEST-60-BONDBRIDGEVLANIFCFG/99-default.link diff --git a/test/TEST-60-IFCFG/99-idesymlinks.rules b/test/TEST-60-BONDBRIDGEVLANIFCFG/99-idesymlinks.rules similarity index 100% rename from test/TEST-60-IFCFG/99-idesymlinks.rules rename to test/TEST-60-BONDBRIDGEVLANIFCFG/99-idesymlinks.rules diff --git a/test/TEST-60-IFCFG/Makefile b/test/TEST-60-BONDBRIDGEVLANIFCFG/Makefile similarity index 100% rename from test/TEST-60-IFCFG/Makefile rename to test/TEST-60-BONDBRIDGEVLANIFCFG/Makefile diff --git a/test/TEST-60-IFCFG/client-init.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh similarity index 100% rename from test/TEST-60-IFCFG/client-init.sh rename to test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh diff --git a/test/TEST-60-IFCFG/dhcpd.conf b/test/TEST-60-BONDBRIDGEVLANIFCFG/dhcpd.conf similarity index 100% rename from test/TEST-60-IFCFG/dhcpd.conf rename to test/TEST-60-BONDBRIDGEVLANIFCFG/dhcpd.conf diff --git a/test/TEST-60-IFCFG/exports b/test/TEST-60-BONDBRIDGEVLANIFCFG/exports similarity index 100% rename from test/TEST-60-IFCFG/exports rename to test/TEST-60-BONDBRIDGEVLANIFCFG/exports diff --git a/test/TEST-60-IFCFG/finished-false.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/finished-false.sh similarity index 100% rename from test/TEST-60-IFCFG/finished-false.sh rename to test/TEST-60-BONDBRIDGEVLANIFCFG/finished-false.sh diff --git a/test/TEST-60-IFCFG/hard-off.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/hard-off.sh similarity index 100% rename from test/TEST-60-IFCFG/hard-off.sh rename to test/TEST-60-BONDBRIDGEVLANIFCFG/hard-off.sh diff --git a/test/TEST-60-IFCFG/hosts b/test/TEST-60-BONDBRIDGEVLANIFCFG/hosts similarity index 100% rename from test/TEST-60-IFCFG/hosts rename to test/TEST-60-BONDBRIDGEVLANIFCFG/hosts diff --git a/test/TEST-60-IFCFG/server-init.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/server-init.sh similarity index 100% rename from test/TEST-60-IFCFG/server-init.sh rename to test/TEST-60-BONDBRIDGEVLANIFCFG/server-init.sh diff --git a/test/TEST-60-IFCFG/test.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh similarity index 76% rename from test/TEST-60-IFCFG/test.sh rename to test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh index 337eb56b..2afeb15d 100755 --- a/test/TEST-60-IFCFG/test.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh @@ -87,7 +87,7 @@ client_test() { $nic3 -device e1000,mac=52:54:00:12:34:05,netdev=n3 \ -watchdog i6300esb -watchdog-action poweroff \ -no-reboot \ - -append "panic=1 $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ + -append "panic=1 $cmdline systemd.crash_reboot rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ -initrd "$TESTDIR"/initramfs.testing else $testdir/run-qemu \ @@ -103,7 +103,7 @@ client_test() { -net nic,vlan=3,macaddr=52:54:00:12:34:05,model=e1000 \ -watchdog i6300esb -watchdog-action poweroff \ -no-reboot \ - -append "panic=1 $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ + -append "panic=1 $cmdline systemd.crash_reboot rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ -initrd "$TESTDIR"/initramfs.testing fi @@ -143,6 +143,51 @@ test_run() { } test_client() { + if $testdir/run-qemu --help | grep -qF -m1 'netdev hubport,id=str,hubid=n[,netdev=nd]'; then + client_test "Multiple VLAN" \ + "yes" \ + " +vlan=vlan0001:ens6 +vlan=vlan2:ens6 +vlan=ens6.3:ens6 +vlan=ens6.0004:ens6 +ip=ens4:dhcp +ip=192.168.54.101::192.168.54.1:24:test:vlan0001:none +ip=192.168.55.102::192.168.55.1:24:test:vlan2:none +ip=192.168.56.103::192.168.56.1:24:test:ens6.3:none +ip=192.168.57.104::192.168.57.1:24:test:ens6.0004:none +rd.neednet=1 +root=nfs:192.168.50.1:/nfs/client bootdev=ens4 +" \ + 'ens4 ens6.0004 ens6.3 vlan0001 vlan2 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" DEVICE="ens4" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Ethernet /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6.0004 # Generated by dracut initrd NAME="ens6.0004" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.57.104" PREFIX="24" GATEWAY="192.168.57.1" TYPE=Vlan DEVICE="ens6.0004" VLAN=yes PHYSDEV="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6.3 # Generated by dracut initrd NAME="ens6.3" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.56.103" PREFIX="24" GATEWAY="192.168.56.1" TYPE=Vlan DEVICE="ens6.3" VLAN=yes PHYSDEV="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan0001 # Generated by dracut initrd NAME="vlan0001" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.54.101" PREFIX="24" GATEWAY="192.168.54.1" TYPE=Vlan DEVICE="vlan0001" VLAN=yes PHYSDEV="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan2 # Generated by dracut initrd NAME="vlan2" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.55.102" PREFIX="24" GATEWAY="192.168.55.1" TYPE=Vlan DEVICE="vlan2" VLAN=yes PHYSDEV="ens6" EOF ' \ + || return 1 + + client_test "Multiple Bonds" \ + "yes" \ + " +bond=bond0:ens4,ens5 +bond=bond1:ens7,ens8 +ip=bond0:dhcp +ip=bond1:dhcp +rd.neednet=1 +root=nfs:192.168.50.1:/nfs/client bootdev=bond0 +" \ + 'bond0 bond1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond0 # Generated by dracut initrd NAME="bond0" DEVICE="bond0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond0" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond1 # Generated by dracut initrd NAME="bond1" DEVICE="bond1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond1" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5 # Generated by dracut initrd NAME="ens5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens7" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens8 # Generated by dracut initrd NAME="ens8" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens8" EOF ' \ + || return 1 + + client_test "Multiple Bridges" \ + "no" \ + " +bridge=br0:ens4,ens5 +bridge=br1:ens7,ens8 +ip=br0:dhcp +ip=br1:dhcp +rd.neednet=1 +root=nfs:192.168.50.1:/nfs/client bootdev=br0 +" \ + 'br0 br1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br0 # Generated by dracut initrd NAME="br0" DEVICE="br0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br0" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br1 # Generated by dracut initrd NAME="br1" DEVICE="br1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br1" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5 # Generated by dracut initrd NAME="ens5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens7" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens8 # Generated by dracut initrd NAME="ens8" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens8" EOF ' \ + || return 1 + else client_test "Multiple VLAN" \ "yes" \ " @@ -186,7 +231,7 @@ root=nfs:192.168.50.1:/nfs/client bootdev=br0 " \ 'br0 br1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br0 # Generated by dracut initrd NAME="br0" DEVICE="br0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br0" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br1 # Generated by dracut initrd NAME="br1" DEVICE="br1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br1" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5 # Generated by dracut initrd NAME="ens5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6 # Generated by dracut initrd NAME="ens6" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens7" EOF ' \ || return 1 - + fi kill_server return 0 } diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/99-default.link b/test/TEST-70-BONDBRIDGETEAMVLAN/99-default.link deleted file mode 100644 index b992bfd2..00000000 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/99-default.link +++ /dev/null @@ -1,6 +0,0 @@ -[Match] -OriginalName=* - -[Link] -NamePolicy=keep kernel database onboard slot path -MACAddressPolicy=keep diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/99-idesymlinks.rules b/test/TEST-70-BONDBRIDGETEAMVLAN/99-idesymlinks.rules deleted file mode 100644 index d557790a..00000000 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/99-idesymlinks.rules +++ /dev/null @@ -1,8 +0,0 @@ -ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hda", SYMLINK+="sda" -ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hda*", SYMLINK+="sda$env{MINOR}" -ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdb", SYMLINK+="sdb" -ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdb*", SYMLINK+="sdb$env{MINOR}" -ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdc", SYMLINK+="sdc" -ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdc*", SYMLINK+="sdc$env{MINOR}" -ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdd", SYMLINK+="sdd" -ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdd*", SYMLINK+="sdd$env{MINOR}" diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/Makefile b/test/TEST-70-BONDBRIDGETEAMVLAN/Makefile deleted file mode 100644 index 2dcab816..00000000 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/Makefile +++ /dev/null @@ -1 +0,0 @@ --include ../Makefile.testdir diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/client-init.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/client-init.sh deleted file mode 100755 index 083e0f59..00000000 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/client-init.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -exec >/dev/console 2>&1 -export PATH=/sbin:/bin:/usr/sbin:/usr/bin -strstr() { [ "${1#*$2*}" != "$1" ]; } -CMDLINE=$(while read line; do echo $line;done < /proc/cmdline) -export TERM=linux -export PS1='initramfs-test:\w\$ ' -stty sane -echo "made it to the rootfs! Powering down." - -( - echo OK - ip -o -4 address show scope global |sed -n 's/^[^:]*: \([^ ]*\) *\(.*\) scope.*/\1 \2/p' |sort - echo EOF -) > /dev/sda - -strstr "$CMDLINE" "rd.shell" && sh -i -poweroff -f diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/dhcpd.conf b/test/TEST-70-BONDBRIDGETEAMVLAN/dhcpd.conf deleted file mode 100644 index e26bd60b..00000000 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/dhcpd.conf +++ /dev/null @@ -1,27 +0,0 @@ -ddns-update-style none; - -use-host-decl-names true; - -subnet 192.168.50.0 netmask 255.255.255.0 { - option subnet-mask 255.255.255.0; - option routers 192.168.50.1; - next-server 192.168.50.1; - server-identifier 192.168.50.1; - option domain-name-servers 192.168.50.1; - option domain-search "example.com"; - option domain-name "other.com"; - option root-path "nfs:192.168.50.1:/nfs/client"; - range 192.168.50.10 192.168.50.100; -} - -subnet 192.168.51.0 netmask 255.255.255.0 { - option subnet-mask 255.255.255.0; - option routers 192.168.51.1; - next-server 192.168.51.1; - server-identifier 192.168.51.1; - option domain-name-servers 192.168.51.1; - option domain-search "example.com"; - option domain-name "other.com"; - option root-path "nfs:192.168.51.1:/nfs/client"; - range 192.168.51.10 192.168.51.100; -} diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/exports b/test/TEST-70-BONDBRIDGETEAMVLAN/exports deleted file mode 100644 index ff5f29b1..00000000 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/exports +++ /dev/null @@ -1 +0,0 @@ -/nfs/client 192.168.50.0/24(rw,insecure,no_subtree_check,no_root_squash) diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/finished-false.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/finished-false.sh deleted file mode 100755 index ecdbef95..00000000 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/finished-false.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exit 1 diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/hard-off.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/hard-off.sh deleted file mode 100755 index 12c3d5ac..00000000 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/hard-off.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -getarg rd.shell || poweroff -f -getarg failme && poweroff -f diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/hosts b/test/TEST-70-BONDBRIDGETEAMVLAN/hosts deleted file mode 100644 index d02a4e9b..00000000 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/hosts +++ /dev/null @@ -1,5 +0,0 @@ -127.0.0.1 localhost -192.168.50.1 server -192.168.50.100 client-if1 -192.168.50.101 client-if2 -192.168.50.102 client-if3 diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh deleted file mode 100755 index e4e541d3..00000000 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/server-init.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/sh -exec /dev/console 2>&1 -set -x -export PATH=/sbin:/bin:/usr/sbin:/usr/bin -export TERM=linux -export PS1='server:\w\$ ' -stty sane -echo "made it to the rootfs!" -echo server > /proc/sys/kernel/hostname - -wait_for_if_link() { - local cnt=0 - local li - while [ $cnt -lt 600 ]; do - li=$(ip -o link show dev $1 2>/dev/null) - [ -n "$li" ] && return 0 - if [[ $2 ]]; then - li=$(ip -o link show dev $2 2>/dev/null) - [ -n "$li" ] && return 0 - fi - sleep 0.1 - cnt=$(($cnt+1)) - done - return 1 -} - -wait_for_if_up() { - local cnt=0 - local li - while [ $cnt -lt 200 ]; do - li=$(ip -o link show up dev $1) - [ -n "$li" ] && return 0 - sleep 0.1 - cnt=$(($cnt+1)) - done - return 1 -} - -wait_for_route_ok() { - local cnt=0 - while [ $cnt -lt 200 ]; do - li=$(ip route show) - [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0 - sleep 0.1 - cnt=$(($cnt+1)) - done - return 1 -} - -linkup() { - wait_for_if_link $1 2>/dev/null\ - && ip link set $1 up 2>/dev/null\ - && wait_for_if_up $1 2>/dev/null -} - -wait_for_if_link eth0 ens3 -wait_for_if_link eth1 ens4 -wait_for_if_link eth2 ens5 -wait_for_if_link eth3 ens6 - -modprobe --all -b -q 8021q ipvlan macvlan ->/dev/watchdog -ip addr add 127.0.0.1/8 dev lo -linkup lo -ip link set dev eth0 name ens3 -ip addr add 192.168.50.1/24 dev ens3 -linkup ens3 ->/dev/watchdog -ip link set dev eth1 name ens4 -ip link add dev ens4.1 link ens4 type vlan id 1 -ip link add dev ens4.2 link ens4 type vlan id 2 -ip link add dev ens4.3 link ens4 type vlan id 3 -ip link add dev ens4.4 link ens4 type vlan id 4 -ip addr add 192.168.54.1/24 dev ens4.1 -ip addr add 192.168.55.1/24 dev ens4.2 -ip addr add 192.168.56.1/24 dev ens4.3 -ip addr add 192.168.57.1/24 dev ens4.4 -linkup ens4 -ip link set dev ens4.1 up -ip link set dev ens4.2 up -ip link set dev ens4.3 up -ip link set dev ens4.4 up -ip link set dev eth2 name ens5 -ip addr add 192.168.51.1/24 dev ens5 -linkup ens5 -ip link set dev eth3 name ens6 -linkup ens6 ->/dev/watchdog -modprobe af_packet -> /dev/watchdog -modprobe sunrpc ->/dev/watchdog -mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs ->/dev/watchdog -[ -x /sbin/portmap ] && portmap ->/dev/watchdog -mkdir -p /run/rpcbind -[ -x /sbin/rpcbind ] && rpcbind ->/dev/watchdog -modprobe nfsd ->/dev/watchdog -mount -t nfsd nfsd /proc/fs/nfsd ->/dev/watchdog -exportfs -r ->/dev/watchdog -rpc.nfsd ->/dev/watchdog -rpc.mountd ->/dev/watchdog -rpc.idmapd ->/dev/watchdog -exportfs -r ->/dev/watchdog ->/var/lib/dhcpd/dhcpd.leases ->/dev/watchdog -chmod 777 /var/lib/dhcpd/dhcpd.leases ->/dev/watchdog -dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases ens3 ens5 -#echo -n 'V' > /dev/watchdog -#sh -i -#tcpdump -i ens3 -# Wait forever for the VM to die -echo "Serving NFS mounts" -while :; do - sleep 10 - >/dev/watchdog -done -mount -n -o remount,ro / -poweroff -f diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh deleted file mode 100755 index 8e293332..00000000 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh +++ /dev/null @@ -1,345 +0,0 @@ -#!/bin/bash -# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -# ex: ts=8 sw=4 sts=4 et filetype=sh -TEST_DESCRIPTION="root filesystem on NFS with bridging/bonding/vlan" -KVERSION=${KVERSION-$(uname -r)} - -# Uncomment this to debug failures -#DEBUGFAIL="rd.shell rd.break" -#DEBUGFAIL="rd.shell rd.break rd.debug" -#SERIAL="tcp:127.0.0.1:9999" - -run_server() { - # Start server first - echo "MULTINIC TEST SETUP: Starting DHCP/NFS server" - - fsck -a "$TESTDIR"/server.ext3 || return 1 - - $testdir/run-qemu \ - -hda "$TESTDIR"/server.ext3 \ - -m 512M -smp 2 \ - -display none \ - -netdev socket,id=n0,listen=127.0.0.1:12370 \ - -netdev socket,id=n1,listen=127.0.0.1:12371 \ - -netdev socket,id=n2,listen=127.0.0.1:12372 \ - -netdev socket,id=n3,listen=127.0.0.1:12373 \ - -device e1000,netdev=n0,mac=52:54:01:12:34:56 \ - -device e1000,netdev=n1,mac=52:54:01:12:34:57 \ - -device e1000,netdev=n2,mac=52:54:01:12:34:58 \ - -device e1000,netdev=n3,mac=52:54:01:12:34:59 \ - ${SERIAL:+-serial "$SERIAL"} \ - ${SERIAL:--serial file:"$TESTDIR"/server.log} \ - -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ - -append "panic=1 systemd.crash_reboot loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 rd.debug" \ - -initrd "$TESTDIR"/initramfs.server \ - -pidfile "$TESTDIR"/server.pid -daemonize || return 1 - chmod 644 -- "$TESTDIR"/server.pid || return 1 - - # Cleanup the terminal if we have one - tty -s && stty sane - - if ! [[ $SERIAL ]]; then - echo "Waiting for the server to startup" - while : ; do - grep Serving "$TESTDIR"/server.log && break - sleep 1 - done - else - echo Sleeping 10 seconds to give the server a head start - sleep 10 - fi -} - -client_test() { - local test_name="$1" - local do_vlan13="$2" - local cmdline="$3" - local check="$4" - local CONF - - echo "CLIENT TEST START: $test_name" - - [ "$do_vlan13" != "yes" ] && unset do_vlan13 - - # Need this so kvm-qemu will boot (needs non-/dev/zero local disk) - if ! dd if=/dev/zero of="$TESTDIR"/client.img bs=1M count=1; then - echo "Unable to make client sda image" 1>&2 - return 1 - fi - if [[ $do_vlan13 ]]; then - nic1=" -netdev socket,connect=127.0.0.1:12371,id=n1" - nic3=" -netdev socket,connect=127.0.0.1:12373,id=n3" - else - nic1=" -netdev hubport,id=n1,hubid=2" - nic3=" -netdev hubport,id=n3,hubid=3" - fi - - if $testdir/run-qemu --help | grep -qF -m1 'netdev hubport,id=str,hubid=n[,netdev=nd]' && echo OK; then - $testdir/run-qemu \ - -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ - -netdev socket,connect=127.0.0.1:12370,id=s1 \ - -netdev hubport,hubid=1,id=h1,netdev=s1 \ - -netdev hubport,hubid=1,id=h2 -device e1000,mac=52:54:00:12:34:01,netdev=h2 \ - -netdev hubport,hubid=1,id=h3 -device e1000,mac=52:54:00:12:34:02,netdev=h3 \ - $nic1 -device e1000,mac=52:54:00:12:34:03,netdev=n1 \ - -netdev socket,connect=127.0.0.1:12372,id=n2 -device e1000,mac=52:54:00:12:34:04,netdev=n2 \ - $nic3 -device e1000,mac=52:54:00:12:34:05,netdev=n3 \ - -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ - -append "panic=1 systemd.crash_reboot $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ - -initrd "$TESTDIR"/initramfs.testing - else - $testdir/run-qemu \ - -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ - -net socket,vlan=0,connect=127.0.0.1:12370 \ - ${do_vlan13:+-net socket,vlan=1,connect=127.0.0.1:12371} \ - -net socket,vlan=2,connect=127.0.0.1:12372 \ - ${do_vlan13:+-net socket,vlan=3,connect=127.0.0.1:12373} \ - -net nic,vlan=0,macaddr=52:54:00:12:34:01,model=e1000 \ - -net nic,vlan=0,macaddr=52:54:00:12:34:02,model=e1000 \ - -net nic,vlan=1,macaddr=52:54:00:12:34:03,model=e1000 \ - -net nic,vlan=2,macaddr=52:54:00:12:34:04,model=e1000 \ - -net nic,vlan=3,macaddr=52:54:00:12:34:05,model=e1000 \ - -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ - -append "panic=1 systemd.crash_reboot $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ - -initrd "$TESTDIR"/initramfs.testing - fi - - { - read OK - if [[ "$OK" != "OK" ]]; then - echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" - return 1 - fi - - while read line; do - [[ $line == END ]] && break - CONF+="$line " - done - } < "$TESTDIR"/client.img || return 1 - - if [[ ! "$CONF" =~ ^$check$ ]]; then - echo "Expected: /^$check\$/" - echo - echo - echo "Got: '$CONF'" - echo "CLIENT TEST END: $test_name [FAILED - BAD CONF]" - return 1 - fi - - echo "CLIENT TEST END: $test_name [OK]" - return 0 -} - - -test_run() { - if ! run_server; then - echo "Failed to start server" 1>&2 - return 1 - fi - test_client || { kill_server; return 1; } -} - -test_client() { - client_test "Multiple VLAN" \ - "yes" \ - " -vlan=vlan0001:ens5 -vlan=vlan2:ens5 -vlan=ens5.3:ens5 -vlan=ens5.0004:ens5 -ip=ens3:dhcp -ip=192.168.54.101::192.168.54.1:24:test:vlan0001:none -ip=192.168.55.102::192.168.55.1:24:test:vlan2:none -ip=192.168.56.103::192.168.56.1:24:test:ens5.3:none -ip=192.168.57.104::192.168.57.1:24:test:ens5.0004:none -rd.neednet=1 -root=nfs:192.168.50.1:/nfs/client bootdev=ens3 -" \ - 'ens3 inet 192\.168\.50\.[0-9]*/24 brd 192\.168\.50\.255 ens5\.0004 inet 192\.168\.57\.104/24 brd 192\.168\.57\.255 ens5\.3 inet 192\.168\.56\.103/24 brd 192\.168\.56\.255 vlan0001 inet 192\.168\.54\.101/24 brd 192\.168\.54\.255 vlan2 inet 192\.168\.55\.102/24 brd 192\.168\.55\.255 EOF ' \ - || return 1 - - client_test "Multiple Bonds" \ - "yes" \ - " -bond=bond0:ens4,ens5 -bond=bond1:ens6,ens7 -ip=bond0:dhcp -ip=bond1:dhcp -rd.neednet=1 -root=nfs:192.168.50.1:/nfs/client bootdev=bond0 -" \ - 'bond0 inet 192\.168\.50\.[0-9]*/24 brd 192\.168\.50\.255 bond1 inet 192\.168\.51\.[0-9]*/24 brd 192\.168\.51\.255 EOF ' \ - || return 1 - - client_test "Multiple Bridges" \ - "no" \ - " -bridge=br0:ens4,ens5 -bridge=br1:ens6,ens7 -ip=br0:dhcp -ip=br1:dhcp -rd.neednet=1 -root=nfs:192.168.50.1:/nfs/client bootdev=br0 -" \ - 'br0 inet 192\.168\.50\.[0-9]*/24 brd 192\.168\.50\.255 br1 inet 192\.168\.51\.[0-9]*/24 brd 192\.168\.51\.255 EOF ' \ - || return 1 - - kill_server - return 0 -} - -test_setup() { - # Make server root - dd if=/dev/null of="$TESTDIR"/server.ext3 bs=1M seek=120 - mke2fs -j -F -- "$TESTDIR"/server.ext3 - mkdir -- "$TESTDIR"/mnt - mount -o loop -- "$TESTDIR"/server.ext3 "$TESTDIR"/mnt - kernel=$KVERSION - ( - export initdir="$TESTDIR"/mnt - . "$basedir"/dracut-init.sh - - ( - cd "$initdir"; - mkdir -p -- dev sys proc run etc var/run tmp var/lib/{dhcpd,rpcbind} - mkdir -p -- var/lib/nfs/{v4recovery,rpc_pipefs} - chmod 777 -- var/lib/rpcbind var/lib/nfs - ) - - for _f in modules.builtin.bin modules.builtin; do - [[ $srcmods/$_f ]] && break - done || { - dfatal "No modules.builtin.bin and modules.builtin found!" - return 1 - } - - for _f in modules.builtin.bin modules.builtin modules.order; do - [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f" - done - - inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ - dmesg mkdir cp ping exportfs \ - modprobe rpc.nfsd rpc.mountd showmount tcpdump \ - /etc/services sleep mount chmod - for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do - [ -f "${_terminfodir}"/l/linux ] && break - done - inst_multiple -o "${_terminfodir}"/l/linux - type -P portmap >/dev/null && inst_multiple portmap - type -P rpcbind >/dev/null && inst_multiple rpcbind - [ -f /etc/netconfig ] && inst_multiple /etc/netconfig - type -P dhcpd >/dev/null && inst_multiple dhcpd - [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd - instmods nfsd sunrpc ipv6 lockd af_packet 8021q ipvlan macvlan - inst_simple /etc/os-release - inst ./server-init.sh /sbin/init - inst ./hosts /etc/hosts - inst ./exports /etc/exports - inst ./dhcpd.conf /etc/dhcpd.conf - inst_multiple /etc/nsswitch.conf /etc/rpc /etc/protocols - - inst_multiple rpc.idmapd /etc/idmapd.conf - - inst_libdir_file 'libnfsidmap_nsswitch.so*' - inst_libdir_file 'libnfsidmap/*.so*' - inst_libdir_file 'libnfsidmap*.so*' - - _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ - | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') - _nsslibs=${_nsslibs#|} - _nsslibs=${_nsslibs%|} - - inst_libdir_file -n "$_nsslibs" 'libnss_*.so*' - - inst /etc/nsswitch.conf /etc/nsswitch.conf - inst /etc/passwd /etc/passwd - inst /etc/group /etc/group - - cp -a -- /etc/ld.so.conf* "$initdir"/etc - ldconfig -r "$initdir" - dracut_kernel_post - ) - - # Make client root inside server root - ( - export initdir="$TESTDIR"/mnt/nfs/client - . "$basedir"/dracut-init.sh - inst_multiple sh shutdown poweroff stty cat ps ln ip \ - mount dmesg mkdir cp ping grep ls sort sed - for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do - [[ -f ${_terminfodir}/l/linux ]] && break - done - inst_multiple -o "${_terminfodir}"/l/linux - inst_simple /etc/os-release - inst ./client-init.sh /sbin/init - ( - cd "$initdir" - mkdir -p -- dev sys proc etc run - mkdir -p -- var/lib/nfs/rpc_pipefs - ) - inst /etc/nsswitch.conf /etc/nsswitch.conf - inst /etc/passwd /etc/passwd - inst /etc/group /etc/group - - inst_multiple rpc.idmapd /etc/idmapd.conf - inst_libdir_file 'libnfsidmap_nsswitch.so*' - inst_libdir_file 'libnfsidmap/*.so*' - inst_libdir_file 'libnfsidmap*.so*' - - _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' -- /etc/nsswitch.conf \ - | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') - _nsslibs=${_nsslibs#|} - _nsslibs=${_nsslibs%|} - - inst_libdir_file -n "$_nsslibs" 'libnss_*.so*' - - cp -a -- /etc/ld.so.conf* "$initdir"/etc - ldconfig -r "$initdir" - ) - - umount "$TESTDIR"/mnt - rm -fr -- "$TESTDIR"/mnt - - # Make an overlay with needed tools for the test harness - ( - export initdir="$TESTDIR"/overlay - . "$basedir"/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules - inst_simple ./99-default.link /etc/systemd/network/99-default.link - ) - - # Make server's dracut image - $basedir/dracut.sh -l -i "$TESTDIR"/overlay / \ - --no-early-microcode \ - -m "udev-rules base rootfs-block fs-lib debug kernel-modules watchdog qemu" \ - -d "ipvlan macvlan af_packet piix ide-gd_mod ata_piix ext3 sd_mod nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files nfsd e1000 i6300esb ib700wdt" \ - --no-hostonly-cmdline -N \ - -f "$TESTDIR"/initramfs.server "$KVERSION" || return 1 - - # Make client's dracut image - $basedir/dracut.sh -l -i "$TESTDIR"/overlay / \ - --no-early-microcode \ - -o "plymouth" \ - -a "debug" \ - -d "ipvlan macvlan af_packet piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files sunrpc i6300esb ib700wdt" \ - --no-hostonly-cmdline -N \ - -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 -} - -kill_server() { - if [[ -s "$TESTDIR"/server.pid ]]; then - kill -TERM -- $(cat "$TESTDIR"/server.pid) - rm -f -- "$TESTDIR"/server.pid - fi -} - -test_cleanup() { - kill_server -} - -. "$testdir"/test-functions From 53e299e6f4d4e9741d9988f5c2323fd150918d50 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 26 Feb 2020 15:17:07 +0100 Subject: [PATCH 14/50] TEST-20-NFS/test.sh TEST-30-ISCSI/test.sh reduce debug output --- test/TEST-20-NFS/test.sh | 9 ++++++--- test/TEST-30-ISCSI/test.sh | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 69d96f7b..b9b31f27 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -4,7 +4,10 @@ TEST_DESCRIPTION="root filesystem on NFS" KVERSION=${KVERSION-$(uname -r)} # Uncomment this to debug failures -#DEBUGFAIL="rd.shell" +DEBUGFAIL="loglevel=1" +#DEBUGFAIL="rd.shell rd.break rd.debug loglevel=7 " +#DEBUGFAIL="rd.debug loglevel=7 " +#SERVER_DEBUG="rd.debug loglevel=7" #SERIAL="tcp:127.0.0.1:9999" run_server() { @@ -22,7 +25,7 @@ run_server() { ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -watchdog i6300esb -watchdog-action poweroff \ -no-reboot \ - -append "panic=1 systemd.crash_reboot rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ + -append "panic=1 quiet root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 sudo chmod 644 $TESTDIR/server.pid || return 1 @@ -65,7 +68,7 @@ client_test() { -net socket,connect=127.0.0.1:12320 \ -watchdog i6300esb -watchdog-action poweroff \ -no-reboot \ - -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \ + -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=10 quiet ro console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.testing if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nfs-OK $TESTDIR/client.img; then diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index c0239981..7b1a5348 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -26,7 +26,7 @@ run_server() { -net nic,macaddr=52:54:00:12:34:57,model=e1000 \ -net socket,listen=127.0.0.1:12330 \ -no-reboot \ - -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ + -append "panic=1 quiet root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 sudo chmod 644 $TESTDIR/server.pid || return 1 From 074ac625762a0560ad6a1867a21bdfd1fcc4c372 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 26 Feb 2020 17:05:11 +0100 Subject: [PATCH 15/50] TEST-04-FULL-SYSTEMD: report failure on rootfs creation --- test/TEST-04-FULL-SYSTEMD/create-root.sh | 1 + test/TEST-04-FULL-SYSTEMD/test.sh | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/TEST-04-FULL-SYSTEMD/create-root.sh b/test/TEST-04-FULL-SYSTEMD/create-root.sh index 0a662576..8a4bdaf9 100755 --- a/test/TEST-04-FULL-SYSTEMD/create-root.sh +++ b/test/TEST-04-FULL-SYSTEMD/create-root.sh @@ -1,5 +1,6 @@ #!/bin/sh # don't let udev and this script step on eachother's toes +set -x for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do > "/etc/udev/rules.d/$x" done diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index 337f0219..4ef6e672 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -256,8 +256,10 @@ EOF -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs || return 1 - + if ! grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs; then + echo "Could not create root filesystem" + return 1 + fi ( export initdir=$TESTDIR/overlay From 3c5036a62f7212cd7b8bd39da91f6d2c81391c6c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 26 Feb 2020 17:09:23 +0100 Subject: [PATCH 16/50] TEST-03-USR-MOUNT: more debugging --- test/TEST-03-USR-MOUNT/create-root.sh | 2 +- test/TEST-03-USR-MOUNT/test.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/TEST-03-USR-MOUNT/create-root.sh b/test/TEST-03-USR-MOUNT/create-root.sh index 66907e8b..62a26c6b 100755 --- a/test/TEST-03-USR-MOUNT/create-root.sh +++ b/test/TEST-03-USR-MOUNT/create-root.sh @@ -1,5 +1,6 @@ #!/bin/sh # don't let udev and this script step on eachother's toes +set -x for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do > "/etc/udev/rules.d/$x" done @@ -37,4 +38,3 @@ umount /root echo "dracut-root-block-created" >/dev/sda1 sync poweroff -f - diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh index 53c4a1dc..f3d05aeb 100755 --- a/test/TEST-03-USR-MOUNT/test.sh +++ b/test/TEST-03-USR-MOUNT/test.sh @@ -118,8 +118,10 @@ test_setup() { -m 512M -smp 2 -nographic -net none \ -append "root=/dev/dracut/root rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs || return 1 - + if ! grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs; then + echo "Could not create root filesystem" + return 1 + fi ( export initdir=$TESTDIR/overlay From eb8856a58c2f2231a7e80818e12b73af2f1d60ba Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 27 Feb 2020 13:38:02 +0100 Subject: [PATCH 17/50] TEST-40-NBD: run the working tests --- test/TEST-40-NBD/test.sh | 97 ++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 43 deletions(-) diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 922f4e5c..94e3826c 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -9,8 +9,17 @@ KVERSION=${KVERSION-$(uname -r)} #SERIAL="tcp:127.0.0.1:9999" test_check() { - echo "nbd is constantly broken. skipping" - return 1 + if ! type -p nbd-server 2>/dev/null; then + echo "Test needs nbd-server... Skipping" + return 1 + fi + + if ! modinfo -k $KVERSION nbd &>/dev/null; then + echo "Kernel module nbd does not exist" + return 1 + fi + + return 0 } run_server() { @@ -107,7 +116,6 @@ client_test() { } test_run() { - modinfo nbd &>/dev/null || { echo "Kernel does not support nbd"; exit 1; } if ! run_server; then echo "Failed to start server" 1>&2 return 1 @@ -137,59 +145,63 @@ client_run() { "root=nbd:192.168.50.1:raw:ext2:errors=panic bridge rd.luks=0" \ ext2 errors=panic || return 1 +# +# FIXME! These fail, but probably shouldn't +# + # There doesn't seem to be a good way to validate the NBD options, so # just check that we don't screw up the other options - - client_test "NBD root=nbd:IP:port:::NBD opts" 52:54:00:12:34:00 \ - "root=nbd:192.168.50.1:raw:::bs=2048 rd.luks=0" || return 1 - - client_test "NBD root=nbd:IP:port:fstype::NBD opts" 52:54:00:12:34:00 \ - "root=nbd:192.168.50.1:raw:ext2::bs=2048 rd.luks=0" ext2 || return 1 - - client_test "NBD root=nbd:IP:port:fstype:fsopts:NBD opts" \ - 52:54:00:12:34:00 \ - "root=nbd:192.168.50.1:raw:ext2:errors=panic:bs=2048 rd.luks=0" \ - ext2 errors=panic || return 1 +# +# client_test "NBD root=nbd:IP:port:::NBD opts" 52:54:00:12:34:00 \ +# "root=nbd:192.168.50.1:raw:::bs=2048 rd.luks=0" || return 1 +# +# client_test "NBD root=nbd:IP:port:fstype::NBD opts" 52:54:00:12:34:00 \ +# "root=nbd:192.168.50.1:raw:ext2::bs=2048 rd.luks=0" ext2 || return 1 +# +# client_test "NBD root=nbd:IP:port:fstype:fsopts:NBD opts" \ +# 52:54:00:12:34:00 \ +# "root=nbd:192.168.50.1:raw:ext2:errors=panic:bs=2048 rd.luks=0" \ +# ext2 errors=panic || return 1 # DHCP root-path parsing - client_test "NBD root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \ - "root=dhcp rd.luks=0" || return 1 +# client_test "NBD root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \ +# "root=dhcp rd.luks=0" || return 1 - client_test "NBD Bridge root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \ - "root=dhcp bridge rd.luks=0" || return 1 +# client_test "NBD Bridge root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \ +# "root=dhcp bridge rd.luks=0" || return 1 - client_test "NBD root=dhcp DHCP root-path nbd:srv:port:fstype" \ - 52:54:00:12:34:02 "root=dhcp rd.luks=0" ext2 || return 1 +# client_test "NBD root=dhcp DHCP root-path nbd:srv:port:fstype" \ +# 52:54:00:12:34:02 "root=dhcp rd.luks=0" ext2 || return 1 - client_test "NBD root=dhcp DHCP root-path nbd:srv:port::fsopts" \ - 52:54:00:12:34:03 "root=dhcp rd.luks=0" ext3 errors=panic || return 1 +# client_test "NBD root=dhcp DHCP root-path nbd:srv:port::fsopts" \ +# 52:54:00:12:34:03 "root=dhcp rd.luks=0" ext3 errors=panic || return 1 - client_test "NBD root=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \ - 52:54:00:12:34:04 "root=dhcp rd.luks=0" ext2 errors=panic || return 1 +# client_test "NBD root=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \ +# 52:54:00:12:34:04 "root=dhcp rd.luks=0" ext2 errors=panic || return 1 # netroot handling - client_test "NBD netroot=nbd:IP:port" 52:54:00:12:34:00 \ - "netroot=nbd:192.168.50.1:raw rd.luks=0" || return 1 - - client_test "NBD netroot=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \ - 52:54:00:12:34:04 "netroot=dhcp rd.luks=0" ext2 errors=panic || return 1 +# client_test "NBD netroot=nbd:IP:port" 52:54:00:12:34:00 \ +# "netroot=nbd:192.168.50.1:raw rd.luks=0" || return 1 +# +# client_test "NBD netroot=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \ +# 52:54:00:12:34:04 "netroot=dhcp rd.luks=0" ext2 errors=panic || return 1 # Encrypted root handling via LVM/LUKS over NBD - . $TESTDIR/luks.uuid - - client_test "NBD root=LABEL=dracut netroot=nbd:IP:port" \ - 52:54:00:12:34:00 \ - "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=nbd:192.168.50.1:encrypted" || return 1 +# . $TESTDIR/luks.uuid +# +# client_test "NBD root=LABEL=dracut netroot=nbd:IP:port" \ +# 52:54:00:12:34:00 \ +# "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=nbd:192.168.50.1:encrypted" || return 1 # XXX This should be ext2,errors=panic but that doesn't currently # XXX work when you have a real root= line in addition to netroot= # XXX How we should work here needs clarification - client_test "NBD root=LABEL=dracut netroot=dhcp (w/ fstype and opts)" \ - 52:54:00:12:34:05 \ - "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=dhcp" || return 1 +# client_test "NBD root=LABEL=dracut netroot=dhcp (w/ fstype and opts)" \ +# 52:54:00:12:34:05 \ +# "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=dhcp" || return 1 if [[ -s server.pid ]]; then sudo kill -TERM $(cat $TESTDIR/server.pid) @@ -200,7 +212,7 @@ client_run() { make_encrypted_root() { # Create the blank file to use as a root filesystem - dd if=/dev/null of=$TESTDIR/encrypted.ext2 bs=1M seek=40 + dd if=/dev/null of=$TESTDIR/encrypted.ext2 bs=1M seek=80 dd if=/dev/null of=$TESTDIR/flag.img bs=1M seek=1 kernel=$KVERSION @@ -273,7 +285,7 @@ make_encrypted_root() { } make_client_root() { - dd if=/dev/null of=$TESTDIR/nbd.ext2 bs=1M seek=60 + dd if=/dev/null of=$TESTDIR/nbd.ext2 bs=1M seek=120 mke2fs -F -j $TESTDIR/nbd.ext2 mkdir $TESTDIR/mnt sudo mount -o loop $TESTDIR/nbd.ext2 $TESTDIR/mnt @@ -315,7 +327,7 @@ make_client_root() { } make_server_root() { - dd if=/dev/null of=$TESTDIR/server.ext2 bs=1M seek=60 + dd if=/dev/null of=$TESTDIR/server.ext2 bs=1M seek=120 mke2fs -F $TESTDIR/server.ext2 mkdir $TESTDIR/mnt sudo mount -o loop $TESTDIR/server.ext2 $TESTDIR/mnt @@ -335,9 +347,11 @@ make_server_root() { [raw] exportname = /dev/sdb port = 2000 +bs = 4096 [encrypted] exportname = /dev/sdc port = 2001 +bs = 4096 EOF inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ dmesg mkdir cp ping grep \ @@ -370,9 +384,6 @@ EOF } test_setup() { - - modinfo nbd &>/dev/null || { echo "Kernel does not support nbd"; exit 1; } - make_encrypted_root || return 1 make_client_root || return 1 make_server_root || return 1 From b4de4f287f9ce62d866556917a64ce36efcf6d3d Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 27 Feb 2020 14:24:38 +0100 Subject: [PATCH 18/50] test: do btrfs filesystem sync in create-root.sh --- test/TEST-03-USR-MOUNT/create-root.sh | 3 +++ test/TEST-04-FULL-SYSTEMD/create-root.sh | 2 ++ 2 files changed, 5 insertions(+) diff --git a/test/TEST-03-USR-MOUNT/create-root.sh b/test/TEST-03-USR-MOUNT/create-root.sh index 62a26c6b..478d5ef4 100755 --- a/test/TEST-03-USR-MOUNT/create-root.sh +++ b/test/TEST-03-USR-MOUNT/create-root.sh @@ -33,8 +33,11 @@ umount /root/usr mount -t btrfs -o subvol=usr /dev/sdb2 /root/usr cp -a -t /root /source/* mkdir -p /root/run +btrfs filesystem sync /root/usr +btrfs filesystem sync /root umount /root/usr umount /root echo "dracut-root-block-created" >/dev/sda1 +udevadm settle sync poweroff -f diff --git a/test/TEST-04-FULL-SYSTEMD/create-root.sh b/test/TEST-04-FULL-SYSTEMD/create-root.sh index 8a4bdaf9..a9f5ac52 100755 --- a/test/TEST-04-FULL-SYSTEMD/create-root.sh +++ b/test/TEST-04-FULL-SYSTEMD/create-root.sh @@ -34,6 +34,8 @@ umount /root/usr mount -t btrfs -o subvol=usr /dev/sdb2 /root/usr cp -a -t /root /source/* mkdir -p /root/run +btrfs filesystem sync /root/usr +btrfs filesystem sync /root umount /root/usr umount /root echo "dracut-root-block-created" >/dev/sda1 From 4bd0ab61b2ee1b2e086199d61aa0a4dff31b158b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 27 Feb 2020 14:25:01 +0100 Subject: [PATCH 19/50] test: remove "sudo" calls in test scripts --- test/TEST-01-BASIC/test.sh | 4 ++-- test/TEST-02-SYSTEMD/test.sh | 4 ++-- test/TEST-03-USR-MOUNT/test.sh | 4 ++-- test/TEST-04-FULL-SYSTEMD/test.sh | 2 +- test/TEST-10-RAID/test.sh | 4 ++-- test/TEST-11-LVM/test.sh | 4 ++-- test/TEST-12-RAID-DEG/test.sh | 4 ++-- test/TEST-13-ENC-RAID-LVM/test.sh | 4 ++-- test/TEST-14-IMSM/test.sh | 4 ++-- test/TEST-15-BTRFSRAID/test.sh | 4 ++-- test/TEST-16-DMSQUASH/test.sh | 4 ++-- test/TEST-17-LVM-THIN/test.sh | 4 ++-- test/TEST-20-NFS/test.sh | 16 ++++++++-------- test/TEST-30-ISCSI/test.sh | 16 ++++++++-------- test/TEST-31-ISCSI-MULTI/test.sh | 16 ++++++++-------- test/TEST-40-NBD/test.sh | 24 ++++++++++++------------ test/TEST-50-MULTINIC/test.sh | 10 +++++----- test/run-qemu | 2 +- 18 files changed, 65 insertions(+), 65 deletions(-) diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index 06d8c53e..db25e5a4 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -53,7 +53,7 @@ test_setup() { inst ./test-init.sh /sbin/init find_binary plymouth >/dev/null && inst_multiple plymouth cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -94,7 +94,7 @@ test_setup() { inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -a "debug watchdog" \ -d "piix ide-gd_mod ata_piix ext3 sd_mod i6300esb ib700wdt" \ --no-hostonly-cmdline -N \ diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh index 52f302b9..6fcd52a1 100755 --- a/test/TEST-02-SYSTEMD/test.sh +++ b/test/TEST-02-SYSTEMD/test.sh @@ -50,7 +50,7 @@ test_setup() { inst ./test-init.sh /sbin/init find_binary plymouth >/dev/null && inst_multiple plymouth cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -92,7 +92,7 @@ test_setup() { inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -a "debug systemd" \ -o "network kernel-network-modules" \ -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh index f3d05aeb..dfe33148 100755 --- a/test/TEST-03-USR-MOUNT/test.sh +++ b/test/TEST-03-USR-MOUNT/test.sh @@ -81,7 +81,7 @@ test_setup() { inst ./test-init.sh /sbin/init find_binary plymouth >/dev/null && inst_multiple plymouth cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -131,7 +131,7 @@ test_setup() { inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -a "debug watchdog" \ -o "network kernel-network-modules" \ -d "piix ide-gd_mod ata_piix btrfs sd_mod i6300esb ib700wdt" \ diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index 4ef6e672..e6a2910c 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -273,7 +273,7 @@ EOF [ -e /etc/machine-id ] && EXTRA_MACHINE="/etc/machine-id" [ -e /etc/machine-info ] && EXTRA_MACHINE+=" /etc/machine-info" - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -a "debug systemd i18n qemu" \ ${EXTRA_MACHINE:+-I "$EXTRA_MACHINE"} \ -o "dash network plymouth lvm mdraid resume crypt caps dm terminfo usrmount kernel-network-modules rngd" \ diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh index 6ac6b17a..84fa58d1 100755 --- a/test/TEST-10-RAID/test.sh +++ b/test/TEST-10-RAID/test.sh @@ -51,7 +51,7 @@ test_setup() { inst_multiple -o /lib/systemd/systemd-shutdown find_binary plymouth >/dev/null && inst_multiple plymouth cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -97,7 +97,7 @@ test_setup() { inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh index a0b2eab2..98daf471 100755 --- a/test/TEST-11-LVM/test.sh +++ b/test/TEST-11-LVM/test.sh @@ -49,7 +49,7 @@ test_setup() { find_binary plymouth >/dev/null && inst_multiple plymouth cp -a /etc/ld.so.conf* $initdir/etc mkdir $initdir/run - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -84,7 +84,7 @@ test_setup() { inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh index 27274191..7f0188c3 100755 --- a/test/TEST-12-RAID-DEG/test.sh +++ b/test/TEST-12-RAID-DEG/test.sh @@ -89,7 +89,7 @@ test_setup() { inst ./test-init.sh /sbin/init find_binary plymouth >/dev/null && inst_multiple plymouth cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -140,7 +140,7 @@ test_setup() { echo -n test > $initdir/etc/key ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh index 757a3e95..9a9cb884 100755 --- a/test/TEST-13-ENC-RAID-LVM/test.sh +++ b/test/TEST-13-ENC-RAID-LVM/test.sh @@ -88,7 +88,7 @@ test_setup() { inst ./test-init.sh /sbin/init find_binary plymouth >/dev/null && inst_multiple plymouth cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -139,7 +139,7 @@ test_setup() { done > $initdir/etc/crypttab echo -n test > $initdir/etc/key ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh index ba79889f..03406c9b 100755 --- a/test/TEST-14-IMSM/test.sh +++ b/test/TEST-14-IMSM/test.sh @@ -83,7 +83,7 @@ test_setup() { find_binary plymouth >/dev/null && inst_multiple plymouth cp -a /etc/ld.so.conf* $initdir/etc mkdir $initdir/run - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -129,7 +129,7 @@ test_setup() { inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh index b0d8c002..8c154143 100755 --- a/test/TEST-15-BTRFSRAID/test.sh +++ b/test/TEST-15-BTRFSRAID/test.sh @@ -53,7 +53,7 @@ test_setup() { inst_simple /etc/os-release find_binary plymouth >/dev/null && inst_multiple plymouth cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -95,7 +95,7 @@ test_setup() { inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix btrfs sd_mod" \ diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh index 5f11aaef..0af7a8a3 100755 --- a/test/TEST-16-DMSQUASH/test.sh +++ b/test/TEST-16-DMSQUASH/test.sh @@ -54,7 +54,7 @@ test_setup() { dd if=/dev/zero of="$TESTDIR"/root.img count=100 - sudo $basedir/dracut.sh -l -i "$TESTDIR"/overlay / \ + $basedir/dracut.sh -l -i "$TESTDIR"/overlay / \ -a "debug dmsquash-live qemu" \ -o "rngd" \ -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ @@ -104,7 +104,7 @@ test_setup() { inst "$VMLINUZ" "/boot/vmlinuz-${KVERSION}" find_binary plymouth >/dev/null && inst_multiple plymouth cp -a -- /etc/ld.so.conf* "$initdir"/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) python create.py -d -c livecd-fedora-minimal.ks return 0 diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh index 40d6c264..07796147 100755 --- a/test/TEST-17-LVM-THIN/test.sh +++ b/test/TEST-17-LVM-THIN/test.sh @@ -49,7 +49,7 @@ test_setup() { find_binary plymouth >/dev/null && inst_multiple plymouth cp -a /etc/ld.so.conf* $initdir/etc mkdir $initdir/run - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -84,7 +84,7 @@ test_setup() { inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" -I lvs \ -d "piix ide-gd_mod ata_piix ext2 sd_mod" \ diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index b9b31f27..3308e652 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -28,7 +28,7 @@ run_server() { -append "panic=1 quiet root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 - sudo chmod 644 $TESTDIR/server.pid || return 1 + chmod 644 $TESTDIR/server.pid || return 1 # Cleanup the terminal if we have one tty -s && stty sane @@ -197,7 +197,7 @@ test_nfsv4() { test_run() { if [[ -s server.pid ]]; then - sudo kill -TERM $(cat $TESTDIR/server.pid) + kill -TERM $(cat $TESTDIR/server.pid) rm -f -- $TESTDIR/server.pid fi @@ -212,7 +212,7 @@ test_run() { ret=$? if [[ -s $TESTDIR/server.pid ]]; then - sudo kill -TERM $(cat $TESTDIR/server.pid) + kill -TERM $(cat $TESTDIR/server.pid) rm -f -- $TESTDIR/server.pid fi @@ -224,7 +224,7 @@ test_setup() { dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=120 mke2fs -j -F $TESTDIR/server.ext3 mkdir $TESTDIR/mnt - sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt + mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt export kernel=$KVERSION @@ -291,7 +291,7 @@ test_setup() { inst /etc/group /etc/group cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" dracut_kernel_post ) @@ -334,14 +334,14 @@ test_setup() { inst_libdir_file -n "$_nsslibs" 'libnss_*.so*' cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) mkdir -p $TESTDIR/mnt/nfs/nfs3-5 mkdir -p $TESTDIR/mnt/nfs/ip/192.168.50.101 mkdir -p $TESTDIR/mnt/nfs/tftpboot/nfs4-5 - sudo umount $TESTDIR/mnt + umount $TESTDIR/mnt rm -fr -- $TESTDIR/mnt # Make an overlay with needed tools for the test harness @@ -374,7 +374,7 @@ test_setup() { test_cleanup() { if [[ -s $TESTDIR/server.pid ]]; then - sudo kill -TERM $(cat $TESTDIR/server.pid) + kill -TERM $(cat $TESTDIR/server.pid) rm -f -- $TESTDIR/server.pid fi } diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index 7b1a5348..3d9d9004 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -29,7 +29,7 @@ run_server() { -append "panic=1 quiet root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 - sudo chmod 644 $TESTDIR/server.pid || return 1 + chmod 644 $TESTDIR/server.pid || return 1 # Cleanup the terminal if we have one tty -s && stty sane @@ -112,7 +112,7 @@ test_run() { do_test_run ret=$? if [[ -s $TESTDIR/server.pid ]]; then - sudo kill -TERM $(cat $TESTDIR/server.pid) + kill -TERM $(cat $TESTDIR/server.pid) rm -f -- $TESTDIR/server.pid fi return $ret @@ -152,7 +152,7 @@ test_setup() { inst_simple /etc/os-release inst ./client-init.sh /sbin/init cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -200,7 +200,7 @@ test_setup() { inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -o "dash plymouth dmraid nfs" \ -a "debug" \ -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \ @@ -211,7 +211,7 @@ test_setup() { dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=60 mkfs.ext3 -j -F $TESTDIR/server.ext3 mkdir $TESTDIR/mnt - sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt + mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt kernel=$KVERSION ( @@ -243,11 +243,11 @@ test_setup() { inst /etc/group /etc/group cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" dracut_kernel_post ) - sudo umount $TESTDIR/mnt + umount $TESTDIR/mnt rm -fr -- $TESTDIR/mnt # Make server's dracut image @@ -261,7 +261,7 @@ test_setup() { test_cleanup() { if [[ -s $TESTDIR/server.pid ]]; then - sudo kill -TERM $(cat $TESTDIR/server.pid) + kill -TERM $(cat $TESTDIR/server.pid) rm -f -- $TESTDIR/server.pid fi } diff --git a/test/TEST-31-ISCSI-MULTI/test.sh b/test/TEST-31-ISCSI-MULTI/test.sh index 2fdc38e2..a0b7ccc4 100755 --- a/test/TEST-31-ISCSI-MULTI/test.sh +++ b/test/TEST-31-ISCSI-MULTI/test.sh @@ -29,7 +29,7 @@ run_server() { -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 - sudo chmod 644 $TESTDIR/server.pid || return 1 + chmod 644 $TESTDIR/server.pid || return 1 # Cleanup the terminal if we have one tty -s && stty sane @@ -126,7 +126,7 @@ test_run() { do_test_run ret=$? if [[ -s $TESTDIR/server.pid ]]; then - sudo kill -TERM $(cat $TESTDIR/server.pid) + kill -TERM $(cat $TESTDIR/server.pid) rm -f -- $TESTDIR/server.pid fi return $ret @@ -166,7 +166,7 @@ test_setup() { inst_simple /etc/os-release inst ./client-init.sh /sbin/init cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -214,7 +214,7 @@ test_setup() { inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -o "dash plymouth dmraid nfs" \ -a "debug" \ -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \ @@ -225,7 +225,7 @@ test_setup() { dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=60 mkfs.ext3 -j -F $TESTDIR/server.ext3 mkdir $TESTDIR/mnt - sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt + mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt kernel=$KVERSION ( @@ -257,11 +257,11 @@ test_setup() { inst /etc/group /etc/group cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" dracut_kernel_post ) - sudo umount $TESTDIR/mnt + umount $TESTDIR/mnt rm -fr -- $TESTDIR/mnt # Make server's dracut image @@ -275,7 +275,7 @@ test_setup() { test_cleanup() { if [[ -s $TESTDIR/server.pid ]]; then - sudo kill -TERM $(cat $TESTDIR/server.pid) + kill -TERM $(cat $TESTDIR/server.pid) rm -f -- $TESTDIR/server.pid fi } diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 94e3826c..5b354b26 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -39,7 +39,7 @@ run_server() { -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1 - sudo chmod 644 $TESTDIR/server.pid || return 1 + chmod 644 $TESTDIR/server.pid || return 1 # Cleanup the terminal if we have one tty -s && stty sane @@ -204,7 +204,7 @@ client_run() { # "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=dhcp" || return 1 if [[ -s server.pid ]]; then - sudo kill -TERM $(cat $TESTDIR/server.pid) + kill -TERM $(cat $TESTDIR/server.pid) rm -f -- $TESTDIR/server.pid fi @@ -239,7 +239,7 @@ make_encrypted_root() { inst_simple /etc/os-release find_binary plymouth >/dev/null && inst_multiple plymouth cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) # second, install the files needed to make the root filesystem @@ -288,7 +288,7 @@ make_client_root() { dd if=/dev/null of=$TESTDIR/nbd.ext2 bs=1M seek=120 mke2fs -F -j $TESTDIR/nbd.ext2 mkdir $TESTDIR/mnt - sudo mount -o loop $TESTDIR/nbd.ext2 $TESTDIR/mnt + mount -o loop $TESTDIR/nbd.ext2 $TESTDIR/mnt kernel=$KVERSION ( @@ -319,10 +319,10 @@ make_client_root() { inst $i done cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) - sudo umount $TESTDIR/mnt + umount $TESTDIR/mnt rm -fr -- $TESTDIR/mnt } @@ -330,7 +330,7 @@ make_server_root() { dd if=/dev/null of=$TESTDIR/server.ext2 bs=1M seek=120 mke2fs -F $TESTDIR/server.ext2 mkdir $TESTDIR/mnt - sudo mount -o loop $TESTDIR/server.ext2 $TESTDIR/mnt + mount -o loop $TESTDIR/server.ext2 $TESTDIR/mnt kernel=$KVERSION ( @@ -376,10 +376,10 @@ EOF done cp -a /etc/ld.so.conf* $initdir/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) - sudo umount $TESTDIR/mnt + umount $TESTDIR/mnt rm -fr -- $TESTDIR/mnt } @@ -407,13 +407,13 @@ test_setup() { echo -n test > $initdir/etc/key ) - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -m "dash udev-rules rootfs-block fs-lib base debug kernel-modules" \ -d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000" \ --no-hostonly-cmdline -N \ -f $TESTDIR/initramfs.server $KVERSION || return 1 - sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ -o "plymouth" \ -a "debug watchdog" \ -d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000 i6300esb ib700wdt" \ @@ -423,7 +423,7 @@ test_setup() { kill_server() { if [[ -s $TESTDIR/server.pid ]]; then - sudo kill -TERM $(cat $TESTDIR/server.pid) + kill -TERM $(cat $TESTDIR/server.pid) rm -f -- $TESTDIR/server.pid fi } diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index dfddfbd7..0720c4f2 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -27,7 +27,7 @@ run_server() { -initrd "$TESTDIR"/initramfs.server \ -pidfile "$TESTDIR"/server.pid -daemonize || return 1 - sudo chmod 644 -- "$TESTDIR"/server.pid || return 1 + chmod 644 -- "$TESTDIR"/server.pid || return 1 # Cleanup the terminal if we have one tty -s && stty sane @@ -170,7 +170,7 @@ test_setup() { dd if=/dev/null of="$TESTDIR"/server.ext3 bs=1M seek=120 mke2fs -j -F -- "$TESTDIR"/server.ext3 mkdir -- "$TESTDIR"/mnt - sudo mount -o loop -- "$TESTDIR"/server.ext3 "$TESTDIR"/mnt + mount -o loop -- "$TESTDIR"/server.ext3 "$TESTDIR"/mnt kernel=$KVERSION ( export initdir="$TESTDIR"/mnt @@ -275,10 +275,10 @@ test_setup() { inst_libdir_file -n "$_nsslibs" 'libnss_*.so*' cp -a -- /etc/ld.so.conf* "$initdir"/etc - sudo ldconfig -r "$initdir" + ldconfig -r "$initdir" ) - sudo umount "$TESTDIR"/mnt + umount "$TESTDIR"/mnt rm -fr -- "$TESTDIR"/mnt # Make an overlay with needed tools for the test harness @@ -312,7 +312,7 @@ test_setup() { kill_server() { if [[ -s "$TESTDIR"/server.pid ]]; then - sudo kill -TERM -- $(cat "$TESTDIR"/server.pid) + kill -TERM -- $(cat "$TESTDIR"/server.pid) rm -f -- "$TESTDIR"/server.pid fi } diff --git a/test/run-qemu b/test/run-qemu index 5d370fa8..ddf31490 100755 --- a/test/run-qemu +++ b/test/run-qemu @@ -34,4 +34,4 @@ if ! [ -f "$VMLINUZ" ]; then fi fi -exec sudo $BIN $ARGS -kernel $VMLINUZ "$@" +exec $BIN $ARGS -kernel $VMLINUZ "$@" From 63b67a48f95361ee570c85a8a7e4637cf44d6660 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 27 Feb 2020 15:24:29 +0100 Subject: [PATCH 20/50] nbd/parse-nbdroot.sh: don't create mount unit let the generator do its thing --- modules.d/95nbd/parse-nbdroot.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules.d/95nbd/parse-nbdroot.sh b/modules.d/95nbd/parse-nbdroot.sh index 902e9a98..d9e4bc67 100755 --- a/modules.d/95nbd/parse-nbdroot.sh +++ b/modules.d/95nbd/parse-nbdroot.sh @@ -46,10 +46,10 @@ fi [ "${netroot%%:*}" = "nbd" ] || return -if [ -n "${DRACUT_SYSTEMD}" ] && [ "$root" = "dhcp" ]; then - echo "root=$netroot" > /etc/cmdline.d/root.conf - systemctl --no-block daemon-reload -fi +#if [ -n "${DRACUT_SYSTEMD}" ] && [ "$root" = "dhcp" ]; then +# echo "root=$netroot" > /etc/cmdline.d/root.conf +# systemctl --no-block daemon-reload +#fi # Check required arguments netroot_to_var $netroot From 0d33ba030bbb0140e9e7484f96f1847d6af1180f Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 27 Feb 2020 15:26:44 +0100 Subject: [PATCH 21/50] test/TEST-40-NBD/test.sh: bail out early if mount fails --- test/TEST-40-NBD/test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 5b354b26..37644c99 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -288,7 +288,10 @@ make_client_root() { dd if=/dev/null of=$TESTDIR/nbd.ext2 bs=1M seek=120 mke2fs -F -j $TESTDIR/nbd.ext2 mkdir $TESTDIR/mnt - mount -o loop $TESTDIR/nbd.ext2 $TESTDIR/mnt + if ! mount -o loop $TESTDIR/nbd.ext2 $TESTDIR/mnt; then + echo "Cannot mount loop" + return 1 + fi kernel=$KVERSION ( From 58ee6dc7f91735c19b921a0c1b95fd37ae56cc50 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 27 Feb 2020 15:51:12 +0100 Subject: [PATCH 22/50] .travis.yml: fix docker pull --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1c46062c..977be3c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ env: - IMAGE=latest TESTS=17 before_script: - - docker pull fedora:$IMAGE + - docker pull quay.io/haraldh/dracut-fedora:$IMAGE - | sudo modprobe kvm-intel nested=1 || : sudo modprobe kvm-amd nested=1 || : From 2d75433cd7a6d301b8617b6bcff3484e43306448 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 27 Feb 2020 16:17:23 +0100 Subject: [PATCH 23/50] test/test-functions: colorize startup --- test/test-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-functions b/test/test-functions index 3395ee8f..ae096c21 100644 --- a/test/test-functions +++ b/test/test-functions @@ -58,7 +58,7 @@ while (($# > 0)); do echo -e "TEST: $TEST_DESCRIPTION " $COLOR_WARNING "[SKIPPED]" $COLOR_NORMAL exit 0; else - echo "TEST: $TEST_DESCRIPTION [STARTED]"; + echo -e "TEST: $TEST_DESCRIPTION " $COLOR_SUCCESS "[STARTED]" $COLOR_NORMAL; fi if [[ "$V" == "1" ]]; then set -o pipefail From ba66cb2789d8379de129ad1e84dcabff871e6ceb Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 27 Feb 2020 16:42:21 +0100 Subject: [PATCH 24/50] TEST-04-FULL-SYSTEMD: more info on failure --- test/TEST-04-FULL-SYSTEMD/test-init.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/TEST-04-FULL-SYSTEMD/test-init.sh b/test/TEST-04-FULL-SYSTEMD/test-init.sh index 3b29beec..e40f5e6f 100755 --- a/test/TEST-04-FULL-SYSTEMD/test-init.sh +++ b/test/TEST-04-FULL-SYSTEMD/test-init.sh @@ -114,6 +114,13 @@ if ismounted /usr && [ ! -s /failed ]; then echo "dracut-root-block-success" >/dev/sdc fi +if ! ismounted /usr; then + echo "**************************FAILED**************************" + echo "/usr not mounted!!" + cat /proc/mounts + echo "**************************FAILED**************************" +fi + journalctl --full --no-pager -o short-monotonic if [ -s /failed ]; then From 7c51256eb21e3456eb9c017d9b53280ff9a302ce Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 27 Feb 2020 16:44:28 +0100 Subject: [PATCH 25/50] TEST-40-NBD: disable again NBD is still too flaky and hangs hard sometimes --- test/TEST-40-NBD/test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 37644c99..45f76c92 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -9,6 +9,9 @@ KVERSION=${KVERSION-$(uname -r)} #SERIAL="tcp:127.0.0.1:9999" test_check() { + # NBD is still too flaky and hangs hard sometimes + return 1 + if ! type -p nbd-server 2>/dev/null; then echo "Test needs nbd-server... Skipping" return 1 From 77537bf2d7ff7b37b1013a2b2eb1ef8cd6a247d7 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 28 Feb 2020 08:39:31 +0100 Subject: [PATCH 26/50] test: run-qemu refactor common qemu parameters --- test/TEST-01-BASIC/test.sh | 4 ---- test/TEST-02-SYSTEMD/test.sh | 4 ---- test/TEST-03-USR-MOUNT/test.sh | 4 ---- test/TEST-04-FULL-SYSTEMD/test.sh | 4 ---- test/TEST-10-RAID/test.sh | 4 ---- test/TEST-11-LVM/test.sh | 5 +---- test/TEST-12-RAID-DEG/test.sh | 5 +---- test/TEST-13-ENC-RAID-LVM/test.sh | 11 +---------- test/TEST-14-IMSM/test.sh | 4 ---- test/TEST-15-BTRFSRAID/test.sh | 4 ---- test/TEST-16-DMSQUASH/test.sh | 4 ---- test/TEST-17-LVM-THIN/test.sh | 5 +---- test/TEST-20-NFS/test.sh | 5 ----- test/TEST-30-ISCSI/test.sh | 6 ------ test/TEST-31-ISCSI-MULTI/test.sh | 6 ------ test/TEST-40-NBD/test.sh | 8 -------- test/TEST-50-MULTINIC/test.sh | 6 +----- test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh | 9 ++------- test/run-qemu | 8 ++++---- 19 files changed, 11 insertions(+), 95 deletions(-) diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index db25e5a4..37f77c36 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -11,10 +11,7 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/result \ - -m 512M -smp 2 -nographic \ - -net none \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing || return 1 grep -F -m 1 -q dracut-root-block-success $TESTDIR/result || return 1 @@ -80,7 +77,6 @@ test_setup() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/dracut/root rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1 diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh index 6fcd52a1..a08bfe5c 100755 --- a/test/TEST-02-SYSTEMD/test.sh +++ b/test/TEST-02-SYSTEMD/test.sh @@ -8,9 +8,6 @@ KVERSION="${KVERSION-$(uname -r)}" test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1 @@ -77,7 +74,6 @@ test_setup() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1 diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh index dfe33148..5943c5c6 100755 --- a/test/TEST-03-USR-MOUNT/test.sh +++ b/test/TEST-03-USR-MOUNT/test.sh @@ -18,10 +18,7 @@ client_run() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ - -m 512M -smp 2 -nographic \ - -net none \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing @@ -115,7 +112,6 @@ test_setup() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/dracut/root rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 if ! grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs; then diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index e6a2910c..4114070a 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -20,9 +20,6 @@ client_run() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing @@ -253,7 +250,6 @@ EOF $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 if ! grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs; then diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh index 84fa58d1..fd92606b 100755 --- a/test/TEST-10-RAID/test.sh +++ b/test/TEST-10-RAID/test.sh @@ -10,9 +10,6 @@ test_run() { DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 @@ -77,7 +74,6 @@ test_setup() { # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/cannotreach rw rootfstype=ext2 console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $DISKIMAGE || return 1 diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh index 98daf471..95463e4b 100755 --- a/test/TEST-11-LVM/test.sh +++ b/test/TEST-11-LVM/test.sh @@ -9,9 +9,6 @@ KVERSION=${KVERSION-$(uname -r)} test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 @@ -72,7 +69,7 @@ test_setup() { -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. - $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh index 7f0188c3..d6b29dde 100755 --- a/test/TEST-12-RAID-DEG/test.sh +++ b/test/TEST-12-RAID-DEG/test.sh @@ -15,11 +15,9 @@ client_run() { cp --sparse=always --reflink=auto $TESTDIR/disk3.img $TESTDIR/disk3.img.new $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -nographic -smp 2 \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img.new \ -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img.new \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot $* systemd.log_target=kmsg loglevel=7 root=LABEL=root rw rd.retry=20 rd.info console=ttyS0,115200n81 log_buf_len=2M selinux=0 rd.debug rd.shell=0 $DEBUGFAIL " \ -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then @@ -117,7 +115,6 @@ test_setup() { -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh index 9a9cb884..1f311be5 100755 --- a/test/TEST-13-ENC-RAID-LVM/test.sh +++ b/test/TEST-13-ENC-RAID-LVM/test.sh @@ -17,9 +17,6 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ - -m 1024M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 @@ -31,9 +28,6 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ - -m 1024M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 @@ -45,9 +39,6 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ - -m 1024M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL rd.luks.uuid=failme" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img && return 1 @@ -111,7 +102,7 @@ test_setup() { -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. - $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh index 03406c9b..75ea587f 100755 --- a/test/TEST-14-IMSM/test.sh +++ b/test/TEST-14-IMSM/test.sh @@ -13,9 +13,6 @@ client_run() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot $* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then @@ -109,7 +106,6 @@ test_setup() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ - -m 512M -nographic -net none \ -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh index 8c154143..873b779a 100755 --- a/test/TEST-15-BTRFSRAID/test.sh +++ b/test/TEST-15-BTRFSRAID/test.sh @@ -12,9 +12,6 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$MARKER_DISKIMAGE \ -drive format=raw,index=1,media=disk,file=$DISKIMAGE \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $MARKER_DISKIMAGE || return 1 @@ -81,7 +78,6 @@ test_setup() { # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh index 0af7a8a3..37a963e2 100755 --- a/test/TEST-16-DMSQUASH/test.sh +++ b/test/TEST-16-DMSQUASH/test.sh @@ -22,10 +22,6 @@ test_run() { -boot order=d \ -drive format=raw,bps=1000000,index=0,media=disk,file="$TESTDIR"/livecd.iso \ -drive format=raw,index=1,media=disk,file="$TESTDIR"/root.img \ - -m 512M -smp 2 \ - -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ -initrd "$TESTDIR"/initramfs.testing diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh index 07796147..fb7b817c 100755 --- a/test/TEST-17-LVM-THIN/test.sh +++ b/test/TEST-17-LVM-THIN/test.sh @@ -9,9 +9,6 @@ KVERSION=${KVERSION-$(uname -r)} test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 @@ -72,7 +69,7 @@ test_setup() { -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. - $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 3308e652..66926103 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -17,14 +17,11 @@ run_server() { fsck -a $TESTDIR/server.ext3 || return 1 $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/server.ext3 \ - -m 512M -smp 2 \ - -display none \ -net socket,listen=127.0.0.1:12320 \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 quiet root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 @@ -63,11 +60,9 @@ client_test() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/client.img \ - -m 512M -smp 2 -nographic \ -net nic,macaddr=$mac,model=e1000 \ -net socket,connect=127.0.0.1:12320 \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=10 quiet ro console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.testing diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index 3d9d9004..400d5c80 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -18,14 +18,11 @@ run_server() { -drive format=raw,index=1,media=disk,file=$TESTDIR/root.ext3 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ - -m 512M -smp 2 \ - -display none \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net nic,macaddr=52:54:00:12:34:57,model=e1000 \ -net socket,listen=127.0.0.1:12330 \ - -no-reboot \ -append "panic=1 quiet root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 @@ -55,11 +52,9 @@ run_client() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/client.img \ - -m 512M -smp 2 -nographic \ -net nic,macaddr=52:54:00:12:34:00,model=e1000 \ -net nic,macaddr=52:54:00:12:34:01,model=e1000 \ -net socket,connect=127.0.0.1:12330 \ - -no-reboot \ -acpitable file=ibft.table \ -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ -initrd $TESTDIR/initramfs.testing @@ -187,7 +182,6 @@ test_setup() { -drive format=raw,index=1,media=disk,file=$TESTDIR/client.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ - -smp 2 -m 512M -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1 diff --git a/test/TEST-31-ISCSI-MULTI/test.sh b/test/TEST-31-ISCSI-MULTI/test.sh index a0b7ccc4..4e1eba97 100755 --- a/test/TEST-31-ISCSI-MULTI/test.sh +++ b/test/TEST-31-ISCSI-MULTI/test.sh @@ -18,14 +18,11 @@ run_server() { -drive format=raw,index=1,media=disk,file=$TESTDIR/root.ext3 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ - -m 512M -smp 2 \ - -display none \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net nic,macaddr=52:54:00:12:34:57,model=e1000 \ -net socket,listen=127.0.0.1:12331 \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 @@ -54,11 +51,9 @@ run_client() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/client.img \ - -m 512M -smp 2 -nographic \ -net nic,macaddr=52:54:00:12:34:00,model=e1000 \ -net nic,macaddr=52:54:00:12:34:01,model=e1000 \ -net socket,connect=127.0.0.1:12331 \ - -no-reboot \ -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then @@ -201,7 +196,6 @@ test_setup() { -drive format=raw,index=1,media=disk,file=$TESTDIR/client.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ - -smp 2 -m 512M -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1 diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 45f76c92..75820cbb 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -33,13 +33,10 @@ run_server() { -drive format=raw,index=0,media=disk,file=$TESTDIR/server.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/nbd.ext2 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/encrypted.ext2 \ - -m 512M -smp 2 \ - -display none \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net socket,listen=127.0.0.1:12340 \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1 chmod 644 $TESTDIR/server.pid || return 1 @@ -80,11 +77,8 @@ client_test() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/flag.img \ - -m 512M -smp 2 \ - -nographic \ -net nic,macaddr=$mac,model=e1000 \ -net socket,connect=127.0.0.1:12340 \ - -no-reboot \ -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \ -initrd $TESTDIR/initramfs.testing @@ -279,8 +273,6 @@ make_encrypted_root() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/flag.img \ -drive format=raw,index=1,media=disk,file=$TESTDIR/encrypted.ext2 \ - -m 512M -smp 2\ - -nographic -net none \ -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/flag.img || return 1 diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index 0720c4f2..26e30561 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -15,14 +15,11 @@ run_server() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file="$TESTDIR"/server.ext3 \ - -m 512M -smp 2 \ - -display none \ -net socket,listen=127.0.0.1:12350 \ -net nic,macaddr=52:54:01:12:34:56,model=e1000 \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 systemd.crash_reboot loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ -initrd "$TESTDIR"/initramfs.server \ -pidfile "$TESTDIR"/server.pid -daemonize || return 1 @@ -60,7 +57,7 @@ client_test() { return 1 fi - $testdir/run-qemu -drive format=raw,index=0,media=disk,file="$TESTDIR"/client.img -m 512M -smp 2 -nographic \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file="$TESTDIR"/client.img \ -net socket,connect=127.0.0.1:12350 \ -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \ -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \ @@ -70,7 +67,6 @@ client_test() { -device e1000,netdev=n1,mac=52:54:00:12:34:98 \ -device e1000,netdev=n2,mac=52:54:00:12:34:99 \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ -initrd "$TESTDIR"/initramfs.testing diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh index 2afeb15d..0b6b7b48 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh @@ -17,8 +17,6 @@ run_server() { $testdir/run-qemu \ -hda "$TESTDIR"/server.ext3 \ - -m 512M -smp 2 \ - -display none \ -netdev socket,id=n0,listen=127.0.0.1:12370 \ -netdev socket,id=n1,listen=127.0.0.1:12371 \ -netdev socket,id=n2,listen=127.0.0.1:12372 \ @@ -30,7 +28,6 @@ run_server() { ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 rd.debug" \ -initrd "$TESTDIR"/initramfs.server \ -pidfile "$TESTDIR"/server.pid -daemonize || return 1 @@ -77,7 +74,7 @@ client_test() { if $testdir/run-qemu --help | grep -qF -m1 'netdev hubport,id=str,hubid=n[,netdev=nd]' && echo OK; then $testdir/run-qemu \ - -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ + -hda "$TESTDIR"/client.img \ -netdev socket,connect=127.0.0.1:12370,id=s1 \ -netdev hubport,hubid=1,id=h1,netdev=s1 \ -netdev hubport,hubid=1,id=h2 -device e1000,mac=52:54:00:12:34:01,netdev=h2 \ @@ -86,12 +83,11 @@ client_test() { -netdev socket,connect=127.0.0.1:12372,id=n2 -device e1000,mac=52:54:00:12:34:04,netdev=n2 \ $nic3 -device e1000,mac=52:54:00:12:34:05,netdev=n3 \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 $cmdline systemd.crash_reboot rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ -initrd "$TESTDIR"/initramfs.testing else $testdir/run-qemu \ - -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ + -hda "$TESTDIR"/client.img \ -net socket,vlan=0,connect=127.0.0.1:12370 \ ${do_vlan13:+-net socket,vlan=1,connect=127.0.0.1:12371} \ -net socket,vlan=2,connect=127.0.0.1:12372 \ @@ -102,7 +98,6 @@ client_test() { -net nic,vlan=2,macaddr=52:54:00:12:34:04,model=e1000 \ -net nic,vlan=3,macaddr=52:54:00:12:34:05,model=e1000 \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 $cmdline systemd.crash_reboot rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ -initrd "$TESTDIR"/initramfs.testing fi diff --git a/test/run-qemu b/test/run-qemu index ddf31490..4859bab8 100755 --- a/test/run-qemu +++ b/test/run-qemu @@ -3,12 +3,12 @@ # We prefer kvm, kqemu, userspace in that order. export PATH=/sbin:/bin:/usr/sbin:/usr/bin -[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS="" +[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS="-cpu max" $(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu -cpu host" [[ -c /dev/kvm && -x /usr/bin/kvm ]] && BIN=/usr/bin/kvm && ARGS="-cpu host" [[ -c /dev/kvm && -x /usr/bin/qemu-kvm ]] && BIN=/usr/bin/qemu-kvm && ARGS="-cpu host" [[ -c /dev/kvm && -x /usr/libexec/qemu-kvm ]] && BIN=/usr/libexec/qemu-kvm && ARGS="-cpu host" -[[ -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS="" +[[ -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS="-cpu max" [[ -c /dev/kvm && -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS="-enable-kvm -cpu host" [[ $BIN ]] || { @@ -17,8 +17,8 @@ $(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu -cpu ho exit 1 } -# Provide rng device sourcing the hosts /dev/urandom -ARGS="$ARGS -device virtio-rng-pci" +# Provide rng device sourcing the hosts /dev/urandom and other standard parameters +ARGS="$ARGS -smp 2 -m 512 -nodefaults -vga none -display none -no-reboot -device virtio-rng-pci" KVERSION=${KVERSION-$(uname -r)} From c6c588d64866579267600f73c5de5b15d44ea807 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 28 Feb 2020 08:47:52 +0100 Subject: [PATCH 27/50] test/run-qemu: add "-serial stdio" --- test/run-qemu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run-qemu b/test/run-qemu index 4859bab8..38ed2d51 100755 --- a/test/run-qemu +++ b/test/run-qemu @@ -18,7 +18,7 @@ $(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu -cpu ho } # Provide rng device sourcing the hosts /dev/urandom and other standard parameters -ARGS="$ARGS -smp 2 -m 512 -nodefaults -vga none -display none -no-reboot -device virtio-rng-pci" +ARGS="$ARGS -smp 2 -m 512 -nodefaults -vga none -display none -no-reboot -device virtio-rng-pci -serial stdio" KVERSION=${KVERSION-$(uname -r)} From 73743914343d1ca3efca83c59f86551ac58a415c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 28 Feb 2020 08:51:31 +0100 Subject: [PATCH 28/50] Revert "test/run-qemu: add "-serial stdio"" This reverts commit c6c588d64866579267600f73c5de5b15d44ea807. --- test/run-qemu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run-qemu b/test/run-qemu index 38ed2d51..4859bab8 100755 --- a/test/run-qemu +++ b/test/run-qemu @@ -18,7 +18,7 @@ $(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu -cpu ho } # Provide rng device sourcing the hosts /dev/urandom and other standard parameters -ARGS="$ARGS -smp 2 -m 512 -nodefaults -vga none -display none -no-reboot -device virtio-rng-pci -serial stdio" +ARGS="$ARGS -smp 2 -m 512 -nodefaults -vga none -display none -no-reboot -device virtio-rng-pci" KVERSION=${KVERSION-$(uname -r)} From 4b60a3471598d9ad2eef179f2a5b8ac55b7e6d22 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 28 Feb 2020 08:51:36 +0100 Subject: [PATCH 29/50] Revert "test: run-qemu refactor common qemu parameters" This reverts commit 77537bf2d7ff7b37b1013a2b2eb1ef8cd6a247d7. Sorry, for the noise! --- test/TEST-01-BASIC/test.sh | 4 ++++ test/TEST-02-SYSTEMD/test.sh | 4 ++++ test/TEST-03-USR-MOUNT/test.sh | 4 ++++ test/TEST-04-FULL-SYSTEMD/test.sh | 4 ++++ test/TEST-10-RAID/test.sh | 4 ++++ test/TEST-11-LVM/test.sh | 5 ++++- test/TEST-12-RAID-DEG/test.sh | 5 ++++- test/TEST-13-ENC-RAID-LVM/test.sh | 11 ++++++++++- test/TEST-14-IMSM/test.sh | 4 ++++ test/TEST-15-BTRFSRAID/test.sh | 4 ++++ test/TEST-16-DMSQUASH/test.sh | 4 ++++ test/TEST-17-LVM-THIN/test.sh | 5 ++++- test/TEST-20-NFS/test.sh | 5 +++++ test/TEST-30-ISCSI/test.sh | 6 ++++++ test/TEST-31-ISCSI-MULTI/test.sh | 6 ++++++ test/TEST-40-NBD/test.sh | 8 ++++++++ test/TEST-50-MULTINIC/test.sh | 6 +++++- test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh | 9 +++++++-- test/run-qemu | 8 ++++---- 19 files changed, 95 insertions(+), 11 deletions(-) diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index 37f77c36..db25e5a4 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -11,7 +11,10 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/result \ + -m 512M -smp 2 -nographic \ + -net none \ -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing || return 1 grep -F -m 1 -q dracut-root-block-success $TESTDIR/result || return 1 @@ -77,6 +80,7 @@ test_setup() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ + -m 512M -smp 2 -nographic -net none \ -append "root=/dev/dracut/root rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1 diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh index a08bfe5c..6fcd52a1 100755 --- a/test/TEST-02-SYSTEMD/test.sh +++ b/test/TEST-02-SYSTEMD/test.sh @@ -8,6 +8,9 @@ KVERSION="${KVERSION-$(uname -r)}" test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1 @@ -74,6 +77,7 @@ test_setup() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ + -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1 diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh index 5943c5c6..dfe33148 100755 --- a/test/TEST-03-USR-MOUNT/test.sh +++ b/test/TEST-03-USR-MOUNT/test.sh @@ -18,7 +18,10 @@ client_run() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ + -m 512M -smp 2 -nographic \ + -net none \ -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing @@ -112,6 +115,7 @@ test_setup() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ + -m 512M -smp 2 -nographic -net none \ -append "root=/dev/dracut/root rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 if ! grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs; then diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index 4114070a..e6a2910c 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -20,6 +20,9 @@ client_run() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing @@ -250,6 +253,7 @@ EOF $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ + -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 if ! grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs; then diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh index fd92606b..84fa58d1 100755 --- a/test/TEST-10-RAID/test.sh +++ b/test/TEST-10-RAID/test.sh @@ -10,6 +10,9 @@ test_run() { DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 @@ -74,6 +77,7 @@ test_setup() { # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ + -m 512M -smp 2 -nographic -net none \ -append "root=/dev/cannotreach rw rootfstype=ext2 console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $DISKIMAGE || return 1 diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh index 95463e4b..98daf471 100755 --- a/test/TEST-11-LVM/test.sh +++ b/test/TEST-11-LVM/test.sh @@ -9,6 +9,9 @@ KVERSION=${KVERSION-$(uname -r)} test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 @@ -69,7 +72,7 @@ test_setup() { -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. - $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh index d6b29dde..7f0188c3 100755 --- a/test/TEST-12-RAID-DEG/test.sh +++ b/test/TEST-12-RAID-DEG/test.sh @@ -15,9 +15,11 @@ client_run() { cp --sparse=always --reflink=auto $TESTDIR/disk3.img $TESTDIR/disk3.img.new $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -nographic -smp 2 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img.new \ -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img.new \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot $* systemd.log_target=kmsg loglevel=7 root=LABEL=root rw rd.retry=20 rd.info console=ttyS0,115200n81 log_buf_len=2M selinux=0 rd.debug rd.shell=0 $DEBUGFAIL " \ -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then @@ -115,6 +117,7 @@ test_setup() { -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img \ + -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh index 1f311be5..9a9cb884 100755 --- a/test/TEST-13-ENC-RAID-LVM/test.sh +++ b/test/TEST-13-ENC-RAID-LVM/test.sh @@ -17,6 +17,9 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ + -m 1024M -smp 2 -nographic \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 @@ -28,6 +31,9 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ + -m 1024M -smp 2 -nographic \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 @@ -39,6 +45,9 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ + -m 1024M -smp 2 -nographic \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL rd.luks.uuid=failme" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img && return 1 @@ -102,7 +111,7 @@ test_setup() { -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. - $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh index 75ea587f..03406c9b 100755 --- a/test/TEST-14-IMSM/test.sh +++ b/test/TEST-14-IMSM/test.sh @@ -13,6 +13,9 @@ client_run() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot $* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then @@ -106,6 +109,7 @@ test_setup() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ + -m 512M -nographic -net none \ -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh index 873b779a..8c154143 100755 --- a/test/TEST-15-BTRFSRAID/test.sh +++ b/test/TEST-15-BTRFSRAID/test.sh @@ -12,6 +12,9 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$MARKER_DISKIMAGE \ -drive format=raw,index=1,media=disk,file=$DISKIMAGE \ + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $MARKER_DISKIMAGE || return 1 @@ -78,6 +81,7 @@ test_setup() { # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ + -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh index 37a963e2..0af7a8a3 100755 --- a/test/TEST-16-DMSQUASH/test.sh +++ b/test/TEST-16-DMSQUASH/test.sh @@ -22,6 +22,10 @@ test_run() { -boot order=d \ -drive format=raw,bps=1000000,index=0,media=disk,file="$TESTDIR"/livecd.iso \ -drive format=raw,index=1,media=disk,file="$TESTDIR"/root.img \ + -m 512M -smp 2 \ + -nographic \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ -initrd "$TESTDIR"/initramfs.testing diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh index fb7b817c..07796147 100755 --- a/test/TEST-17-LVM-THIN/test.sh +++ b/test/TEST-17-LVM-THIN/test.sh @@ -9,6 +9,9 @@ KVERSION=${KVERSION-$(uname -r)} test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 @@ -69,7 +72,7 @@ test_setup() { -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. - $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 66926103..3308e652 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -17,11 +17,14 @@ run_server() { fsck -a $TESTDIR/server.ext3 || return 1 $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/server.ext3 \ + -m 512M -smp 2 \ + -display none \ -net socket,listen=127.0.0.1:12320 \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ -append "panic=1 quiet root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 @@ -60,9 +63,11 @@ client_test() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/client.img \ + -m 512M -smp 2 -nographic \ -net nic,macaddr=$mac,model=e1000 \ -net socket,connect=127.0.0.1:12320 \ -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=10 quiet ro console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.testing diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index 400d5c80..3d9d9004 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -18,11 +18,14 @@ run_server() { -drive format=raw,index=1,media=disk,file=$TESTDIR/root.ext3 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ + -m 512M -smp 2 \ + -display none \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net nic,macaddr=52:54:00:12:34:57,model=e1000 \ -net socket,listen=127.0.0.1:12330 \ + -no-reboot \ -append "panic=1 quiet root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 @@ -52,9 +55,11 @@ run_client() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/client.img \ + -m 512M -smp 2 -nographic \ -net nic,macaddr=52:54:00:12:34:00,model=e1000 \ -net nic,macaddr=52:54:00:12:34:01,model=e1000 \ -net socket,connect=127.0.0.1:12330 \ + -no-reboot \ -acpitable file=ibft.table \ -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ -initrd $TESTDIR/initramfs.testing @@ -182,6 +187,7 @@ test_setup() { -drive format=raw,index=1,media=disk,file=$TESTDIR/client.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ + -smp 2 -m 512M -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1 diff --git a/test/TEST-31-ISCSI-MULTI/test.sh b/test/TEST-31-ISCSI-MULTI/test.sh index 4e1eba97..a0b7ccc4 100755 --- a/test/TEST-31-ISCSI-MULTI/test.sh +++ b/test/TEST-31-ISCSI-MULTI/test.sh @@ -18,11 +18,14 @@ run_server() { -drive format=raw,index=1,media=disk,file=$TESTDIR/root.ext3 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ + -m 512M -smp 2 \ + -display none \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net nic,macaddr=52:54:00:12:34:57,model=e1000 \ -net socket,listen=127.0.0.1:12331 \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 @@ -51,9 +54,11 @@ run_client() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/client.img \ + -m 512M -smp 2 -nographic \ -net nic,macaddr=52:54:00:12:34:00,model=e1000 \ -net nic,macaddr=52:54:00:12:34:01,model=e1000 \ -net socket,connect=127.0.0.1:12331 \ + -no-reboot \ -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then @@ -196,6 +201,7 @@ test_setup() { -drive format=raw,index=1,media=disk,file=$TESTDIR/client.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ + -smp 2 -m 512M -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1 diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 75820cbb..45f76c92 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -33,10 +33,13 @@ run_server() { -drive format=raw,index=0,media=disk,file=$TESTDIR/server.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/nbd.ext2 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/encrypted.ext2 \ + -m 512M -smp 2 \ + -display none \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net socket,listen=127.0.0.1:12340 \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ + -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1 chmod 644 $TESTDIR/server.pid || return 1 @@ -77,8 +80,11 @@ client_test() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/flag.img \ + -m 512M -smp 2 \ + -nographic \ -net nic,macaddr=$mac,model=e1000 \ -net socket,connect=127.0.0.1:12340 \ + -no-reboot \ -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \ -initrd $TESTDIR/initramfs.testing @@ -273,6 +279,8 @@ make_encrypted_root() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/flag.img \ -drive format=raw,index=1,media=disk,file=$TESTDIR/encrypted.ext2 \ + -m 512M -smp 2\ + -nographic -net none \ -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/flag.img || return 1 diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index 26e30561..0720c4f2 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -15,11 +15,14 @@ run_server() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file="$TESTDIR"/server.ext3 \ + -m 512M -smp 2 \ + -display none \ -net socket,listen=127.0.0.1:12350 \ -net nic,macaddr=52:54:01:12:34:56,model=e1000 \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ -append "panic=1 systemd.crash_reboot loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ -initrd "$TESTDIR"/initramfs.server \ -pidfile "$TESTDIR"/server.pid -daemonize || return 1 @@ -57,7 +60,7 @@ client_test() { return 1 fi - $testdir/run-qemu -drive format=raw,index=0,media=disk,file="$TESTDIR"/client.img \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file="$TESTDIR"/client.img -m 512M -smp 2 -nographic \ -net socket,connect=127.0.0.1:12350 \ -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \ -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \ @@ -67,6 +70,7 @@ client_test() { -device e1000,netdev=n1,mac=52:54:00:12:34:98 \ -device e1000,netdev=n2,mac=52:54:00:12:34:99 \ -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ -initrd "$TESTDIR"/initramfs.testing diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh index 0b6b7b48..2afeb15d 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh @@ -17,6 +17,8 @@ run_server() { $testdir/run-qemu \ -hda "$TESTDIR"/server.ext3 \ + -m 512M -smp 2 \ + -display none \ -netdev socket,id=n0,listen=127.0.0.1:12370 \ -netdev socket,id=n1,listen=127.0.0.1:12371 \ -netdev socket,id=n2,listen=127.0.0.1:12372 \ @@ -28,6 +30,7 @@ run_server() { ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ -append "panic=1 loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 rd.debug" \ -initrd "$TESTDIR"/initramfs.server \ -pidfile "$TESTDIR"/server.pid -daemonize || return 1 @@ -74,7 +77,7 @@ client_test() { if $testdir/run-qemu --help | grep -qF -m1 'netdev hubport,id=str,hubid=n[,netdev=nd]' && echo OK; then $testdir/run-qemu \ - -hda "$TESTDIR"/client.img \ + -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ -netdev socket,connect=127.0.0.1:12370,id=s1 \ -netdev hubport,hubid=1,id=h1,netdev=s1 \ -netdev hubport,hubid=1,id=h2 -device e1000,mac=52:54:00:12:34:01,netdev=h2 \ @@ -83,11 +86,12 @@ client_test() { -netdev socket,connect=127.0.0.1:12372,id=n2 -device e1000,mac=52:54:00:12:34:04,netdev=n2 \ $nic3 -device e1000,mac=52:54:00:12:34:05,netdev=n3 \ -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ -append "panic=1 $cmdline systemd.crash_reboot rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ -initrd "$TESTDIR"/initramfs.testing else $testdir/run-qemu \ - -hda "$TESTDIR"/client.img \ + -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ -net socket,vlan=0,connect=127.0.0.1:12370 \ ${do_vlan13:+-net socket,vlan=1,connect=127.0.0.1:12371} \ -net socket,vlan=2,connect=127.0.0.1:12372 \ @@ -98,6 +102,7 @@ client_test() { -net nic,vlan=2,macaddr=52:54:00:12:34:04,model=e1000 \ -net nic,vlan=3,macaddr=52:54:00:12:34:05,model=e1000 \ -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ -append "panic=1 $cmdline systemd.crash_reboot rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ -initrd "$TESTDIR"/initramfs.testing fi diff --git a/test/run-qemu b/test/run-qemu index 4859bab8..ddf31490 100755 --- a/test/run-qemu +++ b/test/run-qemu @@ -3,12 +3,12 @@ # We prefer kvm, kqemu, userspace in that order. export PATH=/sbin:/bin:/usr/sbin:/usr/bin -[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS="-cpu max" +[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS="" $(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu -cpu host" [[ -c /dev/kvm && -x /usr/bin/kvm ]] && BIN=/usr/bin/kvm && ARGS="-cpu host" [[ -c /dev/kvm && -x /usr/bin/qemu-kvm ]] && BIN=/usr/bin/qemu-kvm && ARGS="-cpu host" [[ -c /dev/kvm && -x /usr/libexec/qemu-kvm ]] && BIN=/usr/libexec/qemu-kvm && ARGS="-cpu host" -[[ -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS="-cpu max" +[[ -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS="" [[ -c /dev/kvm && -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS="-enable-kvm -cpu host" [[ $BIN ]] || { @@ -17,8 +17,8 @@ $(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu -cpu ho exit 1 } -# Provide rng device sourcing the hosts /dev/urandom and other standard parameters -ARGS="$ARGS -smp 2 -m 512 -nodefaults -vga none -display none -no-reboot -device virtio-rng-pci" +# Provide rng device sourcing the hosts /dev/urandom +ARGS="$ARGS -device virtio-rng-pci" KVERSION=${KVERSION-$(uname -r)} From a3f73298f287e75810d6784efa52e80af15da2bd Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 28 Feb 2020 08:52:59 +0100 Subject: [PATCH 30/50] testsuite: refactor qemu options - refactor common qemu options - fix the ens[0-9] interface shift - add split network-[legacy|network] tests --- .github/workflows/fedora-30.yml | 25 +++- .github/workflows/fedora-31.yml | 26 +++- .travis.yml | 6 + test/TEST-01-BASIC/test.sh | 4 - test/TEST-02-SYSTEMD/test.sh | 4 - test/TEST-03-USR-MOUNT/test.sh | 4 - test/TEST-04-FULL-SYSTEMD/test.sh | 4 - test/TEST-10-RAID/test.sh | 4 - test/TEST-11-LVM/test.sh | 5 +- test/TEST-12-RAID-DEG/test.sh | 5 +- test/TEST-13-ENC-RAID-LVM/test.sh | 11 +- test/TEST-14-IMSM/test.sh | 4 - test/TEST-15-BTRFSRAID/test.sh | 4 - test/TEST-16-DMSQUASH/test.sh | 4 - test/TEST-17-LVM-THIN/test.sh | 5 +- test/TEST-20-NFS/server-init.sh | 12 +- test/TEST-20-NFS/test.sh | 28 ++-- test/TEST-21-NFS-NM/Makefile | 12 ++ test/TEST-30-ISCSI/server-init.sh | 14 +- test/TEST-30-ISCSI/test.sh | 56 +++++--- test/TEST-31-ISCSI-NM/Makefile | 12 ++ .../99-idesymlinks.rules | 0 .../Makefile | 0 .../client-init.sh | 0 .../create-root.sh | 0 .../dhcpd.conf | 0 .../finished-false.sh | 0 .../hard-off.sh | 0 .../hosts | 0 .../server-init.sh | 14 +- .../test.sh | 71 +++++---- test/TEST-36-ISCSI-MULTI-NM/Makefile | 12 ++ test/TEST-40-NBD/test.sh | 8 -- test/TEST-41-NBD-NM/Makefile | 12 ++ test/TEST-50-MULTINIC/server-init.sh | 2 +- test/TEST-50-MULTINIC/test.sh | 52 ++++--- test/TEST-51-MULTINIC-NM/Makefile | 12 ++ .../client-init.sh | 4 +- .../server-init.sh | 54 +++---- test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh | 135 +++++++----------- test/TEST-61-BONDBRIDGEVLANIFCFG-NM/Makefile | 12 ++ test/run-qemu | 12 +- 42 files changed, 356 insertions(+), 293 deletions(-) create mode 100644 test/TEST-21-NFS-NM/Makefile create mode 100644 test/TEST-31-ISCSI-NM/Makefile rename test/{TEST-31-ISCSI-MULTI => TEST-35-ISCSI-MULTI}/99-idesymlinks.rules (100%) rename test/{TEST-31-ISCSI-MULTI => TEST-35-ISCSI-MULTI}/Makefile (100%) rename test/{TEST-31-ISCSI-MULTI => TEST-35-ISCSI-MULTI}/client-init.sh (100%) rename test/{TEST-31-ISCSI-MULTI => TEST-35-ISCSI-MULTI}/create-root.sh (100%) rename test/{TEST-31-ISCSI-MULTI => TEST-35-ISCSI-MULTI}/dhcpd.conf (100%) rename test/{TEST-31-ISCSI-MULTI => TEST-35-ISCSI-MULTI}/finished-false.sh (100%) rename test/{TEST-31-ISCSI-MULTI => TEST-35-ISCSI-MULTI}/hard-off.sh (100%) rename test/{TEST-31-ISCSI-MULTI => TEST-35-ISCSI-MULTI}/hosts (100%) rename test/{TEST-31-ISCSI-MULTI => TEST-35-ISCSI-MULTI}/server-init.sh (91%) rename test/{TEST-31-ISCSI-MULTI => TEST-35-ISCSI-MULTI}/test.sh (91%) create mode 100644 test/TEST-36-ISCSI-MULTI-NM/Makefile create mode 100644 test/TEST-41-NBD-NM/Makefile create mode 100644 test/TEST-51-MULTINIC-NM/Makefile create mode 100644 test/TEST-61-BONDBRIDGEVLANIFCFG-NM/Makefile diff --git a/.github/workflows/fedora-30.yml b/.github/workflows/fedora-30.yml index e8c5321c..91f2e00b 100644 --- a/.github/workflows/fedora-30.yml +++ b/.github/workflows/fedora-30.yml @@ -17,7 +17,30 @@ jobs: timeout-minutes: 30 strategy: matrix: - test: [ "01", "02", "03", "04", "10", "11", "12", "13", "14", "15", "17", "20", "30", "31", "40", "50", "60" ] + test: [ + "01", + "02", + "03", + "04", + "10", + "11", + "12", + "13", + "14", + "15", + "17", + "20", + "30", + "31", + "35", + "36", + "40", + "41", + "50", + "51", + "60", + "61" + ] fail-fast: false steps: - name: "Checkout Repository" diff --git a/.github/workflows/fedora-31.yml b/.github/workflows/fedora-31.yml index d1260f85..42aa8298 100644 --- a/.github/workflows/fedora-31.yml +++ b/.github/workflows/fedora-31.yml @@ -17,7 +17,31 @@ jobs: timeout-minutes: 30 strategy: matrix: - test: [ "01", "02", "03", "04", "10", "11", "12", "13", "14", "15", "17", "20", "30", "31", "40", "50", "60" ] + test: [ + "01", + "02", + "03", + "04", + "10", + "11", + "12", + "13", + "14", + "15", + "17", + "20", + "21", + "30", + "31", + "35", + "36", + "40", + "41", + "50", + "51", + "60", + "61" + ] fail-fast: false steps: - name: "Checkout Repository" diff --git a/.travis.yml b/.travis.yml index 977be3c7..46447c60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,17 @@ env: - IMAGE=latest TESTS=01 - IMAGE=latest TESTS=12 - IMAGE=latest TESTS=20 + - IMAGE=latest TESTS=21 - IMAGE=latest TESTS=50 + - IMAGE=latest TESTS=51 - IMAGE=latest TESTS=30 - IMAGE=latest TESTS=31 + - IMAGE=latest TESTS=35 + - IMAGE=latest TESTS=36 - IMAGE=latest TESTS=40 + - IMAGE=latest TESTS=41 - IMAGE=latest TESTS=60 + - IMAGE=latest TESTS=61 - IMAGE=latest TESTS=99 - IMAGE=latest TESTS=02 - IMAGE=latest TESTS=03 diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index db25e5a4..37f77c36 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -11,10 +11,7 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/result \ - -m 512M -smp 2 -nographic \ - -net none \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing || return 1 grep -F -m 1 -q dracut-root-block-success $TESTDIR/result || return 1 @@ -80,7 +77,6 @@ test_setup() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/dracut/root rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1 diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh index 6fcd52a1..a08bfe5c 100755 --- a/test/TEST-02-SYSTEMD/test.sh +++ b/test/TEST-02-SYSTEMD/test.sh @@ -8,9 +8,6 @@ KVERSION="${KVERSION-$(uname -r)}" test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1 @@ -77,7 +74,6 @@ test_setup() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1 diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh index dfe33148..5943c5c6 100755 --- a/test/TEST-03-USR-MOUNT/test.sh +++ b/test/TEST-03-USR-MOUNT/test.sh @@ -18,10 +18,7 @@ client_run() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ - -m 512M -smp 2 -nographic \ - -net none \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing @@ -115,7 +112,6 @@ test_setup() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/dracut/root rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 if ! grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs; then diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index e6a2910c..4114070a 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -20,9 +20,6 @@ client_run() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing @@ -253,7 +250,6 @@ EOF $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 if ! grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs; then diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh index 84fa58d1..fd92606b 100755 --- a/test/TEST-10-RAID/test.sh +++ b/test/TEST-10-RAID/test.sh @@ -10,9 +10,6 @@ test_run() { DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 @@ -77,7 +74,6 @@ test_setup() { # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/cannotreach rw rootfstype=ext2 console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $DISKIMAGE || return 1 diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh index 98daf471..95463e4b 100755 --- a/test/TEST-11-LVM/test.sh +++ b/test/TEST-11-LVM/test.sh @@ -9,9 +9,6 @@ KVERSION=${KVERSION-$(uname -r)} test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 @@ -72,7 +69,7 @@ test_setup() { -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. - $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh index 7f0188c3..d6b29dde 100755 --- a/test/TEST-12-RAID-DEG/test.sh +++ b/test/TEST-12-RAID-DEG/test.sh @@ -15,11 +15,9 @@ client_run() { cp --sparse=always --reflink=auto $TESTDIR/disk3.img $TESTDIR/disk3.img.new $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -nographic -smp 2 \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img.new \ -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img.new \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot $* systemd.log_target=kmsg loglevel=7 root=LABEL=root rw rd.retry=20 rd.info console=ttyS0,115200n81 log_buf_len=2M selinux=0 rd.debug rd.shell=0 $DEBUGFAIL " \ -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then @@ -117,7 +115,6 @@ test_setup() { -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh index 9a9cb884..1f311be5 100755 --- a/test/TEST-13-ENC-RAID-LVM/test.sh +++ b/test/TEST-13-ENC-RAID-LVM/test.sh @@ -17,9 +17,6 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ - -m 1024M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 @@ -31,9 +28,6 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ - -m 1024M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 @@ -45,9 +39,6 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \ - -m 1024M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL rd.luks.uuid=failme" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img && return 1 @@ -111,7 +102,7 @@ test_setup() { -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. - $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh index 03406c9b..75ea587f 100755 --- a/test/TEST-14-IMSM/test.sh +++ b/test/TEST-14-IMSM/test.sh @@ -13,9 +13,6 @@ client_run() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot $* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then @@ -109,7 +106,6 @@ test_setup() { -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \ - -m 512M -nographic -net none \ -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh index 8c154143..873b779a 100755 --- a/test/TEST-15-BTRFSRAID/test.sh +++ b/test/TEST-15-BTRFSRAID/test.sh @@ -12,9 +12,6 @@ test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$MARKER_DISKIMAGE \ -drive format=raw,index=1,media=disk,file=$DISKIMAGE \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $MARKER_DISKIMAGE || return 1 @@ -81,7 +78,6 @@ test_setup() { # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \ - -m 512M -smp 2 -nographic -net none \ -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh index 0af7a8a3..37a963e2 100755 --- a/test/TEST-16-DMSQUASH/test.sh +++ b/test/TEST-16-DMSQUASH/test.sh @@ -22,10 +22,6 @@ test_run() { -boot order=d \ -drive format=raw,bps=1000000,index=0,media=disk,file="$TESTDIR"/livecd.iso \ -drive format=raw,index=1,media=disk,file="$TESTDIR"/root.img \ - -m 512M -smp 2 \ - -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ -initrd "$TESTDIR"/initramfs.testing diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh index 07796147..fb7b817c 100755 --- a/test/TEST-17-LVM-THIN/test.sh +++ b/test/TEST-17-LVM-THIN/test.sh @@ -9,9 +9,6 @@ KVERSION=${KVERSION-$(uname -r)} test_run() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ - -m 512M -smp 2 -nographic \ - -net none \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 @@ -72,7 +69,7 @@ test_setup() { -f $TESTDIR/initramfs.makeroot $KVERSION || return 1 rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. - $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 512M -smp 2 -nographic -net none \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 diff --git a/test/TEST-20-NFS/server-init.sh b/test/TEST-20-NFS/server-init.sh index 846bbfd8..166b9e11 100755 --- a/test/TEST-20-NFS/server-init.sh +++ b/test/TEST-20-NFS/server-init.sh @@ -54,15 +54,15 @@ linkup() { && wait_for_if_up $1 2>/dev/null } -wait_for_if_link eth0 ens3 +wait_for_if_link eth0 ens2 ip addr add 127.0.0.1/8 dev lo ip link set lo up -ip link set dev eth0 name ens3 -ip addr add 192.168.50.1/24 dev ens3 -ip addr add 192.168.50.2/24 dev ens3 -ip addr add 192.168.50.3/24 dev ens3 -linkup ens3 +ip link set dev eth0 name ens2 +ip addr add 192.168.50.1/24 dev ens2 +ip addr add 192.168.50.2/24 dev ens2 +ip addr add 192.168.50.3/24 dev ens2 +linkup ens2 echo > /dev/watchdog modprobe af_packet diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 3308e652..27c90d5e 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -1,5 +1,14 @@ #!/bin/bash -TEST_DESCRIPTION="root filesystem on NFS" + +if [[ $NM ]]; then + USE_NETWORK="network-manager" + OMIT_NETWORK="network-legacy" +else + USE_NETWORK="network-legacy" + OMIT_NETWORK="network-manager" +fi + +TEST_DESCRIPTION="root filesystem on NFS with $USE_NETWORK" KVERSION=${KVERSION-$(uname -r)} @@ -17,14 +26,11 @@ run_server() { fsck -a $TESTDIR/server.ext3 || return 1 $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/server.ext3 \ - -m 512M -smp 2 \ - -display none \ -net socket,listen=127.0.0.1:12320 \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 quiet root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 @@ -34,9 +40,9 @@ run_server() { tty -s && stty sane if ! [[ $SERIAL ]]; then - echo "Waiting for the server to startup" while : ; do grep Serving "$TESTDIR"/server.log && break + echo "Waiting for the server to startup" sleep 1 done else @@ -56,19 +62,17 @@ client_test() { echo "CLIENT TEST START: $test_name" # Need this so kvm-qemu will boot (needs non-/dev/zero local disk) - if ! dd if=/dev/zero of=$TESTDIR/client.img bs=1M count=1; then + if ! dd if=/dev/zero of=$TESTDIR/client.img bs=1M count=1 &>/dev/null; then echo "Unable to make client sda image" 1>&2 return 1 fi $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/client.img \ - -m 512M -smp 2 -nographic \ -net nic,macaddr=$mac,model=e1000 \ -net socket,connect=127.0.0.1:12320 \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ - -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=10 quiet ro console=ttyS0,115200n81 selinux=0" \ + -append "rd.net.timeout.dhcp=3 panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=10 quiet ro console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.testing if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nfs-OK $TESTDIR/client.img; then @@ -163,7 +167,7 @@ test_nfsv3() { 52:54:00:12:34:05 "root=dhcp" 192.168.50.1 wsize=4096 || return 1 client_test "NFSv3 Bridge Customized root=dhcp DHCP path,options" \ - 52:54:00:12:34:05 "root=dhcp bridge=foobr0:ens3" 192.168.50.1 wsize=4096 || return 1 + 52:54:00:12:34:05 "root=dhcp bridge=foobr0:ens2" 192.168.50.1 wsize=4096 || return 1 client_test "NFSv3 root=dhcp DHCP IP:path,options" \ 52:54:00:12:34:06 "root=dhcp" 192.168.50.2 wsize=4096 || return 1 @@ -365,8 +369,8 @@ test_setup() { # Make client's dracut image $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "plymouth dash" \ - -a "debug watchdog" \ + -o "plymouth dash ${OMIT_NETWORK}" \ + -a "debug watchdog ${USE_NETWORK}" \ -d "af_packet piix ide-gd_mod ata_piix sd_mod e1000 nfs sunrpc i6300esb" \ --no-hostonly-cmdline -N \ -f $TESTDIR/initramfs.testing $KVERSION || return 1 diff --git a/test/TEST-21-NFS-NM/Makefile b/test/TEST-21-NFS-NM/Makefile new file mode 100644 index 00000000..b19122a1 --- /dev/null +++ b/test/TEST-21-NFS-NM/Makefile @@ -0,0 +1,12 @@ +.PHONY: all setup clean run + +BASETEST=../TEST-20-NFS + +all: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) all +setup: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) setup +clean: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) clean +run: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) run diff --git a/test/TEST-30-ISCSI/server-init.sh b/test/TEST-30-ISCSI/server-init.sh index 320303e9..63d6295e 100755 --- a/test/TEST-30-ISCSI/server-init.sh +++ b/test/TEST-30-ISCSI/server-init.sh @@ -24,17 +24,17 @@ wait_for_if_link() { return 1 } -wait_for_if_link eth0 ens3 -wait_for_if_link eth1 ens4 +wait_for_if_link eth0 ens2 +wait_for_if_link eth1 ens3 ip addr add 127.0.0.1/8 dev lo ip link set lo up -ip link set dev eth0 name ens3 -ip addr add 192.168.50.1/24 dev ens3 +ip link set dev eth0 name ens2 +ip addr add 192.168.50.1/24 dev ens2 +ip link set ens2 up +ip link set dev eth1 name ens3 +ip addr add 192.168.51.1/24 dev ens3 ip link set ens3 up -ip link set dev eth1 name ens4 -ip addr add 192.168.51.1/24 dev ens4 -ip link set ens4 up >/var/lib/dhcpd/dhcpd.leases chmod 777 /var/lib/dhcpd/dhcpd.leases dhcpd -d -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases & diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index 3d9d9004..8c7e9452 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -1,5 +1,14 @@ #!/bin/bash -TEST_DESCRIPTION="root filesystem over iSCSI" + +if [[ $NM ]]; then + USE_NETWORK="network-manager" + OMIT_NETWORK="network-legacy" +else + USE_NETWORK="network-legacy" + OMIT_NETWORK="network-manager" +fi + +TEST_DESCRIPTION="root filesystem over iSCSI with $USE_NETWORK" KVERSION=${KVERSION-$(uname -r)} @@ -18,14 +27,11 @@ run_server() { -drive format=raw,index=1,media=disk,file=$TESTDIR/root.ext3 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ - -m 512M -smp 2 \ - -display none \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net nic,macaddr=52:54:00:12:34:57,model=e1000 \ -net socket,listen=127.0.0.1:12330 \ - -no-reboot \ -append "panic=1 quiet root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 @@ -55,11 +61,9 @@ run_client() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/client.img \ - -m 512M -smp 2 -nographic \ -net nic,macaddr=52:54:00:12:34:00,model=e1000 \ -net nic,macaddr=52:54:00:12:34:01,model=e1000 \ -net socket,connect=127.0.0.1:12330 \ - -no-reboot \ -acpitable file=ibft.table \ -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ -initrd $TESTDIR/initramfs.testing @@ -76,13 +80,13 @@ do_test_run() { initiator=$(iscsi-iname) run_client "root=dhcp" \ - "root=/dev/root netroot=dhcp ip=ens3:dhcp" \ + "root=/dev/root netroot=dhcp ip=ens2:dhcp" \ "rd.iscsi.initiator=$initiator" \ || return 1 run_client "netroot=iscsi target0"\ "root=LABEL=singleroot netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0" \ - "ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \ + "ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens2:off" \ "rd.iscsi.initiator=$initiator" \ || return 1 @@ -131,6 +135,7 @@ test_setup() { kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay + rm -rf -- $TESTDIR/overlay ( export initdir=$TESTDIR/overlay/source . $basedir/dracut-init.sh @@ -187,25 +192,10 @@ test_setup() { -drive format=raw,index=1,media=disk,file=$TESTDIR/client.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ - -smp 2 -m 512M -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1 rm -- $TESTDIR/client.img - ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook shutdown-emergency 000 ./hard-off.sh - inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules - ) - $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "dash plymouth dmraid nfs" \ - -a "debug" \ - -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 # Make server root dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=60 @@ -214,6 +204,7 @@ test_setup() { mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt kernel=$KVERSION + rm -rf -- $TESTDIR/overlay ( export initdir=$TESTDIR/mnt . $basedir/dracut-init.sh @@ -256,6 +247,25 @@ test_setup() { -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod e1000 drbg" \ --no-hostonly-cmdline -N \ -f $TESTDIR/initramfs.server $KVERSION || return 1 + rm -rf -- $TESTDIR/overlay + + # Make client dracut image + rm -rf -- $TESTDIR/overlay + ( + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + -o "dash plymouth dmraid nfs ${OMIT_NETWORK}" \ + -a "debug ${USE_NETWORK}" \ + -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 + rm -rf -- $TESTDIR/overlay } diff --git a/test/TEST-31-ISCSI-NM/Makefile b/test/TEST-31-ISCSI-NM/Makefile new file mode 100644 index 00000000..84884443 --- /dev/null +++ b/test/TEST-31-ISCSI-NM/Makefile @@ -0,0 +1,12 @@ +.PHONY: all setup clean run + +BASETEST=../TEST-30-ISCSI + +all: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) all +setup: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) setup +clean: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) clean +run: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) run diff --git a/test/TEST-31-ISCSI-MULTI/99-idesymlinks.rules b/test/TEST-35-ISCSI-MULTI/99-idesymlinks.rules similarity index 100% rename from test/TEST-31-ISCSI-MULTI/99-idesymlinks.rules rename to test/TEST-35-ISCSI-MULTI/99-idesymlinks.rules diff --git a/test/TEST-31-ISCSI-MULTI/Makefile b/test/TEST-35-ISCSI-MULTI/Makefile similarity index 100% rename from test/TEST-31-ISCSI-MULTI/Makefile rename to test/TEST-35-ISCSI-MULTI/Makefile diff --git a/test/TEST-31-ISCSI-MULTI/client-init.sh b/test/TEST-35-ISCSI-MULTI/client-init.sh similarity index 100% rename from test/TEST-31-ISCSI-MULTI/client-init.sh rename to test/TEST-35-ISCSI-MULTI/client-init.sh diff --git a/test/TEST-31-ISCSI-MULTI/create-root.sh b/test/TEST-35-ISCSI-MULTI/create-root.sh similarity index 100% rename from test/TEST-31-ISCSI-MULTI/create-root.sh rename to test/TEST-35-ISCSI-MULTI/create-root.sh diff --git a/test/TEST-31-ISCSI-MULTI/dhcpd.conf b/test/TEST-35-ISCSI-MULTI/dhcpd.conf similarity index 100% rename from test/TEST-31-ISCSI-MULTI/dhcpd.conf rename to test/TEST-35-ISCSI-MULTI/dhcpd.conf diff --git a/test/TEST-31-ISCSI-MULTI/finished-false.sh b/test/TEST-35-ISCSI-MULTI/finished-false.sh similarity index 100% rename from test/TEST-31-ISCSI-MULTI/finished-false.sh rename to test/TEST-35-ISCSI-MULTI/finished-false.sh diff --git a/test/TEST-31-ISCSI-MULTI/hard-off.sh b/test/TEST-35-ISCSI-MULTI/hard-off.sh similarity index 100% rename from test/TEST-31-ISCSI-MULTI/hard-off.sh rename to test/TEST-35-ISCSI-MULTI/hard-off.sh diff --git a/test/TEST-31-ISCSI-MULTI/hosts b/test/TEST-35-ISCSI-MULTI/hosts similarity index 100% rename from test/TEST-31-ISCSI-MULTI/hosts rename to test/TEST-35-ISCSI-MULTI/hosts diff --git a/test/TEST-31-ISCSI-MULTI/server-init.sh b/test/TEST-35-ISCSI-MULTI/server-init.sh similarity index 91% rename from test/TEST-31-ISCSI-MULTI/server-init.sh rename to test/TEST-35-ISCSI-MULTI/server-init.sh index d825e3a7..fe962311 100755 --- a/test/TEST-31-ISCSI-MULTI/server-init.sh +++ b/test/TEST-35-ISCSI-MULTI/server-init.sh @@ -53,17 +53,17 @@ linkup() { && wait_for_if_up $1 2>/dev/null } -wait_for_if_link eth0 ens3 -wait_for_if_link eth1 ens4 +wait_for_if_link eth0 ens2 +wait_for_if_link eth1 ens3 ip addr add 127.0.0.1/8 dev lo ip link set lo up -ip link set dev eth0 name ens3 -ip addr add 192.168.50.1/24 dev ens3 +ip link set dev eth0 name ens2 +ip addr add 192.168.50.1/24 dev ens2 +linkup ens2 +ip link set dev eth1 name ens3 +ip addr add 192.168.51.1/24 dev ens3 linkup ens3 -ip link set dev eth1 name ens4 -ip addr add 192.168.51.1/24 dev ens4 -linkup ens4 >/var/lib/dhcpd/dhcpd.leases chmod 777 /var/lib/dhcpd/dhcpd.leases diff --git a/test/TEST-31-ISCSI-MULTI/test.sh b/test/TEST-35-ISCSI-MULTI/test.sh similarity index 91% rename from test/TEST-31-ISCSI-MULTI/test.sh rename to test/TEST-35-ISCSI-MULTI/test.sh index a0b7ccc4..0c40e55c 100755 --- a/test/TEST-31-ISCSI-MULTI/test.sh +++ b/test/TEST-35-ISCSI-MULTI/test.sh @@ -1,5 +1,14 @@ #!/bin/bash -TEST_DESCRIPTION="root filesystem over multiple iSCSI" + +if [[ $NM ]]; then + USE_NETWORK="network-manager" + OMIT_NETWORK="network-legacy" +else + USE_NETWORK="network-legacy" + OMIT_NETWORK="network-manager" +fi + +TEST_DESCRIPTION="root filesystem over multiple iSCSI with $USE_NETWORK" KVERSION=${KVERSION-$(uname -r)} @@ -18,14 +27,11 @@ run_server() { -drive format=raw,index=1,media=disk,file=$TESTDIR/root.ext3 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ - -m 512M -smp 2 \ - -display none \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net nic,macaddr=52:54:00:12:34:57,model=e1000 \ -net socket,listen=127.0.0.1:12331 \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ -initrd $TESTDIR/initramfs.server \ -pidfile $TESTDIR/server.pid -daemonize || return 1 @@ -35,9 +41,10 @@ run_server() { tty -s && stty sane if ! [[ $SERIAL ]]; then - echo "Waiting for the server to startup" while : ; do grep Serving "$TESTDIR"/server.log && break + echo "Waiting for the server to startup" + tail "$TESTDIR"/server.log sleep 1 done else @@ -54,11 +61,9 @@ run_client() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/client.img \ - -m 512M -smp 2 -nographic \ -net nic,macaddr=52:54:00:12:34:00,model=e1000 \ -net nic,macaddr=52:54:00:12:34:01,model=e1000 \ -net socket,connect=127.0.0.1:12331 \ - -no-reboot \ -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ -initrd $TESTDIR/initramfs.testing if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then @@ -74,8 +79,8 @@ do_test_run() { initiator=$(iscsi-iname) run_client "netroot=iscsi target1 target2" \ "root=LABEL=sysroot" \ - "ip=192.168.50.101:::255.255.255.0::ens3:off" \ - "ip=192.168.51.101:::255.255.255.0::ens4:off" \ + "ip=192.168.50.101:::255.255.255.0::ens2:off" \ + "ip=192.168.51.101:::255.255.255.0::ens3:off" \ "netroot=iscsi:192.168.51.1::::iqn.2009-06.dracut:target1" \ "netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target2" \ "rd.iscsi.initiator=$initiator" \ @@ -83,8 +88,8 @@ do_test_run() { run_client "netroot=iscsi target1 target2 rd.iscsi.waitnet=0" \ "root=LABEL=sysroot" \ - "ip=192.168.50.101:::255.255.255.0::ens3:off" \ - "ip=192.168.51.101:::255.255.255.0::ens4:off" \ + "ip=192.168.50.101:::255.255.255.0::ens2:off" \ + "ip=192.168.51.101:::255.255.255.0::ens3:off" \ "netroot=iscsi:192.168.51.1::::iqn.2009-06.dracut:target1" \ "netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target2" \ "rd.iscsi.firmware" \ @@ -94,8 +99,8 @@ do_test_run() { run_client "netroot=iscsi target1 target2 rd.iscsi.waitnet=0 rd.iscsi.testroute=0" \ "root=LABEL=sysroot" \ - "ip=192.168.50.101:::255.255.255.0::ens3:off" \ - "ip=192.168.51.101:::255.255.255.0::ens4:off" \ + "ip=192.168.50.101:::255.255.255.0::ens2:off" \ + "ip=192.168.51.101:::255.255.255.0::ens3:off" \ "netroot=iscsi:192.168.51.1::::iqn.2009-06.dracut:target1" \ "netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target2" \ "rd.iscsi.firmware" \ @@ -105,8 +110,8 @@ do_test_run() { run_client "netroot=iscsi target1 target2 rd.iscsi.waitnet=0 rd.iscsi.testroute=0 default GW" \ "root=LABEL=sysroot" \ - "ip=192.168.50.101::192.168.50.1:255.255.255.0::ens3:off" \ - "ip=192.168.51.101::192.168.51.1:255.255.255.0::ens4:off" \ + "ip=192.168.50.101::192.168.50.1:255.255.255.0::ens2:off" \ + "ip=192.168.51.101::192.168.51.1:255.255.255.0::ens3:off" \ "netroot=iscsi:192.168.51.1::::iqn.2009-06.dracut:target1" \ "netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target2" \ "rd.iscsi.firmware" \ @@ -145,6 +150,7 @@ test_setup() { kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay + rm -rf -- $TESTDIR/overlay ( export initdir=$TESTDIR/overlay/source . $basedir/dracut-init.sh @@ -201,25 +207,10 @@ test_setup() { -drive format=raw,index=1,media=disk,file=$TESTDIR/client.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \ - -smp 2 -m 512M -nographic -net none \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1 rm -- $TESTDIR/client.img - ( - export initdir=$TESTDIR/overlay - . $basedir/dracut-init.sh - inst_multiple poweroff shutdown - inst_hook shutdown-emergency 000 ./hard-off.sh - inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules - ) - $basedir/dracut.sh -l -i $TESTDIR/overlay / \ - -o "dash plymouth dmraid nfs" \ - -a "debug" \ - -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \ - --no-hostonly-cmdline -N \ - -f $TESTDIR/initramfs.testing $KVERSION || return 1 # Make server root dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=60 @@ -228,6 +219,7 @@ test_setup() { mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt kernel=$KVERSION + rm -rf -- $TESTDIR/overlay ( export initdir=$TESTDIR/mnt . $basedir/dracut-init.sh @@ -271,6 +263,25 @@ test_setup() { --no-hostonly-cmdline -N \ -f $TESTDIR/initramfs.server $KVERSION || return 1 + + # Make client dracut image + rm -rf -- $TESTDIR/overlay + ( + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh + inst_multiple poweroff shutdown + inst_hook shutdown-emergency 000 ./hard-off.sh + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + -o "dash plymouth dmraid nfs ${OMIT_NETWORK}" \ + -a "debug ${USE_NETWORK}" \ + -d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 + + rm -rf -- $TESTDIR/overlay } test_cleanup() { diff --git a/test/TEST-36-ISCSI-MULTI-NM/Makefile b/test/TEST-36-ISCSI-MULTI-NM/Makefile new file mode 100644 index 00000000..8b8a77ad --- /dev/null +++ b/test/TEST-36-ISCSI-MULTI-NM/Makefile @@ -0,0 +1,12 @@ +.PHONY: all setup clean run + +BASETEST=../TEST-35-ISCSI-MULTI + +all: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) all +setup: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) setup +clean: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) clean +run: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) run diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 45f76c92..75820cbb 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -33,13 +33,10 @@ run_server() { -drive format=raw,index=0,media=disk,file=$TESTDIR/server.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/nbd.ext2 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/encrypted.ext2 \ - -m 512M -smp 2 \ - -display none \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net socket,listen=127.0.0.1:12340 \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ - -no-reboot \ -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1 chmod 644 $TESTDIR/server.pid || return 1 @@ -80,11 +77,8 @@ client_test() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/flag.img \ - -m 512M -smp 2 \ - -nographic \ -net nic,macaddr=$mac,model=e1000 \ -net socket,connect=127.0.0.1:12340 \ - -no-reboot \ -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \ -initrd $TESTDIR/initramfs.testing @@ -279,8 +273,6 @@ make_encrypted_root() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/flag.img \ -drive format=raw,index=1,media=disk,file=$TESTDIR/encrypted.ext2 \ - -m 512M -smp 2\ - -nographic -net none \ -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/flag.img || return 1 diff --git a/test/TEST-41-NBD-NM/Makefile b/test/TEST-41-NBD-NM/Makefile new file mode 100644 index 00000000..b19122a1 --- /dev/null +++ b/test/TEST-41-NBD-NM/Makefile @@ -0,0 +1,12 @@ +.PHONY: all setup clean run + +BASETEST=../TEST-20-NFS + +all: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) all +setup: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) setup +clean: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) clean +run: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) run diff --git a/test/TEST-50-MULTINIC/server-init.sh b/test/TEST-50-MULTINIC/server-init.sh index ccabc830..66a242eb 100755 --- a/test/TEST-50-MULTINIC/server-init.sh +++ b/test/TEST-50-MULTINIC/server-init.sh @@ -84,7 +84,7 @@ rpc.nfsd >/dev/watchdog rpc.mountd >/dev/watchdog -rpc.idmapd +rpc.idmapd -S >/dev/watchdog exportfs -r >/dev/watchdog diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index 0720c4f2..14f6b6b7 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -1,5 +1,14 @@ #!/bin/bash -TEST_DESCRIPTION="root filesystem on NFS with multiple nics" + +if [[ $NM ]]; then + USE_NETWORK="network-manager" + OMIT_NETWORK="network-legacy" +else + USE_NETWORK="network-legacy" + OMIT_NETWORK="network-manager" +fi + +TEST_DESCRIPTION="root filesystem on NFS with multiple nics with $USE_NETWORK" KVERSION=${KVERSION-$(uname -r)} @@ -15,14 +24,11 @@ run_server() { $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file="$TESTDIR"/server.ext3 \ - -m 512M -smp 2 \ - -display none \ -net socket,listen=127.0.0.1:12350 \ -net nic,macaddr=52:54:01:12:34:56,model=e1000 \ ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 systemd.crash_reboot loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ -initrd "$TESTDIR"/initramfs.server \ -pidfile "$TESTDIR"/server.pid -daemonize || return 1 @@ -33,9 +39,9 @@ run_server() { tty -s && stty sane if ! [[ $SERIAL ]]; then - echo "Waiting for the server to startup" while : ; do grep Serving "$TESTDIR"/server.log && break + echo "Waiting for the server to startup" sleep 1 done else @@ -60,7 +66,7 @@ client_test() { return 1 fi - $testdir/run-qemu -drive format=raw,index=0,media=disk,file="$TESTDIR"/client.img -m 512M -smp 2 -nographic \ + $testdir/run-qemu -drive format=raw,index=0,media=disk,file="$TESTDIR"/client.img \ -net socket,connect=127.0.0.1:12350 \ -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \ -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \ @@ -70,8 +76,7 @@ client_test() { -device e1000,netdev=n1,mac=52:54:00:12:34:98 \ -device e1000,netdev=n2,mac=52:54:00:12:34:99 \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ - -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ + -append "quiet rd.net.timeout.dhcp=3 panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console" \ -initrd "$TESTDIR"/initramfs.testing { read OK; read IFACES; } < "$TESTDIR"/client.img @@ -122,45 +127,46 @@ test_client() { client_test "MULTINIC root=nfs BOOTIF=" \ 00 01 02 \ "root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00" \ - "ens3" || return 1 + "ens2" || return 1 client_test "MULTINIC root=nfs BOOTIF= ip=ens4:dhcp" \ 00 01 02 \ - "root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00 ip=ens4:dhcp" \ - "ens3 ens4" || return 1 + "root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00 ip=ens3:dhcp" \ + "ens2 ens3" || return 1 # PXE Style BOOTIF= with dhcp root-path client_test "MULTINIC root=dhcp BOOTIF=" \ 00 01 02 \ "root=dhcp BOOTIF=52-54-00-12-34-02" \ - "ens5" || return 1 + "ens4" || return 1 # Multinic case, where only one nic works client_test "MULTINIC root=nfs ip=dhcp" \ FF 00 FE \ "root=nfs:192.168.50.1:/nfs/client ip=dhcp" \ - "ens4" || return 1 + "ens3" || return 1 # Require two interfaces - client_test "MULTINIC root=nfs ip=ens4:dhcp ip=ens5:dhcp bootdev=ens4" \ + client_test "MULTINIC root=nfs ip=ens3:dhcp ip=ens4:dhcp bootdev=ens3" \ 00 01 02 \ - "root=nfs:192.168.50.1:/nfs/client ip=ens4:dhcp ip=ens5:dhcp bootdev=ens4" \ - "ens4 ens5" || return 1 + "root=nfs:192.168.50.1:/nfs/client ip=ens3:dhcp ip=ens4:dhcp bootdev=ens3" \ + "ens3 ens4" || return 1 # Require three interfaces with dhcp root-path - client_test "MULTINIC root=dhcp ip=ens3:dhcp ip=ens4:dhcp ip=ens5:dhcp bootdev=ens5" \ + client_test "MULTINIC root=dhcp ip=ens2:dhcp ip=ens3:dhcp ip=ens4:dhcp bootdev=ens4" \ 00 01 02 \ - "root=dhcp ip=ens3:dhcp ip=ens4:dhcp ip=ens5:dhcp bootdev=ens5" \ - "ens3 ens4 ens5" || return 1 + "root=dhcp ip=ens2:dhcp ip=ens3:dhcp ip=ens4:dhcp bootdev=ens4" \ + "ens2 ens3 ens4" || return 1 client_test "MULTINIC bonding" \ 00 01 02 \ - "root=nfs:192.168.50.1:/nfs/client ip=bond0:dhcp bond=bond0:ens3,ens4,ens5:mode=balance-rr" \ + "root=nfs:192.168.50.1:/nfs/client ip=bond0:dhcp bond=bond0:ens2,ens3,ens4:mode=balance-rr" \ "bond0" || return 1 + # bridge, where only one interface is actually connected client_test "MULTINIC bridging" \ 00 01 02 \ - "root=nfs:192.168.50.1:/nfs/client ip=bridge0:dhcp bridge=bridge0:ens3,ens6,ens7" \ + "root=nfs:192.168.50.1:/nfs/client ip=bridge0:dhcp bridge=bridge0:ens2,ens6,ens7" \ "bridge0" || return 1 return 0 } @@ -303,8 +309,8 @@ test_setup() { # Make client's dracut image $basedir/dracut.sh \ -l -i "$TESTDIR"/overlay / \ - -o "plymouth" \ - -a "debug" \ + -o "plymouth ${OMIT_NETWORK}" \ + -a "debug ${USE_NETWORK}" \ -d "af_packet piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files sunrpc i6300esb ib700wdt" \ --no-hostonly-cmdline -N \ -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 diff --git a/test/TEST-51-MULTINIC-NM/Makefile b/test/TEST-51-MULTINIC-NM/Makefile new file mode 100644 index 00000000..6c093fd5 --- /dev/null +++ b/test/TEST-51-MULTINIC-NM/Makefile @@ -0,0 +1,12 @@ +.PHONY: all setup clean run + +BASETEST=../TEST-50-MULTINIC + +all: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) all +setup: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) setup +clean: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) clean +run: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) run diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh index 8c33ff0f..26935557 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh @@ -12,8 +12,8 @@ echo "made it to the rootfs! Powering down." echo OK ip -o -4 address show scope global | while read n if rest; do echo $if;done | sort for i in /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-*; do - echo $i - grep -v 'UUID=' $i + echo $i + grep -v 'UUID=' $i done echo EOF ) > /dev/sda diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/server-init.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/server-init.sh index 69fad5dc..c3d5c989 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/server-init.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/server-init.sh @@ -53,38 +53,38 @@ linkup() { && wait_for_if_up $1 2>/dev/null } -wait_for_if_link eth0 ens3 -wait_for_if_link eth1 ens4 -wait_for_if_link eth2 ens5 -wait_for_if_link eth3 ens6 +wait_for_if_link eth0 ens2 +wait_for_if_link eth1 ens3 +wait_for_if_link eth2 ens4 +wait_for_if_link eth3 ens5 modprobe --all -b -q 8021q ipvlan macvlan >/dev/watchdog ip addr add 127.0.0.1/8 dev lo linkup lo -ip link set dev eth0 name ens3 -ip addr add 192.168.50.1/24 dev ens3 +ip link set dev eth0 name ens2 +ip addr add 192.168.50.1/24 dev ens2 +linkup ens2 +>/dev/watchdog +ip link set dev eth1 name ens3 +ip link add dev ens3.1 link ens3 type vlan id 1 +ip link add dev ens3.2 link ens3 type vlan id 2 +ip link add dev ens3.3 link ens3 type vlan id 3 +ip link add dev ens3.4 link ens3 type vlan id 4 +ip addr add 192.168.54.1/24 dev ens3.1 +ip addr add 192.168.55.1/24 dev ens3.2 +ip addr add 192.168.56.1/24 dev ens3.3 +ip addr add 192.168.57.1/24 dev ens3.4 linkup ens3 ->/dev/watchdog -ip link set dev eth1 name ens4 -ip link add dev ens4.1 link ens4 type vlan id 1 -ip link add dev ens4.2 link ens4 type vlan id 2 -ip link add dev ens4.3 link ens4 type vlan id 3 -ip link add dev ens4.4 link ens4 type vlan id 4 -ip addr add 192.168.54.1/24 dev ens4.1 -ip addr add 192.168.55.1/24 dev ens4.2 -ip addr add 192.168.56.1/24 dev ens4.3 -ip addr add 192.168.57.1/24 dev ens4.4 +ip link set dev ens3.1 up +ip link set dev ens3.2 up +ip link set dev ens3.3 up +ip link set dev ens3.4 up +ip link set dev eth2 name ens4 +ip addr add 192.168.51.1/24 dev ens4 linkup ens4 -ip link set dev ens4.1 up -ip link set dev ens4.2 up -ip link set dev ens4.3 up -ip link set dev ens4.4 up -ip link set dev eth2 name ens5 -ip addr add 192.168.51.1/24 dev ens5 +ip link set dev eth3 name ens5 linkup ens5 -ip link set dev eth3 name ens6 -linkup ens6 >/dev/watchdog modprobe af_packet > /dev/watchdog @@ -107,7 +107,7 @@ rpc.nfsd >/dev/watchdog rpc.mountd >/dev/watchdog -rpc.idmapd +rpc.idmapd -S >/dev/watchdog exportfs -r >/dev/watchdog @@ -115,10 +115,10 @@ exportfs -r >/dev/watchdog chmod 777 /var/lib/dhcpd/dhcpd.leases >/dev/watchdog -dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases ens3 ens5 +dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases ens2 ens4 #echo -n 'V' > /dev/watchdog #sh -i -#tcpdump -i ens3 +#tcpdump -i ens2 # Wait forever for the VM to die echo "Serving" while :; do diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh index 2afeb15d..859b279e 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh @@ -1,7 +1,18 @@ #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh -TEST_DESCRIPTION="root filesystem on NFS with bridging/bonding/vlan" + + +if [[ $NM ]]; then + USE_NETWORK="network-manager" + OMIT_NETWORK="network-legacy" +else + USE_NETWORK="network-legacy" + OMIT_NETWORK="network-manager" +fi + +TEST_DESCRIPTION="root filesystem on NFS with bridging/bonding/vlan with $USE_NETWORK" + KVERSION=${KVERSION-$(uname -r)} # Uncomment this to debug failures @@ -17,8 +28,6 @@ run_server() { $testdir/run-qemu \ -hda "$TESTDIR"/server.ext3 \ - -m 512M -smp 2 \ - -display none \ -netdev socket,id=n0,listen=127.0.0.1:12370 \ -netdev socket,id=n1,listen=127.0.0.1:12371 \ -netdev socket,id=n2,listen=127.0.0.1:12372 \ @@ -30,7 +39,6 @@ run_server() { ${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ -append "panic=1 loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 rd.debug" \ -initrd "$TESTDIR"/initramfs.server \ -pidfile "$TESTDIR"/server.pid -daemonize || return 1 @@ -75,37 +83,18 @@ client_test() { nic3=" -netdev hubport,id=n3,hubid=3" fi - if $testdir/run-qemu --help | grep -qF -m1 'netdev hubport,id=str,hubid=n[,netdev=nd]' && echo OK; then - $testdir/run-qemu \ - -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ - -netdev socket,connect=127.0.0.1:12370,id=s1 \ - -netdev hubport,hubid=1,id=h1,netdev=s1 \ - -netdev hubport,hubid=1,id=h2 -device e1000,mac=52:54:00:12:34:01,netdev=h2 \ - -netdev hubport,hubid=1,id=h3 -device e1000,mac=52:54:00:12:34:02,netdev=h3 \ - $nic1 -device e1000,mac=52:54:00:12:34:03,netdev=n1 \ - -netdev socket,connect=127.0.0.1:12372,id=n2 -device e1000,mac=52:54:00:12:34:04,netdev=n2 \ - $nic3 -device e1000,mac=52:54:00:12:34:05,netdev=n3 \ - -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ - -append "panic=1 $cmdline systemd.crash_reboot rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ - -initrd "$TESTDIR"/initramfs.testing - else - $testdir/run-qemu \ - -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ - -net socket,vlan=0,connect=127.0.0.1:12370 \ - ${do_vlan13:+-net socket,vlan=1,connect=127.0.0.1:12371} \ - -net socket,vlan=2,connect=127.0.0.1:12372 \ - ${do_vlan13:+-net socket,vlan=3,connect=127.0.0.1:12373} \ - -net nic,vlan=0,macaddr=52:54:00:12:34:01,model=e1000 \ - -net nic,vlan=0,macaddr=52:54:00:12:34:02,model=e1000 \ - -net nic,vlan=1,macaddr=52:54:00:12:34:03,model=e1000 \ - -net nic,vlan=2,macaddr=52:54:00:12:34:04,model=e1000 \ - -net nic,vlan=3,macaddr=52:54:00:12:34:05,model=e1000 \ - -watchdog i6300esb -watchdog-action poweroff \ - -no-reboot \ - -append "panic=1 $cmdline systemd.crash_reboot rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ - -initrd "$TESTDIR"/initramfs.testing - fi + $testdir/run-qemu \ + -hda "$TESTDIR"/client.img \ + -netdev socket,connect=127.0.0.1:12370,id=s1 \ + -netdev hubport,hubid=1,id=h1,netdev=s1 \ + -netdev hubport,hubid=1,id=h2 -device e1000,mac=52:54:00:12:34:01,netdev=h2 \ + -netdev hubport,hubid=1,id=h3 -device e1000,mac=52:54:00:12:34:02,netdev=h3 \ + $nic1 -device e1000,mac=52:54:00:12:34:03,netdev=n1 \ + -netdev socket,connect=127.0.0.1:12372,id=n2 -device e1000,mac=52:54:00:12:34:04,netdev=n2 \ + $nic3 -device e1000,mac=52:54:00:12:34:05,netdev=n3 \ + -watchdog i6300esb -watchdog-action poweroff \ + -append "panic=1 $cmdline systemd.crash_reboot rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ + -initrd "$TESTDIR"/initramfs.testing { read OK @@ -143,51 +132,12 @@ test_run() { } test_client() { - if $testdir/run-qemu --help | grep -qF -m1 'netdev hubport,id=str,hubid=n[,netdev=nd]'; then - client_test "Multiple VLAN" \ - "yes" \ - " -vlan=vlan0001:ens6 -vlan=vlan2:ens6 -vlan=ens6.3:ens6 -vlan=ens6.0004:ens6 -ip=ens4:dhcp -ip=192.168.54.101::192.168.54.1:24:test:vlan0001:none -ip=192.168.55.102::192.168.55.1:24:test:vlan2:none -ip=192.168.56.103::192.168.56.1:24:test:ens6.3:none -ip=192.168.57.104::192.168.57.1:24:test:ens6.0004:none -rd.neednet=1 -root=nfs:192.168.50.1:/nfs/client bootdev=ens4 -" \ - 'ens4 ens6.0004 ens6.3 vlan0001 vlan2 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" DEVICE="ens4" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Ethernet /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6.0004 # Generated by dracut initrd NAME="ens6.0004" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.57.104" PREFIX="24" GATEWAY="192.168.57.1" TYPE=Vlan DEVICE="ens6.0004" VLAN=yes PHYSDEV="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6.3 # Generated by dracut initrd NAME="ens6.3" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.56.103" PREFIX="24" GATEWAY="192.168.56.1" TYPE=Vlan DEVICE="ens6.3" VLAN=yes PHYSDEV="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan0001 # Generated by dracut initrd NAME="vlan0001" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.54.101" PREFIX="24" GATEWAY="192.168.54.1" TYPE=Vlan DEVICE="vlan0001" VLAN=yes PHYSDEV="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan2 # Generated by dracut initrd NAME="vlan2" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.55.102" PREFIX="24" GATEWAY="192.168.55.1" TYPE=Vlan DEVICE="vlan2" VLAN=yes PHYSDEV="ens6" EOF ' \ - || return 1 - - client_test "Multiple Bonds" \ - "yes" \ - " -bond=bond0:ens4,ens5 -bond=bond1:ens7,ens8 -ip=bond0:dhcp -ip=bond1:dhcp -rd.neednet=1 -root=nfs:192.168.50.1:/nfs/client bootdev=bond0 -" \ - 'bond0 bond1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond0 # Generated by dracut initrd NAME="bond0" DEVICE="bond0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond0" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond1 # Generated by dracut initrd NAME="bond1" DEVICE="bond1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond1" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5 # Generated by dracut initrd NAME="ens5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens7" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens8 # Generated by dracut initrd NAME="ens8" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens8" EOF ' \ - || return 1 - - client_test "Multiple Bridges" \ - "no" \ - " -bridge=br0:ens4,ens5 -bridge=br1:ens7,ens8 -ip=br0:dhcp -ip=br1:dhcp -rd.neednet=1 -root=nfs:192.168.50.1:/nfs/client bootdev=br0 -" \ - 'br0 br1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br0 # Generated by dracut initrd NAME="br0" DEVICE="br0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br0" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br1 # Generated by dracut initrd NAME="br1" DEVICE="br1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br1" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5 # Generated by dracut initrd NAME="ens5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens7" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens8 # Generated by dracut initrd NAME="ens8" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens8" EOF ' \ - || return 1 + if [[ $NM ]]; then + EXPECT='ens3 ens5.0004 ens5.3 vlan0001 vlan2 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-* EOF ' else + EXPECT='ens3 ens5.0004 ens5.3 vlan0001 vlan2 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens3 # Generated by dracut initrd NAME="ens3" DEVICE="ens3" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Ethernet /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5.0004 # Generated by dracut initrd NAME="ens5.0004" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.57.104" PREFIX="24" GATEWAY="192.168.57.1" TYPE=Vlan DEVICE="ens5.0004" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5.3 # Generated by dracut initrd NAME="ens5.3" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.56.103" PREFIX="24" GATEWAY="192.168.56.1" TYPE=Vlan DEVICE="ens5.3" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan0001 # Generated by dracut initrd NAME="vlan0001" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.54.101" PREFIX="24" GATEWAY="192.168.54.1" TYPE=Vlan DEVICE="vlan0001" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan2 # Generated by dracut initrd NAME="vlan2" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.55.102" PREFIX="24" GATEWAY="192.168.55.1" TYPE=Vlan DEVICE="vlan2" VLAN=yes PHYSDEV="ens5" EOF ' + fi + client_test "Multiple VLAN" \ "yes" \ " @@ -203,35 +153,46 @@ ip=192.168.57.104::192.168.57.1:24:test:ens5.0004:none rd.neednet=1 root=nfs:192.168.50.1:/nfs/client bootdev=ens3 " \ - 'ens3 ens5.0004 ens5.3 vlan0001 vlan2 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens3 # Generated by dracut initrd NAME="ens3" DEVICE="ens3" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Ethernet /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5.0004 # Generated by dracut initrd NAME="ens5.0004" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.57.104" PREFIX="24" GATEWAY="192.168.57.1" TYPE=Vlan DEVICE="ens5.0004" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5.3 # Generated by dracut initrd NAME="ens5.3" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.56.103" PREFIX="24" GATEWAY="192.168.56.1" TYPE=Vlan DEVICE="ens5.3" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan0001 # Generated by dracut initrd NAME="vlan0001" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.54.101" PREFIX="24" GATEWAY="192.168.54.1" TYPE=Vlan DEVICE="vlan0001" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan2 # Generated by dracut initrd NAME="vlan2" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.55.102" PREFIX="24" GATEWAY="192.168.55.1" TYPE=Vlan DEVICE="vlan2" VLAN=yes PHYSDEV="ens5" EOF ' \ + "$EXPECT" \ || return 1 + if [[ $NM ]]; then + EXPECT='bond0 bond1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-* EOF ' + else + EXPECT='bond0 bond1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond0 # Generated by dracut initrd NAME="bond0" DEVICE="bond0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond0" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond1 # Generated by dracut initrd NAME="bond1" DEVICE="bond1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond1" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens3 # Generated by dracut initrd NAME="ens3" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens3" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6 # Generated by dracut initrd NAME="ens6" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens7" EOF ' + fi + client_test "Multiple Bonds" \ "yes" \ " -bond=bond0:ens4,ens5 +bond=bond0:ens3,ens4 bond=bond1:ens6,ens7 ip=bond0:dhcp ip=bond1:dhcp rd.neednet=1 root=nfs:192.168.50.1:/nfs/client bootdev=bond0 " \ - 'bond0 bond1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond0 # Generated by dracut initrd NAME="bond0" DEVICE="bond0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond0" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond1 # Generated by dracut initrd NAME="bond1" DEVICE="bond1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond1" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5 # Generated by dracut initrd NAME="ens5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6 # Generated by dracut initrd NAME="ens6" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens7" EOF ' \ + "$EXPECT" \ || return 1 + if [[ $NM ]]; then + EXPECT='br0 br1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-* EOF ' + else + EXPECT='br0 br1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br0 # Generated by dracut initrd NAME="br0" DEVICE="br0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br0" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br1 # Generated by dracut initrd NAME="br1" DEVICE="br1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br1" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens3 # Generated by dracut initrd NAME="ens3" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens3" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6 # Generated by dracut initrd NAME="ens6" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens7" EOF ' + fi + client_test "Multiple Bridges" \ "no" \ " -bridge=br0:ens4,ens5 +bridge=br0:ens3,ens4 bridge=br1:ens6,ens7 ip=br0:dhcp ip=br1:dhcp rd.neednet=1 root=nfs:192.168.50.1:/nfs/client bootdev=br0 " \ - 'br0 br1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br0 # Generated by dracut initrd NAME="br0" DEVICE="br0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br0" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br1 # Generated by dracut initrd NAME="br1" DEVICE="br1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br1" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5 # Generated by dracut initrd NAME="ens5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6 # Generated by dracut initrd NAME="ens6" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens7" EOF ' \ + "$EXPECT" \ || return 1 - fi kill_server return 0 } @@ -369,8 +330,8 @@ test_setup() { # Make client's dracut image $basedir/dracut.sh -l -i "$TESTDIR"/overlay / \ --no-early-microcode \ - -o "plymouth" \ - -a "debug network-legacy" \ + -o "plymouth ${OMIT_NETWORK}" \ + -a "debug ${USE_NETWORK}" \ -d "ipvlan macvlan af_packet piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files sunrpc i6300esb ib700wdt" \ --no-hostonly-cmdline -N \ -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 diff --git a/test/TEST-61-BONDBRIDGEVLANIFCFG-NM/Makefile b/test/TEST-61-BONDBRIDGEVLANIFCFG-NM/Makefile new file mode 100644 index 00000000..f94ba3c5 --- /dev/null +++ b/test/TEST-61-BONDBRIDGEVLANIFCFG-NM/Makefile @@ -0,0 +1,12 @@ +.PHONY: all setup clean run + +BASETEST=../TEST-60-BONDBRIDGEVLANIFCFG + +all: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) all +setup: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) setup +clean: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) clean +run: + @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) run diff --git a/test/run-qemu b/test/run-qemu index ddf31490..4cde33aa 100755 --- a/test/run-qemu +++ b/test/run-qemu @@ -3,12 +3,12 @@ # We prefer kvm, kqemu, userspace in that order. export PATH=/sbin:/bin:/usr/sbin:/usr/bin -[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS="" +[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS="-cpu max" $(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu -cpu host" [[ -c /dev/kvm && -x /usr/bin/kvm ]] && BIN=/usr/bin/kvm && ARGS="-cpu host" [[ -c /dev/kvm && -x /usr/bin/qemu-kvm ]] && BIN=/usr/bin/qemu-kvm && ARGS="-cpu host" [[ -c /dev/kvm && -x /usr/libexec/qemu-kvm ]] && BIN=/usr/libexec/qemu-kvm && ARGS="-cpu host" -[[ -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS="" +[[ -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS="-cpu max" [[ -c /dev/kvm && -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS="-enable-kvm -cpu host" [[ $BIN ]] || { @@ -17,8 +17,12 @@ $(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu -cpu ho exit 1 } -# Provide rng device sourcing the hosts /dev/urandom -ARGS="$ARGS -device virtio-rng-pci" +# Provide rng device sourcing the hosts /dev/urandom and other standard parameters +ARGS="$ARGS -smp 2 -m 512 -nodefaults -vga none -display none -no-reboot -device virtio-rng-pci" + +if ! [[ $* = *-daemonize* ]] && ! [[ $* = *-daemonize* ]]; then + ARGS="$ARGS -serial stdio" +fi KVERSION=${KVERSION-$(uname -r)} From 74ba8f9e1d9a588db3c0482526cb980573c17b6c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 28 Feb 2020 11:59:51 +0100 Subject: [PATCH 31/50] .travis.yml: add note about test container --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 46447c60..e9f62a98 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,6 +43,7 @@ before_script: git describe --tags || : script: + ## The test container is created with https://github.com/dracutdevs/fedora-container - docker run --privileged -it -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS" notifications: From 3703ec867260a67e519558246f13f1a96f49a8bb Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 28 Feb 2020 12:51:16 +0100 Subject: [PATCH 32/50] Disable NetworkManager tests for Fedora 30 --- .github/workflows/fedora-30.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/fedora-30.yml b/.github/workflows/fedora-30.yml index 91f2e00b..edfc0735 100644 --- a/.github/workflows/fedora-30.yml +++ b/.github/workflows/fedora-30.yml @@ -31,15 +31,10 @@ jobs: "17", "20", "30", - "31", "35", - "36", "40", - "41", "50", - "51", "60", - "61" ] fail-fast: false steps: From 55a974bae699367f56fd78e4f90070da278d5013 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 28 Feb 2020 12:52:03 +0100 Subject: [PATCH 33/50] fedora-test.sh / fedora-test-github.sh: don't build the documentation don't build the documentation, if running a test --- fedora-test-github.sh | 3 ++- fedora-test.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fedora-test-github.sh b/fedora-test-github.sh index 01312e2c..6d5e7e37 100755 --- a/fedora-test-github.sh +++ b/fedora-test-github.sh @@ -14,11 +14,12 @@ NCPU=$(getconf _NPROCESSORS_ONLN) if ! [[ $TESTS ]]; then make -j$NCPU all syncheck rpm logtee else - make -j$NCPU all logtee + make -j$NCPU enable_documentation=no all logtee cd test time LOGTEE_TIMEOUT_MS=590000 make \ + enable_documentation=no \ KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \ DRACUT_NO_XATTR=1 \ TEST_RUN_ID=$RUN_ID \ diff --git a/fedora-test.sh b/fedora-test.sh index 096ed6c4..ea3d6770 100755 --- a/fedora-test.sh +++ b/fedora-test.sh @@ -14,11 +14,12 @@ NCPU=$(getconf _NPROCESSORS_ONLN) if ! [[ $TESTS ]]; then make -j$NCPU all syncheck rpm logtee else - make -j$NCPU all logtee + make -j$NCPU enable_documentation=no all logtee cd test time sudo LOGTEE_TIMEOUT_MS=590000 make \ + enable_documentation=no \ KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \ DRACUT_NO_XATTR=1 \ TEST_RUN_ID=$RUN_ID \ From 69341c95726561b8ee6ac0c6d0eb5d37536a4a21 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 28 Feb 2020 13:12:25 +0100 Subject: [PATCH 34/50] fedora-test.sh: set logtee timeout to 5 minutes --- fedora-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora-test.sh b/fedora-test.sh index ea3d6770..753f10e3 100755 --- a/fedora-test.sh +++ b/fedora-test.sh @@ -18,7 +18,7 @@ else cd test - time sudo LOGTEE_TIMEOUT_MS=590000 make \ + time sudo LOGTEE_TIMEOUT_MS=300000 make \ enable_documentation=no \ KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \ DRACUT_NO_XATTR=1 \ From 9ca53063ee3530280f9a656020d3beada2905342 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 28 Feb 2020 13:39:05 +0100 Subject: [PATCH 35/50] test: use dd to write status to marker disk --- test/TEST-01-BASIC/create-root.sh | 2 +- test/TEST-01-BASIC/test-init.sh | 2 +- test/TEST-01-BASIC/test.sh | 6 +++--- test/TEST-02-SYSTEMD/create-root.sh | 2 +- test/TEST-02-SYSTEMD/test-init.sh | 2 +- test/TEST-02-SYSTEMD/test.sh | 6 +++--- test/TEST-03-USR-MOUNT/create-root.sh | 2 +- test/TEST-03-USR-MOUNT/test-init.sh | 2 +- test/TEST-03-USR-MOUNT/test.sh | 6 +++--- test/TEST-04-FULL-SYSTEMD/create-root.sh | 2 +- test/TEST-04-FULL-SYSTEMD/test-init.sh | 2 +- test/TEST-04-FULL-SYSTEMD/test.sh | 6 +++--- test/TEST-10-RAID/create-root.sh | 2 +- test/TEST-10-RAID/test-init.sh | 2 +- test/TEST-10-RAID/test.sh | 6 +++--- test/TEST-11-LVM/create-root.sh | 2 +- test/TEST-11-LVM/test-init.sh | 2 +- test/TEST-11-LVM/test.sh | 6 +++--- test/TEST-12-RAID-DEG/create-root.sh | 2 +- test/TEST-12-RAID-DEG/test-init.sh | 2 +- test/TEST-12-RAID-DEG/test.sh | 4 ++-- test/TEST-13-ENC-RAID-LVM/create-root.sh | 2 +- test/TEST-13-ENC-RAID-LVM/test-init.sh | 2 +- test/TEST-13-ENC-RAID-LVM/test.sh | 6 +++--- test/TEST-14-IMSM/create-root.sh | 2 +- test/TEST-14-IMSM/test-init.sh | 2 +- test/TEST-14-IMSM/test.sh | 4 ++-- test/TEST-15-BTRFSRAID/create-root.sh | 2 +- test/TEST-15-BTRFSRAID/test-init.sh | 2 +- test/TEST-15-BTRFSRAID/test.sh | 4 ++-- test/TEST-16-DMSQUASH/test-init.sh | 2 +- test/TEST-16-DMSQUASH/test.sh | 2 +- test/TEST-17-LVM-THIN/create-root.sh | 2 +- test/TEST-17-LVM-THIN/test-init.sh | 2 +- test/TEST-17-LVM-THIN/test.sh | 4 ++-- test/TEST-20-NFS/client-init.sh | 2 +- test/TEST-20-NFS/test.sh | 2 +- test/TEST-30-ISCSI/client-init.sh | 2 +- test/TEST-30-ISCSI/create-root.sh | 2 +- test/TEST-30-ISCSI/test.sh | 4 ++-- test/TEST-35-ISCSI-MULTI/client-init.sh | 2 +- test/TEST-35-ISCSI-MULTI/create-root.sh | 2 +- test/TEST-35-ISCSI-MULTI/test.sh | 4 ++-- test/TEST-40-NBD/client-init.sh | 2 +- test/TEST-40-NBD/create-root.sh | 2 +- test/TEST-40-NBD/test.sh | 8 ++++---- test/TEST-50-MULTINIC/client-init.sh | 2 +- test/TEST-50-MULTINIC/test.sh | 2 +- test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh | 2 +- test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh | 2 +- 50 files changed, 73 insertions(+), 73 deletions(-) diff --git a/test/TEST-01-BASIC/create-root.sh b/test/TEST-01-BASIC/create-root.sh index 8b28c309..97071fa3 100755 --- a/test/TEST-01-BASIC/create-root.sh +++ b/test/TEST-01-BASIC/create-root.sh @@ -19,7 +19,7 @@ mount /dev/sda2 /root cp -a -t /root /source/* mkdir -p /root/run umount /root -echo "dracut-root-block-created" >/dev/sda1 +echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 sync poweroff -f diff --git a/test/TEST-01-BASIC/test-init.sh b/test/TEST-01-BASIC/test-init.sh index 78f124a5..07fd0ed4 100755 --- a/test/TEST-01-BASIC/test-init.sh +++ b/test/TEST-01-BASIC/test-init.sh @@ -100,7 +100,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; } CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) plymouth --quit exec >/dev/console 2>&1 -echo "dracut-root-block-success" >/dev/sdb +echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sdb export TERM=linux export PS1='initramfs-test:\w\$ ' [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index 37f77c36..c47098ea 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -38,7 +38,7 @@ test_setup() { ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ mount dmesg dhclient mkdir cp ping dhclient \ - umount strace less setsid + umount strace less setsid dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -57,7 +57,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mkfs.ext3 poweroff cp umount sync + inst_multiple sfdisk mkfs.ext3 poweroff cp umount sync dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules @@ -85,7 +85,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple poweroff shutdown + inst_multiple poweroff shutdown dd inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/test/TEST-02-SYSTEMD/create-root.sh b/test/TEST-02-SYSTEMD/create-root.sh index 0e60e742..457a74bb 100755 --- a/test/TEST-02-SYSTEMD/create-root.sh +++ b/test/TEST-02-SYSTEMD/create-root.sh @@ -19,6 +19,6 @@ mount /dev/sda2 /root cp -a -t /root /source/* mkdir -p /root/run umount /root -echo "dracut-root-block-created" >/dev/sda1 +echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 poweroff -f diff --git a/test/TEST-02-SYSTEMD/test-init.sh b/test/TEST-02-SYSTEMD/test-init.sh index 63fd58f7..66bd1c3a 100755 --- a/test/TEST-02-SYSTEMD/test-init.sh +++ b/test/TEST-02-SYSTEMD/test-init.sh @@ -102,7 +102,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; } plymouth --quit exec /dev/console 2>&1 -echo "dracut-root-block-success" >/dev/sda1 +echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sda1 export TERM=linux export PS1='initramfs-test:\w\$ ' [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh index a08bfe5c..cf1fcaa5 100755 --- a/test/TEST-02-SYSTEMD/test.sh +++ b/test/TEST-02-SYSTEMD/test.sh @@ -35,7 +35,7 @@ test_setup() { ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ mount dmesg dhclient mkdir cp ping dhclient \ - umount strace less setsid systemd-analyze + umount strace less setsid systemd-analyze dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -54,7 +54,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mkfs.ext3 poweroff cp umount + inst_multiple sfdisk mkfs.ext3 poweroff cp umount dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules @@ -82,7 +82,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple poweroff shutdown + inst_multiple poweroff shutdown dd inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook pre-pivot 000 ./systemd-analyze.sh inst_hook emergency 000 ./hard-off.sh diff --git a/test/TEST-03-USR-MOUNT/create-root.sh b/test/TEST-03-USR-MOUNT/create-root.sh index 478d5ef4..238fad06 100755 --- a/test/TEST-03-USR-MOUNT/create-root.sh +++ b/test/TEST-03-USR-MOUNT/create-root.sh @@ -37,7 +37,7 @@ btrfs filesystem sync /root/usr btrfs filesystem sync /root umount /root/usr umount /root -echo "dracut-root-block-created" >/dev/sda1 +echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 udevadm settle sync poweroff -f diff --git a/test/TEST-03-USR-MOUNT/test-init.sh b/test/TEST-03-USR-MOUNT/test-init.sh index dc03359a..d49372f6 100755 --- a/test/TEST-03-USR-MOUNT/test-init.sh +++ b/test/TEST-03-USR-MOUNT/test-init.sh @@ -109,7 +109,7 @@ ismounted() { } if ismounted /usr; then - echo "dracut-root-block-success" >/dev/sdc + echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sdc fi export TERM=linux export PS1='initramfs-test:\w\$ ' diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh index 5943c5c6..cdf71838 100755 --- a/test/TEST-03-USR-MOUNT/test.sh +++ b/test/TEST-03-USR-MOUNT/test.sh @@ -65,7 +65,7 @@ test_setup() { ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ mount dmesg dhclient mkdir cp ping dhclient \ - umount strace less setsid + umount strace less setsid dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -85,7 +85,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mkfs.btrfs btrfs poweroff cp umount sync + inst_multiple sfdisk mkfs.btrfs btrfs poweroff cp umount sync dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules @@ -122,7 +122,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple poweroff shutdown + inst_multiple poweroff shutdown dd inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/test/TEST-04-FULL-SYSTEMD/create-root.sh b/test/TEST-04-FULL-SYSTEMD/create-root.sh index a9f5ac52..d89c6494 100755 --- a/test/TEST-04-FULL-SYSTEMD/create-root.sh +++ b/test/TEST-04-FULL-SYSTEMD/create-root.sh @@ -38,7 +38,7 @@ btrfs filesystem sync /root/usr btrfs filesystem sync /root umount /root/usr umount /root -echo "dracut-root-block-created" >/dev/sda1 +echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 sync poweroff -f diff --git a/test/TEST-04-FULL-SYSTEMD/test-init.sh b/test/TEST-04-FULL-SYSTEMD/test-init.sh index e40f5e6f..687522b9 100755 --- a/test/TEST-04-FULL-SYSTEMD/test-init.sh +++ b/test/TEST-04-FULL-SYSTEMD/test-init.sh @@ -111,7 +111,7 @@ ismounted() { systemctl --failed --no-legend --no-pager > /failed if ismounted /usr && [ ! -s /failed ]; then - echo "dracut-root-block-success" >/dev/sdc + echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sdc fi if ! ismounted /usr; then diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index 4114070a..a7b99600 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -69,7 +69,7 @@ test_setup() { ln -sfn /run/lock "$initdir/var/lock" inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg mkdir cp ping \ + mount dmesg mkdir cp ping dd \ umount strace less setsid tree systemctl reset for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do @@ -227,7 +227,7 @@ EOF ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mkfs.btrfs btrfs poweroff cp umount sync + inst_multiple sfdisk mkfs.btrfs btrfs poweroff cp umount sync dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules @@ -260,7 +260,7 @@ EOF ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple poweroff shutdown + inst_multiple poweroff shutdown dd inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/test/TEST-10-RAID/create-root.sh b/test/TEST-10-RAID/create-root.sh index af4cac0d..e7bb3ef9 100755 --- a/test/TEST-10-RAID/create-root.sh +++ b/test/TEST-10-RAID/create-root.sh @@ -36,5 +36,5 @@ udevadm settle cryptsetup luksClose /dev/mapper/dracut_crypt_test udevadm settle eval $(udevadm info --query=env --name=/dev/md0|while read line || [ -n "$line" ]; do [ "$line" != "${line#*ID_FS_UUID*}" ] && echo $line; done;) -{ echo "dracut-root-block-created"; echo "ID_FS_UUID=$ID_FS_UUID"; } >/dev/sda1 +{ echo "dracut-root-block-created"; echo "ID_FS_UUID=$ID_FS_UUID"; } | dd oflag=direct,dsync of=/dev/sda1 poweroff -f diff --git a/test/TEST-10-RAID/test-init.sh b/test/TEST-10-RAID/test-init.sh index 5ca9de15..1d9c9a88 100755 --- a/test/TEST-10-RAID/test-init.sh +++ b/test/TEST-10-RAID/test-init.sh @@ -99,7 +99,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; } CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) command -v plymouth >/dev/null && plymouth --quit exec >/dev/console 2>&1 -echo "dracut-root-block-success" >/dev/sda1 +echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sda1 export TERM=linux export PS1='initramfs-test:\w\$ ' [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh index fd92606b..981c1b9d 100755 --- a/test/TEST-10-RAID/test.sh +++ b/test/TEST-10-RAID/test.sh @@ -35,7 +35,7 @@ test_setup() { done ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient + mount dmesg dhclient mkdir cp ping dhclient dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -55,7 +55,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount + inst_multiple sfdisk mke2fs poweroff cp umount dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules @@ -82,7 +82,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple poweroff shutdown + inst_multiple poweroff shutdown dd inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh inst ./cryptroot-ask.sh /sbin/cryptroot-ask diff --git a/test/TEST-11-LVM/create-root.sh b/test/TEST-11-LVM/create-root.sh index 5d7443fd..7fbef295 100755 --- a/test/TEST-11-LVM/create-root.sh +++ b/test/TEST-11-LVM/create-root.sh @@ -27,5 +27,5 @@ umount /sysroot && \ sleep 1 && \ lvm lvchange -a n /dev/dracut/root && \ sleep 1 && \ -echo "dracut-root-block-created" >/dev/sda1 +echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 poweroff -f diff --git a/test/TEST-11-LVM/test-init.sh b/test/TEST-11-LVM/test-init.sh index 00d9da77..975bfece 100755 --- a/test/TEST-11-LVM/test-init.sh +++ b/test/TEST-11-LVM/test-init.sh @@ -99,7 +99,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; } CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) plymouth --quit exec >/dev/console 2>&1 -echo "dracut-root-block-success" >/dev/sda1 +echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sda1 export TERM=linux export PS1='initramfs-test:\w\$ ' [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh index 95463e4b..c718ad57 100755 --- a/test/TEST-11-LVM/test.sh +++ b/test/TEST-11-LVM/test.sh @@ -33,7 +33,7 @@ test_setup() { mkdir -p -- var/lib/nfs/rpc_pipefs ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient + mount dmesg dhclient mkdir cp ping dhclient dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -53,7 +53,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount + inst_multiple sfdisk mke2fs poweroff cp umount dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules @@ -76,7 +76,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple poweroff shutdown + inst_multiple poweroff shutdown dd inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/test/TEST-12-RAID-DEG/create-root.sh b/test/TEST-12-RAID-DEG/create-root.sh index df4f619d..31be41d1 100755 --- a/test/TEST-12-RAID-DEG/create-root.sh +++ b/test/TEST-12-RAID-DEG/create-root.sh @@ -45,4 +45,4 @@ mdadm -W /dev/md0 || : mdadm --detail --export /dev/md0 |grep -F MD_UUID > /tmp/mduuid . /tmp/mduuid eval $(udevadm info --query=env --name=/dev/md0|while read line || [ -n "$line" ]; do [ "$line" != "${line#*ID_FS_UUID*}" ] && echo $line; done;) -{ echo "dracut-root-block-created"; echo MD_UUID=$MD_UUID; echo "ID_FS_UUID=$ID_FS_UUID";} > /dev/sda1 +{ echo "dracut-root-block-created"; echo MD_UUID=$MD_UUID; echo "ID_FS_UUID=$ID_FS_UUID";} | dd oflag=direct,dsync of=/dev/sda1 diff --git a/test/TEST-12-RAID-DEG/test-init.sh b/test/TEST-12-RAID-DEG/test-init.sh index 5ca9de15..1d9c9a88 100755 --- a/test/TEST-12-RAID-DEG/test-init.sh +++ b/test/TEST-12-RAID-DEG/test-init.sh @@ -99,7 +99,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; } CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) command -v plymouth >/dev/null && plymouth --quit exec >/dev/console 2>&1 -echo "dracut-root-block-success" >/dev/sda1 +echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sda1 export TERM=linux export PS1='initramfs-test:\w\$ ' [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh index d6b29dde..2f3d72a8 100755 --- a/test/TEST-12-RAID-DEG/test.sh +++ b/test/TEST-12-RAID-DEG/test.sh @@ -75,7 +75,7 @@ test_setup() { done ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient + mount dmesg dhclient mkdir cp ping dhclient dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -126,7 +126,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple poweroff shutdown + inst_multiple poweroff shutdown dd inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/test/TEST-13-ENC-RAID-LVM/create-root.sh b/test/TEST-13-ENC-RAID-LVM/create-root.sh index 13e65838..437f0fb2 100755 --- a/test/TEST-13-ENC-RAID-LVM/create-root.sh +++ b/test/TEST-13-ENC-RAID-LVM/create-root.sh @@ -51,5 +51,5 @@ cryptsetup luksClose /dev/mapper/dracut_sda4 && \ for i in /dev/sda[234]; do udevadm info --query=env --name=$i|grep -F 'ID_FS_UUID=' done -} >/dev/sda1 +} | dd oflag=direct,dsync of=/dev/sda1 poweroff -f diff --git a/test/TEST-13-ENC-RAID-LVM/test-init.sh b/test/TEST-13-ENC-RAID-LVM/test-init.sh index 6b86561f..07d245a7 100755 --- a/test/TEST-13-ENC-RAID-LVM/test-init.sh +++ b/test/TEST-13-ENC-RAID-LVM/test-init.sh @@ -1,7 +1,7 @@ #!/bin/sh export PATH=/sbin:/bin:/usr/sbin:/usr/bin exec >/dev/console 2>&1 -echo "dracut-root-block-success" >/dev/sdb +echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sdb export TERM=linux export PS1='initramfs-test:\w\$ ' [ -f /etc/fstab ] || ln -s /proc/mounts /etc/fstab diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh index 1f311be5..580ade85 100755 --- a/test/TEST-13-ENC-RAID-LVM/test.sh +++ b/test/TEST-13-ENC-RAID-LVM/test.sh @@ -67,7 +67,7 @@ test_setup() { mkdir -p -- var/lib/nfs/rpc_pipefs ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient + mount dmesg dhclient mkdir cp ping dhclient dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -86,7 +86,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount grep + inst_multiple sfdisk mke2fs poweroff cp umount grep dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules @@ -116,7 +116,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple poweroff shutdown + inst_multiple poweroff shutdown dd inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/test/TEST-14-IMSM/create-root.sh b/test/TEST-14-IMSM/create-root.sh index 0d10945b..9b6517fb 100755 --- a/test/TEST-14-IMSM/create-root.sh +++ b/test/TEST-14-IMSM/create-root.sh @@ -73,5 +73,5 @@ udevadm settle mdadm --detail --export /dev/md0 |grep -F MD_UUID > /tmp/mduuid . /tmp/mduuid echo "MD_UUID=$MD_UUID" -{ echo "dracut-root-block-created"; echo MD_UUID=$MD_UUID;} > /dev/sda +{ echo "dracut-root-block-created"; echo MD_UUID=$MD_UUID;} | dd oflag=direct,dsync of=/dev/sda mdadm --wait-clean /dev/md0 diff --git a/test/TEST-14-IMSM/test-init.sh b/test/TEST-14-IMSM/test-init.sh index 01cbe961..d82657ad 100755 --- a/test/TEST-14-IMSM/test-init.sh +++ b/test/TEST-14-IMSM/test-init.sh @@ -99,7 +99,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; } CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) plymouth --quit exec >/dev/console 2>&1 -echo "dracut-root-block-success" >/dev/sda +echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sda export TERM=linux export PS1='initramfs-test:\w\$ ' cat /proc/mdstat diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh index 75ea587f..51c26e81 100755 --- a/test/TEST-14-IMSM/test.sh +++ b/test/TEST-14-IMSM/test.sh @@ -67,7 +67,7 @@ test_setup() { done ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient + mount dmesg dhclient mkdir cp ping dhclient dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -87,7 +87,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount grep + inst_multiple sfdisk mke2fs poweroff cp umount grep dd inst_hook initqueue 01 ./create-root.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) diff --git a/test/TEST-15-BTRFSRAID/create-root.sh b/test/TEST-15-BTRFSRAID/create-root.sh index e95e57da..4d0bf2eb 100755 --- a/test/TEST-15-BTRFSRAID/create-root.sh +++ b/test/TEST-15-BTRFSRAID/create-root.sh @@ -23,5 +23,5 @@ mkdir -p /sysroot mount -t btrfs /dev/sda5 /sysroot cp -a -t /sysroot /source/* umount /sysroot -echo "dracut-root-block-created" >/dev/sda1 +echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 poweroff -f diff --git a/test/TEST-15-BTRFSRAID/test-init.sh b/test/TEST-15-BTRFSRAID/test-init.sh index ed66a2b3..56328727 100755 --- a/test/TEST-15-BTRFSRAID/test-init.sh +++ b/test/TEST-15-BTRFSRAID/test-init.sh @@ -1,7 +1,7 @@ #!/bin/sh export PATH=/sbin:/bin:/usr/sbin:/usr/bin exec >/dev/console 2>&1 -echo "dracut-root-block-success" >/dev/sda +echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sda sync export TERM=linux export PS1='initramfs-test:\w\$ ' diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh index 873b779a..435e52be 100755 --- a/test/TEST-15-BTRFSRAID/test.sh +++ b/test/TEST-15-BTRFSRAID/test.sh @@ -38,7 +38,7 @@ test_setup() { mkdir -p -- var/lib/nfs/rpc_pipefs ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient sync + mount dmesg dhclient mkdir cp ping dhclient sync dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -57,7 +57,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mkfs.btrfs poweroff cp umount + inst_multiple sfdisk mkfs.btrfs poweroff cp umount dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/test/TEST-16-DMSQUASH/test-init.sh b/test/TEST-16-DMSQUASH/test-init.sh index 3a93c802..4a9c814b 100755 --- a/test/TEST-16-DMSQUASH/test-init.sh +++ b/test/TEST-16-DMSQUASH/test-init.sh @@ -99,7 +99,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; } CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) plymouth --quit exec >/dev/console 2>&1 -echo "dracut-root-block-success" >/dev/sdb +echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sdb export TERM=linux export PS1='initramfs-test:\w\$ ' [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh index 37a963e2..def97e27 100755 --- a/test/TEST-16-DMSQUASH/test.sh +++ b/test/TEST-16-DMSQUASH/test.sh @@ -73,7 +73,7 @@ test_setup() { ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ mount dmesg dhclient mkdir cp ping dhclient \ - umount strace less + umount strace less dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [[ -f ${_terminfodir}/l/linux ]] && break done diff --git a/test/TEST-17-LVM-THIN/create-root.sh b/test/TEST-17-LVM-THIN/create-root.sh index 6e09012e..01f0a119 100755 --- a/test/TEST-17-LVM-THIN/create-root.sh +++ b/test/TEST-17-LVM-THIN/create-root.sh @@ -29,5 +29,5 @@ sleep 1 && \ lvm lvchange -a n /dev/dracut/root && \ sleep 1 dmsetup status |grep out_of_data_space || \ - echo "dracut-root-block-created" >/dev/sda1 + echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 poweroff -f diff --git a/test/TEST-17-LVM-THIN/test-init.sh b/test/TEST-17-LVM-THIN/test-init.sh index cb9d921d..ef867ab9 100755 --- a/test/TEST-17-LVM-THIN/test-init.sh +++ b/test/TEST-17-LVM-THIN/test-init.sh @@ -99,7 +99,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; } CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) plymouth --quit exec >/dev/console 2>&1 -echo "dracut-root-block-success" >/dev/sda1 +echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sda1 export TERM=linux export PS1='initramfs-test:\w\$ ' [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh index fb7b817c..e4755f78 100755 --- a/test/TEST-17-LVM-THIN/test.sh +++ b/test/TEST-17-LVM-THIN/test.sh @@ -33,7 +33,7 @@ test_setup() { mkdir -p -- var/lib/nfs/rpc_pipefs ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg dhclient mkdir cp ping dhclient + mount dmesg dhclient mkdir cp ping dhclient dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -53,7 +53,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount grep dmsetup + inst_multiple sfdisk mke2fs poweroff cp umount grep dmsetup dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/test/TEST-20-NFS/client-init.sh b/test/TEST-20-NFS/client-init.sh index 55762d1e..127555a9 100755 --- a/test/TEST-20-NFS/client-init.sh +++ b/test/TEST-20-NFS/client-init.sh @@ -112,7 +112,7 @@ echo "made it to the rootfs! Powering down." while read dev fs fstype opts rest || [ -n "$dev" ]; do [ "$fstype" != "nfs" -a "$fstype" != "nfs4" ] && continue - echo "nfs-OK $dev $fstype $opts" > /dev/sda + echo "nfs-OK $dev $fstype $opts" | dd oflag=direct,dsync of=/dev/sda break done < /proc/mounts >/dev/watchdog diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 27c90d5e..9d5493c7 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -305,7 +305,7 @@ test_setup() { export initdir=$TESTDIR/mnt/nfs/client . $basedir/dracut-init.sh - inst_multiple sh shutdown poweroff stty cat ps ln ip \ + inst_multiple sh shutdown poweroff stty cat ps ln ip dd \ mount dmesg mkdir cp ping grep setsid ls vi /etc/virc less cat for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break diff --git a/test/TEST-30-ISCSI/client-init.sh b/test/TEST-30-ISCSI/client-init.sh index 7a5b7546..a659f148 100755 --- a/test/TEST-30-ISCSI/client-init.sh +++ b/test/TEST-30-ISCSI/client-init.sh @@ -104,7 +104,7 @@ stty sane echo "made it to the rootfs! Powering down." while read dev fs fstype opts rest || [ -n "$dev" ]; do [ "$fstype" != "ext3" ] && continue - echo "iscsi-OK $dev $fstype $opts" > /dev/sda + echo "iscsi-OK $dev $fstype $opts" | dd oflag=direct,dsync of=/dev/sda break done < /proc/mounts #sh -i diff --git a/test/TEST-30-ISCSI/create-root.sh b/test/TEST-30-ISCSI/create-root.sh index 5f4b32a2..d44c3576 100755 --- a/test/TEST-30-ISCSI/create-root.sh +++ b/test/TEST-30-ISCSI/create-root.sh @@ -21,5 +21,5 @@ mount /dev/dracut/root /sysroot && \ cp -a -t /sysroot /source/* && \ umount /sysroot && \ lvm lvchange -a n /dev/dracut/root && \ -echo "dracut-root-block-created" >/dev/sdb +echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sdb poweroff -f diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index 8c7e9452..a8aee221 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -149,7 +149,7 @@ test_setup() { mkdir -p -- var/lib/nfs/rpc_pipefs ) inst_multiple sh shutdown poweroff stty cat ps ln ip \ - mount dmesg mkdir cp ping grep setsid + mount dmesg mkdir cp ping grep setsid dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -164,7 +164,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mkfs.ext3 poweroff cp umount setsid + inst_multiple sfdisk mkfs.ext3 poweroff cp umount setsid dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/test/TEST-35-ISCSI-MULTI/client-init.sh b/test/TEST-35-ISCSI-MULTI/client-init.sh index 7a5b7546..a659f148 100755 --- a/test/TEST-35-ISCSI-MULTI/client-init.sh +++ b/test/TEST-35-ISCSI-MULTI/client-init.sh @@ -104,7 +104,7 @@ stty sane echo "made it to the rootfs! Powering down." while read dev fs fstype opts rest || [ -n "$dev" ]; do [ "$fstype" != "ext3" ] && continue - echo "iscsi-OK $dev $fstype $opts" > /dev/sda + echo "iscsi-OK $dev $fstype $opts" | dd oflag=direct,dsync of=/dev/sda break done < /proc/mounts #sh -i diff --git a/test/TEST-35-ISCSI-MULTI/create-root.sh b/test/TEST-35-ISCSI-MULTI/create-root.sh index 5f4b32a2..d44c3576 100755 --- a/test/TEST-35-ISCSI-MULTI/create-root.sh +++ b/test/TEST-35-ISCSI-MULTI/create-root.sh @@ -21,5 +21,5 @@ mount /dev/dracut/root /sysroot && \ cp -a -t /sysroot /source/* && \ umount /sysroot && \ lvm lvchange -a n /dev/dracut/root && \ -echo "dracut-root-block-created" >/dev/sdb +echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sdb poweroff -f diff --git a/test/TEST-35-ISCSI-MULTI/test.sh b/test/TEST-35-ISCSI-MULTI/test.sh index 0c40e55c..e96c9c56 100755 --- a/test/TEST-35-ISCSI-MULTI/test.sh +++ b/test/TEST-35-ISCSI-MULTI/test.sh @@ -164,7 +164,7 @@ test_setup() { mkdir -p -- var/lib/nfs/rpc_pipefs ) inst_multiple sh shutdown poweroff stty cat ps ln ip \ - mount dmesg mkdir cp ping grep setsid + mount dmesg mkdir cp ping grep setsid dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -179,7 +179,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mkfs.ext3 poweroff cp umount setsid + inst_multiple sfdisk mkfs.ext3 poweroff cp umount setsid dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/test/TEST-40-NBD/client-init.sh b/test/TEST-40-NBD/client-init.sh index 2b42e21b..6292501a 100755 --- a/test/TEST-40-NBD/client-init.sh +++ b/test/TEST-40-NBD/client-init.sh @@ -5,7 +5,7 @@ exec >/dev/console 2>&1 while read dev fs fstype opts rest || [ -n "$dev" ]; do [ "$dev" = "rootfs" ] && continue [ "$fs" != "/" ] && continue - echo "nbd-OK $fstype $opts" >/dev/sda + echo "nbd-OK $fstype $opts" | dd oflag=direct,dsync of=/dev/sda echo "nbd-OK $fstype $opts" break done < /proc/mounts diff --git a/test/TEST-40-NBD/create-root.sh b/test/TEST-40-NBD/create-root.sh index 20d0effd..c57bf7f4 100755 --- a/test/TEST-40-NBD/create-root.sh +++ b/test/TEST-40-NBD/create-root.sh @@ -26,5 +26,5 @@ cryptsetup luksClose /dev/mapper/dracut_crypt_test udevadm settle sleep 1 eval $(udevadm info --query=env --name=/dev/sdb|while read line || [ -n "$line" ]; do [ "$line" != "${line#*ID_FS_UUID*}" ] && echo $line; done;) -{ echo "dracut-root-block-created"; echo "ID_FS_UUID=$ID_FS_UUID"; } >/dev/sda +{ echo "dracut-root-block-created"; echo "ID_FS_UUID=$ID_FS_UUID"; } | dd oflag=direct,dsync of=/dev/sda poweroff -f diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 75820cbb..f06c36c3 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -227,7 +227,7 @@ make_encrypted_root() { ln -s ../run var/run ) inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \ - mount dmesg mkdir cp ping + mount dmesg mkdir cp ping dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -251,7 +251,7 @@ make_encrypted_root() { done ln -s ../run var/run ) - inst_multiple mke2fs poweroff cp umount tune2fs + inst_multiple mke2fs poweroff cp umount tune2fs dd inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh inst_hook initqueue 01 ./create-root.sh @@ -302,7 +302,7 @@ make_client_root() { ln -s ../run var/run ) inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ - dmesg mkdir cp ping + dmesg mkdir cp ping dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done @@ -390,7 +390,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple poweroff shutdown + inst_multiple poweroff shutdown dd inst_hook shutdown-emergency 000 ./hard-off.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules inst ./cryptroot-ask.sh /sbin/cryptroot-ask diff --git a/test/TEST-50-MULTINIC/client-init.sh b/test/TEST-50-MULTINIC/client-init.sh index 518f00fc..38879049 100755 --- a/test/TEST-50-MULTINIC/client-init.sh +++ b/test/TEST-50-MULTINIC/client-init.sh @@ -124,7 +124,7 @@ done { echo "OK" echo "$IFACES" -} > /dev/sda +} | dd oflag=direct,dsync of=/dev/sda getargbool 0 rd.shell && sh -i poweroff -f diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index 14f6b6b7..b4326d5a 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -257,7 +257,7 @@ test_setup() { done ) inst_multiple sh shutdown poweroff stty cat ps ln ip \ - mount dmesg mkdir cp ping grep ls + mount dmesg mkdir cp ping grep ls dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [[ -f ${_terminfodir}/l/linux ]] && break done diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh index 26935557..13cef7ff 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh @@ -16,7 +16,7 @@ echo "made it to the rootfs! Powering down." grep -v 'UUID=' $i done echo EOF -) > /dev/sda +) | dd oflag=direct,dsync of=/dev/sda strstr "$CMDLINE" "rd.shell" && sh -i poweroff -f diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh index 859b279e..72826a5d 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh @@ -274,7 +274,7 @@ test_setup() { export initdir="$TESTDIR"/mnt/nfs/client . "$basedir"/dracut-init.sh inst_multiple sh shutdown poweroff stty cat ps ln ip \ - mount dmesg mkdir cp ping grep ls sort + mount dmesg mkdir cp ping grep ls sort dd for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [[ -f ${_terminfodir}/l/linux ]] && break done From d5088b1703983f301c00f9f2a00af35a7ee5ddac Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 28 Feb 2020 14:40:14 +0100 Subject: [PATCH 36/50] TEST-12-RAID-DEG: harden test use whole sda as marker disk and clear it completly between test runs --- test/TEST-12-RAID-DEG/create-root.sh | 10 +--------- test/TEST-12-RAID-DEG/hard-off.sh | 2 +- test/TEST-12-RAID-DEG/test-init.sh | 2 +- test/TEST-12-RAID-DEG/test.sh | 26 ++++++++++++++------------ 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/test/TEST-12-RAID-DEG/create-root.sh b/test/TEST-12-RAID-DEG/create-root.sh index 31be41d1..c210b582 100755 --- a/test/TEST-12-RAID-DEG/create-root.sh +++ b/test/TEST-12-RAID-DEG/create-root.sh @@ -10,14 +10,6 @@ rm -f -- /etc/lvm/lvm.conf udevadm control --reload udevadm settle sleep 1 -# save a partition at the beginning for future flagging purposes -sfdisk /dev/sda < /tmp/mduuid . /tmp/mduuid eval $(udevadm info --query=env --name=/dev/md0|while read line || [ -n "$line" ]; do [ "$line" != "${line#*ID_FS_UUID*}" ] && echo $line; done;) -{ echo "dracut-root-block-created"; echo MD_UUID=$MD_UUID; echo "ID_FS_UUID=$ID_FS_UUID";} | dd oflag=direct,dsync of=/dev/sda1 +{ echo "dracut-root-block-created"; echo MD_UUID=$MD_UUID; echo "ID_FS_UUID=$ID_FS_UUID";} | dd oflag=direct,dsync of=/dev/sda diff --git a/test/TEST-12-RAID-DEG/hard-off.sh b/test/TEST-12-RAID-DEG/hard-off.sh index 24668d9c..8179d577 100755 --- a/test/TEST-12-RAID-DEG/hard-off.sh +++ b/test/TEST-12-RAID-DEG/hard-off.sh @@ -1,4 +1,4 @@ #!/bin/sh -sleep 10 +sleep 5 getargbool 0 rd.shell || poweroff -f ! getargbool 0 rd.break && getargbool 0 failme && poweroff -f diff --git a/test/TEST-12-RAID-DEG/test-init.sh b/test/TEST-12-RAID-DEG/test-init.sh index 1d9c9a88..1e41a0a4 100755 --- a/test/TEST-12-RAID-DEG/test-init.sh +++ b/test/TEST-12-RAID-DEG/test-init.sh @@ -99,7 +99,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; } CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) command -v plymouth >/dev/null && plymouth --quit exec >/dev/console 2>&1 -echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sda1 +echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sda export TERM=linux export PS1='initramfs-test:\w\$ ' [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh index 2f3d72a8..f8dc08d9 100755 --- a/test/TEST-12-RAID-DEG/test.sh +++ b/test/TEST-12-RAID-DEG/test.sh @@ -15,25 +15,25 @@ client_run() { cp --sparse=always --reflink=auto $TESTDIR/disk3.img $TESTDIR/disk3.img.new $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/marker.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img.new \ -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img.new \ - -append "panic=1 systemd.crash_reboot $* systemd.log_target=kmsg loglevel=7 root=LABEL=root rw rd.retry=20 rd.info console=ttyS0,115200n81 log_buf_len=2M selinux=0 rd.debug rd.shell=0 $DEBUGFAIL " \ + -append "panic=1 systemd.crash_reboot $* systemd.log_target=kmsg root=LABEL=root rw rd.retry=10 rd.info console=ttyS0,115200n81 log_buf_len=2M selinux=0 rd.shell=0 $DEBUGFAIL " \ -initrd $TESTDIR/initramfs.testing - if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then + if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/marker.img; then echo "CLIENT TEST END: $@ [FAIL]" return 1; fi + rm -f -- $TESTDIR/marker.img + dd if=/dev/null of=$TESTDIR/marker.img bs=1M seek=40 - sed -i -e 's#dracut-root-block-success#dracut-root-block-xxxxxxx#' $TESTDIR/root.ext2 echo "CLIENT TEST END: $@ [OK]" return 0 } test_run() { - eval $(grep -F --binary-files=text -m 1 MD_UUID $TESTDIR/root.ext2) - echo "MD_UUID=$MD_UUID" read LUKS_UUID < $TESTDIR/luksuuid + read MD_UUID < $TESTDIR/mduuid client_run failme && return 1 client_run rd.auto || return 1 @@ -55,8 +55,8 @@ test_run() { test_setup() { # Create the blank file to use as a root filesystem - rm -f -- $TESTDIR/root.ext2 - dd if=/dev/null of=$TESTDIR/root.ext2 bs=1M seek=40 + rm -f -- $TESTDIR/marker.img + dd if=/dev/null of=$TESTDIR/marker.img bs=1M seek=40 dd if=/dev/null of=$TESTDIR/disk1.img bs=1M seek=35 dd if=/dev/null of=$TESTDIR/disk2.img bs=1M seek=35 dd if=/dev/null of=$TESTDIR/disk3.img bs=1M seek=35 @@ -111,17 +111,19 @@ test_setup() { rm -rf -- $TESTDIR/overlay # Invoke KVM and/or QEMU to actually create the target filesystem. $testdir/run-qemu \ - -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \ + -drive format=raw,index=0,media=disk,file=$TESTDIR/marker.img \ -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 - eval $(grep -F --binary-files=text -m 1 MD_UUID $TESTDIR/root.ext2) - eval $(grep -F -a -m 1 ID_FS_UUID $TESTDIR/root.ext2) + grep -F -m 1 -q dracut-root-block-created $TESTDIR/marker.img || return 1 + eval $(grep -F --binary-files=text -m 1 MD_UUID $TESTDIR/marker.img) + eval $(grep -F -a -m 1 ID_FS_UUID $TESTDIR/marker.img) echo $ID_FS_UUID > $TESTDIR/luksuuid + eval $(grep -F --binary-files=text -m 1 MD_UUID $TESTDIR/marker.img) + echo "$MD_UUID" > $TESTDIR/mduuid ( export initdir=$TESTDIR/overlay From 3f4ffebf33229c9f061d3153b209d1dae205702e Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 24 Feb 2020 21:56:37 +0100 Subject: [PATCH 37/50] Makefile: fix RPM build `make rpm` usually chose `/tmp` as the `$rpmbuild` dir, which breaks the dracut build, since it needs to execute `./configure`, but `/tmp` is mounted with `-o noexec`, leading to: ``` /var/tmp/rpm-tmp.SwEhJO: line 46: ./configure: Permission denied error: Bad exit status from /var/tmp/rpm-tmp.SwEhJO (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.SwEhJO (%build) ``` Switching to `/var/tmp` helps in this case. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ba87d08e..22b584f1 100644 --- a/Makefile +++ b/Makefile @@ -210,7 +210,7 @@ dracut-$(DRACUT_MAIN_VERSION).tar.xz: doc syncheck rm -f -- dracut-$(DRACUT_MAIN_VERSION).tar rpm: dracut-$(DRACUT_MAIN_VERSION).tar.xz syncheck - rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \ + rpmbuild=$$(mktemp -d -p /var/tmp rpmbuild-dracut.XXXXXX); src=$$(pwd); \ cp dracut-$(DRACUT_MAIN_VERSION).tar.xz "$$rpmbuild"; \ LC_MESSAGES=C $$src/git2spec.pl $(DRACUT_MAIN_VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \ (cd "$$rpmbuild"; \ From f1dc2180d4cd52c1d98868f0f8318fd3ea710538 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 24 Feb 2020 22:10:58 +0100 Subject: [PATCH 38/50] TEST-99-RPM: ignore weak dependencies in dnf Weak dependencies are useless for this test and pollute the chroot, causing unexpected fails. --- test/TEST-99-RPM/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/TEST-99-RPM/test.sh b/test/TEST-99-RPM/test.sh index 22d579f5..af64c24a 100755 --- a/test/TEST-99-RPM/test.sh +++ b/test/TEST-99-RPM/test.sh @@ -36,7 +36,7 @@ test_run() { command -v dnf >/dev/null && { dnf_or_yum="dnf"; dnf_or_yum_cmd="dnf --allowerasing"; } for (( i=0; i < 5 ; i++)); do $dnf_or_yum_cmd -v --nogpgcheck --installroot "$rootdir"/ --releasever "$VERSION_ID" --disablerepo='*' \ - --enablerepo=fedora --enablerepo=updates \ + --enablerepo=fedora --enablerepo=updates --setopt=install_weak_deps=False \ install -y \ $dnf_or_yum \ passwd \ From 8cba0ff83316cccbdfdc3234fb8b5bf31dd693f3 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 28 Feb 2020 15:18:18 +0100 Subject: [PATCH 39/50] github: add TEST-99 to the workflow --- .github/workflows/fedora-30.yml | 1 + .github/workflows/fedora-31.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fedora-30.yml b/.github/workflows/fedora-30.yml index edfc0735..350a14df 100644 --- a/.github/workflows/fedora-30.yml +++ b/.github/workflows/fedora-30.yml @@ -35,6 +35,7 @@ jobs: "40", "50", "60", + "99", ] fail-fast: false steps: diff --git a/.github/workflows/fedora-31.yml b/.github/workflows/fedora-31.yml index 42aa8298..fbc570c1 100644 --- a/.github/workflows/fedora-31.yml +++ b/.github/workflows/fedora-31.yml @@ -40,7 +40,8 @@ jobs: "50", "51", "60", - "61" + "61", + "99", ] fail-fast: false steps: From 355df861da9e0b2e756a76940bb06b0198568134 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 28 Feb 2020 15:49:37 +0100 Subject: [PATCH 40/50] test: build docs when running TEST-99-RPM --- fedora-test-github.sh | 5 +++-- fedora-test.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fedora-test-github.sh b/fedora-test-github.sh index 6d5e7e37..acd6f67c 100755 --- a/fedora-test-github.sh +++ b/fedora-test-github.sh @@ -14,12 +14,13 @@ NCPU=$(getconf _NPROCESSORS_ONLN) if ! [[ $TESTS ]]; then make -j$NCPU all syncheck rpm logtee else - make -j$NCPU enable_documentation=no all logtee + [[ $TESTS == "99" ]] && make_docs=yes || make_docs=no + make -j$NCPU enable_documentation=$make_docs all logtee cd test time LOGTEE_TIMEOUT_MS=590000 make \ - enable_documentation=no \ + enable_documentation=$make_docs \ KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \ DRACUT_NO_XATTR=1 \ TEST_RUN_ID=$RUN_ID \ diff --git a/fedora-test.sh b/fedora-test.sh index 753f10e3..395ed5f5 100755 --- a/fedora-test.sh +++ b/fedora-test.sh @@ -14,12 +14,13 @@ NCPU=$(getconf _NPROCESSORS_ONLN) if ! [[ $TESTS ]]; then make -j$NCPU all syncheck rpm logtee else - make -j$NCPU enable_documentation=no all logtee + [[ $TESTS == "99" ]] && make_docs=yes || make_docs=no + make -j$NCPU enable_documentation=$make_docs all logtee cd test time sudo LOGTEE_TIMEOUT_MS=300000 make \ - enable_documentation=no \ + enable_documentation=$make_docs \ KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \ DRACUT_NO_XATTR=1 \ TEST_RUN_ID=$RUN_ID \ From 11a5501d0f844b9e52f2f1b62d980b733c73f10a Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 28 Feb 2020 14:58:59 +0100 Subject: [PATCH 41/50] cms/cmssetup.sh: use $name instead of $env{INTERFACE} Followup to a8ba1c4e25051c3c482bb7a6a754c9d785463917 --- modules.d/80cms/cmssetup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules.d/80cms/cmssetup.sh b/modules.d/80cms/cmssetup.sh index 3b8750b6..1cfce551 100755 --- a/modules.d/80cms/cmssetup.sh +++ b/modules.d/80cms/cmssetup.sh @@ -164,11 +164,11 @@ processcmsfile() driver=$NETTYPE fi - printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$env{INTERFACE} /sbin/cmsifup $env{INTERFACE}"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules + printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$name /sbin/cmsifup $name"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules # remove the default net rules rm -f -- /etc/udev/rules.d/91-default-net.rules [[ -f /etc/udev/rules.d/90-net.rules ]] \ - || printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$env{INTERFACE} source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules + || printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$name source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules udevadm control --reload znet_cio_free fi From 7261a0540a52b64918da48df68a6efabb56bdd93 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 28 Feb 2020 18:07:12 +0100 Subject: [PATCH 42/50] github: fetch git tags before testing GitHub workflows fetch a clone of the dracut repository which doesn't contain git tags, thus "breaking" the RPM build in certain situations i.e.: DRACUT_MAIN_VERSION in Makefile is defined as an output of `git describe`, which in full git clone returns a tag with a numeric version. However, without tags it returns SHA of the last commit, which later propagates into `Provides:` attribute of the built RPM and can break dependency tree when installed --- fedora-test-github.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fedora-test-github.sh b/fedora-test-github.sh index acd6f67c..283e8956 100755 --- a/fedora-test-github.sh +++ b/fedora-test-github.sh @@ -7,6 +7,16 @@ set -ex RUN_ID="$1" TESTS=$2 +# GitHub workflows fetch a clone of the dracut repository which doesn't +# contain git tags, thus "breaking" the RPM build in certain situations +# i.e.: +# DRACUT_MAIN_VERSION in Makefile is defined as an output of `git describe`, +# which in full git clone returns a tag with a numeric version. However, +# without tags it returns SHA of the last commit, which later propagates into +# `Provides:` attribute of the built RPM and can break dependency tree when +# installed +[[ -d .git ]] && git fetch --tags && git describe --tags + ./configure NCPU=$(getconf _NPROCESSORS_ONLN) From ef8915d7afc429f1403885a6fbbb7dfbaa0be144 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 28 Feb 2020 16:43:14 +0100 Subject: [PATCH 43/50] fcoe/fcoe-genrules.sh: use $name instead of $env{INTERFACE} Followup to a8ba1c4e25051c3c482bb7a6a754c9d785463917 and 11a5501d0f844b9e52f2f1b62d980b733c73f10a --- modules.d/95fcoe/fcoe-genrules.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules.d/95fcoe/fcoe-genrules.sh b/modules.d/95fcoe/fcoe-genrules.sh index 445a09c2..031d2a0f 100755 --- a/modules.d/95fcoe/fcoe-genrules.sh +++ b/modules.d/95fcoe/fcoe-genrules.sh @@ -7,10 +7,10 @@ # Write udev rules { if [ -n "$fcoe_mac" ] ; then - printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode" - printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode" + printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$name /sbin/fcoe-up $name %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode" + printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$name /sbin/fcoe-up $name %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode" else - printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode" - printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode" + printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$name /sbin/fcoe-up $name %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode" + printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$name /sbin/fcoe-up $name %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode" fi } >> /etc/udev/rules.d/92-fcoe.rules From 3ea80545d6544ab0e9bbfb9d418af5738400ef2e Mon Sep 17 00:00:00 2001 From: Alexander Miroshnichenko Date: Mon, 24 Feb 2020 18:14:26 +0300 Subject: [PATCH 44/50] stratis module: fix start order Change start script order to pre-mount as stratis require fully initialized udev. --- modules.d/90stratis/module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.d/90stratis/module-setup.sh b/modules.d/90stratis/module-setup.sh index 943f572e..e13000b4 100755 --- a/modules.d/90stratis/module-setup.sh +++ b/modules.d/90stratis/module-setup.sh @@ -26,7 +26,7 @@ install() { inst_simple "${moddir}/stratisd-init.service" "${systemdsystemunitdir}/stratisd-init.service" systemctl -q --root "$initdir" enable stratisd-init.service else - inst_hook cmdline 25 "$moddir/stratisd-start.sh" + inst_hook pre-mount 25 "$moddir/stratisd-start.sh" inst_hook cleanup 25 "$moddir/stratisd-stop.sh" fi } From ecbdff68af39ccbf91ca2ea553b168588fc870f1 Mon Sep 17 00:00:00 2001 From: Topi Miettinen Date: Wed, 26 Feb 2020 14:48:18 +0200 Subject: [PATCH 45/50] Don't resolve libraries lazily if tmpdir is mounted with 'noexec' If the temporary directory for images is mounted with 'noexec', dracut would construct unbootable images because most dynamic libraries aren't installed. Avoid this by not resolving library dependencies lazily if the temporary directory is mounted with 'noexec'. Signed-off-by: Topi Miettinen --- dracut.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dracut.sh b/dracut.sh index 908d3448..3219dd86 100755 --- a/dracut.sh +++ b/dracut.sh @@ -945,6 +945,12 @@ readonly TMPDIR="$(realpath -e "$tmpdir")" printf "%s\n" "dracut: Invalid tmpdir '$tmpdir'." >&2 exit 1 } + +if findmnt --raw -n --target "$tmpdir" --output=options | grep -q noexec; then + [[ $debug == yes ]] && printf "%s\n" "dracut: Tmpdir '$tmpdir' is mounted with 'noexec'." + noexec=1 +fi + readonly DRACUT_TMPDIR="$(mktemp -p "$TMPDIR/" -d -t dracut.XXXXXX)" [ -d "$DRACUT_TMPDIR" ] || { printf "%s\n" "dracut: mktemp -p '$TMPDIR/' -d -t dracut.XXXXXX failed." >&2 @@ -969,7 +975,7 @@ if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_t mkdir "$early_cpio_dir" fi -[[ -n "$dracutsysrootdir" ]] || export DRACUT_RESOLVE_LAZY="1" +[[ -n "$dracutsysrootdir" || "$noexec" ]] || export DRACUT_RESOLVE_LAZY="1" if [[ $print_cmdline ]]; then stdloglvl=0 From 1edee0c4a12aa39f514d94007e3a9bb4d2a50f3b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 2 Mar 2020 14:40:16 +0100 Subject: [PATCH 46/50] test/TEST-0[34] remove qemu return check remove check of qemu return code $? seems like it randomly returns with != 0 --- test/TEST-03-USR-MOUNT/test.sh | 5 ----- test/TEST-04-FULL-SYSTEMD/test.sh | 5 ----- 2 files changed, 10 deletions(-) diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh index cdf71838..5de7f4a1 100755 --- a/test/TEST-03-USR-MOUNT/test.sh +++ b/test/TEST-03-USR-MOUNT/test.sh @@ -22,11 +22,6 @@ client_run() { -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing - if (($? != 0)); then - echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" - return 1 - fi - if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/result; then echo "CLIENT TEST END: $test_name [FAILED]" return 1 diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index a7b99600..77d3a7ff 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -23,11 +23,6 @@ client_run() { -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing - if (($? != 0)); then - echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" - return 1 - fi - if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/result; then echo "CLIENT TEST END: $test_name [FAILED]" return 1 From 3d2a6d29d4cec422e2d00c67b12ec5adae1ada86 Mon Sep 17 00:00:00 2001 From: "Lucas C. Villa Real" Date: Thu, 20 Feb 2020 16:37:32 -0300 Subject: [PATCH 47/50] dracut_mkdir(): create parent directories as needed. --- install/dracut-install.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/install/dracut-install.c b/install/dracut-install.c index 5d48e9d5..3d64ed7a 100644 --- a/install/dracut-install.c +++ b/install/dracut-install.c @@ -687,29 +687,41 @@ static bool check_hashmap(Hashmap *hm, const char *item) static int dracut_mkdir(const char *src) { _cleanup_free_ char *parent = NULL; + char *path; struct stat sb; parent = strdup(src); if (!parent) return 1; - parent[dir_len(parent)] = '\0'; + path = parent[0] == '/' ? parent+1 : parent; + while (path) { + path = strstr(path, "/"); + if (path) + *path = '\0'; - if (stat(parent, &sb) == 0) { - if (!S_ISDIR(sb.st_mode)) { - log_error("%s exists but is not a directory!", parent); + if (stat(parent, &sb) == 0) { + if (!S_ISDIR(sb.st_mode)) { + log_error("%s exists but is not a directory!", parent); + return 1; + } + } else if (errno != ENOENT) { + log_error("ERROR: stat '%s': %s", parent, strerror(errno)); return 1; + } else { + if (mkdir(parent, 0755) < 0) { + log_error("ERROR: mkdir '%s': %s", parent, strerror(errno)); + return 1; + } } - return mkdir(src, 0755); - } - - if (errno != ENOENT) { - log_error("ERROR: stat '%s': %m", src); - return 1; + if (path) { + *path = '/'; + path++; + } } - return dracut_mkdir(parent); + return 0; } static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir, bool resolvedeps, bool hashdst) From b3d40a4390feeffad3c50a8a12a87de197291db8 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 2 Mar 2020 14:55:23 +0100 Subject: [PATCH 48/50] TEST-04-FULL-SYSTEMD: change error reporting --- test/TEST-04-FULL-SYSTEMD/test-init.sh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/test/TEST-04-FULL-SYSTEMD/test-init.sh b/test/TEST-04-FULL-SYSTEMD/test-init.sh index 687522b9..80fecb95 100755 --- a/test/TEST-04-FULL-SYSTEMD/test-init.sh +++ b/test/TEST-04-FULL-SYSTEMD/test-init.sh @@ -110,27 +110,23 @@ ismounted() { systemctl --failed --no-legend --no-pager > /failed -if ismounted /usr && [ ! -s /failed ]; then - echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sdc -fi - if ! ismounted /usr; then echo "**************************FAILED**************************" echo "/usr not mounted!!" cat /proc/mounts echo "**************************FAILED**************************" -fi - -journalctl --full --no-pager -o short-monotonic +else + if [ -s /failed ]; then + echo "**************************FAILED**************************" + cat /failed + echo "**************************FAILED**************************" -if [ -s /failed ]; then - echo "**************************FAILED**************************" - cat /failed - echo "**************************FAILED**************************" + else + echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/sdc + echo "All OK" + fi fi -ls -al /run/systemd/system - export TERM=linux export PS1='initramfs-test:\w\$ ' [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab From ce62465cafcc780fba13b0ae60d22ada2f77f436 Mon Sep 17 00:00:00 2001 From: Topi Miettinen Date: Sun, 1 Mar 2020 12:22:30 +0200 Subject: [PATCH 49/50] Make lsinitrd usable for images made with Debian mkinitramfs Debian mkinitramfs does not create the file 'early_cpio', so detection of additional cpio images fails and only the first cpio is listed. I checked some Arch and Gentoo initramfs files and these didn't have 'early_cpio' either, but they also have only one cpio part. Fix this so that if check for 'early_cpio' fails, check if firmware files ('/kernel/*/microcode/*.bin') exist. Signed-off-by: Topi Miettinen --- lsinitrd.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lsinitrd.sh b/lsinitrd.sh index 67af769e..b5c73f62 100755 --- a/lsinitrd.sh +++ b/lsinitrd.sh @@ -236,6 +236,8 @@ case $bin in $'\x71\xc7'*|070701) CAT="cat --" is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2>/dev/null) + # Debian mkinitramfs does not create the file 'early_cpio', so let's check if firmware files exist + [[ "$is_early" ]] || is_early=$(cpio --list --verbose --quiet --to-stdout -- 'kernel/*/microcode/*.bin' < "$image" 2>/dev/null) if [[ "$is_early" ]]; then if [[ -n "$unpack" ]]; then # should use --unpackearly for early CPIO From c7403700dfb6fbe696d195dc5db941e40f079be0 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 3 Mar 2020 16:56:16 +0100 Subject: [PATCH 50/50] TEST-04-FULL-SYSTEMD: use seperate marker disk for root creation --- test/TEST-04-FULL-SYSTEMD/create-root.sh | 3 +-- test/TEST-04-FULL-SYSTEMD/test.sh | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/TEST-04-FULL-SYSTEMD/create-root.sh b/test/TEST-04-FULL-SYSTEMD/create-root.sh index d89c6494..5de376c7 100755 --- a/test/TEST-04-FULL-SYSTEMD/create-root.sh +++ b/test/TEST-04-FULL-SYSTEMD/create-root.sh @@ -38,7 +38,6 @@ btrfs filesystem sync /root/usr btrfs filesystem sync /root umount /root/usr umount /root -echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 +echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sdc sync poweroff -f - diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index 77d3a7ff..3a544d7c 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -242,12 +242,14 @@ EOF # Invoke KVM and/or QEMU to actually create the target filesystem. rm -rf -- $TESTDIR/overlay + dd if=/dev/zero of=$TESTDIR/result bs=1M count=1 $testdir/run-qemu \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \ + -drive format=raw,index=2,media=disk,file=$TESTDIR/result \ -append "root=/dev/fakeroot rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - if ! grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs; then + if ! grep -F -m 1 -q dracut-root-block-created $TESTDIR/result; then echo "Could not create root filesystem" return 1 fi