From da5b25db64d4807ce2b5c519e779534a65f6e12a Mon Sep 17 00:00:00 2001 From: John Spray Date: Fri, 7 Sep 2018 11:08:32 -0400 Subject: [PATCH] qa/vstart_runner: fix daemons list This was missing a cluster name prefix that was added at some point, and consequently calls to iter_daemons_of_role were returning no daemons. This was causing e.g. TestVolumeClient.test_data_isolated to fail when run in vstart_runner. Signed-off-by: John Spray --- qa/tasks/vstart_runner.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index b5b18743429..5e7278b36e2 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -312,6 +312,10 @@ class LocalDaemon(object): def running(self): return self._get_pid() is not None + def check_status(self): + if self.proc: + return self.proc.poll() + def _get_pid(self): """ Return PID as an integer or None if not found @@ -674,7 +678,7 @@ class LocalMDSCluster(LocalCephCluster, MDSCluster): def __init__(self, ctx): super(LocalMDSCluster, self).__init__(ctx) - self.mds_ids = ctx.daemons.daemons['mds'].keys() + self.mds_ids = ctx.daemons.daemons['ceph.mds'].keys() self.mds_daemons = dict([(id_, LocalDaemon("mds", id_)) for id_ in self.mds_ids]) def clear_firewall(self): @@ -689,7 +693,7 @@ class LocalMgrCluster(LocalCephCluster, MgrCluster): def __init__(self, ctx): super(LocalMgrCluster, self).__init__(ctx) - self.mgr_ids = ctx.daemons.daemons['mgr'].keys() + self.mgr_ids = ctx.daemons.daemons['ceph.mgr'].keys() self.mgr_daemons = dict([(id_, LocalDaemon("mgr", id_)) for id_ in self.mgr_ids]) @@ -844,12 +848,13 @@ class LocalContext(object): # Inspect ceph.conf to see what roles exist for conf_line in open("ceph.conf").readlines(): for svc_type in ["mon", "osd", "mds", "mgr"]: - if svc_type not in self.daemons.daemons: - self.daemons.daemons[svc_type] = {} + prefixed_type = "ceph." + svc_type + if prefixed_type not in self.daemons.daemons: + self.daemons.daemons[prefixed_type] = {} match = re.match("^\[{0}\.(.+)\]$".format(svc_type), conf_line) if match: svc_id = match.group(1) - self.daemons.daemons[svc_type][svc_id] = LocalDaemon(svc_type, svc_id) + self.daemons.daemons[prefixed_type][svc_id] = LocalDaemon(svc_type, svc_id) def __del__(self): shutil.rmtree(self.teuthology_config['test_path']) -- 2.39.5