From a7b276089b4c782eafb5141684efabecd8a0d3c8 Mon Sep 17 00:00:00 2001 From: hyaish Date: Thu, 11 Jul 2024 11:06:25 +0300 Subject: [PATCH] ACA-1603: Adding verefication to ensure Load Balancer was created as expected Signed-off-by: hyaish --- .../20240710-test_azure_load_balancer_with_public_ip.yml | 2 ++ .../tasks/create_and_delete_lb.yml | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/20240710-test_azure_load_balancer_with_public_ip.yml 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..407e64b5 --- /dev/null +++ b/changelogs/fragments/20240710-test_azure_load_balancer_with_public_ip.yml @@ -0,0 +1,2 @@ +bugfixes: + - Adding testing to ensure Load Balancer was created as expected \ No newline at end of file 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 }}"