mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-16 07:48:38 -05:00
Fix bug that would run --worker-info health checks on control or hybrid nodes (#11161)
* Fix bug that would run health check on control nodes * Prevent running execution node health check against main cluster nodes
This commit is contained in:
@@ -2,8 +2,8 @@ import pytest
|
||||
from unittest import mock
|
||||
import os
|
||||
|
||||
from awx.main.tasks import RunProjectUpdate, RunInventoryUpdate
|
||||
from awx.main.models import ProjectUpdate, InventoryUpdate, InventorySource
|
||||
from awx.main.tasks import RunProjectUpdate, RunInventoryUpdate, execution_node_health_check
|
||||
from awx.main.models import ProjectUpdate, InventoryUpdate, InventorySource, Instance
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -15,6 +15,15 @@ def scm_revision_file(tmpdir_factory):
|
||||
return os.path.join(revision_file.dirname, 'revision.txt')
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
@pytest.mark.parametrize('node_type', ('control', 'hybrid'))
|
||||
def test_no_worker_info_on_AWX_nodes(node_type):
|
||||
hostname = 'us-south-3-compute.invalid'
|
||||
Instance.objects.create(hostname=hostname, node_type=node_type)
|
||||
with pytest.raises(RuntimeError):
|
||||
execution_node_health_check(hostname)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
class TestDependentInventoryUpdate:
|
||||
def test_dependent_inventory_updates_is_called(self, scm_inventory_source, scm_revision_file):
|
||||
|
||||
Reference in New Issue
Block a user