]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
use shutdown-emergency hook in testsuite to poweroff the machine
authorHarald Hoyer <harald@redhat.com>
Fri, 27 May 2016 08:52:28 +0000 (10:52 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 7 Jun 2016 12:27:03 +0000 (14:27 +0200)
17 files changed:
modules.d/99base/dracut-lib.sh
test/TEST-01-BASIC/test.sh
test/TEST-02-SYSTEMD/test.sh
test/TEST-03-USR-MOUNT/test.sh
test/TEST-04-FULL-SYSTEMD/test.sh
test/TEST-10-RAID/test.sh
test/TEST-11-LVM/test.sh
test/TEST-12-RAID-DEG/test.sh
test/TEST-13-ENC-RAID-LVM/test.sh
test/TEST-14-IMSM/test.sh
test/TEST-15-BTRFSRAID/test.sh
test/TEST-16-DMSQUASH/test.sh
test/TEST-17-LVM-THIN/test.sh
test/TEST-20-NFS/test.sh
test/TEST-30-ISCSI/test.sh
test/TEST-40-NBD/test.sh
test/TEST-50-MULTINIC/test.sh

index 48fc83dc1757389a7a001c6924f8f04d5ecec64a..94e4614cf639289ed8f1c92e0889bf1ea09869b6 100755 (executable)
@@ -457,7 +457,11 @@ die() {
 
     > /run/initramfs/.die
 
-    getargbool 0 "rd.shell=" && emergency_shell
+    if getargbool 0 "rd.shell"; then
+        emergency_shell
+    else
+        source_hook "shutdown-emergency"
+    fi
 
     if [ -n "$DRACUT_SYSTEMD" ]; then
         systemctl --no-block --force halt
index 83320e273c7acbca8c71b00fd78cef3f8ef5f998..959ac05dddd8156d4828753d204e7b84451351ac 100755 (executable)
@@ -89,7 +89,7 @@ test_setup() {
        export initdir=$TESTDIR/overlay
        . $basedir/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       inst_hook shutdown-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 / \
index 16f5c2659ea9bff12a86695260b957d7d8a9c6a4..6dc6f42ef2ff74364b157db04c6bb42b13563fcc 100755 (executable)
@@ -86,7 +86,7 @@ test_setup() {
        export initdir=$TESTDIR/overlay
        . $basedir/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       inst_hook shutdown-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 / \
index 61063fd51029c5cacee253987bb4f91f60611e13..0aca8cf1013db1f9fe64d9c0be31007f97a50811 100755 (executable)
@@ -124,7 +124,7 @@ test_setup() {
        export initdir=$TESTDIR/overlay
        . $basedir/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       inst_hook shutdown-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 / \
index c7e08bfb06786e60bd49c9818b41f1a07c8d5b43..884f4412f83440fa54f91b0007b6967b5ad3f183 100755 (executable)
@@ -261,7 +261,7 @@ EOF
        export initdir=$TESTDIR/overlay
        . $basedir/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       inst_hook shutdown-emergency 000 ./hard-off.sh
        inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
     )
 
index 523b61a6e7c90ba8c59deb65a1beb51181854d3f..6ec77a68d3e5a8c7b883d668da2c0d4f69b954b4 100755 (executable)
@@ -86,7 +86,7 @@ test_setup() {
        export initdir=$TESTDIR/overlay
        . $basedir/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       inst_hook shutdown-emergency 000 ./hard-off.sh
        inst ./cryptroot-ask.sh /sbin/cryptroot-ask
         mkdir -p $initdir/etc
         echo "testluks UUID=$ID_FS_UUID /etc/key" > $initdir/etc/crypttab
index 34c7736a1ce79a4fc79ef5e30597a9a6a02ff016..412a0658fcc7c147d1938bcc997904a0071edf0f 100755 (executable)
@@ -79,7 +79,7 @@ test_setup() {
        export initdir=$TESTDIR/overlay
        . $basedir/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       inst_hook shutdown-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 / \
index f4ec2d0050ede2b3729e802e3b03efc1d7ebd193..444dca6d2541d42fec1c0b5bc7757fa26a75af3f 100755 (executable)
@@ -129,7 +129,7 @@ test_setup() {
        export initdir=$TESTDIR/overlay
        . $basedir/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       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
         mkdir -p $initdir/etc
index ea816976ba4d1018578c348180eb404a035ab64c..2a814f89d4e6d68c7d6000d0244320f6cc72cc28 100755 (executable)
@@ -123,7 +123,7 @@ test_setup() {
        export initdir=$TESTDIR/overlay
        . $basedir/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       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
         mkdir -p $initdir/etc
index f4ea7ae0f6707c30936ce7ecd9adecb634aed5c5..315bc5aa9ab3806800161c88e31be180f97c9777 100755 (executable)
@@ -113,7 +113,7 @@ test_setup() {
        export initdir=$TESTDIR/overlay
        . $basedir/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       inst_hook shutdown-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 / \
index 5a9b6e1f633684f65c35d58fcb03fbe4e5ddf91d..8e2ea49ef987890005cbc90e79b26fe31c614d9c 100755 (executable)
@@ -87,7 +87,7 @@ test_setup() {
         export initdir=$TESTDIR/overlay
        . $basedir/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       inst_hook shutdown-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 / \
index 53a45d692713280a62f72942f43069fce69fc21c..b255492eb38ab5bf91a222f3cabea5cd72bd38bb 100755 (executable)
@@ -43,7 +43,7 @@ test_setup() {
        export initdir="$TESTDIR"/overlay
        . "$basedir"/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       inst_hook shutdown-emergency 000 ./hard-off.sh
        inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
     )
 
index 859d4dc05d16b733413b683724a731aa6a15b4d9..e3375918c689f411ba9e819a38212ce84d19a671 100755 (executable)
@@ -79,7 +79,7 @@ test_setup() {
        export initdir=$TESTDIR/overlay
        . $basedir/dracut-init.sh
        inst_multiple poweroff shutdown
-       inst_hook emergency 000 ./hard-off.sh
+       inst_hook shutdown-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 / \
index ceca1f088c94aba6c5a8ee4f95b05570f5c0253e..1dfdfc4ecbfd3778aca1887390f3fb232d9789dc 100755 (executable)
@@ -141,7 +141,7 @@ test_nfsv3() {
 
     # 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" 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
@@ -334,7 +334,7 @@ test_setup() {
         . $basedir/dracut-init.sh
         mkdir $TESTDIR/overlay
         inst_multiple poweroff shutdown
-        inst_hook emergency 000 ./hard-off.sh
+        inst_hook shutdown-emergency 000 ./hard-off.sh
         inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
     )
 
index 940edb6bc6b57a66f06b5674fe935a78e3672d87..1c06b06d27e112f668dc5f76d1edae05916d2f83 100755 (executable)
@@ -213,7 +213,7 @@ test_setup() {
         export initdir=$TESTDIR/overlay
         . $basedir/dracut-init.sh
         inst_multiple poweroff shutdown
-        inst_hook emergency 000 ./hard-off.sh
+        inst_hook shutdown-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 / \
index 28ba6aa3772151b6209cc78e33f9a4510fea2188..2061392ab91271d2166a65d43b9d56c8790bdfff 100755 (executable)
@@ -226,7 +226,7 @@ make_encrypted_root() {
             done
         )
         inst_multiple mke2fs poweroff cp umount tune2fs
-        inst_hook emergency 000 ./hard-off.sh
+        inst_hook shutdown-emergency 000 ./hard-off.sh
         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
@@ -362,7 +362,7 @@ test_setup() {
         export initdir=$TESTDIR/overlay
         . $basedir/dracut-init.sh
         inst_multiple poweroff shutdown
-        inst_hook emergency 000 ./hard-off.sh
+        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
 
index 484ebeeda764bb4a7f441386657c371282467ba3..e0bf7d2fa2838ba5d425dfdb543fdaee82a956a1 100755 (executable)
@@ -269,7 +269,7 @@ test_setup() {
         export initdir="$TESTDIR"/overlay
         . "$basedir"/dracut-init.sh
         inst_multiple poweroff shutdown
-        inst_hook emergency 000 ./hard-off.sh
+        inst_hook shutdown-emergency 000 ./hard-off.sh
         inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
     )