summaryrefslogtreecommitdiff
path: root/tests/common
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-04-03 15:01:12 +0800
committerDavid Sterba <dsterba@suse.cz>2015-04-07 17:22:30 +0200
commit8720e15cd1dc3993729141f54d2c6301cce4415a (patch)
tree0632d31948954b4615b7f32836c6df56ef70506b /tests/common
parentffe9554b7888846e374cedba0e9f21142d988d8f (diff)
btrfs-progs: test-frame: Update variant names
Use upper case variant name for the following variants: 1) top -> TOP 2) script_dir -> SCRIPT_DIR And change the following variant name: 1) RESULT -> RESULTS Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
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