From: Dhairya Parmar <87528150+dparmar18@users.noreply.github.com> Date: Mon, 9 May 2022 10:16:04 +0000 (+0530) Subject: Merge branch 'master' into qa_testcephfs_shell_pep8_fixes X-Git-Tag: v18.0.0~925^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F46047%2Fhead;p=ceph.git Merge branch 'master' into qa_testcephfs_shell_pep8_fixes --- 53aa69e3735cc7199966199fad084fa62beefd4d diff --cc qa/tasks/cephfs/test_cephfs_shell.py index 9ac21f3827d4,a33ccaa733c7..82ea7d9c40dc --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@@ -271,9 -274,15 +279,16 @@@ class TestRmdir(TestCephFSShell) Test that rmdir does not delete directory containing file """ self.run_cephfs_shell_cmd("mkdir " + self.dir_name) - self.run_cephfs_shell_cmd("put - test_dir/dumpfile", - stdin="Valid File") - self.run_cephfs_shell_cmd("rmdir" + self.dir_name) ++ + self.run_cephfs_shell_cmd("put - test_dir/dumpfile", stdin="Valid File") + # see comment below + # with self.assertRaises(CommandFailedError) as cm: + with self.assertRaises(CommandFailedError): + self.run_cephfs_shell_cmd("rmdir " + self.dir_name) + # TODO: we need to check for exit code and error message as well. + # skipping it for not since error codes used by cephfs-shell are not + # standard and they may change soon. + # self.assertEqual(cm.exception.exitcode, 39) self.mount_a.stat(self.dir_name) def test_rmdir_existing_file(self): @@@ -1001,7 -978,14 +1016,15 @@@ class TestMisc(TestCephFSShell) o = self.get_cephfs_shell_cmd_output("help all") log.info("output:\n{}".format(o)) + + def test_chmod(self): + """Test chmod is allowed above o0777 """ + + test_file1 = "test_file2.txt" + file1_content = 'A' * 102 + self.run_cephfs_shell_cmd(f"write {test_file1}", stdin=file1_content) + self.run_cephfs_shell_cmd(f"chmod 01777 {test_file1}") + class TestShellOpts(TestCephFSShell): """ Contains tests for shell options from conf file and shell prompt.