]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rados: Add tests for CLI strict parsing
authorAdam Crume <adamcrume@gmail.com>
Fri, 10 Oct 2014 20:33:39 +0000 (13:33 -0700)
committerAdam Crume <adamcrume@gmail.com>
Fri, 10 Oct 2014 20:33:39 +0000 (13:33 -0700)
Fixes: 8983
Signed-off-by: Adam Crume <adamcrume@gmail.com>
src/test/test_rados_tool.sh

index f85250d59ec213f213b1c65281daebf9bf3a40c8..afd5f91a938d3b693943aa590f4e431f1dd08bb6 100755 (executable)
@@ -220,5 +220,48 @@ done
 diff -q -r "$TDIR/dir_cp_src" "$TDIR/dir_cp_dst" \
     || die "copy pool validation failed!"
 
+for opt in \
+    block-size \
+    concurrent-ios \
+    min-object-size \
+    max-object-size \
+    min-op-len \
+    max-op-len \
+    max-ops \
+    max-backlog \
+    target-throughput \
+    read-percent \
+    num-objects \
+    run-length \
+    ; do
+    run_expect_succ "$RADOS_TOOL" --$opt 4 df
+    run_expect_fail "$RADOS_TOOL" --$opt 4k df
+done
+
+run_expect_succ "$RADOS_TOOL" lock list f.1 --lock-duration 4 --pool "$POOL"
+echo # previous command doesn't output an end of line: issue #9735
+run_expect_fail "$RADOS_TOOL" lock list f.1 --lock-duration 4k --pool "$POOL"
+
+run_expect_succ "$RADOS_TOOL" mksnap snap1 --pool "$POOL"
+snapid=$("$RADOS_TOOL" lssnap --pool "$POOL" | grep snap1 | cut -f1)
+[ $? -ne 0 ] && die "expected success, but got failure! cmd: \"$RADOS_TOOL\" lssnap --pool \"$POOL\" | grep snap1 | cut -f1"
+run_expect_succ "$RADOS_TOOL" ls --pool "$POOL" --snapid="$snapid"
+run_expect_fail "$RADOS_TOOL" ls --pool "$POOL" --snapid="$snapid"k
+
+run_expect_succ "$RADOS_TOOL" chown 1 --pool "$POOL"
+run_expect_fail "$RADOS_TOOL" chown 1k --pool "$POOL"
+
+run_expect_succ "$RADOS_TOOL" truncate f.1 0 --pool "$POOL"
+run_expect_fail "$RADOS_TOOL" truncate f.1 0k --pool "$POOL"
+
+run "$RADOS_TOOL" rmpool delete_me_mkpool_test delete_me_mkpool_test --yes-i-really-really-mean-it
+run_expect_succ "$RADOS_TOOL" mkpool delete_me_mkpool_test 0 0
+run_expect_fail "$RADOS_TOOL" mkpool delete_me_mkpool_test2 0k 0
+run_expect_fail "$RADOS_TOOL" mkpool delete_me_mkpool_test3 0 0k
+
+run_expect_succ "$RADOS_TOOL" --pool "$POOL" bench 1 write
+run_expect_fail "$RADOS_TOOL" --pool "$POOL" bench 1k write
+
+
 echo "SUCCESS!"
 exit 0