Skip to content

Commit

Permalink
Adding finalizer for custome role cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Adarsh Dubey <[email protected]>
  • Loading branch information
adarshdubey-star authored and JacobCallahan committed Mar 21, 2023
1 parent bca8bda commit 1fb8fbe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/foreman/ui/test_ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def test_positive_config_report_ansible(session, target_sat, module_org, rhel_co

@pytest.mark.no_containers
@pytest.mark.rhel_ver_match('9')
def test_positive_ansible_custom_role(target_sat, session, module_org, rhel_contenthost):
def test_positive_ansible_custom_role(target_sat, session, module_org, rhel_contenthost, request):
"""
Test Config report generation with Custom Ansible Role
Expand Down Expand Up @@ -261,3 +261,8 @@ def test_positive_ansible_custom_role(target_sat, session, module_org, rhel_cont
session.configreport.search(rhel_contenthost.hostname)
session.configreport.delete(rhel_contenthost.hostname)
assert len(session.configreport.read()['table']) == 0

@request.addfinalizer
def _finalize():
result = target_sat.cli.Ansible.roles_delete({'name': SELECTED_ROLE})
assert f'Ansible role [{SELECTED_ROLE}] was deleted.' in result[0]['message']

0 comments on commit 1fb8fbe

Please sign in to comment.