]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: Fix issues in vstart runner 28208/head
authorVolker Theile <vtheile@suse.com>
Wed, 22 May 2019 09:01:08 +0000 (11:01 +0200)
committerVolker Theile <vtheile@suse.com>
Wed, 29 May 2019 07:22:35 +0000 (09:22 +0200)
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 <vtheile@suse.com>
qa/tasks/vstart_runner.py

index 4e6d15a98e201f44448f0c237c262729e64c2ef2..44933b7c0440ce363ab444548880a89453b21eb3 100644 (file)
@@ -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):