]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: reset osd blacklist between tests
authorJohn Spray <jspray@redhat.com>
Fri, 22 May 2015 10:01:55 +0000 (11:01 +0100)
committerJohn Spray <jspray@redhat.com>
Fri, 22 May 2015 10:04:46 +0000 (11:04 +0100)
...to avoid OSDMap modifications happening in the
background due to blacklist expiry.

Fixes: #11301
Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/cephfs_test_case.py

index b146154e8284235e81e37f26fe4e6f2196ac895b..23a4653368d7f1cad837b0c1d9c8b1dad049e932 100644 (file)
@@ -1,3 +1,4 @@
+import json
 import logging
 import unittest
 from unittest import case
@@ -96,6 +97,13 @@ class CephFSTestCase(unittest.TestCase):
         self.wait_until_true(lambda: not self.fs.is_full(),
                              timeout=osd_mon_report_interval_max * 5)
 
+        # In case anything is in the OSD blacklist list, clear it out.  This is to avoid
+        # the OSD map changing in the background (due to blacklist expiry) while tests run.
+        blacklist = json.loads(self.fs.mon_manager.raw_cluster_cmd("osd", "dump", "--format=json-pretty"))['flags']
+        log.info("Removing {0} blacklist entries".format(len(blacklist)))
+        for addr, blacklisted_at in blacklist.items():
+            self.fs.mon_manager.raw_cluster_cmd("osd", "blacklist", "rm", addr)
+
         self.fs.mds_restart()
         self.fs.wait_for_daemons()
         if not self.mount_a.is_mounted():