From: Rishabh Dave Date: Wed, 13 Nov 2019 12:42:13 +0000 (+0530) Subject: test_cephfs_shell: update test since shell can now read ceph.conf X-Git-Tag: v15.1.0~636^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f85a03b56e4c29f0eaa8ced2e5c0de08da1dd85;p=ceph-ci.git 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 --- 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'