From 2f85a03b56e4c29f0eaa8ced2e5c0de08da1dd85 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Wed, 13 Nov 2019 18:12:13 +0530 Subject: [PATCH] test_cephfs_shell: update test since shell can now read ceph.conf In the test test_cephfs_shell.TestMisc.test_issue_cephfs_shell_cmd_at_invocation, don't set the shell option with in the command to be tested since CephFS shell can now read it's value from ceph.conf. Also, add methods to set config options for vstart as well teuthology testing. Signed-off-by: Rishabh Dave --- qa/tasks/cephfs/filesystem.py | 6 ++++++ qa/tasks/cephfs/test_cephfs_shell.py | 5 +---- qa/tasks/vstart_runner.py | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/qa/tasks/cephfs/filesystem.py b/qa/tasks/cephfs/filesystem.py index d65c3a3e3f4..be0fc9197a7 100644 --- a/qa/tasks/cephfs/filesystem.py +++ b/qa/tasks/cephfs/filesystem.py @@ -173,6 +173,12 @@ class CephCluster(object): self._ctx = ctx self.mon_manager = ceph_manager.CephManager(self.admin_remote, ctx=ctx, logger=log.getChild('ceph_manager')) + def set_config_opt(self, section, opt, val): + self.mon_manager.raw_cluster_cmd('config', 'set', section, opt, val) + + def rm_config_opt(self, section, opt): + self.mon_manager.raw_cluster_cmd('config', 'rm', section) + def get_config(self, key, service_type=None): """ Get config from mon by default, or a specific service if caller asks for it diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index 42137189a17..f4ab63f19a7 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -671,11 +671,8 @@ class TestMisc(TestCephFSShell): dirname = 'somedirectory' self.run_cephfs_shell_cmd(['mkdir', dirname]) - # TODO: Once cephfs-shell can pickup its config variables from - # ceph.conf, set colors Never there and get rid of the same in - # following comamnd. output = self.mount_a.client_remote.run(args=['cephfs-shell', '-c', - self.mount_a.config_path, 'set colors Never, ls'], + self.mount_a.config_path, 'ls'], stdout=StringIO()).stdout.getvalue().strip() if sys_version_info.major >= 3: diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index ef0ff340d8e..db838c6668b 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -1002,6 +1002,12 @@ class LocalCephCluster(CephCluster): def admin_remote(self): return LocalRemote() + def set_config_opt(self, section, opt, val): + self.mon_manager.raw_cluster_cmd('config', 'set', section, opt, val) + + def rm_config_opt(self, section, opt): + self.mon_manager.raw_cluster_cmd('config', 'rm', section, opt) + def get_config(self, key, service_type=None): if service_type is None: service_type = 'mon' -- 2.39.5