mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 23:16:01 -03:30
Update awx_collection to support ReceptorAddress
- Add receptor_address module which allows users to create addresses for instances - Update awx_collection functional and integration tests to support new peering design Signed-off-by: Seth Foster <fosterbseth@gmail.com>
This commit is contained in:
@@ -13,39 +13,39 @@ def test_peers_adding_and_removing(run_module, admin_user):
|
||||
with override_settings(IS_K8S=True):
|
||||
result = run_module(
|
||||
'instance',
|
||||
{'hostname': 'hopnode1', 'node_type': 'hop', 'peers_from_control_nodes': True, 'node_state': 'installed', 'listener_port': 27199},
|
||||
{'hostname': 'hopnode', 'node_type': 'hop', 'node_state': 'installed'},
|
||||
admin_user,
|
||||
)
|
||||
assert result['changed']
|
||||
|
||||
hop_node_1 = Instance.objects.get(pk=result.get('id'))
|
||||
hop_node = Instance.objects.get(pk=result.get('id'))
|
||||
|
||||
assert hop_node_1.peers_from_control_nodes is True
|
||||
assert hop_node_1.node_type == 'hop'
|
||||
assert hop_node.node_type == 'hop'
|
||||
|
||||
result = run_module(
|
||||
'instance',
|
||||
{'hostname': 'hopnode2', 'node_type': 'hop', 'peers_from_control_nodes': True, 'node_state': 'installed', 'listener_port': 27199},
|
||||
'receptor_address',
|
||||
{'address': 'hopnodeaddr', 'instance': 'hopnode', 'port': 6789},
|
||||
admin_user,
|
||||
)
|
||||
assert result['changed']
|
||||
|
||||
hop_node_2 = Instance.objects.get(pk=result.get('id'))
|
||||
address = hop_node.receptor_addresses.get(pk=result.get('id'))
|
||||
assert address.port == 6789
|
||||
|
||||
result = run_module(
|
||||
'instance',
|
||||
{'hostname': 'executionnode', 'node_type': 'execution', 'node_state': 'installed', 'listener_port': 27199, 'peers': ['hopnode1', 'hopnode2']},
|
||||
{'hostname': 'executionnode', 'node_type': 'execution', 'node_state': 'installed', 'peers': ['hopnodeaddr']},
|
||||
admin_user,
|
||||
)
|
||||
assert result['changed']
|
||||
|
||||
execution_node = Instance.objects.get(pk=result.get('id'))
|
||||
|
||||
assert set(execution_node.peers.all()) == {hop_node_1, hop_node_2}
|
||||
assert set(execution_node.peers.all()) == {address}
|
||||
|
||||
result = run_module(
|
||||
'instance',
|
||||
{'hostname': 'executionnode', 'node_type': 'execution', 'node_state': 'installed', 'listener_port': 27199, 'peers': []},
|
||||
{'hostname': 'executionnode', 'node_type': 'execution', 'node_state': 'installed', 'peers': []},
|
||||
admin_user,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user