btrfs-progs: tests: truncate test image to 0 first
[platform/upstream/btrfs-progs.git] / tests / clean-tests.sh
1 #!/bin/bash
2 # remove all intermediate files from tests
3
4 SCRIPT_DIR=$(dirname $(readlink -f "$0"))
5 TOP=$(readlink -f "$SCRIPT_DIR/../")
6 source "$TOP/tests/common"
7
8 setup_root_helper
9
10 if [ "$BUILD_VERBOSE" = 1 ]; then
11         verbose=-print
12 fi
13
14 $SUDO_HELPER umount "$TEST_MNT" &>/dev/null
15
16 if ! cd "$TOP/tests"; then
17         echo "ERROR: cannot cd to $TOP/tests"
18         exit 1
19 fi
20
21 find fsck-tests -type f -name '*.restored' $verbose -delete
22
23 # do not remove, the file could have special permissions set
24 echo -n > test.img