From: Kefu Chai Date: Thu, 4 Jun 2015 09:45:09 +0000 (+0800) Subject: test: fix the plugin_exists() X-Git-Tag: v9.0.2~53^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6bd425b025c8841f2c53b0bfd64fd8d4123a22de;p=ceph.git test: fix the plugin_exists() in 8e61a99, we try to init the plugin when user set a profile using "ceph osd erasure-code-profile set ", 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 --- diff --git a/src/test/erasure-code/test-erasure-code.sh b/src/test/erasure-code/test-erasure-code.sh index 0a6f1a53d57..ba62ba57e0f 100755 --- a/src/test/erasure-code/test-erasure-code.sh +++ b/src/test/erasure-code/test-erasure-code.sh @@ -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 }