]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa: have kclient tests use new mount.ceph functionality
authorJeff Layton <jlayton@redhat.com>
Tue, 17 Sep 2019 13:30:16 +0000 (09:30 -0400)
committerJeff Layton <jlayton@redhat.com>
Fri, 20 Sep 2019 10:50:43 +0000 (06:50 -0400)
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 <jlayton@redhat.com>
qa/tasks/cephfs/kernel_mount.py
qa/tasks/kclient.py

index 950a1137d1b77ab23343f78a45e059cd4dbe277f..3c33cc83c1c435f1e02a9838961b48b31e7c0e50 100644 (file)
@@ -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',
index 5e217b323585e7df1a68a3d8586600fec7f8602f..88f27366a718f348ed509a53a0521090cd960fde 100644 (file)
@@ -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,