From 12bb3af3b54a7bb81cd06815754c6f4bd7f5edac Mon Sep 17 00:00:00 2001 From: amol patil Date: Thu, 26 Sep 2024 18:27:50 +0530 Subject: [PATCH] fix in CR for import ansible role --- tests/foreman/ui/test_computeresource_vmware.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/foreman/ui/test_computeresource_vmware.py b/tests/foreman/ui/test_computeresource_vmware.py index 1b3d350818e..62a4d81ef9f 100644 --- a/tests/foreman/ui/test_computeresource_vmware.py +++ b/tests/foreman/ui/test_computeresource_vmware.py @@ -59,8 +59,7 @@ def _get_normalized_size(size): return f'{size} {suffixes[suffix_index]}' -@pytest.fixture -def get_vmware_datastore_summary_string(vmware, vmwareclient): +def get_vmware_datastore_summary_string(vmwareclient): """Return the datastore string summary for data_store_name For "Local-Ironforge" datastore the string looks Like: @@ -576,7 +575,6 @@ def test_positive_provision_end_to_end( vmwareclient, target_sat, module_provisioning_rhel_content, - get_vmware_datastore_summary_string, ): """Assign Ansible role to a Hostgroup and verify ansible role execution job is scheduled after a host is provisioned @@ -607,9 +605,9 @@ def test_positive_provision_end_to_end( 'network': f'VLAN {settings.provisioning.vlan_id}', } } + proxy_id = target_sat.nailgun_smart_proxy.id + target_sat.api.AnsibleRoles().sync(data={'proxy_id': proxy_id, 'role_names': [SELECTED_ROLE]}) with target_sat.ui_session() as session: - session.ansibleroles.import_all_roles() - assert session.ansibleroles.import_all_roles() == session.ansibleroles.imported_roles_count session.location.select(module_location.name) session.organization.select(module_sca_manifest_org.name) session.hostgroup.assign_role_to_hostgroup( @@ -649,7 +647,9 @@ def test_positive_provision_end_to_end( silent_failure=True, handle_exception=True, ) - values = session.host_new.get_host_statuses(host_name) + values = session.host_new.get_host_statuses( + f'{host_name}.{module_vmware_hostgroup.domain.read().name}' + ) assert values['Build']['Status'] == 'Installed' assert values['Execution']['Status'] == 'Last execution succeeded'