tests: use get_pg from ceph-helpers.sh

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>
This commit is contained in:
Loic Dachary 2015-05-31 15:13:52 +02:00
parent 64944d4105
commit d2cc2b184b
3 changed files with 4 additions and 18 deletions

View 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

2
debian/control vendored
View 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.

View File

@ -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