Skip to content

Commit

Permalink
qa: test chmod is allowed above 0777.
Browse files Browse the repository at this point in the history
Signed-off-by: Neeraj Pratap Singh <[email protected]>
  • Loading branch information
neesingh-rh committed Apr 19, 2022
1 parent ddc85ec commit 5aa304e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions qa/tasks/cephfs/test_cephfs_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ def test_mkdir(self):
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:
Expand Down Expand Up @@ -968,6 +968,14 @@ def test_help(self):
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.
Expand Down

0 comments on commit 5aa304e

Please sign in to comment.