From: Harald Hoyer Date: Mon, 26 Apr 2021 09:06:41 +0000 (+0200) Subject: test(ISCSI): fix the watchdog loop X-Git-Tag: 054~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c5bb67d83a9b17e825ac8cd37bd1e72ab8d9713;p=thirdparty%2Fdracut.git test(ISCSI): fix the watchdog loop Test for `pidof tgtd` and not the shell background jobs. --- diff --git a/test/TEST-30-ISCSI/server-init.sh b/test/TEST-30-ISCSI/server-init.sh index 420ad6182..9c00d7d9b 100755 --- a/test/TEST-30-ISCSI/server-init.sh +++ b/test/TEST-30-ISCSI/server-init.sh @@ -44,11 +44,14 @@ tgtadm --lld iscsi --mode target --op bind --tid 1 -I 192.168.50.101 tgtadm --lld iscsi --mode target --op bind --tid 2 -I 192.168.51.101 tgtadm --lld iscsi --mode target --op bind --tid 3 -I 192.168.50.101 +echo "Serving iSCSI" + # Wait forever for the VM to die -while :; do - echo "Serving iSCSI" - [ -n "$(jobs -rp)" ] && echo > /dev/watchdog - sleep 10 +while pidof tgtd > /dev/null; do + : > /dev/watchdog + dmesg -c + sleep 1 done +dmesg -c mount -n -o remount,ro / poweroff -f diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index 39269c5b0..d72d67e94 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -244,7 +244,7 @@ test_setup() { inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ dmesg mkdir cp ping \ modprobe tcpdump setsid \ - /etc/services sleep mount chmod + /etc/services sleep mount chmod pidof inst_multiple tgtd tgtadm for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break diff --git a/test/TEST-35-ISCSI-MULTI/server-init.sh b/test/TEST-35-ISCSI-MULTI/server-init.sh index 420335c9c..436ee9b8d 100755 --- a/test/TEST-35-ISCSI-MULTI/server-init.sh +++ b/test/TEST-35-ISCSI-MULTI/server-init.sh @@ -78,9 +78,11 @@ tgtadm --lld iscsi --mode target --op bind --tid 3 -I 192.168.50.101 # Wait forever for the VM to die echo "Serving iSCSI" -while :; do - [ -n "$(jobs -rp)" ] && echo > /dev/watchdog - sleep 10 +while pidof tgtd > /dev/null; do + : > /dev/watchdog + dmesg -c + sleep 1 done +dmesg -c mount -n -o remount,ro / poweroff -f diff --git a/test/TEST-35-ISCSI-MULTI/test.sh b/test/TEST-35-ISCSI-MULTI/test.sh index 1dee2eedf..f3f213a1b 100755 --- a/test/TEST-35-ISCSI-MULTI/test.sh +++ b/test/TEST-35-ISCSI-MULTI/test.sh @@ -248,7 +248,7 @@ test_setup() { inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ dmesg mkdir cp ping \ modprobe tcpdump setsid \ - /etc/services sleep mount chmod + /etc/services sleep mount chmod pidof inst_multiple tgtd tgtadm for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break