]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge branch 'master' into qa_testcephfs_shell_pep8_fixes 46047/head
authorDhairya Parmar <87528150+dparmar18@users.noreply.github.com>
Mon, 9 May 2022 10:16:04 +0000 (15:46 +0530)
committerGitHub <noreply@github.com>
Mon, 9 May 2022 10:16:04 +0000 (15:46 +0530)
1  2 
qa/tasks/cephfs/test_cephfs_shell.py

index 9ac21f3827d460ed01784bda93a6cd9797958958,a33ccaa733c7453b6ec69624a027454a139e2502..82ea7d9c40dcbe52f285d68ce74180d92c5b9585
@@@ -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.