]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: new integration test for validating new RBD pools 6925/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 14 Dec 2015 22:49:55 +0000 (17:49 -0500)
committerJason Dillaman <dillaman@redhat.com>
Mon, 14 Dec 2015 22:49:55 +0000 (17:49 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
qa/workunits/rbd/verify_pool.sh [new file with mode: 0755]
src/test/run-rbd-tests

diff --git a/qa/workunits/rbd/verify_pool.sh b/qa/workunits/rbd/verify_pool.sh
new file mode 100755 (executable)
index 0000000..73f1864
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh -ex
+
+POOL_NAME=rbd_test_validate_pool
+PG_NUM=100
+
+function tear_down() {
+  ceph osd pool delete $POOL_NAME $POOL_NAME --yes-i-really-really-mean-it || true
+}
+
+function set_up() {
+  tear_down
+  ceph osd pool create $POOL_NAME $PG_NUM
+  ceph osd pool mksnap $POOL_NAME snap
+}
+
+trap tear_down EXIT HUP INT
+set_up
+
+# creating an image in a pool-managed snapshot pool should fail
+rbd create --pool $POOL_NAME --size 1 foo && exit 1 || true
+
+# should succeed if images already exist in the pool
+rados --pool $POOL_NAME create rbd_directory
+rbd create --pool $POOL_NAME --size 1 foo
+
+echo OK
index dd76ce72185640c6e669e3b76ed8c0aef9af39de..c9e1e2c53fed0811cb6662830170dc57b2be98b1 100755 (executable)
@@ -23,6 +23,16 @@ run_cli_tests() {
     $CEPH_SRC/../qa/workunits/rbd/journal.sh
 }
 
+# tests that do not depend on image format / features
+run_generic_tests() {
+    $CEPH_SRC/../qa/workunits/rbd/verify_pool.sh
+
+    recreate_pool rbd
+    $CEPH_SRC/../qa/workunits/rbd/journal.sh
+    recreate_pool rbd
+    $CEPH_SRC/../qa/workunits/rbd/test_admin_socket.sh
+}
+
 run_api_tests() {
     # skip many_snaps since it takes several minutes
     nosetests -v test_rbd -e '.*many_snaps'
@@ -30,15 +40,10 @@ run_api_tests() {
     ceph_test_librbd
 }
 
-run_admin_socket_tests() {
-    recreate_pool rbd
-    $CEPH_SRC/../qa/workunits/rbd/test_admin_socket.sh
-}
-
 ceph_test_cls_rbd
+run_generic_tests
 run_api_tests
 run_cli_tests
-run_admin_socket_tests
 
 export RBD_CREATE_ARGS="--image-format 2"
 run_cli_tests