From 7fb7812acd1425778961daa828be626ae2ba3165 Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Wed, 22 May 2019 11:01:08 +0200 Subject: [PATCH] qa: Fix issues in vstart runner Add missing timeout parameter to LocalRemote::run() and LocalCephManager::admin_socket() method Fixes: https://tracker.ceph.com/issues/40054 cherry picked from commit 00e3022710dc49f72005ef2e34efea10f279bfb3 partial manual backport of 8620c4caf55d3ee6424a8f83ab3f3934a705be5f (partly because the origin patch contains changes that i was not affected from and i don't know if they are needed in Mimic and do not break something). Signed-off-by: Volker Theile --- qa/tasks/vstart_runner.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index 4e6d15a98e201..44933b7c0440c 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -231,7 +231,7 @@ class LocalRemote(object): def run(self, args, check_status=True, wait=True, stdout=None, stderr=None, cwd=None, stdin=None, - logger=None, label=None, env=None): + logger=None, label=None, env=None, timeout=None): log.info("run args={0}".format(args)) # We don't need no stinkin' sudo @@ -397,8 +397,8 @@ def safe_kill(pid): class LocalFuseMount(FuseMount): - def __init__(self, test_dir, client_id): - super(LocalFuseMount, self).__init__(None, test_dir, client_id, LocalRemote()) + def __init__(self, ctx, test_dir, client_id): + super(LocalFuseMount, self).__init__(ctx, None, test_dir, client_id, LocalRemote()) @property def config_path(self): @@ -574,9 +574,11 @@ class LocalCephManager(CephManager): proc = self.controller.run([os.path.join(BIN_PREFIX, "ceph")] + list(args), **kwargs) return proc.exitstatus - def admin_socket(self, daemon_type, daemon_id, command, check_status=True): + def admin_socket(self, daemon_type, daemon_id, command, check_status=True, timeout=None): return self.controller.run( - args=[os.path.join(BIN_PREFIX, "ceph"), "daemon", "{0}.{1}".format(daemon_type, daemon_id)] + command, check_status=check_status + args=[os.path.join(BIN_PREFIX, "ceph"), "daemon", "{0}.{1}".format(daemon_type, daemon_id)] + command, + check_status=check_status, + timeout=timeout ) @@ -903,6 +905,11 @@ def exec_test(): test_dir = tempfile.mkdtemp() teuth_config['test_path'] = test_dir + ctx = LocalContext() + ceph_cluster = LocalCephCluster(ctx) + mds_cluster = LocalMDSCluster(ctx) + mgr_cluster = LocalMgrCluster(ctx) + # Construct Mount classes mounts = [] for client_id in clients: @@ -918,7 +925,7 @@ def exec_test(): open("./keyring", "a").write(p.stdout.getvalue()) - mount = LocalFuseMount(test_dir, client_id) + mount = LocalFuseMount(ctx, test_dir, client_id) mounts.append(mount) if mount.is_mounted(): log.warn("unmounting {0}".format(mount.mountpoint)) @@ -927,11 +934,6 @@ def exec_test(): if os.path.exists(mount.mountpoint): os.rmdir(mount.mountpoint) - ctx = LocalContext() - ceph_cluster = LocalCephCluster(ctx) - mds_cluster = LocalMDSCluster(ctx) - mgr_cluster = LocalMgrCluster(ctx) - from tasks.cephfs_test_runner import DecoratingLoader class LogStream(object): -- 2.47.3