]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: btrfs/276 - stop all fsstress before exiting
authorEric Sandeen <sandeen@redhat.com>
Fri, 26 Apr 2013 05:29:21 +0000 (05:29 +0000)
committerRich Johnston <rjohnston@sgi.com>
Fri, 3 May 2013 15:01:20 +0000 (10:01 -0500)
Tests after 276 were failing because the background fsstress
hadn't quit prior to exit, devices couldn't be unmounted, etc.

Just use the same trick as generic/068 does, and use
a tmpfile to control whether the background loop keeps
running.

Also, no need to umount scratch at cleanup time, the scripts
do that for us.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Jan Schmidt list.xfs@jan-o-sch.net
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
tests/btrfs/276
tests/btrfs/276.out

index 0a5ce362d357a2b0f58958362f4939780849e0a1..9d68b5487e1f3f3a3bdb066bf30340b49e2ff7f9 100755 (executable)
@@ -36,14 +36,8 @@ noise_pid=0
 
 _cleanup()
 {
-       if [ $noise_pid -ne 0 ]; then
-               echo "background noise kill $noise_pid" >>$seqres.full
-               kill $noise_pid
-               noise_pid=0
-               wait
-       fi
-       echo "*** unmount"
-       umount $SCRATCH_MNT 2>/dev/null
+       rm $tmp.running
+       wait
        rm -f $tmp.*
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -210,7 +204,7 @@ workout()
 
        if [ $do_bg_noise -ne 0 ]; then
                # make background noise while backrefs are being walked
-               while /bin/true; do
+               while [ -f "$tmp.running" ]; do
                        echo background fsstress >>$seqres.full
                        run_check $FSSTRESS_PROG -d $SCRATCH_MNT/bgnoise -n 999
                        echo background rm >>$seqres.full
@@ -263,6 +257,8 @@ nfiles=4
 numprocs=1
 do_bg_noise=1
 
+touch $tmp.running
+
 workout $filesize $nfiles $numprocs $snap_name $do_bg_noise
 
 echo "*** done"
index 2032deaa2ee8cb7f19098b652b1764b80254ad9c..511316464ce8bf1e032a577b90fce620d949e0f8 100644 (file)
@@ -1,4 +1,3 @@
 QA output created by 276
 *** test backref walking
 *** done
-*** unmount