From: Harald Hoyer Date: Wed, 26 Feb 2020 11:00:35 +0000 (+0100) Subject: tests: untabify, reformat X-Git-Tag: 050~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f78bafa4b1b2b226a2ebebdab221013a5c42d25;p=thirdparty%2Fdracut.git tests: untabify, reformat --- diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index a88843d32..06d8c53e5 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 c5739a70a..52f302b90 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 dffcc0a4c..53c4a1dc5 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 1fcbeeb85..337f02196 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 71e8cd29e..a0b2eab28 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 edb711867..757a3e950 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 40ca132e0..ba79889f8 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 cad641e46..b0d8c0020 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 f244ba1d4..5f11aaeff 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 8203b0f51..40d6c2649 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 6334e2290..69d96f7b7 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 7424d1059..c0239981e 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 946a198a3..2fdc38e2e 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 5e0793c92..922f4e5c0 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" <