diff options
| author | Peter Holm <pho@FreeBSD.org> | 2025-11-21 08:49:47 +0000 |
|---|---|---|
| committer | Peter Holm <pho@FreeBSD.org> | 2025-11-21 08:49:47 +0000 |
| commit | c149db04aecc013cc98e921ee1b0deb54a5c34a6 (patch) | |
| tree | 7ea11cac98e2ae848165ec1fb7986cafeff893ab | |
| parent | 51e0c428749c0bd6ed90191a6a9fbfed28a0f98e (diff) | |
stress2: No not rely on unset variables when using 'set -u'
| -rwxr-xr-x | tools/test/stress2/misc/syzkaller82.sh | 4 | ||||
| -rwxr-xr-x | tools/test/stress2/misc/syzkaller84.sh | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/tools/test/stress2/misc/syzkaller82.sh b/tools/test/stress2/misc/syzkaller82.sh index c810942eb060..557d52d269c0 100755 --- a/tools/test/stress2/misc/syzkaller82.sh +++ b/tools/test/stress2/misc/syzkaller82.sh @@ -114,9 +114,9 @@ work=/tmp/$prog.dir rm -rf $work mkdir $work cd /tmp/$prog.dir -kldstat | grep -q sctp || { kldload sctp.ko && loaded=1; } +kldstat | grep -q sctp && loaded=0 || { kldload sctp.ko && loaded=1; } timeout 3m /tmp/$prog > /dev/null 2>&1 rm -rf /tmp/$prog /tmp/$prog.c /tmp/$prog.core /tmp/$prog.?????? $work -[ $loaded ] && kldunload sctp.ko +[ $loaded -eq 1 ] && kldunload sctp.ko exit 0 diff --git a/tools/test/stress2/misc/syzkaller84.sh b/tools/test/stress2/misc/syzkaller84.sh index a7976be2eeb6..631dd6e2dd6f 100755 --- a/tools/test/stress2/misc/syzkaller84.sh +++ b/tools/test/stress2/misc/syzkaller84.sh @@ -398,5 +398,6 @@ kldstat | grep -q sctp || { kldload sctp.ko && loaded=1; } timeout 3m /tmp/$prog > /dev/null 2>&1 rm -rf /tmp/$prog /tmp/$prog.c /tmp/$prog.core $work +set +u [ $loaded ] && kldunload sctp.ko exit 0 |
