From 6f774c5dcea2f2edc13aea18bc64774704030c12 Mon Sep 17 00:00:00 2001 From: dparmar18 Date: Wed, 20 Apr 2022 12:23:55 +0530 Subject: [PATCH] qa: added tests to make sure put accepts both paths and validate local path Signed-off-by: Dhairya Parmar (cherry picked from commit e52fb12c393944f1f1c1c4819a9d4a7912f3a4c1) --- qa/tasks/cephfs/test_cephfs_shell.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index 1ee5c7f8464..a7b9bbd28da 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -416,6 +416,23 @@ class TestGetAndPut(TestCephFSShell): log.info("o_hash:{}".format(o_hash)) assert(s_hash == o_hash) + def test_put_without_target_name(self): + """ + put - should fail as the cmd expects both arguments are mandatory. + """ + with self.assertRaises(CommandFailedError): + self.get_cephfs_shell_cmd_output("put -") + + def test_put_validate_local_path(self): + """ + This test is intended to make sure local_path is validated before + trying to put the file from local fs to cephfs and the command + put ./dumpXYZ dump8 would fail as dumpXYX doesn't exist. + """ + with self.assertRaises(CommandFailedError): + o = self.get_cephfs_shell_cmd_output("put ./dumpXYZ dump8") + log.info("cephfs-shell output:\n{}".format(o)) + class TestSnapshots(TestCephFSShell): def test_snap(self): """ -- 2.47.3