From: Mykola Golub Date: Tue, 7 Jul 2015 06:54:24 +0000 (+0300) Subject: qa: add tests for 'ceph mds metadata' command X-Git-Tag: v9.0.3~26^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b53e3e275f11fbbb53f83f0bf14b8fe874b561d2;p=ceph.git qa: add tests for 'ceph mds metadata' command Signed-off-by: Mykola Golub --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index f6f7460fbbd5..f93c8e7fdd3f 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -579,6 +579,7 @@ function test_mon_misc() ceph_watch_wait "$mymsg" ceph mon_metadata a + ceph node ls } function check_mds_active() @@ -884,6 +885,25 @@ function test_mon_mds() ceph osd pool delete fs_metadata fs_metadata --yes-i-really-really-mean-it } +function test_mon_mds_metadata() +{ + local nmons=$(ceph tell 'mon.*' version | grep -c 'version') + test "$nmons" -gt 0 + + ceph mds dump | + sed -nEe "s/^([0-9]+):.*'([a-z])' mds\\.([0-9]+)\\..*/\\1 \\2 \\3/p" | + while read gid id rank; do + ceph mds metadata ${gid} | grep '"hostname":' + ceph mds metadata ${id} | grep '"hostname":' + ceph mds metadata ${rank} | grep '"hostname":' + + local n=$(ceph tell 'mon.*' mds metadata ${id} | grep -c '"hostname":') + test "$n" -eq "$nmons" + done + + expect_false ceph mds metadata UNKNOWN +} + function test_mon_mon() { # print help message @@ -1642,6 +1662,7 @@ OSD_TESTS+=" osd_bench" MDS_TESTS+=" mds_tell" MDS_TESTS+=" mon_mds" +MDS_TESTS+=" mon_mds_metadata" TESTS+=$MON_TESTS TESTS+=$OSD_TESTS