From 54562691ee6edda78c17f81adb64a7f4773b09c2 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Wed, 21 Aug 2019 01:57:58 +0530 Subject: [PATCH] test_cephfs_shell: test du with multiple paths in args Signed-off-by: Rishabh Dave --- qa/tasks/cephfs/test_cephfs_shell.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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): # """ -- 2.39.5