From 57f91d1550913daf808652b65f3d647b1a59f817 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Tue, 17 Sep 2019 09:30:16 -0400 Subject: [PATCH] qa: have kclient tests use new mount.ceph functionality Now that the mount helper has the ability to discover mon addrs and can scrape secrets from the keyring, take advantage of it and simplify the KernelMount class. Fixes: https://tracker.ceph.com/issues/41892 Signed-off-by: Jeff Layton --- qa/tasks/cephfs/kernel_mount.py | 37 +++++++-------------------------- qa/tasks/kclient.py | 8 ------- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/qa/tasks/cephfs/kernel_mount.py b/qa/tasks/cephfs/kernel_mount.py index 950a1137d1b..3c33cc83c1c 100644 --- a/qa/tasks/cephfs/kernel_mount.py +++ b/qa/tasks/cephfs/kernel_mount.py @@ -18,46 +18,21 @@ UMOUNT_TIMEOUT = 300 class KernelMount(CephFSMount): - def __init__(self, ctx, mons, test_dir, client_id, client_remote, + def __init__(self, ctx, test_dir, client_id, client_remote, ipmi_user, ipmi_password, ipmi_domain): super(KernelMount, self).__init__(ctx, test_dir, client_id, client_remote) - self.mons = mons self.mounted = False self.ipmi_user = ipmi_user self.ipmi_password = ipmi_password self.ipmi_domain = ipmi_domain - def write_secret_file(self, remote, role, keyring, filename): - """ - Stash the keyring in the filename specified. - """ - remote.run( - args=[ - 'adjust-ulimits', - 'ceph-coverage', - '{tdir}/archive/coverage'.format(tdir=self.test_dir), - 'ceph-authtool', - '--name={role}'.format(role=role), - '--print-key', - keyring, - run.Raw('>'), - filename, - ], - timeout=(5*60), - ) - def mount(self, mount_path=None, mount_fs_name=None): self.setupfs(name=mount_fs_name) log.info('Mounting kclient client.{id} at {remote} {mnt}...'.format( id=self.client_id, remote=self.client_remote, mnt=self.mountpoint)) - keyring = self.get_keyring_path() - secret = '{tdir}/ceph.data/client.{id}.secret'.format(tdir=self.test_dir, id=self.client_id) - self.write_secret_file(self.client_remote, 'client.{id}'.format(id=self.client_id), - keyring, secret) - self.client_remote.run( args=[ 'mkdir', @@ -70,8 +45,8 @@ class KernelMount(CephFSMount): if mount_path is None: mount_path = "/" - opts = 'name={id},secretfile={secret},norequire_active_mds'.format(id=self.client_id, - secret=secret) + opts = 'name={id},norequire_active_mds,conf={conf}'.format(id=self.client_id, + conf=self.config_path) if mount_fs_name is not None: opts += ",mds_namespace={0}".format(mount_fs_name) @@ -82,8 +57,10 @@ class KernelMount(CephFSMount): 'adjust-ulimits', 'ceph-coverage', '{tdir}/archive/coverage'.format(tdir=self.test_dir), - '/sbin/mount.ceph', - '{mons}:{mount_path}'.format(mons=','.join(self.mons), mount_path=mount_path), + '/bin/mount', + '-t', + 'ceph', + ':{mount_path}'.format(mount_path=mount_path), self.mountpoint, '-v', '-o', diff --git a/qa/tasks/kclient.py b/qa/tasks/kclient.py index 5e217b32358..88f27366a71 100644 --- a/qa/tasks/kclient.py +++ b/qa/tasks/kclient.py @@ -72,13 +72,6 @@ def task(ctx, config): test_dir = misc.get_testdir(ctx) - # Assemble mon addresses - remotes_and_roles = ctx.cluster.remotes.items() - roles = [roles for (remote_, roles) in remotes_and_roles] - ips = [remote_.ssh.get_transport().getpeername()[0] - for (remote_, _) in remotes_and_roles] - mons = misc.get_mons(roles, ips).values() - mounts = {} for id_, remote in clients: client_config = config.get("client.%s" % id_) @@ -90,7 +83,6 @@ def task(ctx, config): kernel_mount = KernelMount( ctx, - mons, test_dir, id_, remote, -- 2.39.5