git: 8ebc23256176 - main - stress2: Save a copy of the program file for regression tests
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 11 Dec 2021 06:08:03 UTC
The branch main has been updated by pho:
URL: https://cgit.FreeBSD.org/src/commit/?id=8ebc232561769043ba7901c39e2e57a35dc7c446
commit 8ebc232561769043ba7901c39e2e57a35dc7c446
Author: Peter Holm <pho@FreeBSD.org>
AuthorDate: 2021-12-11 06:07:04 +0000
Commit: Peter Holm <pho@FreeBSD.org>
CommitDate: 2021-12-11 06:07:04 +0000
stress2: Save a copy of the program file for regression tests
Suggested by: kib
---
tools/test/stress2/misc/elf.sh | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/test/stress2/misc/elf.sh b/tools/test/stress2/misc/elf.sh
index e0f88e5e90bc..eb6650c9c088 100755
--- a/tools/test/stress2/misc/elf.sh
+++ b/tools/test/stress2/misc/elf.sh
@@ -37,11 +37,13 @@
dir=/tmp
odir=`pwd`
+save=/tmp/elf.sh.img
+[ -f $save ] && { echo "$save exists"; exit 0; }
cc -o /tmp/flip -Wall -Wextra -O2 ../tools/flip.c || exit 1
set -e
mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint
-[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart
+[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart
mdconfig -a -t swap -s 2g -u $mdstart
newfs $newfs_flags md$mdstart > /dev/null
mount /dev/md$mdstart $mntpoint
@@ -54,6 +56,7 @@ while [ $((`date +%s` - start)) -lt 180 ]; do
cp /bin/ps ./elf
for j in `jot 10`; do
/tmp/flip -n 1 ./elf
+ cp elf $save; fsync $save; sync
timeout -s SIGKILL 2 ./elf aux > /dev/null 2>&1 || break
rm -f *.core
done
@@ -67,5 +70,5 @@ for i in `jot 6`; do
{ echo FATAL; fstat -mf $mntpoint; exit 1; }
done
mdconfig -d -u $mdstart
-rm /tmp/flip
+rm /tmp/flip $save
exit 0