]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: use get_pg from ceph-helpers.sh
authorLoic Dachary <ldachary@redhat.com>
Sun, 31 May 2015 13:13:52 +0000 (15:13 +0200)
committerLoic Dachary <ldachary@redhat.com>
Sun, 31 May 2015 23:11:28 +0000 (01:11 +0200)
The semantic and interface of get_pg are the same, that avoids
duplication and the ceph-helpers.sh version is tested and documented.

Make the ceph-test package dependent on xmlstarlet because it is
needed by ceph-helpers.sh.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
ceph.spec.in
debian/control
qa/workunits/cephtool/test.sh

index 752311cf0ec39c29a2644eb67160ad85805580c8..041e5108787f5ea807899ebcbfe0602bfa07cb3e 100644 (file)
@@ -346,6 +346,7 @@ Summary:    Ceph benchmarks and test tools
 Group:         System Environment/Libraries
 License:       LGPL-2.0
 Requires:      ceph-common
+Requires:      xmlstarlet
 %if (0%{?fedora} >= 20 || 0%{?rhel} == 6)
 BuildRequires: lttng-ust-devel
 BuildRequires: libbabeltrace-devel
index 30764fd8275d80c83b7b62d775393f32e4926b5c..099f4b708aa372c0f67084f0c4423be0a93dd156 100644 (file)
@@ -463,7 +463,7 @@ Description: debugging symbols for rest-bench
 
 Package: ceph-test
 Architecture: linux-any
-Depends: ceph-common, curl, xml2, ${misc:Depends}, ${shlibs:Depends}
+Depends: ceph-common, curl, xml2, xmlstarlet, ${misc:Depends}, ${shlibs:Depends}
 Description: Ceph test and benchmarking tools
  This package contains tools for testing and benchmarking Ceph.
 
index 1b57375f3f3f2f8d0dbee4c1b70a7f26e95f2f79..09c11fd513b08aa483d1b7104aa283bae014fcb5 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash -x
 
+source $(dirname $0)/../ceph-helpers.sh
+
 set -e
 set -o functrace
 PS4=' ${FUNCNAME[0]}: $LINENO: '
@@ -23,23 +25,6 @@ function wait_no_osd_down()
   check_no_osd_down
 }
 
-function get_pg()
-{
-       local pool obj map_output pg
-       pool=$1
-       obj=$2
-       declare -a map_output
-       map_output=($(ceph osd map $1 $2))
-       for (( i=0; i<${#map_output[*]}; i++ )) ; do
-               if [ "${map_output[$i]}" == "pg" ] ; then
-                       pg=${map_output[((i+2))]}
-                       break
-               fi
-       done
-       pg=$(echo $pg | sed 's/[()]//g')
-       echo $pg
-}
-
 function expect_false()
 {
        set -x