From 87b50f3ff16bd8f7c0e0344f4656bf38e617b279 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Thu, 27 Oct 2022 18:19:49 +0530 Subject: [PATCH] qa: Fix test_subvolume_snapshot_info_if_orphan_clone Fixes the usage of the grep command. It was failing as below. smithi008:> (cd /home/ubuntu/cephtest/mnt.0 && exec sudo grep '"clone' 'snaps"' \ -A3 ./volumes/_nogroup/subvolume_0000000000856603/.meta) INFO:teuthology.orchestra.run.smithi008.stderr:grep: snaps": No such file or directory Fixes: https://tracker.ceph.com/issues/57446 Signed-off-by: Kotresh HR --- qa/tasks/cephfs/test_volumes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index 85ddd2e68fe..c813086cc7f 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -5825,7 +5825,7 @@ class TestSubvolumeSnapshotClones(TestVolumesHelper): self._fs_cmd("subvolume", "snapshot", "create", self.volname, subvolume, snapshot) # insert delay at the beginning of snapshot clone - self.config_set('mgr', 'mgr/volumes/snapshot_clone_delay', 10) + self.config_set('mgr', 'mgr/volumes/snapshot_clone_delay', 15) # schedule a clones for clone in clone_list: @@ -5833,7 +5833,7 @@ class TestSubvolumeSnapshotClones(TestVolumesHelper): # remove track file for third clone to make it orphan meta_path = os.path.join(".", "volumes", "_nogroup", subvolume, ".meta") - pending_clones_result = self.mount_a.run_shell(f"sudo grep \"clone snaps\" -A3 {meta_path}", omit_sudo=False, stdout=StringIO(), stderr=StringIO()) + pending_clones_result = self.mount_a.run_shell(['sudo', 'grep', 'clone snaps', '-A3', meta_path], omit_sudo=False, stdout=StringIO(), stderr=StringIO()) third_clone_track_id = pending_clones_result.stdout.getvalue().splitlines()[3].split(" = ")[0] third_clone_track_path = os.path.join(".", "volumes", "_index", "clone", third_clone_track_id) self.mount_a.run_shell(f"sudo rm -f {third_clone_track_path}", omit_sudo=False) -- 2.39.5