]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rados/test_rados_tool.sh: make it run under ctest
authorWillem Jan Withagen <wjw@digiware.nl>
Wed, 6 Jul 2016 18:00:09 +0000 (20:00 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Thu, 7 Jul 2016 12:57:03 +0000 (14:57 +0200)
 - This script is always called from a controlled environment
 - use CEPH_BIN for exec's, otherwise QA sets PATH correctly

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
qa/workunits/rados/test_rados_tool.sh

index 8aef84aedbd733b6f37986d56db3135b00088e93..2defe48242c685aecde9ba529001a2a75e807595 100755 (executable)
@@ -49,21 +49,22 @@ run() {
     do_run "$@"
 }
 
-DNAME="`dirname $0`"
-DNAME="`readlink -f $DNAME`"
-RADOS_TOOL="`readlink -f \"$DNAME/../rados\"`"
-if ! test -f $RADOS_TOOL ; then
-    RADOS_TOOL=$(which rados)
-fi
-CEPH_TOOL="`readlink -f \"$DNAME/../ceph\"`"
-if ! test -f $CEPH_TOOL ; then
-    CEPH_TOOL=$(which ceph)
+if [ -n "$CEPH_BIN" ] ; then
+   # CMake env
+   RADOS_TOOL="$CEPH_BIN/rados"
+   CEPH_TOOL="$CEPH_BIN/ceph"
+else
+   # executables should be installed by the QA env 
+   RADOS_TOOL=$(which rados)
+   CEPH_TOOL=$(which ceph)
 fi
+
 KEEP_TEMP_FILES=0
 POOL=trs_pool
 POOL_CP_TARGET=trs_pool.2
 
 [ -x "$RADOS_TOOL" ] || die "couldn't find $RADOS_TOOL binary to test"
+[ -x "$CEPH_TOOL" ] || die "couldn't find $CEPH_TOOL binary to test"
 
 while getopts  "c:hkp:" flag; do
     case $flag in
@@ -304,7 +305,7 @@ test_xattr() {
     $RADOS_TOOL -p $POOL listxattr $OBJ > $V1
     grep -q foo $V1
     grep -q bar $V1
-    wc -l $V1 | grep -q "^2 "
+    [ `cat $V1 | wc -l` -eq 2 ]
     rm $V1 $V2
     cleanup
 }