From: Venky Shankar Date: Tue, 4 Aug 2020 09:05:51 +0000 (-0400) Subject: test: cephfs-mirror teuthology task and test yamls X-Git-Tag: v17.0.0~16^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3478b2a06204bc58dcefae7f1d1f2497dd08fccf;p=ceph.git test: cephfs-mirror teuthology task and test yamls Signed-off-by: Venky Shankar --- diff --git a/qa/cephfs/begin.yaml b/qa/cephfs/begin.yaml index d63591f974e7d..879294a1fdccf 100644 --- a/qa/cephfs/begin.yaml +++ b/qa/cephfs/begin.yaml @@ -7,10 +7,12 @@ tasks: rpm: - python3-cephfs - cephfs-top + - cephfs-mirror deb: - python3-cephfs - cephfs-shell - cephfs-top + - cephfs-mirror # For kernel_untar_build workunit extra_system_packages: deb: diff --git a/qa/suites/fs/mirror/% b/qa/suites/fs/mirror/% new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/qa/suites/fs/mirror/.qa b/qa/suites/fs/mirror/.qa new file mode 120000 index 0000000000000..fea2489fdf6d9 --- /dev/null +++ b/qa/suites/fs/mirror/.qa @@ -0,0 +1 @@ +../.qa \ No newline at end of file diff --git a/qa/suites/fs/mirror/begin.yaml b/qa/suites/fs/mirror/begin.yaml new file mode 120000 index 0000000000000..311d404f7c276 --- /dev/null +++ b/qa/suites/fs/mirror/begin.yaml @@ -0,0 +1 @@ +.qa/cephfs/begin.yaml \ No newline at end of file diff --git a/qa/suites/fs/mirror/cephfs-mirror/+ b/qa/suites/fs/mirror/cephfs-mirror/+ new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/qa/suites/fs/mirror/cephfs-mirror/one-per-cluster.yaml b/qa/suites/fs/mirror/cephfs-mirror/one-per-cluster.yaml new file mode 100644 index 0000000000000..c355a9db594bb --- /dev/null +++ b/qa/suites/fs/mirror/cephfs-mirror/one-per-cluster.yaml @@ -0,0 +1,5 @@ +meta: +- desc: run one cephfs-mirror daemon on primary cluster +tasks: +- cephfs-mirror: + client: client.mirror diff --git a/qa/suites/fs/mirror/clients/+ b/qa/suites/fs/mirror/clients/+ new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/qa/suites/fs/mirror/clients/.qa b/qa/suites/fs/mirror/clients/.qa new file mode 120000 index 0000000000000..fea2489fdf6d9 --- /dev/null +++ b/qa/suites/fs/mirror/clients/.qa @@ -0,0 +1 @@ +../.qa \ No newline at end of file diff --git a/qa/suites/fs/mirror/clients/mirror.yaml b/qa/suites/fs/mirror/clients/mirror.yaml new file mode 100644 index 0000000000000..eb1ee5c55f585 --- /dev/null +++ b/qa/suites/fs/mirror/clients/mirror.yaml @@ -0,0 +1,18 @@ +meta: +- desc: configure the permissions for client.mirror +overrides: + ceph: + conf: + client: + debug cephfs_mirror: 20 + log to stderr: false + # make these predictable + client.mirror: + admin socket: /var/run/ceph/cephfs-mirror.asok + pid file: /var/run/ceph/cephfs-mirror.pid +tasks: +- exec: + client.mirror: + - "sudo ceph auth caps client.mirror mon 'allow r' mds 'allow r' osd 'allow rw tag cephfs metadata=*, allow r tag cephfs data=*' mgr 'allow r'" + client.mirror_remote: + - "sudo ceph auth caps client.mirror_remote mon 'allow r' mds 'allow rwps' osd 'allow rw tag cephfs *=*' mgr 'allow r'" diff --git a/qa/suites/fs/mirror/cluster/+ b/qa/suites/fs/mirror/cluster/+ new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/qa/suites/fs/mirror/cluster/1-node.yaml b/qa/suites/fs/mirror/cluster/1-node.yaml new file mode 100644 index 0000000000000..a9748e071a946 --- /dev/null +++ b/qa/suites/fs/mirror/cluster/1-node.yaml @@ -0,0 +1,17 @@ +meta: +- desc: 1 ceph cluster with 1 mon, 1 mgr, 3 osds, 5 mdss +roles: +- - mon.a + - mgr.x + - mds.a + - mds.b + - mds.c + - mds.d + - mds.e + - osd.0 + - osd.1 + - osd.2 + - client.0 + - client.1 + - client.mirror + - client.mirror_remote \ No newline at end of file diff --git a/qa/suites/fs/mirror/mount/.qa b/qa/suites/fs/mirror/mount/.qa new file mode 120000 index 0000000000000..fea2489fdf6d9 --- /dev/null +++ b/qa/suites/fs/mirror/mount/.qa @@ -0,0 +1 @@ +../.qa \ No newline at end of file diff --git a/qa/suites/fs/mirror/mount/fuse.yaml b/qa/suites/fs/mirror/mount/fuse.yaml new file mode 100644 index 0000000000000..1fdf55ab4621c --- /dev/null +++ b/qa/suites/fs/mirror/mount/fuse.yaml @@ -0,0 +1,2 @@ +tasks: + - ceph-fuse: [client.0, client.1] diff --git a/qa/suites/fs/mirror/objectstore/.qa b/qa/suites/fs/mirror/objectstore/.qa new file mode 120000 index 0000000000000..fea2489fdf6d9 --- /dev/null +++ b/qa/suites/fs/mirror/objectstore/.qa @@ -0,0 +1 @@ +../.qa \ No newline at end of file diff --git a/qa/suites/fs/mirror/objectstore/bluestore-bitmap.yaml b/qa/suites/fs/mirror/objectstore/bluestore-bitmap.yaml new file mode 120000 index 0000000000000..a59cf5175069a --- /dev/null +++ b/qa/suites/fs/mirror/objectstore/bluestore-bitmap.yaml @@ -0,0 +1 @@ +.qa/objectstore/bluestore-bitmap.yaml \ No newline at end of file diff --git a/qa/suites/fs/mirror/overrides/+ b/qa/suites/fs/mirror/overrides/+ new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/qa/suites/fs/mirror/overrides/.qa b/qa/suites/fs/mirror/overrides/.qa new file mode 120000 index 0000000000000..fea2489fdf6d9 --- /dev/null +++ b/qa/suites/fs/mirror/overrides/.qa @@ -0,0 +1 @@ +../.qa \ No newline at end of file diff --git a/qa/suites/fs/mirror/overrides/whitelist_health.yaml b/qa/suites/fs/mirror/overrides/whitelist_health.yaml new file mode 120000 index 0000000000000..3f8d0af872a49 --- /dev/null +++ b/qa/suites/fs/mirror/overrides/whitelist_health.yaml @@ -0,0 +1 @@ +./.qa/cephfs/overrides/whitelist_health.yaml \ No newline at end of file diff --git a/qa/suites/fs/mirror/supported-random-distros$ b/qa/suites/fs/mirror/supported-random-distros$ new file mode 120000 index 0000000000000..0862b4457b37a --- /dev/null +++ b/qa/suites/fs/mirror/supported-random-distros$ @@ -0,0 +1 @@ +.qa/distros/supported-random-distro$ \ No newline at end of file diff --git a/qa/suites/fs/mirror/tasks/.qa b/qa/suites/fs/mirror/tasks/.qa new file mode 120000 index 0000000000000..fea2489fdf6d9 --- /dev/null +++ b/qa/suites/fs/mirror/tasks/.qa @@ -0,0 +1 @@ +../.qa \ No newline at end of file diff --git a/qa/suites/fs/mirror/tasks/mirror.yaml b/qa/suites/fs/mirror/tasks/mirror.yaml new file mode 100644 index 0000000000000..af60495e53f8b --- /dev/null +++ b/qa/suites/fs/mirror/tasks/mirror.yaml @@ -0,0 +1,10 @@ +overrides: + ceph: + conf: + mgr: + debug client: 10 + +tasks: + - cephfs_test_runner: + modules: + - tasks.cephfs.test_mirroring diff --git a/qa/tasks/cephfs_mirror.py b/qa/tasks/cephfs_mirror.py new file mode 100644 index 0000000000000..037f13e1def0d --- /dev/null +++ b/qa/tasks/cephfs_mirror.py @@ -0,0 +1,63 @@ +""" +Task for running cephfs mirror daemons +""" + +import logging + +from teuthology.orchestra import run +from teuthology import misc +from teuthology.exceptions import ConfigError +from teuthology.task import Task +from tasks.util import get_remote_for_role + +log = logging.getLogger(__name__) + +class CephFSMirror(Task): + def __init__(self, ctx, config): + super(CephFSMirror, self).__init__(ctx, config) + self.log = log + + def setup(self): + super(CephFSMirror, self).setup() + try: + self.client = self.config['client'] + except KeyError: + raise ConfigError('cephfs-mirror requires a client to connect') + + self.cluster_name, type_, self.client_id = misc.split_role(self.client) + if not type_ == 'client': + raise ConfigError(f'client role {self.client} must be a client') + self.remote = get_remote_for_role(self.ctx, self.client) + + def begin(self): + super(CephFSMirror, self).begin() + testdir = misc.get_testdir(self.ctx) + + args = [ + 'adjust-ulimits', + 'ceph-coverage', + '{tdir}/archive/coverage'.format(tdir=testdir), + 'daemon-helper', + 'term', + ] + + args.extend([ + 'cephfs-mirror', + '--id', + self.client_id, + ]) + + self.ctx.daemons.add_daemon( + self.remote, 'cephfs-mirror', self.client, + args=args, + logger=self.log.getChild(self.client), + stdin=run.PIPE, + wait=False, + ) + + def end(self): + mirror_daemon = self.ctx.daemons.get_daemon('cephfs-mirror', self.client) + mirror_daemon.stop() + super(CephFSMirror, self).end() + +task = CephFSMirror