From: dparmar18 Date: Tue, 19 Apr 2022 11:28:11 +0000 (+0530) Subject: qa: added testcase to check get cmd doesn't create subdirs on its own X-Git-Tag: v17.2.1~27^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=76f92eb3be9563607b62a9ab370b9974235856d5;p=ceph.git qa: added testcase to check get cmd doesn't create subdirs on its own Signed-off-by: Dhairya Parmar (cherry picked from commit aa9938aacb02ab010754241d468d34702be9e473) --- diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index 728e16fd991b..f08547bf240c 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -361,6 +361,19 @@ class TestGetAndPut(TestCephFSShell): # if the int() fails then that means there's a valid stat output pass + def test_get_doesnt_create_dir(self): + # if get cmd is creating subdirs on its own then dump7 will be + # stored as ./dump7/tmp/dump7 and not ./dump7, therefore + # if doing `cat ./dump7` returns non-zero exit code(i.e. 1) then + # it implies that no such file exists at that location + dir_abspath = path.join(self.mount_a.mountpoint, 'tmp') + self.mount_a.run_shell_payload(f"mkdir {dir_abspath}") + self.mount_a.client_remote.write_file(path.join(dir_abspath, 'dump7'), + 'somedata') + self.get_cephfs_shell_cmd_output("get /tmp/dump7 ./dump7") + # test that dump7 exists + self.mount_a.run_shell("cat ./dump7", cwd=None) + def test_get_to_console(self): """ Test that get passes with target name