From 0126bd3e6ca43c350437fa8bfe72958a5aad5984 Mon Sep 17 00:00:00 2001 From: Peter Holm Date: Mon, 6 Feb 2023 11:09:52 +0100 Subject: [PATCH] stress2: Return error on exit. Run test for longer --- tools/test/stress2/misc/mkdir.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/test/stress2/misc/mkdir.sh b/tools/test/stress2/misc/mkdir.sh index 155de9b61cc6..39cc828f0303 100755 --- a/tools/test/stress2/misc/mkdir.sh +++ b/tools/test/stress2/misc/mkdir.sh @@ -28,7 +28,7 @@ # # Demonstrate incorrect "out of inodes" message with SU enabled. -# No issue without SU. +# No issue seen with SU+J [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg @@ -45,18 +45,23 @@ mdconfig -a -t swap -s 100m -u $mdstart echo "newfs $flags /dev/md$mdstart" newfs $flags /dev/md$mdstart > /dev/null mount /dev/md$mdstart $mntpoint -jot 10 | xargs -I% mkdir $mntpoint/% set +e ifree1=`df -i $mntpoint | tail -1 | awk '{print $7}'` before=`df -i $mntpoint` n=$(((ifree1 - 5) / 10)) -for i in `jot 5`; do +jot 10 | xargs -I% mkdir $mntpoint/% +start=`date +%s` +while [ $((`date +%s` - start)) -lt 180 ]; do for j in `jot 10`; do jot $n | xargs -P0 -I% mkdir $mntpoint/$j/% jot $n | xargs -P0 -I% rmdir $mntpoint/$j/% done -done 2>&1 | head -5 +done 2>&1 | tee $log | head -5 +[ -s $log ] && s=3 +jot 10 | xargs -I% rmdir $mntpoint/% +umount $mntpoint; mount /dev/md$mdstart $mntpoint + ifree2=`df -i $mntpoint | tail -1 | awk '{print $7}'` after=`df -i $mntpoint | tail -1` if [ $ifree1 -ne $ifree2 ]; then