From 5aa304e12894cf1646a3e4efd2134ac8a194f029 Mon Sep 17 00:00:00 2001 From: Neeraj Pratap Singh Date: Wed, 13 Apr 2022 13:30:14 +0530 Subject: [PATCH] qa: test chmod is allowed above 0777. Signed-off-by: Neeraj Pratap Singh --- qa/tasks/cephfs/test_cephfs_shell.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index 1ee5c7f84645d..f944cf312b561 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -168,11 +168,11 @@ class TestMkdir(TestCephFSShell): o = self.mount_a.stat('d1') log.info("mount_a output:\n{}".format(o)) - def test_mkdir_with_07000_octal_mode(self): + def test_mkdir_with_070000_octal_mode(self): """ - Test that mkdir fails with octal mode greater than 0777 + Test that mkdir fails with octal mode greater than 07777 """ - self.negtest_cephfs_shell_cmd(cmd="mkdir -m 07000 d2") + self.negtest_cephfs_shell_cmd(cmd="mkdir -m 070000 d2") try: self.mount_a.stat('d2') except CommandFailedError: @@ -968,6 +968,14 @@ 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. -- 2.47.3