]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: add get_osds() and get_pg() helpers
authorLoic Dachary <loic-201408@dachary.org>
Wed, 3 Sep 2014 12:17:17 +0000 (14:17 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Tue, 16 Sep 2014 08:28:42 +0000 (10:28 +0200)
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 <loic-201408@dachary.org>
src/test/erasure-code/test-erasure-code.sh
src/test/osd/osd-test-helpers.sh

index 6f31673c1c99ed4bcc4bd0d18ec40db254d25791..e7543199955d7980f1505dce6bab74ff5b303ad6 100755 (executable)
@@ -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=)
index a1b073ae45185262a1a96889fc33239c2df7b52c..28d8544b6cfebcec43a803194b1c2257311234f6 100644 (file)
@@ -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/'
+}