From a4bbb62bd6d30bc0266766f4ae6fc9e1af44af48 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Wed, 20 Apr 2022 18:13:05 +0530 Subject: [PATCH] qa/cephfs: cleanup some code in test_cephfs_shell.py Also delete a comment since it's incorrect. Signed-off-by: Rishabh Dave --- qa/tasks/cephfs/test_cephfs_shell.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index f9d6ad44cef55..5304eb3282f94 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -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): """ -- 2.39.5