From aa0ffb313c3815d9796462f1e0de4d1ecb9cee4f Mon Sep 17 00:00:00 2001 From: John Spray Date: Fri, 22 May 2015 11:01:55 +0100 Subject: [PATCH] tasks/cephfs: reset osd blacklist between tests ...to avoid OSDMap modifications happening in the background due to blacklist expiry. Fixes: #11301 Signed-off-by: John Spray --- tasks/cephfs/cephfs_test_case.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/cephfs/cephfs_test_case.py b/tasks/cephfs/cephfs_test_case.py index b146154e82842..23a4653368d7f 100644 --- a/tasks/cephfs/cephfs_test_case.py +++ b/tasks/cephfs/cephfs_test_case.py @@ -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(): -- 2.39.5