From a9db23fd18f64851e9cee7ffc7d220b08af69359 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Thu, 8 Aug 2019 21:22:58 +0530 Subject: [PATCH] qa/cephfs: add tests for ACLs Add code to run tests for ACLs from xfstests-dev against kernel and FUSE CephFS mounts. Signed-off-by: Rishabh Dave --- .../tasks/acls-fuse-client.yaml | 5 ++++ .../cephfs/tasks/acls-kernel-client.yaml | 4 +++ qa/tasks/cephfs/test_acls.py | 27 +++++++++++++++++++ qa/tasks/cephfs/xfstests_dev.py | 3 +++ 4 files changed, 39 insertions(+) create mode 100644 qa/suites/fs/basic_functional/tasks/acls-fuse-client.yaml create mode 100644 qa/suites/kcephfs/cephfs/tasks/acls-kernel-client.yaml create mode 100644 qa/tasks/cephfs/test_acls.py diff --git a/qa/suites/fs/basic_functional/tasks/acls-fuse-client.yaml b/qa/suites/fs/basic_functional/tasks/acls-fuse-client.yaml new file mode 100644 index 00000000000..5b38d351bd4 --- /dev/null +++ b/qa/suites/fs/basic_functional/tasks/acls-fuse-client.yaml @@ -0,0 +1,5 @@ +tasks: + - cephfs_test_runner: + fail_on_skip: false + modules: + - tasks.cephfs.test_acls diff --git a/qa/suites/kcephfs/cephfs/tasks/acls-kernel-client.yaml b/qa/suites/kcephfs/cephfs/tasks/acls-kernel-client.yaml new file mode 100644 index 00000000000..6e270104247 --- /dev/null +++ b/qa/suites/kcephfs/cephfs/tasks/acls-kernel-client.yaml @@ -0,0 +1,4 @@ +tasks: + - cephfs_test_runner: + modules: + - tasks.cephfs.test_acls diff --git a/qa/tasks/cephfs/test_acls.py b/qa/tasks/cephfs/test_acls.py new file mode 100644 index 00000000000..586cbde765c --- /dev/null +++ b/qa/tasks/cephfs/test_acls.py @@ -0,0 +1,27 @@ +import logging +from StringIO import StringIO + +from xfstests_dev import XFSTestsDev + +log = logging.getLogger(__name__) + +class TestACLs(XFSTestsDev): + + def test_acls(self): + from tasks.cephfs.fuse_mount import FuseMount + from tasks.cephfs.kernel_mount import KernelMount + + # TODO: make xfstests-dev compatible with ceph-fuse. xfstests-dev + # remounts CephFS before running tests using kernel, so ceph-fuse + # mounts are never actually testsed. + if isinstance(self.mount_a, FuseMount): + log.info('client is fuse mounted') + self.skipTest('Requires kernel client; xfstests-dev not '\ + 'compatible with ceph-fuse ATM.') + elif isinstance(self.mount_a, KernelMount): + log.info('client is kernel mounted') + + self.mount_a.client_remote.run(args=['sudo', './check', + 'generic/099'], cwd=self.repo_path, stdout=StringIO(), + stderr=StringIO(), timeout=30, check_status=True, + label='running tests for ACLs from xfstests-dev') diff --git a/qa/tasks/cephfs/xfstests_dev.py b/qa/tasks/cephfs/xfstests_dev.py index 25f8a89235f..bf15b02a3a0 100644 --- a/qa/tasks/cephfs/xfstests_dev.py +++ b/qa/tasks/cephfs/xfstests_dev.py @@ -8,6 +8,9 @@ logger = logging.getLogger(__name__) # TODO: add code to run non-ACL tests too. # TODO: get tests running with SCRATCH_DEV and SCRATCH_DIR. # TODO: make xfstests-dev tests running without running `make install`. +# TODO: make xfstests-dev compatible with ceph-fuse. xfstests-dev remounts +# CephFS before running tests using kernel, so ceph-fuse mounts are never +# actually testsed. class XFSTestsDev(CephFSTestCase): def setUp(self): -- 2.47.3