From 5236f76a19ff7858e01ecddb5e39726cb3b0d3bf Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Thu, 14 Nov 2019 16:43:05 +0530 Subject: [PATCH] cephfs-shell: Add rmdir test for valid file Signed-off-by: Varsha Rao --- qa/tasks/cephfs/test_cephfs_shell.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index 846862d3840..12a8ccaed6a 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -197,6 +197,16 @@ class TestRmdir(TestCephFSShell): log.info("cephfs-shell rmdir output:\n{}".format(rmdir_output)) self.assertTrue(rmdir_output, "Something went wrong!! non existing dir deleted") + def test_rmdir_existing_file(self): + """ + Test that rmdir outputs error on file + """ + self.run_cephfs_shell_cmd("put - dumpfile", stdin="Valid File") + self.run_cephfs_shell_cmd("rmdir dumpfile") + self.assertTrue(path.exists(path.join(self.mount_a.mountpoint, "dumpfile")), + "Something went wrong!! rmdir deleted a file") + + class TestGetAndPut(TestCephFSShell): # the 'put' command gets tested as well with the 'get' comamnd def test_put_and_get_without_target_directory(self):