From: Loic Dachary Date: Sat, 30 May 2015 15:02:08 +0000 (+0200) Subject: tests: ceph-helpers.sh get_osds with no trailing whitespace X-Git-Tag: v9.0.3~75^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=96ec2a744420a83ddd4eafb0041d66aa9be97a36;p=ceph.git tests: ceph-helpers.sh get_osds with no trailing whitespace Trim the trailing whitespace of the get_osds output to help with comparisons. Signed-off-by: Loic Dachary --- diff --git a/qa/workunits/ceph-helpers.sh b/qa/workunits/ceph-helpers.sh index 7e3dd2ce8f9f..880f3d6c31e5 100755 --- a/qa/workunits/ceph-helpers.sh +++ b/qa/workunits/ceph-helpers.sh @@ -589,8 +589,10 @@ function get_osds() { local poolname=$1 local objectname=$2 - ceph --format xml osd map $poolname $objectname 2>/dev/null | \ - $XMLSTARLET sel -t -m "//acting/osd" -v . -o ' ' + local osds=$(ceph --format xml osd map $poolname $objectname 2>/dev/null | \ + $XMLSTARLET sel -t -m "//acting/osd" -v . -o ' ') + # get rid of the trailing space + echo $osds } function test_get_osds() { @@ -601,7 +603,7 @@ function test_get_osds() { run_osd $dir 0 || return 1 run_osd $dir 1 || return 1 wait_for_clean || return 1 - get_osds rbd GROUP | grep --quiet '[0-1] [0-1] ' || return 1 + get_osds rbd GROUP | grep --quiet '^[0-1] [0-1]$' || return 1 teardown $dir || return 1 }