Skip to content

Commit

Permalink
Merge pull request #28208 from votdev/fix_vstart_runner
Browse files Browse the repository at this point in the history
mimic: qa: Fix issues in vstart runner

Reviewed-by: Rishabh Dave <ridave@redhat.com>
Reviewed-by: Nathan Cutler <ncutler@suse.com>
  • Loading branch information
yuriw committed Jul 15, 2019
2 parents 241abb2 + 7fb7812 commit 2259f89
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions qa/tasks/vstart_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def put_file(self, src, dst, sudo=False):

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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -574,9 +574,11 @@ def raw_cluster_cmd_result(self, *args, **kwargs):
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
)


Expand Down Expand Up @@ -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:
Expand All @@ -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))
Expand All @@ -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):
Expand Down

0 comments on commit 2259f89

Please sign in to comment.