Skip to content

Commit

Permalink
Fixed the assertion error
Browse files Browse the repository at this point in the history
  • Loading branch information
amolpati30 committed Jul 24, 2024
1 parent a175f22 commit e6a4c47
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
14 changes: 7 additions & 7 deletions pytest_fixtures/core/xdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def align_to_satellite(request, worker_id, satellite_factory):
worker_pos = 0 if worker_id in ["master", "local"] else int(worker_id.replace("gw", ""))

# attempt to add potential satellites from the broker inventory file
# if settings.server.inventory_filter:
# logger.info(
# f'{worker_id=}: Attempting to add Satellite hosts using inventory filter: '
# f'{settings.server.inventory_filter}'
# )
# hosts = Satellite.get_hosts_from_inventory(filter=settings.server.inventory_filter)
# settings.server.hostnames += [host.hostname for host in hosts]
if settings.server.inventory_filter:
logger.info(
f'{worker_id=}: Attempting to add Satellite hosts using inventory filter: '
f'{settings.server.inventory_filter}'
)
hosts = Satellite.get_hosts_from_inventory(filter=settings.server.inventory_filter)
settings.server.hostnames += [host.hostname for host in hosts]

logger.debug(
f'{worker_id=}: {settings.server.xdist_behavior=}, '
Expand Down
17 changes: 10 additions & 7 deletions tests/foreman/cli/test_computeresource_azurerm.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,12 @@ def test_positive_azurerm_host_provisioned(

assert class_host_ft['name'] == self.fullhostname
assert class_host_ft['status']['build-status'] == "Installed"
assert class_host_ft['compute-resource'] == module_azurerm_cr.name
assert class_host_ft['operating-system']['image'] == module_azurerm_custom_finishimg.name
assert class_host_ft['network-interfaces'][0]['ipv4-address'] == azureclient_host.ip
assert class_host_ft['compute-resource']['name'] == module_azurerm_cr.name
assert (
class_host_ft['operating-system']['image']['name']
== module_azurerm_custom_finishimg.name
)
assert class_host_ft['network-interfaces']['1']['ipv4-address'] == azureclient_host.ip

# Azure cloud
assert self.hostname.lower() == azureclient_host.name
Expand Down Expand Up @@ -537,10 +540,10 @@ def test_positive_azurerm_host_provisioned(
"""
assert class_host_ud['name'] == self.fullhostname
assert class_host_ud['status']['build-status'] == "Pending installation"
assert class_host_ud['network-interfaces'][0]['ipv4-address'] == azureclient_host.ip
assert class_host_ud['compute-resource'] == module_azurerm_cr.name
assert class_host_ud['operating-system']['image'] == module_azurerm_cloudimg.name
assert class_host_ud['host-group'] == azurerm_hostgroup.name
assert class_host_ud['network-interfaces']['1']['ipv4-address'] == azureclient_host.ip
assert class_host_ud['compute-resource']['name'] == module_azurerm_cr.name
assert class_host_ud['operating-system']['image']['name'] == module_azurerm_cloudimg.name
assert class_host_ud['host-group']['name'] == azurerm_hostgroup.name

# Azure cloud
assert self.hostname.lower() == azureclient_host.name
Expand Down

0 comments on commit e6a4c47

Please sign in to comment.