use shutdown-emergency hook in testsuite to poweroff the machine
parent
8e01095755
commit
4e882b8090
|
@ -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
|
||||
|
|
|
@ -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 / \
|
||||
|
|
|
@ -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 / \
|
||||
|
|
|
@ -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 / \
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 / \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 / \
|
||||
|
|
|
@ -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 / \
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
@ -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 / \
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
@ -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 / \
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue