]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/standalone: extract delete_pool() 20634/head
authorKefu Chai <kchai@redhat.com>
Wed, 28 Feb 2018 07:40:25 +0000 (15:40 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 28 Feb 2018 07:40:28 +0000 (15:40 +0800)
some tests, like osd-backfill-stats.sh are using delete_pool(), but
they don't have this function defined. and this function is defined
in standalone tests separately, so would be simpler if we can
consolidate them in ceph-helper.sh.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/standalone/ceph-helpers.sh
qa/standalone/erasure-code/test-erasure-code.sh
qa/standalone/erasure-code/test-erasure-eio.sh
qa/standalone/osd/osd-rep-recov-eio.sh

index f66eef3631bb80f7d71788cc27e9d7b87143b6ed..2d84ef8eabd62cecc3a4edf7f42f86a9c358ddd4 100755 (executable)
@@ -509,6 +509,11 @@ function create_pool() {
     sleep 1
 }
 
+function delete_pool() {
+    local poolname=$1
+    ceph osd pool delete $poolname $poolname --yes-i-really-really-mean-it
+}
+
 #######################################################################
 
 function run_mgr() {
index eab6ff3c13d742e8f1311e825b60520e4cb65ad0..ecdc25421ca7e4c969e2aee837aa9d39b01c276a 100755 (executable)
@@ -62,12 +62,6 @@ function create_erasure_coded_pool() {
     wait_for_clean || return 1
 }
 
-function delete_pool() {
-    local poolname=$1
-
-    ceph osd pool delete $poolname $poolname --yes-i-really-really-mean-it
-}
-
 function rados_put_get() {
     local dir=$1
     local poolname=$2
index 13b64f1238b7f25dfb35c2be60bc433af9fbddb6..ac2a5ffa2302a15a2433554f792c2e328ea5b415 100755 (executable)
@@ -80,9 +80,8 @@ function create_erasure_coded_pool() {
     wait_for_clean || return 1
 }
 
-function delete_pool() {
+function delete_erasure_coded_pool() {
     local poolname=$1
-
     ceph osd pool delete $poolname $poolname --yes-i-really-really-mean-it
     ceph osd erasure-code-profile rm myprofile
 }
@@ -260,7 +259,7 @@ function TEST_rados_get_subread_eio_shard_0() {
     # inject eio on primary OSD (0) and replica OSD (1)
     local shard_id=0
     rados_put_get_data eio $dir $shard_id || return 1
-    delete_pool $poolname
+    delete_erasure_pool $poolname
 }
 
 function TEST_rados_get_subread_eio_shard_1() {
@@ -272,7 +271,7 @@ function TEST_rados_get_subread_eio_shard_1() {
     # inject eio into replicas OSD (1) and OSD (2)
     local shard_id=1
     rados_put_get_data eio $dir $shard_id || return 1
-    delete_pool $poolname
+    delete_erasure_coded_pool $poolname
 }
 
 # We don't remove the object from the primary because
@@ -287,7 +286,7 @@ function TEST_rados_get_subread_missing() {
     # inject remove into replicas OSD (1) and OSD (2)
     local shard_id=1
     rados_put_get_data remove $dir $shard_id || return 1
-    delete_pool $poolname
+    delete_erasure_coded_pool $poolname
 }
 
 #
@@ -309,7 +308,7 @@ function TEST_rados_get_bad_size_shard_0() {
     rados_get_data_bad_size $dir $shard_id 10 || return 1
     rados_get_data_bad_size $dir $shard_id 0 || return 1
     rados_get_data_bad_size $dir $shard_id 256 add || return 1
-    delete_pool $poolname
+    delete_erasure_coded_pool $poolname
 }
 
 function TEST_rados_get_bad_size_shard_1() {
@@ -323,7 +322,7 @@ function TEST_rados_get_bad_size_shard_1() {
     rados_get_data_bad_size $dir $shard_id 10 || return 1
     rados_get_data_bad_size $dir $shard_id 0 || return 1
     rados_get_data_bad_size $dir $shard_id 256 add || return 1
-    delete_pool $poolname
+    delete_erasure_coded_pool $poolname
 }
 
 function TEST_rados_get_with_subreadall_eio_shard_0() {
@@ -337,7 +336,7 @@ function TEST_rados_get_with_subreadall_eio_shard_0() {
     # inject eio on primary OSD (0)
     rados_put_get_data eio $dir $shard_id recovery || return 1
 
-    delete_pool $poolname
+    delete_erasure_coded_pool $poolname
 }
 
 function TEST_rados_get_with_subreadall_eio_shard_1() {
@@ -351,7 +350,7 @@ function TEST_rados_get_with_subreadall_eio_shard_1() {
     # inject eio on replica OSD (1)
     rados_put_get_data eio $dir $shard_id recovery || return 1
 
-    delete_pool $poolname
+    delete_erasure_coded_pool $poolname
 }
 
 # Test recovery the first k copies aren't all available
@@ -377,7 +376,7 @@ function TEST_ec_recovery_errors() {
     # Cluster should recover this object
     wait_for_clean || return 1
 
-    delete_pool $poolname
+    delete_erasure_coded_pool $poolname
 }
 
 # Test backfill with unfound object
@@ -455,7 +454,7 @@ function TEST_ec_backfill_unfound() {
 
     rm -f ${dir}/ORIGINAL ${dir}/CHECK
 
-    delete_pool $poolname
+    delete_erasure_coded_pool $poolname
 }
 
 # Test recovery with unfound object
@@ -531,7 +530,7 @@ function TEST_ec_recovery_unfound() {
 
     rm -f ${dir}/ORIGINAL ${dir}/CHECK
 
-    delete_pool $poolname
+    delete_erasure_coded_pool $poolname
 }
 
 main test-erasure-eio "$@"
index d0fe538363c80cf87fc3a4bc7b3fe15b87ec45dc..3a478566320be5c691c9fa4022c61c91f1412ed1 100755 (executable)
@@ -57,12 +57,6 @@ function get_state() {
         jq -r ".[] | select(.pgid==\"$pgid\") | .$sname"
 }
 
-function delete_pool() {
-    local poolname=$1
-
-    ceph osd pool delete $poolname $poolname --yes-i-really-really-mean-it
-}
-
 function rados_put() {
     local dir=$1
     local poolname=$2