From: Rishabh Dave Date: Tue, 20 Aug 2019 20:27:58 +0000 (+0530) Subject: test_cephfs_shell: test du with multiple paths in args X-Git-Tag: v15.1.0~1555^2~9 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=54562691ee6edda78c17f81adb64a7f4773b09c2;p=ceph-ci.git test_cephfs_shell: test du with multiple paths in args Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index d3b203e95f2..6697f3cff85 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -523,6 +523,22 @@ class TestDU(TestCephFSShell): "expected_output -\n{}\ndu_output -\n{}\n".format( expected_output, du_output) + def test_du_with_path_in_args(self): + expected_patterns_in_output, path_to_files = self._setup_files(True, + path_prefix='') + + args = ['du', '/'] + for path in path_to_files: + args.append(path) + du_output = self.get_cephfs_shell_cmd_output(args) + + for expected_output in expected_patterns_in_output: + if sys_version_info.major >= 3: + self.assertRegex(expected_output, du_output) + elif sys_version_info.major < 3: + assert re_search(expected_output, du_output) != None, "\n" +\ + "expected_output -\n{}\ndu_output -\n{}\n".format( + expected_output, du_output) # def test_ls(self): # """