From d94a42dc1b4d5a49f00ebbece7969a1c19a707a6 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Tue, 16 Jul 2019 16:23:02 +0530 Subject: [PATCH] test_cephfs_shell: add a test for cd with arguments Add a method to test that the cd command changes the current working directory to the path passed as an argument to it. Signed-off-by: Rishabh Dave --- qa/tasks/cephfs/test_cephfs_shell.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index 335fe41104e..049c516afc0 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -280,6 +280,19 @@ class TestCD(TestCephFSShell): output = self.get_cephfs_shell_script_output(script) self.assertEqual(output, expected_cwd) + def test_cd_with_args(self): + """ + Test that when cd is issued with an argument, CWD is changed + to the path passed in the argument. + """ + path = 'dir1/dir2/dir3' + self.mount_a.run_shell('mkdir -p ' + path) + expected_cwd = '/dir1/dir2/dir3' + + script = 'cd {}\ncwd\n'.format(path) + output = self.get_cephfs_shell_script_output(script) + self.assertEqual(output, expected_cwd) + # def test_ls(self): # """ # Test that ls passes -- 2.39.5