]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa: add tests for CephFS admin commands
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 30 Oct 2019 17:21:22 +0000 (10:21 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 30 Oct 2019 18:44:26 +0000 (11:44 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
qa/suites/fs/basic_functional/tasks/admin.yaml [new file with mode: 0644]
qa/suites/fs/basic_functional/tasks/config-commands.yaml [deleted file]
qa/suites/kcephfs/recovery/tasks/config-commands.yaml [deleted file]
qa/tasks/cephfs/test_admin.py [new file with mode: 0644]
qa/tasks/cephfs/test_config_commands.py [deleted file]

diff --git a/qa/suites/fs/basic_functional/tasks/admin.yaml b/qa/suites/fs/basic_functional/tasks/admin.yaml
new file mode 100644 (file)
index 0000000..ef40ef9
--- /dev/null
@@ -0,0 +1,11 @@
+
+overrides:
+  ceph:
+    conf:
+      global:
+        lockdep: true
+
+tasks:
+  - cephfs_test_runner:
+      modules:
+        - tasks.cephfs.test_admin
diff --git a/qa/suites/fs/basic_functional/tasks/config-commands.yaml b/qa/suites/fs/basic_functional/tasks/config-commands.yaml
deleted file mode 100644 (file)
index 2f51801..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-overrides:
-  ceph:
-    conf:
-      global:
-        lockdep: true
-
-tasks:
-  - cephfs_test_runner:
-      modules:
-        - tasks.cephfs.test_config_commands
diff --git a/qa/suites/kcephfs/recovery/tasks/config-commands.yaml b/qa/suites/kcephfs/recovery/tasks/config-commands.yaml
deleted file mode 100644 (file)
index cb00216..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-
-overrides:
-  ceph:
-    conf:
-      global:
-        lockdep: true
-
-tasks:
-  - cephfs_test_runner:
-      fail_on_skip: false
-      modules:
-        - tasks.cephfs.test_config_commands
diff --git a/qa/tasks/cephfs/test_admin.py b/qa/tasks/cephfs/test_admin.py
new file mode 100644 (file)
index 0000000..6459ab7
--- /dev/null
@@ -0,0 +1,88 @@
+
+from tasks.cephfs.cephfs_test_case import CephFSTestCase
+from tasks.cephfs.fuse_mount import FuseMount
+
+class TestAdminCommands(CephFSTestCase):
+    """
+    Tests for administration command.
+    """
+
+    CLIENTS_REQUIRED = 1
+    MDSS_REQUIRED = 1
+
+    def test_fs_status(self):
+        """
+        That `ceph fs status` command functions.
+        """
+
+        s = self.fs.mon_manager.raw_cluster_cmd("fs", "status")
+        self.assertTrue("active" in s)
+
+class TestConfigCommands(CephFSTestCase):
+    """
+    Test that daemons and clients respond to the otherwise rarely-used
+    runtime config modification operations.
+    """
+
+    CLIENTS_REQUIRED = 1
+    MDSS_REQUIRED = 1
+
+    def test_ceph_config_show(self):
+        """
+        That I can successfully show MDS configuration.
+        """
+
+        names = self.fs.get_rank_names()
+        for n in names:
+            s = self.fs.mon_manager.raw_cluster_cmd("config", "show", "mds."+n)
+            self.assertTrue("NAME" in s)
+            self.assertTrue("mon_host" in s)
+
+    def test_client_config(self):
+        """
+        That I can successfully issue asok "config set" commands
+
+        :return:
+        """
+
+        if not isinstance(self.mount_a, FuseMount):
+            self.skipTest("Test only applies to FUSE clients")
+
+        test_key = "client_cache_size"
+        test_val = "123"
+        self.mount_a.admin_socket(['config', 'set', test_key, test_val])
+        out = self.mount_a.admin_socket(['config', 'get', test_key])
+        self.assertEqual(out[test_key], test_val)
+
+        self.mount_a.write_n_mb("file.bin", 1);
+
+        # Implicitly asserting that things don't have lockdep error in shutdown
+        self.mount_a.umount_wait(require_clean=True)
+        self.fs.mds_stop()
+
+    def test_mds_config_asok(self):
+        test_key = "mds_max_purge_ops"
+        test_val = "123"
+        self.fs.mds_asok(['config', 'set', test_key, test_val])
+        out = self.fs.mds_asok(['config', 'get', test_key])
+        self.assertEqual(out[test_key], test_val)
+
+        # Implicitly asserting that things don't have lockdep error in shutdown
+        self.mount_a.umount_wait(require_clean=True)
+        self.fs.mds_stop()
+
+    def test_mds_config_tell(self):
+        test_key = "mds_max_purge_ops"
+        test_val = "123"
+
+        mds_id = self.fs.get_lone_mds_id()
+        self.fs.mon_manager.raw_cluster_cmd("tell", "mds.{0}".format(mds_id), "injectargs",
+                                            "--{0}={1}".format(test_key, test_val))
+
+        # Read it back with asok because there is no `tell` equivalent
+        out = self.fs.mds_asok(['config', 'get', test_key])
+        self.assertEqual(out[test_key], test_val)
+
+        # Implicitly asserting that things don't have lockdep error in shutdown
+        self.mount_a.umount_wait(require_clean=True)
+        self.fs.mds_stop()
diff --git a/qa/tasks/cephfs/test_config_commands.py b/qa/tasks/cephfs/test_config_commands.py
deleted file mode 100644 (file)
index 51bf40f..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-
-from tasks.cephfs.cephfs_test_case import CephFSTestCase
-from tasks.cephfs.fuse_mount import FuseMount
-
-
-class TestConfigCommands(CephFSTestCase):
-    """
-    Test that daemons and clients respond to the otherwise rarely-used
-    runtime config modification operations.
-    """
-
-    CLIENTS_REQUIRED = 1
-    MDSS_REQUIRED = 1
-
-    def test_client_config(self):
-        """
-        That I can successfully issue asok "config set" commands
-
-        :return:
-        """
-
-        if not isinstance(self.mount_a, FuseMount):
-            self.skipTest("Test only applies to FUSE clients")
-
-        test_key = "client_cache_size"
-        test_val = "123"
-        self.mount_a.admin_socket(['config', 'set', test_key, test_val])
-        out = self.mount_a.admin_socket(['config', 'get', test_key])
-        self.assertEqual(out[test_key], test_val)
-
-        self.mount_a.write_n_mb("file.bin", 1);
-
-        # Implicitly asserting that things don't have lockdep error in shutdown
-        self.mount_a.umount_wait(require_clean=True)
-        self.fs.mds_stop()
-
-    def test_mds_config_asok(self):
-        test_key = "mds_max_purge_ops"
-        test_val = "123"
-        self.fs.mds_asok(['config', 'set', test_key, test_val])
-        out = self.fs.mds_asok(['config', 'get', test_key])
-        self.assertEqual(out[test_key], test_val)
-
-        # Implicitly asserting that things don't have lockdep error in shutdown
-        self.mount_a.umount_wait(require_clean=True)
-        self.fs.mds_stop()
-
-    def test_mds_config_tell(self):
-        test_key = "mds_max_purge_ops"
-        test_val = "123"
-
-        mds_id = self.fs.get_lone_mds_id()
-        self.fs.mon_manager.raw_cluster_cmd("tell", "mds.{0}".format(mds_id), "injectargs",
-                                            "--{0}={1}".format(test_key, test_val))
-
-        # Read it back with asok because there is no `tell` equivalent
-        out = self.fs.mds_asok(['config', 'get', test_key])
-        self.assertEqual(out[test_key], test_val)
-
-        # Implicitly asserting that things don't have lockdep error in shutdown
-        self.mount_a.umount_wait(require_clean=True)
-        self.fs.mds_stop()