use shutdown-emergency hook in testsuite to poweroff the machine

master
Harald Hoyer 2016-05-27 10:52:28 +02:00
parent 8e01095755
commit 4e882b8090
17 changed files with 23 additions and 19 deletions

View File

@ -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

View File

@ -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 / \

View File

@ -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 / \

View File

@ -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 / \

View File

@ -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
)


View File

@ -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

View File

@ -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 / \

View File

@ -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

View File

@ -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

View File

@ -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 / \

View File

@ -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 / \

View File

@ -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
)


View File

@ -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 / \

View File

@ -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
)


View File

@ -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 / \

View File

@ -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


View File

@ -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
)