Browse Source

use shutdown-emergency hook in testsuite to poweroff the machine

master
Harald Hoyer 9 years ago
parent
commit
4e882b8090
  1. 6
      modules.d/99base/dracut-lib.sh
  2. 2
      test/TEST-01-BASIC/test.sh
  3. 2
      test/TEST-02-SYSTEMD/test.sh
  4. 2
      test/TEST-03-USR-MOUNT/test.sh
  5. 2
      test/TEST-04-FULL-SYSTEMD/test.sh
  6. 2
      test/TEST-10-RAID/test.sh
  7. 2
      test/TEST-11-LVM/test.sh
  8. 2
      test/TEST-12-RAID-DEG/test.sh
  9. 2
      test/TEST-13-ENC-RAID-LVM/test.sh
  10. 2
      test/TEST-14-IMSM/test.sh
  11. 2
      test/TEST-15-BTRFSRAID/test.sh
  12. 2
      test/TEST-16-DMSQUASH/test.sh
  13. 2
      test/TEST-17-LVM-THIN/test.sh
  14. 4
      test/TEST-20-NFS/test.sh
  15. 2
      test/TEST-30-ISCSI/test.sh
  16. 4
      test/TEST-40-NBD/test.sh
  17. 2
      test/TEST-50-MULTINIC/test.sh

6
modules.d/99base/dracut-lib.sh

@ -457,7 +457,11 @@ die() { @@ -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

2
test/TEST-01-BASIC/test.sh

@ -89,7 +89,7 @@ test_setup() { @@ -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 / \

2
test/TEST-02-SYSTEMD/test.sh

@ -86,7 +86,7 @@ test_setup() { @@ -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 / \

2
test/TEST-03-USR-MOUNT/test.sh

@ -124,7 +124,7 @@ test_setup() { @@ -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 / \

2
test/TEST-04-FULL-SYSTEMD/test.sh

@ -261,7 +261,7 @@ EOF @@ -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
)


2
test/TEST-10-RAID/test.sh

@ -86,7 +86,7 @@ test_setup() { @@ -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

2
test/TEST-11-LVM/test.sh

@ -79,7 +79,7 @@ test_setup() { @@ -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 / \

2
test/TEST-12-RAID-DEG/test.sh

@ -129,7 +129,7 @@ test_setup() { @@ -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

2
test/TEST-13-ENC-RAID-LVM/test.sh

@ -123,7 +123,7 @@ test_setup() { @@ -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

2
test/TEST-14-IMSM/test.sh

@ -113,7 +113,7 @@ test_setup() { @@ -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 / \

2
test/TEST-15-BTRFSRAID/test.sh

@ -87,7 +87,7 @@ test_setup() { @@ -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 / \

2
test/TEST-16-DMSQUASH/test.sh

@ -43,7 +43,7 @@ test_setup() { @@ -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
)


2
test/TEST-17-LVM-THIN/test.sh

@ -79,7 +79,7 @@ test_setup() { @@ -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 / \

4
test/TEST-20-NFS/test.sh

@ -141,7 +141,7 @@ test_nfsv3() { @@ -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() { @@ -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
)


2
test/TEST-30-ISCSI/test.sh

@ -213,7 +213,7 @@ test_setup() { @@ -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 / \

4
test/TEST-40-NBD/test.sh

@ -226,7 +226,7 @@ make_encrypted_root() { @@ -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() { @@ -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


2
test/TEST-50-MULTINIC/test.sh

@ -269,7 +269,7 @@ test_setup() { @@ -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
)


Loading…
Cancel
Save