]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/490: fix cleanup function
authorTheodore Ts'o <tytso@mit.edu>
Sun, 20 May 2018 18:45:17 +0000 (14:45 -0400)
committerEryu Guan <guaneryu@gmail.com>
Mon, 21 May 2018 08:45:59 +0000 (16:45 +0800)
generic/490 fails because cleanup tries to delete . and .. since $tmp
is left unset, and so "rm -f $tmp.*" does nothing useful. Instead
define $tmp and delete temp files created by seek_sanity_test.

[Eryu: define $tmp and remove $tmp.* too on cleanup]

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/490

index b5042c2ebc0e6f5e02bc2d1e8b968865e6550970..abb8383738cbb34377adad5c6a232850ee5f0d1a 100755 (executable)
@@ -29,6 +29,7 @@ seqres=$RESULT_DIR/$seq
 echo "QA output created by $seq"
 
 here=`pwd`
+tmp=/tmp/$$
 status=1       # failure is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
@@ -50,6 +51,7 @@ _cleanup()
 {
        cd /
        rm -f $tmp.*
+       rm -f $base_test_file*
 }
 
 $here/src/seek_sanity_test -s 19 -e 20 $base_test_file > $seqres.full 2>&1 ||