From: Rishabh Dave Date: Tue, 20 Aug 2019 22:01:55 +0000 (+0530) Subject: test_cephfs_shell: test du with no args X-Git-Tag: v15.1.0~1555^2~8 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=79c9d91b9a677f5861171257174280ff32965c24;p=ceph-ci.git test_cephfs_shell: test du with no 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 6697f3cff85..d5f858b0866 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -540,6 +540,22 @@ class TestDU(TestCephFSShell): "expected_output -\n{}\ndu_output -\n{}\n".format( expected_output, du_output) + def test_du_with_no_args(self): + expected_patterns_in_output = self._setup_files() + + du_output = self.get_cephfs_shell_cmd_output('du') + + for expected_output in expected_patterns_in_output: + # Since CWD is CephFS root and being non-recursive expect only + # CWD in DU report. + if expected_output.find('/') == len(expected_output) - 1: + 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): # """ # Test that ls passes