Skip to content

Commit

Permalink
Updated partition link end2end tests to also clean up partitions at end
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Maier <[email protected]>
  • Loading branch information
andy-maier committed Jan 23, 2025
1 parent 3dd35fb commit 1ba6202
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/end2end/test_partition_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,8 @@ def test_partlink_create_delete(
def test_partlink_zzz_cleanup(dpm_mode_cpcs): # noqa: F811
# pylint: disable=redefined-outer-name, exec-used, unused-argument
"""
Cleanup any created partition links
Cleanup any created partitions and partition links that may have not been
cleaned up by the other testcase functions.
"""
if not dpm_mode_cpcs:
pytest.skip("HMC definition does not include any CPCs in DPM mode")
Expand All @@ -537,3 +538,14 @@ def test_partlink_zzz_cleanup(dpm_mode_cpcs): # noqa: F811
partlink.delete()
except zhmcclient.HTTPError as exc:
print(f"HTTPError during PartitionLink.delete(): {exc}")

parts = cpc.partitions.findall(name=name_pattern)
for part in parts:

print("Deleting test partition from a prior test run: "
f"{part.name!r} on CPC {cpc.name}")

try:
part.delete()
except zhmcclient.HTTPError as exc:
print(f"HTTPError during Partition.delete(): {exc}")

0 comments on commit 1ba6202

Please sign in to comment.