From: Willem Jan Withagen Date: Wed, 6 Jul 2016 19:51:59 +0000 (+0200) Subject: rados/test_rados_tool.sh: Improve on testing conditions X-Git-Tag: ses5-milestone5~387^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a939e993411fb8bd38ed63c5b780fbf0719a327a;p=ceph.git rados/test_rados_tool.sh: Improve on testing conditions - have test aka [] use numeric comparisons - suppress the filename on 'wc -l' by pipping the file 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 2defe48242c..56092ed7a35 100755 --- a/qa/workunits/rados/test_rados_tool.sh +++ b/qa/workunits/rados/test_rados_tool.sh @@ -346,18 +346,18 @@ test_ls() { done done CHECK=$("$RADOS_TOOL" -p $p ls 2> /dev/null | wc -l) - if test "$OBJS" != "$CHECK"; + if [ "$OBJS" -ne "$CHECK" ]; then die "Created $OBJS objects in default namespace but saw $CHECK" fi TESTNS=NS${NS} CHECK=$("$RADOS_TOOL" -p $p -N $TESTNS ls 2> /dev/null | wc -l) - if test "$OBJS" != "$CHECK"; + if [ "$OBJS" -ne "$CHECK" ]; then die "Created $OBJS objects in $TESTNS namespace but saw $CHECK" fi CHECK=$("$RADOS_TOOL" -p $p --all ls 2> /dev/null | wc -l) - if test "$TOTAL" != "$CHECK"; + if [ "$TOTAL" -ne "$CHECK" ]; then die "Created $TOTAL objects but saw $CHECK" fi @@ -400,7 +400,7 @@ test_cleanup() { $RADOS_TOOL -p $p -N NS3 cleanup 2> /dev/null #echo "Check NS3 after specific cleanup" CHECK=$($RADOS_TOOL -p $p -N NS3 ls | wc -l) - if test "$OBJS" != "$CHECK"; + if [ "$OBJS" -ne "$CHECK" ] ; then die "Expected $OBJS objects in NS3 but saw $CHECK" fi @@ -410,7 +410,7 @@ test_cleanup() { #echo "Check all namespaces" $RADOS_TOOL -p $p --all ls > $TDIR/after.ls.out 2> /dev/null CHECK=$(cat $TDIR/after.ls.out | wc -l) - if test "$TOTAL" != "$CHECK"; + if [ "$TOTAL" -ne "$CHECK" ]; then die "Expected $TOTAL objects but saw $CHECK" fi