]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: Fix test_subvolume_snapshot_info_if_orphan_clone 48647/head
authorKotresh HR <khiremat@redhat.com>
Thu, 27 Oct 2022 12:49:49 +0000 (18:19 +0530)
committerKotresh HR <khiremat@redhat.com>
Fri, 2 Dec 2022 10:05:31 +0000 (15:35 +0530)
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 <khiremat@redhat.com>
(cherry picked from commit b6291096d1205456a8320063d4d629ca093bd041)

qa/tasks/cephfs/test_volumes.py

index 205dcb216827aeceb84505884a2035b364653f5f..8a4822748ba52e2dc1de4fa0a1e8c4620eb0b573 100644 (file)
@@ -5696,7 +5696,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:
@@ -5704,7 +5704,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)