]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test_cephfs_shell: test du with multiple paths in args
authorRishabh Dave <ridave@redhat.com>
Tue, 20 Aug 2019 20:27:58 +0000 (01:57 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 13 Sep 2019 05:15:34 +0000 (10:45 +0530)
Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/cephfs/test_cephfs_shell.py

index d3b203e95f2b659271bb7be5f9e31b56395d9248..6697f3cff858ee16fc30bf5c70ca2db1545124e0 100644 (file)
@@ -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):
 #        """