]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test/pybind/test_rados: fix accidental mon tell test
authorSage Weil <sage@redhat.com>
Wed, 11 Sep 2019 15:47:03 +0000 (10:47 -0500)
committerSage Weil <sage@redhat.com>
Fri, 4 Oct 2019 14:07:02 +0000 (09:07 -0500)
This test assumed 'mon dump' (a CLI command) would work when targetted at
a specific mon (i.e., a tell command).

Signed-off-by: Sage Weil <sage@redhat.com>
src/test/pybind/test_rados.py

index 8d65942f4a8da8dd1431d165ed1b027871f514a1..967fc0adae5b49750289f2cb2fcf793fdcc96513 100644 (file)
@@ -1079,25 +1079,26 @@ class TestCommand(object):
         eq(len(buf), 0)
         del cmd['epoch']
 
-        # send to specific target by name
+        # send to specific target by name, rank
+        cmd = {"prefix": "version"}
+
         target = d['mons'][0]['name']
         print(target)
         ret, buf, errs = self.rados.mon_command(json.dumps(cmd), b'', timeout=30,
                                                 target=target)
         eq(ret, 0)
         assert len(buf) > 0
-        d = json.loads(buf.decode("utf-8"))
-        assert('epoch' in d)
+        e = json.loads(buf.decode("utf-8"))
+        assert('release' in e)
 
-        # and by rank
         target = d['mons'][0]['rank']
         print(target)
         ret, buf, errs = self.rados.mon_command(json.dumps(cmd), b'', timeout=30,
                                                 target=target)
         eq(ret, 0)
         assert len(buf) > 0
-        d = json.loads(buf.decode("utf-8"))
-        assert('epoch' in d)
+        e = json.loads(buf.decode("utf-8"))
+        assert('release' in e)
 
     def test_osd_bench(self):
         cmd = dict(prefix='bench', size=4096, count=8192)