From: David Zafman Date: Wed, 6 Apr 2016 20:41:45 +0000 (-0700) Subject: test: Test rados ls with --all option X-Git-Tag: v11.0.0~689 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1976ee7fc240af3e1ae39b3b87306c3532cc9513;p=ceph.git test: Test rados ls with --all option Signed-off-by: David Zafman --- diff --git a/qa/workunits/rados/test_rados_tool.sh b/qa/workunits/rados/test_rados_tool.sh index 54103a70efb3..411adfac655f 100755 --- a/qa/workunits/rados/test_rados_tool.sh +++ b/qa/workunits/rados/test_rados_tool.sh @@ -323,9 +323,51 @@ test_rmobj() { rm $V1 } +test_ls() { + echo "Testing rados ls command" + p=`uuidgen` + $CEPH_TOOL osd pool create $p 1 + NS=10 + OBJS=20 + # Include default namespace (0) in the total + TOTAL=$(expr $OBJS \* $(expr $NS + 1)) + + for nsnum in `seq 0 $NS` + do + for onum in `seq 1 $OBJS` + do + if [ "$nsnum" = "0" ]; + then + "$RADOS_TOOL" -p $p put obj${onum} /etc/fstab 2> /dev/null + else + "$RADOS_TOOL" -p $p -N "NS${nsnum}" put obj${onum} /etc/fstab 2> /dev/null + fi + done + done + CHECK=$("$RADOS_TOOL" -p $p ls 2> /dev/null | wc -l) + if test "$OBJS" != "$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"; + 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"; + then + die "Created $TOTAL objects but saw $CHECK" + fi + + $RADOS_TOOL rmpool $p $p --yes-i-really-really-mean-it +} + test_xattr test_omap test_rmobj +test_ls echo "SUCCESS!" exit 0