From: Rishabh Dave Date: Thu, 1 Aug 2019 20:22:22 +0000 (+0530) Subject: test_cephfs_shell: test cephfs-shell command at invocation X-Git-Tag: v15.1.0~1555^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f9b4d790e5ca965bde277f1f7ed46dc32cc7eb49;p=ceph.git test_cephfs_shell: test cephfs-shell command at invocation Verify that "cephfs-shell -c ceph.conf " works as expected. Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index d5f858b08661..4fef6a6bf8fc 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -588,6 +588,29 @@ class TestDU(TestCephFSShell): # log.info('ls -a failed') class TestMisc(TestCephFSShell): + def test_issue_cephfs_shell_cmd_at_invocation(self): + """ + Test that `cephfs-shell -c conf cmd` works. + """ + # choosing a long name since short ones have a higher probability + # of getting matched by coincidence. + 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'], + stdout=StringIO()).stdout.getvalue().strip() + + if sys_version_info.major >= 3: + self.assertRegex(dirname, output) + elif sys_version_info.major < 3: + assert re_search(dirname, output) != None, "\n" + \ + "expected_output -\n{}\ndu_output -\n{}\n".format( + dirname, output) + def test_help(self): """ Test that help outputs commands.