From: Loic Dachary Date: Wed, 3 Sep 2014 12:17:17 +0000 (+0200) Subject: tests: add get_osds() and get_pg() helpers X-Git-Tag: v0.86~53^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=191d67cb4645919527c557af35fd43717148e159;p=ceph.git tests: add get_osds() and get_pg() helpers To get the ordered list of OSD to which an object is mapped and the name of the corresponding PG. Signed-off-by: Loic Dachary --- diff --git a/src/test/erasure-code/test-erasure-code.sh b/src/test/erasure-code/test-erasure-code.sh index 6f31673c1c99..e7543199955d 100755 --- a/src/test/erasure-code/test-erasure-code.sh +++ b/src/test/erasure-code/test-erasure-code.sh @@ -204,14 +204,6 @@ function TEST_alignment_constraints() { rm $dir/ORIGINAL } -function get_osds() { - local poolname=$1 - local objectname=$2 - - ./ceph osd map $poolname $objectname | \ - perl -p -e 's/.*up \(\[(.*?)\].*/$1/; s/,/ /g' -} - function chunk_size() { local stripe_width=$(./ceph-conf --show-config-value osd_pool_erasure_code_stripe_width) eval local $(./ceph osd erasure-code-profile get default | grep k=) diff --git a/src/test/osd/osd-test-helpers.sh b/src/test/osd/osd-test-helpers.sh index a1b073ae4518..28d8544b6cfe 100644 --- a/src/test/osd/osd-test-helpers.sh +++ b/src/test/osd/osd-test-helpers.sh @@ -68,3 +68,19 @@ function run_osd() { return $status } + +function get_osds() { + local poolname=$1 + local objectname=$2 + + ./ceph osd map $poolname $objectname | \ + perl -p -e 's/.*up \(\[(.*?)\].*/$1/; s/,/ /g' +} + +function get_pg() { + local poolname=$1 + local objectname=$2 + + ./ceph osd map $poolname $objectname | \ + perl -p -e 's/.*\((.*?)\) -> up.*/$1/' +}