]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test_cephfs_shell: add a test for cd with arguments
authorRishabh Dave <ridave@redhat.com>
Tue, 16 Jul 2019 10:53:02 +0000 (16:23 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 25 Jul 2019 05:21:50 +0000 (10:51 +0530)
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 <ridave@redhat.com>
qa/tasks/cephfs/test_cephfs_shell.py

index 335fe41104ea33179d1769aa47d73d532eeb9a73..049c516afc0f2fc569ead87c4fc7988316eec2f5 100644 (file)
@@ -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