From: Harald Hoyer Date: Mon, 8 Mar 2021 12:19:42 +0000 (+0100) Subject: test: sync and poweroff in create-root.sh X-Git-Tag: 054~315 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72cba8aecd7592d13a4b58a111af860fd44c2aee;p=thirdparty%2Fdracut.git test: sync and poweroff in create-root.sh --- diff --git a/test/TEST-10-RAID/create-root.sh b/test/TEST-10-RAID/create-root.sh index b4415994a..2f35e4907 100755 --- a/test/TEST-10-RAID/create-root.sh +++ b/test/TEST-10-RAID/create-root.sh @@ -38,4 +38,5 @@ 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"; } | dd oflag=direct,dsync of=/dev/sda1 +sync poweroff -f diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh index fb34c7888..e0f0b2d96 100755 --- a/test/TEST-10-RAID/test.sh +++ b/test/TEST-10-RAID/test.sh @@ -55,7 +55,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount dd + inst_multiple sfdisk mke2fs poweroff cp umount dd 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 @@ -65,7 +65,7 @@ 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" \ + -m "bash 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 \ diff --git a/test/TEST-11-LVM/create-root.sh b/test/TEST-11-LVM/create-root.sh index 3da501f25..fecb494a6 100755 --- a/test/TEST-11-LVM/create-root.sh +++ b/test/TEST-11-LVM/create-root.sh @@ -29,4 +29,5 @@ sleep 1 && \ lvm lvchange -a n /dev/dracut/root && \ sleep 1 && \ echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 +sync poweroff -f diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh index 26d52e9ab..775d57651 100755 --- a/test/TEST-11-LVM/test.sh +++ b/test/TEST-11-LVM/test.sh @@ -53,7 +53,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount dd + inst_multiple sfdisk mke2fs poweroff cp umount dd 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 @@ -63,7 +63,7 @@ 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 lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -m "bash 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 diff --git a/test/TEST-12-RAID-DEG/create-root.sh b/test/TEST-12-RAID-DEG/create-root.sh index cce030ab4..6f3e61dbd 100755 --- a/test/TEST-12-RAID-DEG/create-root.sh +++ b/test/TEST-12-RAID-DEG/create-root.sh @@ -18,6 +18,7 @@ printf test >keyfile cryptsetup -q luksFormat /dev/md0 /keyfile echo "The passphrase is test" set -e +set -x cryptsetup luksOpen /dev/md0 dracut_crypt_test /tmp/mduuid 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 MD_UUID=$MD_UUID; echo "ID_FS_UUID=$ID_FS_UUID";} | dd oflag=direct,dsync of=/dev/sda +sync +poweroff -f diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh index ad42d8ae9..499a3bcda 100755 --- a/test/TEST-12-RAID-DEG/test.sh +++ b/test/TEST-12-RAID-DEG/test.sh @@ -94,7 +94,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount dd grep + inst_multiple sfdisk mke2fs poweroff cp umount dd grep 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 @@ -104,7 +104,7 @@ 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" \ + -m "bash 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 diff --git a/test/TEST-13-ENC-RAID-LVM/create-root.sh b/test/TEST-13-ENC-RAID-LVM/create-root.sh index a09b3bee6..fae995690 100755 --- a/test/TEST-13-ENC-RAID-LVM/create-root.sh +++ b/test/TEST-13-ENC-RAID-LVM/create-root.sh @@ -53,4 +53,5 @@ cryptsetup luksClose /dev/mapper/dracut_sda4 && \ udevadm info --query=env --name=$i|grep -F 'ID_FS_UUID=' done } | dd oflag=direct,dsync of=/dev/sda1 +sync poweroff -f diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh index 6f1fb452f..499105168 100755 --- a/test/TEST-13-ENC-RAID-LVM/test.sh +++ b/test/TEST-13-ENC-RAID-LVM/test.sh @@ -86,7 +86,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount grep dd + inst_multiple sfdisk mke2fs poweroff cp umount grep dd 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 @@ -96,7 +96,7 @@ 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" \ + -m "bash 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 diff --git a/test/TEST-14-IMSM/create-root.sh b/test/TEST-14-IMSM/create-root.sh index afa2f3a22..e18084c72 100755 --- a/test/TEST-14-IMSM/create-root.sh +++ b/test/TEST-14-IMSM/create-root.sh @@ -77,3 +77,5 @@ mdadm --detail --export /dev/md0 |grep -F MD_UUID > /tmp/mduuid echo "MD_UUID=$MD_UUID" { echo "dracut-root-block-created"; echo MD_UUID=$MD_UUID;} | dd oflag=direct,dsync of=/dev/sda mdadm --wait-clean /dev/md0 +sync +poweroff -f diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh index 886e6ef35..3c2bdee6d 100755 --- a/test/TEST-14-IMSM/test.sh +++ b/test/TEST-14-IMSM/test.sh @@ -91,7 +91,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount grep dd + inst_multiple sfdisk mke2fs poweroff cp umount grep dd sync inst_hook initqueue 01 ./create-root.sh inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ) @@ -100,7 +100,7 @@ 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 lvm mdraid dmraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -m "bash 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 diff --git a/test/TEST-15-BTRFSRAID/create-root.sh b/test/TEST-15-BTRFSRAID/create-root.sh index 85faeb6cc..6a309ea98 100755 --- a/test/TEST-15-BTRFSRAID/create-root.sh +++ b/test/TEST-15-BTRFSRAID/create-root.sh @@ -25,4 +25,5 @@ mount -t btrfs /dev/sda5 /sysroot cp -a -t /sysroot /source/* umount /sysroot echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 +sync poweroff -f diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh index 9ab127f88..8084e3e5f 100755 --- a/test/TEST-15-BTRFSRAID/test.sh +++ b/test/TEST-15-BTRFSRAID/test.sh @@ -57,7 +57,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mkfs.btrfs poweroff cp umount dd + inst_multiple sfdisk mkfs.btrfs poweroff cp umount dd 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 @@ -67,7 +67,7 @@ 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 btrfs udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -m "bash 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 \ diff --git a/test/TEST-17-LVM-THIN/create-root.sh b/test/TEST-17-LVM-THIN/create-root.sh index 6679125db..23629e659 100755 --- a/test/TEST-17-LVM-THIN/create-root.sh +++ b/test/TEST-17-LVM-THIN/create-root.sh @@ -31,4 +31,5 @@ lvm lvchange -a n /dev/dracut/root && \ sleep 1 dmsetup status |grep out_of_data_space || \ echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 +sync poweroff -f diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh index 1193464af..94931e8b1 100755 --- a/test/TEST-17-LVM-THIN/test.sh +++ b/test/TEST-17-LVM-THIN/test.sh @@ -53,7 +53,7 @@ test_setup() { ( export initdir=$TESTDIR/overlay . $basedir/dracut-init.sh - inst_multiple sfdisk mke2fs poweroff cp umount grep dmsetup dd + inst_multiple sfdisk mke2fs poweroff cp umount grep dmsetup dd 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 @@ -63,7 +63,7 @@ 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 lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules qemu" \ + -m "bash 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 diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 09a7f1326..648fe68a1 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -352,7 +352,7 @@ 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/server/overlay / \ - -m "dash udev-rules base rootfs-block fs-lib kernel-modules fs-lib qemu" \ + -m "bash 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 \ diff --git a/test/TEST-30-ISCSI/create-client-root.sh b/test/TEST-30-ISCSI/create-client-root.sh index de14e794e..efd8204cb 100755 --- a/test/TEST-30-ISCSI/create-client-root.sh +++ b/test/TEST-30-ISCSI/create-client-root.sh @@ -24,4 +24,5 @@ cp -a -t /sysroot /source/* && \ umount /sysroot && \ lvm lvchange -a n /dev/dracut/root && \ echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sdb +sync poweroff -f diff --git a/test/TEST-30-ISCSI/create-server-root.sh b/test/TEST-30-ISCSI/create-server-root.sh index cae305f9c..b15110f79 100755 --- a/test/TEST-30-ISCSI/create-server-root.sh +++ b/test/TEST-30-ISCSI/create-server-root.sh @@ -23,4 +23,3 @@ umount /root echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 sync poweroff -f - diff --git a/test/TEST-35-ISCSI-MULTI/create-client-root.sh b/test/TEST-35-ISCSI-MULTI/create-client-root.sh index de14e794e..efd8204cb 100755 --- a/test/TEST-35-ISCSI-MULTI/create-client-root.sh +++ b/test/TEST-35-ISCSI-MULTI/create-client-root.sh @@ -24,4 +24,5 @@ cp -a -t /sysroot /source/* && \ umount /sysroot && \ lvm lvchange -a n /dev/dracut/root && \ echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sdb +sync poweroff -f diff --git a/test/TEST-40-NBD/create-encrypted-root.sh b/test/TEST-40-NBD/create-encrypted-root.sh index 1e9495d70..efe106c04 100755 --- a/test/TEST-40-NBD/create-encrypted-root.sh +++ b/test/TEST-40-NBD/create-encrypted-root.sh @@ -28,4 +28,5 @@ udevadm settle sleep 1 eval $(udevadm info --query=env --name=/dev/sda|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"; } | dd oflag=direct,dsync of=/dev/sdb +sync poweroff -f diff --git a/test/TEST-50-MULTINIC/create-root.sh b/test/TEST-50-MULTINIC/create-root.sh index cae305f9c..b15110f79 100755 --- a/test/TEST-50-MULTINIC/create-root.sh +++ b/test/TEST-50-MULTINIC/create-root.sh @@ -23,4 +23,3 @@ umount /root echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 sync poweroff -f - diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index 2e2208461..e9328a8d7 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -299,7 +299,7 @@ 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 fs-lib qemu" \ + -m "bash 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 \ diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/create-root.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/create-root.sh index cae305f9c..b15110f79 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/create-root.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/create-root.sh @@ -23,4 +23,3 @@ umount /root echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/sda1 sync poweroff -f - diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh index 2b4650e63..77e197fb5 100755 --- a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh +++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh @@ -318,7 +318,7 @@ 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 fs-lib qemu" \ + -m "bash 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 \