]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: fix the plugin_exists() 4859/head
authorKefu Chai <kchai@redhat.com>
Thu, 4 Jun 2015 09:45:09 +0000 (17:45 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 4 Jun 2015 09:51:58 +0000 (17:51 +0800)
in 8e61a99, we try to init the plugin when user set a profile using
"ceph osd erasure-code-profile set <profile-name> <profile>", so
if user passes in an unknown plugin, ceph will reject it right away,
instead of loading the plugin when "ceph osd crush rule create-erasure".

Fixes: #11870
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/erasure-code/test-erasure-code.sh

index 0a6f1a53d57535b88a038b271869f1b84605f4cb..ba62ba57e0fca9c6314b0225bf1a1242a106f635 100755 (executable)
@@ -105,15 +105,13 @@ function plugin_exists() {
     local plugin=$1
 
     local status
-    ./ceph osd erasure-code-profile set TESTPROFILE plugin=$plugin
-    if ./ceph osd crush rule create-erasure TESTRULE TESTPROFILE 2>&1 |
+    if ./ceph osd erasure-code-profile set TESTPROFILE plugin=$plugin 2>&1 |
         grep "$plugin.*No such file" ; then
         status=1
     else
-        ./ceph osd crush rule rm TESTRULE
         status=0
+        ./ceph osd erasure-code-profile rm TESTPROFILE
     fi
-    ./ceph osd erasure-code-profile rm TESTPROFILE 
     return $status
 }