# 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.