diff --git a/changelogs/fragments/20240710-test_azure_load_balancer_with_public_ip.yml b/changelogs/fragments/20240710-test_azure_load_balancer_with_public_ip.yml new file mode 100644 index 00000000..27385d83 --- /dev/null +++ b/changelogs/fragments/20240710-test_azure_load_balancer_with_public_ip.yml @@ -0,0 +1,3 @@ +bugfixes: + - Adding testing to ensure Load Balancer was created as expected + diff --git a/tests/integration/targets/test_azure_load_balancer_with_public_ip/tasks/create_and_delete_lb.yml b/tests/integration/targets/test_azure_load_balancer_with_public_ip/tasks/create_and_delete_lb.yml index 9bd801be..b796a5c8 100644 --- a/tests/integration/targets/test_azure_load_balancer_with_public_ip/tasks/create_and_delete_lb.yml +++ b/tests/integration/targets/test_azure_load_balancer_with_public_ip/tasks/create_and_delete_lb.yml @@ -21,12 +21,19 @@ name: "{{ load_balancer_name }}" resource_group: "{{ test_resource_group }}" register: _loadbalancer + + - name: Creating loadbalancer_id for loadbalancer creation test + ansible.builtin.set_fact: + loadbalancer_id: "/subscriptions/{{ azure_subscription_id }}/resourceGroups/{{ test_resource_group }}/providers/Microsoft.Network/loadBalancers/{{ load_balancer_name }}" - name: Ensure Load Balancer was created as expected ansible.builtin.assert: that: - _loadbalancer.loadbalancers | length == 1 - + - _loadbalancer.loadbalancers[0].name == load_balancer_name + - _loadbalancer.loadbalancers[0].id == loadbalancer_id + - _loadbalancer.loadbalancers[0].sku.name == load_balancer_sku + - name: Gather Public IP info azure.azcollection.azure_rm_publicipaddress_info: name: "{{ load_balancer_public_ip_name }}"