From 17e310f57c4f9c95a343f63a5f5aace8c73a227b Mon Sep 17 00:00:00 2001 From: John Spray Date: Thu, 21 Jan 2016 12:22:27 +0000 Subject: [PATCH] tasks/cephfs: add TestConfigCommands Get some coverage on the otherwise rarely touched injectargs and `config set` interfaces. Fixes: #14365 Signed-off-by: John Spray --- suites/fs/recovery/tasks/config-commands.yaml | 11 ++++ tasks/cephfs/test_config_commands.py | 63 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 suites/fs/recovery/tasks/config-commands.yaml create mode 100644 tasks/cephfs/test_config_commands.py diff --git a/suites/fs/recovery/tasks/config-commands.yaml b/suites/fs/recovery/tasks/config-commands.yaml new file mode 100644 index 0000000000000..2f51801d6cb14 --- /dev/null +++ b/suites/fs/recovery/tasks/config-commands.yaml @@ -0,0 +1,11 @@ + +overrides: + ceph: + conf: + global: + lockdep: true + +tasks: + - cephfs_test_runner: + modules: + - tasks.cephfs.test_config_commands diff --git a/tasks/cephfs/test_config_commands.py b/tasks/cephfs/test_config_commands.py new file mode 100644 index 0000000000000..ce0619fe4a201 --- /dev/null +++ b/tasks/cephfs/test_config_commands.py @@ -0,0 +1,63 @@ + +from unittest import case +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): + raise case.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() -- 2.39.5