summaryrefslogtreecommitdiff
path: root/tests/clean-tests.sh
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2016-07-26 13:24:39 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2016-07-26 13:24:39 +0100
commit3d69435ee3292b4b1db2d61c4784789d75883821 (patch)
tree2c0edc9d9501374799875af36259089feb99d48c /tests/clean-tests.sh
Imported Upstream version 4.6.1
Diffstat (limited to 'tests/clean-tests.sh')
-rwxr-xr-xtests/clean-tests.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/clean-tests.sh b/tests/clean-tests.sh
new file mode 100755
index 0000000..f7fefdd
--- /dev/null
+++ b/tests/clean-tests.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# remove all intermediate files from tests
+
+SCRIPT_DIR=$(dirname $(readlink -f $0))
+TOP=$(readlink -f $SCRIPT_DIR/../)
+source $TOP/tests/common
+
+setup_root_helper
+
+if [ "$BUILD_VERBOSE" = 1 ]; then
+ verbose=-print
+fi
+
+$SUDO_HELPER umount "$TEST_MNT" &>/dev/null
+
+if ! cd $TOP/tests; then
+ echo "ERROR: cannot cd to $TOP/tests"
+ exit 1
+fi
+
+find fsck-tests -type f -name '*.restored' $verbose -delete
+
+# do not remove, the file could have special permissions set
+echo -n > test.img