From: Willem Jan Withagen Date: Wed, 6 Jul 2016 18:00:09 +0000 (+0200) Subject: qa/workunits/rados/test_rados_tool.sh: make it run under ctest X-Git-Tag: ses5-milestone5~387^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6029b5974b6b2ca7e200b5f0333dc2b9a3a65fd1;p=ceph.git qa/workunits/rados/test_rados_tool.sh: make it run under ctest - 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 --- diff --git a/qa/workunits/rados/test_rados_tool.sh b/qa/workunits/rados/test_rados_tool.sh index 8aef84aedbd7..2defe48242c6 100755 --- a/qa/workunits/rados/test_rados_tool.sh +++ b/qa/workunits/rados/test_rados_tool.sh @@ -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 }