Message ID | df9f4f0f57be049efe6e5002311b6cbff0fb1167.1440997237.git.zhaolei@cn.fujitsu.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On Mon, Aug 31, 2015 at 01:04:38PM +0800, Zhao Lei wrote: > If a testcase failed, we can't run it(or other tests needs mount) again, > # ./misc-tests.sh 007 > [TEST] 007-subvolume-sync > failed: fail > test failed for case 007-subvolume-sync > # ./misc-tests.sh 007 > [TEST] 007-subvolume-sync > failed: mount /root/btrfs-progs/tests/test.img /root/btrfs-progs/tests/mnt > test failed for case 007-subvolume-sync > # > > This patch add "umount $TEST_MNT" to clean-tests.sh, to let user > clean mountpoint easily. > > After patch: > # ./misc-tests.sh 007 > [TEST] 007-subvolume-sync > failed: fail > test failed for case 007-subvolume-sync > # > # clean-tests.sh > # > # ./misc-tests.sh 007 > [TEST] 007-subvolume-sync > failed: fail > test failed for case 007-subvolume-sync > # > > Changelog v1->v2: > Put umount command to clean-tests.sh instead of in testscript, > to keep failed-test stat until user run clean-tests.sh > explicitly, Suggested-by: David Sterba <dsterba@suse.cz> > > Suggested-by: David Sterba <dsterba@suse.cz> > Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/tests/clean-tests.sh b/tests/clean-tests.sh index c1dc56a..19d682d 100755 --- a/tests/clean-tests.sh +++ b/tests/clean-tests.sh @@ -1,12 +1,15 @@ #!/bin/sh # remove all intermediate files from tests +SCRIPT_DIR=$(dirname $(readlink -f $0)) +TOP=$(readlink -f $SCRIPT_DIR/../) +source $TOP/tests/common + if [ "$BUILD_VERBOSE" = 1 ]; then verbose=-print fi -SCRIPT_DIR=$(dirname $(readlink -f $0)) -TOP=$(readlink -f $SCRIPT_DIR/../) +umount "$TEST_MNT" &>/dev/null if ! cd $TOP/tests; then echo "ERROR: cannot cd to $TOP/tests"
If a testcase failed, we can't run it(or other tests needs mount) again, # ./misc-tests.sh 007 [TEST] 007-subvolume-sync failed: fail test failed for case 007-subvolume-sync # ./misc-tests.sh 007 [TEST] 007-subvolume-sync failed: mount /root/btrfs-progs/tests/test.img /root/btrfs-progs/tests/mnt test failed for case 007-subvolume-sync # This patch add "umount $TEST_MNT" to clean-tests.sh, to let user clean mountpoint easily. After patch: # ./misc-tests.sh 007 [TEST] 007-subvolume-sync failed: fail test failed for case 007-subvolume-sync # # clean-tests.sh # # ./misc-tests.sh 007 [TEST] 007-subvolume-sync failed: fail test failed for case 007-subvolume-sync # Changelog v1->v2: Put umount command to clean-tests.sh instead of in testscript, to keep failed-test stat until user run clean-tests.sh explicitly, Suggested-by: David Sterba <dsterba@suse.cz> Suggested-by: David Sterba <dsterba@suse.cz> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> --- tests/clean-tests.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)