Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: find backup should also wait until backup volume is synced (backport #1729) #1776

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 12 additions & 23 deletions manager/integration/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3109,17 +3109,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 @@ -3752,17 +3755,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 @@ -5155,15 +5151,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