Skip to content

Commit

Permalink
Check upgradelog pod and volume
Browse files Browse the repository at this point in the history
  • Loading branch information
albinsun committed Jan 15, 2025
1 parent 4ddf058 commit da75449
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions harvester_e2e_tests/integrations/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,30 @@ def test_verify_crds_existed(self, api_client, harvester_crds):
if not exist_crds:
raise AssertionError(f"CRDs {not_existed_crds} are not existed")

@pytest.mark.dependency(depends=["any_nodes_upgrade"])
def test_verify_upgradelog(self, api_client):
""" Verify upgradelog pod and volume existed when upgrade with "Enable Logging"
"""
# pod
code, data = api_client.get_pods(namespace='harvester-system')
assert code == 200 and data['data'], (code, data)

upgradelog_pods = [pod for pod in data['data'] if 'upgradelog' in pod['id']]
assert upgradelog_pods, f"No upgradelog pod found:\n{data['data']}"
for pod in upgradelog_pods:
assert pod["status"]["phase"] == "Running", (code, upgradelog_pods)

# volume
code, data = api_client.volumes.get(namespace='harvester-system')
assert code == 200 and data['data'], (code, data)

upgradelog_vols = [vol for vol in data['data'] if 'upgradelog' in vol['id']]
assert upgradelog_vols, f"No upgradelog volume found:\n{data['data']}"
for vol in upgradelog_vols:
assert not vol["metadata"]['state']['error'], (code, upgradelog_vols)
assert not vol["metadata"]['state']['transitioning'], (code, upgradelog_vols)
assert vol['status']['phase'] == "Bound", (code, upgradelog_vols)

@pytest.mark.dependency(depends=["any_nodes_upgrade"])
def test_upgrade_vm_deleted(self, api_client, wait_timeout):
# max to wait 300s for the upgrade related VMs to be deleted
Expand Down

0 comments on commit da75449

Please sign in to comment.