Merge pull request #14468 from tchaikov/wip-show-me-fake-plugin

qa/workunits/ceph-helpers: display rejected string

Reviewed-by: Loic Dachary <ldachary@redhat.com>
Reviewed-by: Brad Hubbard <bhubbard@redhat.com>
This commit is contained in:
Kefu Chai 2017-04-13 22:24:03 +08:00 committed by GitHub
commit 8442cbb521

View File

@ -1163,7 +1163,6 @@ function test_is_clean() {
run_mon $dir a --osd_pool_default_size=1 || return 1
run_mgr $dir x || return 1
run_osd $dir 0 || return 1
! is_clean || return 1
wait_for_clean || return 1
is_clean || return 1
teardown $dir || return 1
@ -1443,19 +1442,20 @@ function erasure_code_plugin_exists() {
local plugin=$1
local status
local grepstr
local s
case `uname` in
FreeBSD) grepstr="Cannot open.*$plugin" ;;
*) grepstr="$plugin.*No such file" ;;
esac
if ceph osd erasure-code-profile set TESTPROFILE plugin=$plugin 2>&1 |
grep "$grepstr" ; then
# display why the string was rejected.
ceph osd erasure-code-profile set TESTPROFILE plugin=$plugin
status=1
else
status=0
s=$(ceph osd erasure-code-profile set TESTPROFILE plugin=$plugin 2>&1)
local status=$?
if [ $status -eq 0 ]; then
ceph osd erasure-code-profile rm TESTPROFILE
elif ! echo $s | grep --quiet "$grepstr" ; then
status=1
# display why the string was rejected.
echo $s
fi
return $status
}