git: dd894897691f - main - stress2: Updated tests as a result of the latest updates to fsck_ffs(8)
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 19 Aug 2022 09:43:02 UTC
The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=dd894897691f88061ed7630ded985bc6f9632e39 commit dd894897691f88061ed7630ded985bc6f9632e39 Author: Peter Holm <pho@FreeBSD.org> AuthorDate: 2022-08-19 09:40:49 +0000 Commit: Peter Holm <pho@FreeBSD.org> CommitDate: 2022-08-19 09:40:49 +0000 stress2: Updated tests as a result of the latest updates to fsck_ffs(8) --- tools/test/stress2/misc/fsck8.sh | 13 +++++++------ tools/test/stress2/misc/fsck9.sh | 24 ++++++++++++++++-------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/tools/test/stress2/misc/fsck8.sh b/tools/test/stress2/misc/fsck8.sh index 7b2e20bb7d5b..41f03bc3bece 100755 --- a/tools/test/stress2/misc/fsck8.sh +++ b/tools/test/stress2/misc/fsck8.sh @@ -80,15 +80,15 @@ chk() { clean=0 rerun=0 waccess=0 - fsck_ffs -fy $1 > $log 2>&1 + timeout 5m fsck_ffs -fy $1 > $log 2>&1 r=$? - if grep -qE "Cannot find file system superblock|Superblock check-hash failed" $log; then + if grep -qiE "super-?block.*failed" $log; then for b in $backups; do echo "Using alternate SB $b" asbs=$((asbs + 1)) fsck_ffs -b $b -fy $1 > $log 2>&1 r=$? - grep -qE "Cannot find file system superblock|Superblock check-hash failed" $log || + grep -qiE "super-?block.*failed" $log || break done usedasb=1 @@ -110,7 +110,7 @@ clean=0 s=0 start=`date +%s` while [ $((`date +%s` - start)) -lt 300 ]; do - mount /dev/md$u2 $mp2 || { s=101; break; } + mount /dev/md$u2 $mp2 || break ls -lR $mp2 > /dev/null || { s=102; echo "ls failed"; break; } touch $mp2/`jot -rc 8 a z | tr -d '\n'` while mount | grep -q "on $mp2 "; do umount $mp2; done @@ -128,6 +128,7 @@ while [ $((`date +%s` - start)) -lt 300 ]; do gzip < $diskimage > $backup fi fsync $backup + sync for i in `jot 5`; do [ $i -gt 2 ] && echo "fsck run #$i" @@ -135,7 +136,7 @@ while [ $((`date +%s` - start)) -lt 300 ]; do [ $rerun -eq 1 ] && { reruns=$((reruns + 1)); continue; } [ $clean -eq 1 ] && { cleans=$((cleans + 1)); break; } [ -f fsck_ffs.core ] && - { cp $diskimage \ + { cp -v $diskimage \ /tmp/fsck_ffs.core.diskimage.`date +%Y%m%dT%H%M%S`; break 2; } done [ $clean -ne 1 ] && break @@ -165,7 +166,7 @@ if [ $clean -ne 1 ]; then cp -v $log /tmp [ $s -eq 0 ] && s=106 fi -echo * | grep -q core && { ls -l *.core; cp $log /tmp; exit 106; } || +echo * | grep -q core && { ls -l *.core; cp -v $log /tmp; exit 106; } || rm -f $backup [ $s -eq 101 ] && rm -f $backup # mount error breakout cd /tmp diff --git a/tools/test/stress2/misc/fsck9.sh b/tools/test/stress2/misc/fsck9.sh index 0297013839eb..4610e9da1fb8 100755 --- a/tools/test/stress2/misc/fsck9.sh +++ b/tools/test/stress2/misc/fsck9.sh @@ -80,12 +80,14 @@ chk() { rerun=0 fsck_ffs -fy $1 > $log 2>&1 r=$? - if grep -qE "Cannot find file system superblock|Superblock check-hash failed" $log; then + if grep -qiE "super-?block.*failed" $log; then for b in $backups; do + echo "fsck_ffs -b $b -fy $1" fsck_ffs -b $b -fy $1 > $log 2>&1 r=$? - grep -qE "Cannot find file system superblock|Superblock check-hash failed" $log || + grep -qiE "super-?block.*failed" $log || break + echo "Checking next SB" done usedasb=1 else @@ -102,8 +104,12 @@ clean=0 s=0 start=`date +%s` while [ $((`date +%s` - start)) -lt 300 ]; do - mount /dev/md$u2 $mp2 || { s=101; break; } - ls -lR $mp2 > /dev/null || { s=102; echo "ls failed"; break; } + mount /dev/md$u2 $mp2 || break + if ! ls -lR $mp2 > /dev/null; then + s=102 + echo "ls failed"; grep "core dumped" /var/log/messages | tail -1 + break + fi touch $mp2/`jot -rc 8 a z | tr -d '\n'` while mount | grep -q "on $mp2 "; do umount $mp2; done echo * | grep -q core && break @@ -119,19 +125,21 @@ while [ $((`date +%s` - start)) -lt 300 ]; do gzip < $diskimage > $backup fi fsync $backup + sync for i in `jot 5`; do [ $i -gt 2 ] && echo "fsck run #$i" chk $diskimage [ $rerun -eq 1 ] && { reruns=$((reruns + 1)); continue; } [ $clean -eq 1 ] && { cleans=$((cleans + 1)); break; } - [ -f fsck_ffs.core ] && break 2 + [ -f fsck_ffs.core ] && + { cp -v $diskimage \ + /tmp/fsck_ffs.core.diskimage.`date +%Y%m%dT%H%M%S`; break 2; } done if [ $clean -eq 1 ]; then -# echo "Checking clean claim" fsck_ffs -fy $diskimage > $log 2>&1 if grep -q MODIFIED $log; then - echo "fsck of "clean" FS found more issues:" + echo "*** fsck of \"clean\" FS found more issues:" cat $log s=1 break @@ -149,7 +157,7 @@ for i in `jot 5`; do done mdconfig -d -u $u2 2>/dev/null # XXX when mount fails -[ $s -eq 0 ] && rm -f $backup +[ $s -eq 0 ] && rm -f $backup || echo "Preserved $backup due to status code $s" cd /tmp for i in `jot 5`; do umount $mp1 && break