]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/standalone: extract delete_pool()
authorKefu Chai <kchai@redhat.com>
Wed, 28 Feb 2018 07:40:25 +0000 (15:40 +0800)
committerDavid Zafman <dzafman@redhat.com>
Wed, 9 May 2018 22:41:10 +0000 (15:41 -0700)
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>
(cherry picked from commit ac56a202fd57d6a18d3852d26a4e5cf4a214bf8a)

Brought into Luminous to make backport clean

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 6a8eebff4b4475fcfd1167220a16682e7ba92ddd..b9dd86bf2030d1246ade886d417534f3623841b0 100755 (executable)
@@ -514,6 +514,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 6dd5833ad04486db57759fcf2519f0932adeebe6..452161dbd2a76a090e5f6e6a49290f6b69425e55 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 5dccebb3ba78f06c22fe8afb195fc340e789acd5..8c4666b4092e9c782ad13d37c6b7b6d927cc515f 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