]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: cleanup some code in test_cephfs_shell.py 45971/head
authorRishabh Dave <ridave@redhat.com>
Wed, 20 Apr 2022 12:43:05 +0000 (18:13 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 21 Apr 2022 11:17:39 +0000 (16:47 +0530)
Also delete a comment since it's incorrect.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/cephfs/test_cephfs_shell.py

index f9d6ad44cef5502f2792b0d692c829decc62a7e9..5304eb3282f94bf73f9c0e27a5f340ebc96d6e63 100644 (file)
@@ -383,23 +383,10 @@ class TestGetAndPut(TestCephFSShell):
         o = self.mount_a.stat('dump5')
         log.info("mount_a output:\n{}".format(o))
 
-        # get dump5 should fail
         o = self.get_cephfs_shell_cmd_output("get dump5")
         # NOTE: cwd=None because we want to run it at CWD, not at cephfs mntpt.
-        o = self.mount_a.run_shell('stat dump5 || echo $?', cwd=None).stdout.\
-                getvalue().strip()
-        log.info("cephfs-shell output:\n{}".format(o))
-        l = o.split('\n')
-        try:
-            ret = int(l[1])
-            # verify that stat dump5 passes
-            # if ret == 1, then that implies the stat failed
-            # which implies that there was a problem with "get dump5"
-            assert(ret != 1)
-        except ValueError:
-            # we have a valid stat output; so this is good
-            # if the int() fails then that means there's a valid stat output
-            pass
+        # NOTE: following command must run successfully.
+        self.mount_a.run_shell('stat dump5', cwd=None)
 
     def test_get_to_console(self):
         """