]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: ceph-helpers.sh get_osds with no trailing whitespace
authorLoic Dachary <ldachary@redhat.com>
Sat, 30 May 2015 15:02:08 +0000 (17:02 +0200)
committerLoic Dachary <ldachary@redhat.com>
Wed, 8 Jul 2015 14:14:23 +0000 (16:14 +0200)
Trim the trailing whitespace of the get_osds output to help with
comparisons.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
qa/workunits/ceph-helpers.sh

index 7e3dd2ce8f9f688f77e05fc5089abe1efb98b9e2..880f3d6c31e542189a8610f41c3d5fc74a6b4c43 100755 (executable)
@@ -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
 }