Skip to content

Commit

Permalink
test(ISCSI): fix the watchdog loop
Browse files Browse the repository at this point in the history
Test for `pidof tgtd` and not the shell background jobs.
  • Loading branch information
haraldh committed Apr 26, 2021
1 parent 3fdc734 commit 2c5bb67
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
11 changes: 7 additions & 4 deletions test/TEST-30-ISCSI/server-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion test/TEST-30-ISCSI/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions test/TEST-35-ISCSI-MULTI/server-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion test/TEST-35-ISCSI-MULTI/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2c5bb67

Please sign in to comment.