Skip to content

Commit

Permalink
[6.14.z] Fix teardown of bootdisk tests with request.addfinalizer (Sa…
Browse files Browse the repository at this point in the history
  • Loading branch information
Satellite-QE authored Apr 10, 2024
1 parent 3bb9adb commit 0de67b4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/foreman/cli/test_bootdisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

@pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True)
def test_positive_bootdisk_download_https(
request,
module_location,
module_sync_kickstart_content,
module_provisioning_capsule,
Expand Down Expand Up @@ -79,8 +80,12 @@ def test_positive_bootdisk_download_https(
'lifecycle-environment-id': module_lce_library.id,
}
)

@request.addfinalizer
def _finalize():
module_target_sat.api.Host(id=host.id).delete()
module_target_sat.api.Media(id=media['id']).delete()

# Check if full-host bootdisk can be downloaded.
bootdisk = module_target_sat.cli.Bootdisk.host({'host-id': host['id'], 'full': 'true'})
assert 'Successfully downloaded host disk image' in bootdisk['message']
module_target_sat.api.Host(id=host.id).delete()
module_target_sat.api.Media(id=media['id']).delete()

0 comments on commit 0de67b4

Please sign in to comment.