summaryrefslogtreecommitdiff
path: root/tests/common
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/common b/tests/common
index 91a73e1b..94cf913c 100644
--- a/tests/common
+++ b/tests/common
@@ -5,7 +5,7 @@
_fail()
{
- echo "$*" | tee -a $RESULT
+ echo "$*" | tee -a $RESULTS
exit 1
}
@@ -17,13 +17,13 @@ _not_run()
run_check()
{
- echo "############### $@" >> $RESULT 2>&1
- "$@" >> $RESULT 2>&1 || _fail "failed: $@"
+ echo "############### $@" >> $RESULTS 2>&1
+ "$@" >> $RESULTS 2>&1 || _fail "failed: $@"
}
check_prereq()
{
- if ! [ -f $top/$1 ]; then
+ if ! [ -f $TOP/$1 ]; then
_fail "Failed prerequisities: $1";
fi
}
@@ -31,12 +31,12 @@ check_prereq()
check_image()
{
image=$1
- echo "testing image $(basename $image)" >> $RESULT
- $top/btrfs check $image >> $RESULT 2>&1
+ echo "testing image $(basename $image)" >> $RESULTS
+ $TOP/btrfs check $image >> $RESULTS 2>&1
[ $? -eq 0 ] && _fail "btrfs check should have detected corruption"
- run_check $top/btrfs check --repair $image
- run_check $top/btrfs check $image
+ run_check $TOP/btrfs check --repair $image
+ run_check $TOP/btrfs check $image
}
check_all_images()
@@ -44,8 +44,8 @@ check_all_images()
dir=$1
for i in $(find $dir -iname '*.img')
do
- echo "extracting image $(basename $i)" >> $RESULT
- $top/btrfs-image -r $i $i.restored || \
+ echo "extracting image $(basename $i)" >> $RESULTS
+ $TOP/btrfs-image -r $i $i.restored || \
_fail "failed to extract image $i"
check_image $i.restored