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>
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
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.
#!/bin/bash -x
+source $(dirname $0)/../ceph-helpers.sh
+
set -e
set -o functrace
PS4=' ${FUNCNAME[0]}: $LINENO: '
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