diff --git a/tests/foreman/cli/test_bootdisk.py b/tests/foreman/cli/test_bootdisk.py index e6515e1af9f..e3e767b9ff7 100644 --- a/tests/foreman/cli/test_bootdisk.py +++ b/tests/foreman/cli/test_bootdisk.py @@ -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, @@ -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()