summaryrefslogtreecommitdiffstats
path: root/qa/tasks/cephfs/test_acls.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /qa/tasks/cephfs/test_acls.py
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'qa/tasks/cephfs/test_acls.py')
-rw-r--r--qa/tasks/cephfs/test_acls.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/qa/tasks/cephfs/test_acls.py b/qa/tasks/cephfs/test_acls.py
new file mode 100644
index 000000000..48160dd8b
--- /dev/null
+++ b/qa/tasks/cephfs/test_acls.py
@@ -0,0 +1,39 @@
+from logging import getLogger
+
+from io import StringIO
+from tasks.cephfs.xfstests_dev import XFSTestsDev
+
+
+log = getLogger(__name__)
+
+
+class TestACLs(XFSTestsDev):
+
+ def test_acls(self):
+ from tasks.cephfs.fuse_mount import FuseMount
+ from tasks.cephfs.kernel_mount import KernelMount
+
+ if isinstance(self.mount_a, FuseMount):
+ log.info('client is fuse mounted')
+ elif isinstance(self.mount_a, KernelMount):
+ log.info('client is kernel mounted')
+
+ # XXX: check_status is set to False so that we can check for command's
+ # failure on our own (since this command doesn't set right error code
+ # and error message in some cases) and print custom log messages
+ # accordingly.
+ proc = self.mount_a.client_remote.run(args=['sudo', 'env', 'DIFF_LENGTH=0',
+ './check', 'generic/099'], cwd=self.xfstests_repo_path, stdout=StringIO(),
+ stderr=StringIO(), timeout=30, check_status=False,omit_sudo=False,
+ label='running tests for ACLs from xfstests-dev')
+
+ if proc.returncode != 0:
+ log.info('Command failed.')
+ log.info(f'Command return value: {proc.returncode}')
+ stdout, stderr = proc.stdout.getvalue(), proc.stderr.getvalue()
+ log.info(f'Command stdout -\n{stdout}')
+ log.info(f'Command stderr -\n{stderr}')
+
+ self.assertEqual(proc.returncode, 0)
+ success_line = 'Passed all 1 tests'
+ self.assertIn(success_line, stdout)