Skip to content

Commit

Permalink
test: find backup should also wait until backup volume is synced
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Chiu <yang.chiu@suse.com>
  • Loading branch information
yangchiu committed Feb 16, 2024
1 parent 7d9378c commit 31855ce
Showing 1 changed file with 12 additions and 23 deletions.
35 changes: 12 additions & 23 deletions manager/integration/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3113,17 +3113,20 @@ def check_volume_endpoint(v):
return endpoint


def find_backup_volume(client, volume_name):
bvs = client.list_backupVolume()
for bv in bvs:
if bv.name == volume_name and bv.created != "":
return bv
return None


def wait_for_backup_volume_backing_image_synced(
client, volume_name, backing_image, retry_count=RETRY_BACKUP_COUNTS):
def find_backup_volume():
bvs = client.list_backupVolume()
for bv in bvs:
if bv.name == volume_name:
return bv
return None

completed = False
for _ in range(retry_count):
bv = find_backup_volume()
bv = find_backup_volume(client, volume_name)
assert bv is not None
if bv.backingImageName == backing_image:
completed = True
Expand Down Expand Up @@ -3756,17 +3759,10 @@ def find_backup(client, vol_name, snap_name):
been completed successfully
"""

def find_backup_volume():
bvs = client.list_backupVolume()
for bv in bvs:
if bv.name == vol_name and bv.created != "":
return bv
return None

bv = None
for i in range(120):
if bv is None:
bv = find_backup_volume()
bv = find_backup_volume(client, vol_name)
if bv is not None:
backups = bv.backupList().data
for b in backups:
Expand Down Expand Up @@ -5161,15 +5157,8 @@ def wait_for_instance_manager_desire_state(client, core_api, im_name,

def wait_for_backup_delete(client, volume_name, backup_name):

def find_backup_volume():
bvs = client.list_backupVolume()
for bv in bvs:
if bv.name == volume_name:
return bv
return None

def backup_exists():
bv = find_backup_volume()
bv = find_backup_volume(client, volume_name)
if bv is not None:
backups = bv.backupList()
for b in backups:
Expand Down

0 comments on commit 31855ce

Please sign in to comment.