]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa: add require_kernel_mount helper support
authorXiubo Li <xiubli@redhat.com>
Tue, 31 Jan 2023 02:12:51 +0000 (10:12 +0800)
committerXiubo Li <xiubli@redhat.com>
Thu, 16 Feb 2023 00:43:39 +0000 (08:43 +0800)
This will simplify the code later.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
qa/tasks/cephfs/test_fscrypt.py

index 33a5878ea2c4074472950530a805ff39001a8f63..022574b79fd5fa04fb737c0be8e806d6721e6dad 100644 (file)
@@ -12,7 +12,7 @@ class TestFscrypt(XFSTestsDev):
     def setup_xfsprogs_devs(self):
         self.install_xfsprogs = True
 
-    def test_fscrypt_encrypt(self):
+    def require_kernel_mount(self):
         from tasks.cephfs.fuse_mount import FuseMount
         from tasks.cephfs.kernel_mount import KernelMount
 
@@ -20,12 +20,14 @@ class TestFscrypt(XFSTestsDev):
         # remounts CephFS before running tests using kernel, so ceph-fuse
         # mounts are never actually tested.
         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')
 
+    def test_fscrypt_encrypt(self):
+        self.require_kernel_mount()
+
         # 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