[PATCH v2 3/4] btrfs-progs: tests: umount TEST_MNT in clean-tests.sh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>

Suggested-by: David Sterba <dsterba@xxxxxxx>
Signed-off-by: Zhao Lei <zhaolei@xxxxxxxxxxxxxx>
---
 tests/clean-tests.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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"
-- 
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux