From: Kefu Chai Date: Wed, 12 Apr 2017 04:33:53 +0000 (+0800) Subject: qa/workunits/ceph-helpers: display rejected string X-Git-Tag: v12.0.2~79^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0196e154ed2e164cf55b0d7ed9f9cdd1f4f50100;p=ceph.git qa/workunits/ceph-helpers: display rejected string Signed-off-by: Kefu Chai --- diff --git a/qa/workunits/ceph-helpers.sh b/qa/workunits/ceph-helpers.sh index 316e826f803..c43a369c717 100755 --- a/qa/workunits/ceph-helpers.sh +++ b/qa/workunits/ceph-helpers.sh @@ -1443,19 +1443,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 }