diff --git a/tests/integration/targets/ntnx_address_groups/tasks/main.yml b/tests/integration/targets/ntnx_address_groups/tasks/main.yml index 9cfdf76e..e4554ddc 100644 --- a/tests/integration/targets/ntnx_address_groups/tasks/main.yml +++ b/tests/integration/targets/ntnx_address_groups/tasks/main.yml @@ -1,15 +1,15 @@ --- - name: Initializing variables module_defaults: - group/nutanix.ncp.ntnx: + group/nutanix.ncp.ntnx: nutanix_host: "{{ ip }}" nutanix_username: "{{ username }}" nutanix_password: "{{ password }}" validate_certs: "{{ validate_certs }}" block: - - name: Import create.yml - ansible.builtin.import_tasks: "create.yml" - - name: Import update.yml - ansible.builtin.import_tasks: "update.yml" - - name: Import delete.yml - ansible.builtin.import_tasks: "delete.yml" + - name: Import create.yml + ansible.builtin.import_tasks: "create.yml" + - name: Import update.yml + ansible.builtin.import_tasks: "update.yml" + - name: Import delete.yml + ansible.builtin.import_tasks: "delete.yml" diff --git a/tests/integration/targets/ntnx_address_groups_info/tasks/main.yml b/tests/integration/targets/ntnx_address_groups_info/tasks/main.yml index 4156c2d0..1198ff65 100644 --- a/tests/integration/targets/ntnx_address_groups_info/tasks/main.yml +++ b/tests/integration/targets/ntnx_address_groups_info/tasks/main.yml @@ -1,11 +1,11 @@ --- - name: Initializing variables module_defaults: - group/nutanix.ncp.ntnx: + group/nutanix.ncp.ntnx: nutanix_host: "{{ ip }}" nutanix_username: "{{ username }}" nutanix_password: "{{ password }}" validate_certs: "{{ validate_certs }}" block: - - name: Import create.yml - ansible.builtin.import_tasks: "address_groups_info.yml" + - name: Import create.yml + ansible.builtin.import_tasks: "address_groups_info.yml" diff --git a/tests/integration/targets/ntnx_categories/tasks/main.yml b/tests/integration/targets/ntnx_categories/tasks/main.yml index 820d2df6..76916a64 100644 --- a/tests/integration/targets/ntnx_categories/tasks/main.yml +++ b/tests/integration/targets/ntnx_categories/tasks/main.yml @@ -1,11 +1,11 @@ --- - name: Initializing variables module_defaults: - group/nutanix.ncp.ntnx: + group/nutanix.ncp.ntnx: nutanix_host: "{{ ip }}" nutanix_username: "{{ username }}" nutanix_password: "{{ password }}" validate_certs: "{{ validate_certs }}" block: - - name: Import all_operations.yml - ansible.builtin.import_tasks: "all_operations.yml" + - name: Import all_operations.yml + ansible.builtin.import_tasks: "all_operations.yml" diff --git a/tests/integration/targets/ntnx_categories_info/tasks/main.yml b/tests/integration/targets/ntnx_categories_info/tasks/main.yml index 79fd2a50..a37bd6bd 100644 --- a/tests/integration/targets/ntnx_categories_info/tasks/main.yml +++ b/tests/integration/targets/ntnx_categories_info/tasks/main.yml @@ -1,11 +1,11 @@ --- - name: Initializing variables module_defaults: - group/nutanix.ncp.ntnx: + group/nutanix.ncp.ntnx: nutanix_host: "{{ ip }}" nutanix_username: "{{ username }}" nutanix_password: "{{ password }}" validate_certs: "{{ validate_certs }}" block: - - name: Import info.yml - ansible.builtin.import_tasks: "info.yml" + - name: Import info.yml + ansible.builtin.import_tasks: "info.yml" diff --git a/tests/integration/targets/ntnx_clusters_info/tasks/main.yml b/tests/integration/targets/ntnx_clusters_info/tasks/main.yml index 2acd600a..94ef5e38 100644 --- a/tests/integration/targets/ntnx_clusters_info/tasks/main.yml +++ b/tests/integration/targets/ntnx_clusters_info/tasks/main.yml @@ -1,11 +1,11 @@ --- - name: Initializing variables module_defaults: - group/nutanix.ncp.ntnx: + group/nutanix.ncp.ntnx: nutanix_host: "{{ ip }}" nutanix_username: "{{ username }}" nutanix_password: "{{ password }}" validate_certs: "{{ validate_certs }}" block: - - name: Import get_clusters_info.yml - ansible.builtin.import_tasks: "get_clusters_info.yml" + - name: Import get_clusters_info.yml + ansible.builtin.import_tasks: "get_clusters_info.yml" diff --git a/tests/integration/targets/ntnx_hosts_info/tasks/main.yml b/tests/integration/targets/ntnx_hosts_info/tasks/main.yml index 5f8b994c..d8e77cc9 100644 --- a/tests/integration/targets/ntnx_hosts_info/tasks/main.yml +++ b/tests/integration/targets/ntnx_hosts_info/tasks/main.yml @@ -1,11 +1,11 @@ --- - name: Initializing variables module_defaults: - group/nutanix.ncp.ntnx: + group/nutanix.ncp.ntnx: nutanix_host: "{{ ip }}" nutanix_username: "{{ username }}" nutanix_password: "{{ password }}" validate_certs: "{{ validate_certs }}" block: - - name: Import get_hosts_info.yml - ansible.builtin.import_tasks: "get_hosts_info.yml" + - name: Import get_hosts_info.yml + ansible.builtin.import_tasks: "get_hosts_info.yml" diff --git a/tests/integration/targets/ntnx_image_placement_policies_info/tasks/main.yml b/tests/integration/targets/ntnx_image_placement_policies_info/tasks/main.yml index 79fd2a50..a37bd6bd 100644 --- a/tests/integration/targets/ntnx_image_placement_policies_info/tasks/main.yml +++ b/tests/integration/targets/ntnx_image_placement_policies_info/tasks/main.yml @@ -1,11 +1,11 @@ --- - name: Initializing variables module_defaults: - group/nutanix.ncp.ntnx: + group/nutanix.ncp.ntnx: nutanix_host: "{{ ip }}" nutanix_username: "{{ username }}" nutanix_password: "{{ password }}" validate_certs: "{{ validate_certs }}" block: - - name: Import info.yml - ansible.builtin.import_tasks: "info.yml" + - name: Import info.yml + ansible.builtin.import_tasks: "info.yml" diff --git a/tests/integration/targets/ntnx_image_placement_policy/tasks/main.yml b/tests/integration/targets/ntnx_image_placement_policy/tasks/main.yml index 9cfdf76e..e4554ddc 100644 --- a/tests/integration/targets/ntnx_image_placement_policy/tasks/main.yml +++ b/tests/integration/targets/ntnx_image_placement_policy/tasks/main.yml @@ -1,15 +1,15 @@ --- - name: Initializing variables module_defaults: - group/nutanix.ncp.ntnx: + group/nutanix.ncp.ntnx: nutanix_host: "{{ ip }}" nutanix_username: "{{ username }}" nutanix_password: "{{ password }}" validate_certs: "{{ validate_certs }}" block: - - name: Import create.yml - ansible.builtin.import_tasks: "create.yml" - - name: Import update.yml - ansible.builtin.import_tasks: "update.yml" - - name: Import delete.yml - ansible.builtin.import_tasks: "delete.yml" + - name: Import create.yml + ansible.builtin.import_tasks: "create.yml" + - name: Import update.yml + ansible.builtin.import_tasks: "update.yml" + - name: Import delete.yml + ansible.builtin.import_tasks: "delete.yml" diff --git a/tests/integration/targets/ntnx_images/tasks/main.yml b/tests/integration/targets/ntnx_images/tasks/main.yml index 83f52f1a..65a6e295 100644 --- a/tests/integration/targets/ntnx_images/tasks/main.yml +++ b/tests/integration/targets/ntnx_images/tasks/main.yml @@ -1,15 +1,15 @@ --- - name: Set module defaults module_defaults: - group/nutanix.ncp.ntnx: + group/nutanix.ncp.ntnx: nutanix_host: "{{ ip }}" nutanix_username: "{{ username }}" nutanix_password: "{{ password }}" validate_certs: "{{ validate_certs }}" block: - - name: Import create.yml - ansible.builtin.import_tasks: "create.yml" - - name: Import update.yml - ansible.builtin.import_tasks: "update.yml" - - name: Import delete.yml - ansible.builtin.import_tasks: "delete.yml" + - name: Import create.yml + ansible.builtin.import_tasks: "create.yml" + - name: Import update.yml + ansible.builtin.import_tasks: "update.yml" + - name: Import delete.yml + ansible.builtin.import_tasks: "delete.yml" diff --git a/tests/integration/targets/ntnx_images_info/tasks/main.yml b/tests/integration/targets/ntnx_images_info/tasks/main.yml index 288e27d3..74e773fc 100644 --- a/tests/integration/targets/ntnx_images_info/tasks/main.yml +++ b/tests/integration/targets/ntnx_images_info/tasks/main.yml @@ -1,11 +1,11 @@ --- - name: Set module defaults module_defaults: - group/nutanix.ncp.ntnx: + group/nutanix.ncp.ntnx: nutanix_host: "{{ ip }}" nutanix_username: "{{ username }}" nutanix_password: "{{ password }}" validate_certs: "{{ validate_certs }}" block: - - name: Import info.yml - ansible.builtin.import_tasks: "info.yml" + - name: Import info.yml + ansible.builtin.import_tasks: "info.yml" diff --git a/tests/integration/targets/ntnx_service_groups/tasks/create.yml b/tests/integration/targets/ntnx_service_groups/tasks/create.yml index 7fa4a6ba..9c7c13f6 100644 --- a/tests/integration/targets/ntnx_service_groups/tasks/create.yml +++ b/tests/integration/targets/ntnx_service_groups/tasks/create.yml @@ -156,7 +156,7 @@ - result.response.service_group.service_list[1].udp_port_range_list[2].start_port == 99 - result.response.service_group.service_list[1].udp_port_range_list[2].end_port == 99 - result.response.service_group.service_list[2].protocol == "ICMP" - - result.response.service_group.service_list[2].icmp_type_code_list == [] + - result.response.service_group.service_list[2].icmp_type_code_list == [{}] fail_msg: "Fail: Unable to create tcp service group " success_msg: "Pass: tcp service group created successfully" diff --git a/tests/integration/targets/ntnx_static_routes/tasks/create.yml b/tests/integration/targets/ntnx_static_routes/tasks/create.yml index f4671fdd..69ecea87 100644 --- a/tests/integration/targets/ntnx_static_routes/tasks/create.yml +++ b/tests/integration/targets/ntnx_static_routes/tasks/create.yml @@ -32,18 +32,36 @@ - result.response is defined - result.response.status.state == 'COMPLETE' - result.changed == true - - result.response.status.resources.static_routes_list[0]["is_active"] == true - ("{{d1}}" == "10.2.2.0/24" and "{{d2}}" == "10.2.3.0/24") or ("{{d2}}" == "10.2.2.0/24" and "{{d1}}" == "10.2.3.0/24") - result.response.status.resources.static_routes_list[0]["nexthop"]["external_subnet_reference"]["name"] == "{{ external_nat_subnet.name }}" - - result.response.status.resources.static_routes_list[1]["is_active"] == true - result.response.status.resources.static_routes_list[1]["nexthop"]["external_subnet_reference"]["name"] == "{{ external_nat_subnet.name }}" - - result.response.status.resources.default_route["is_active"] == true - result.response.status.resources.default_route["destination"] == "0.0.0.0/0" - result.response.status.resources.default_route["nexthop"]["external_subnet_reference"]["name"] == "{{ external_nat_subnet.name }}" fail_msg: "Fail: Unable to update static routes of vpc" success_msg: "Succes: static routes updated successfully" +- name: Wait 1 minute for static routes to be become active + pause: + seconds: 60 + +- name: get all static routes + ntnx_static_routes_info: + vpc_uuid: "{{ vpc.uuid }}" + register: result + +- set_fact: + d1: "{{ result.response.status.resources.static_routes_list[0].destination }}" + d2: "{{ result.response.status.resources.static_routes_list[1].destination }}" + +- debug: + msg: "{{ result }}" + +- name: check info module response + assert: + that: + - result.response is defined + - result.changed == false ########################################################################################################### - name: Idempotency check @@ -91,12 +109,32 @@ - result.response is defined - result.response.status.state == 'COMPLETE' - result.changed == true - - result.response.status.resources.static_routes_list[0]["is_active"] == true - result.response.status.resources.static_routes_list[0]["destination"] == "10.2.4.0/24" - result.response.status.resources.static_routes_list[0]["nexthop"]["external_subnet_reference"]["name"] == "{{ external_nat_subnet.name }}" fail_msg: "Static routes overriding failed" success_msg: "Static routes overriden successfully" +- name: Wait 1 minute for static routes to be become active + pause: + seconds: 60 + +- name: get all static routes + ntnx_static_routes_info: + vpc_uuid: "{{ vpc.uuid }}" + register: result + +- set_fact: + d1: "{{ result.response.status.resources.static_routes_list[0].destination }}" + +- name: check info module response + assert: + that: + - result.response is defined + - result.changed == false + - result.response.status.resources.static_routes_list[0]["is_active"] == true + - result.response.status.resources.static_routes_list[0]["destination"] == "10.2.4.0/24" + - result.response.status.resources.static_routes_list[0]["nexthop"]["external_subnet_reference"]["name"] == "{{ external_nat_subnet.name }}" + ########################################################################################################### - name: Netgative scenario of cretaing multiple default routes diff --git a/tests/integration/targets/ntnx_static_routes_info/tasks/info.yml b/tests/integration/targets/ntnx_static_routes_info/tasks/info.yml index 870c7d69..14ebd81c 100644 --- a/tests/integration/targets/ntnx_static_routes_info/tasks/info.yml +++ b/tests/integration/targets/ntnx_static_routes_info/tasks/info.yml @@ -20,17 +20,21 @@ uuid: "{{ external_nat_subnet.uuid }}" register: result -- name: Update static routes list Status +- name: Create new static routes status ansible.builtin.assert: that: - result.response is defined - result.response.status.state == 'COMPLETE' - result.changed == true - fail_msg: "Fail: Unable to update static routes of vpc" - success_msg: "Succes: static routes updated successfully" + fail_msg: "Fail: Unable to create static routes for vpc" + success_msg: "Success: Static routes created" ########################################################################################################### +- name: Wait 60 seconds for static routes to be created + pause: + seconds: 60 + - name: Get all static routes ntnx_static_routes_info: vpc_uuid: "{{ vpc.uuid }}" diff --git a/tests/integration/targets/nutanix_vms/tasks/main.yml b/tests/integration/targets/nutanix_vms/tasks/main.yml index 7020053b..54eee0d1 100644 --- a/tests/integration/targets/nutanix_vms/tasks/main.yml +++ b/tests/integration/targets/nutanix_vms/tasks/main.yml @@ -1,21 +1,21 @@ --- - name: Set module defaults module_defaults: - group/nutanix.ncp.ntnx: + group/nutanix.ncp.ntnx: nutanix_host: "{{ ip }}" nutanix_username: "{{ username }}" nutanix_password: "{{ password }}" validate_certs: "{{ validate_certs }}" block: - - name: Import create.yml - ansible.builtin.import_tasks: "create.yml" - - name: Import negtaive_scenarios.yml - ansible.builtin.import_tasks: "negtaive_scenarios.yml" - - name: Import delete.yml - ansible.builtin.import_tasks: "delete.yml" - - name: Import vm_operations.yml - ansible.builtin.import_tasks: "vm_operations.yml" - - name: Import vm_update.yml - ansible.builtin.import_tasks: "vm_update.yml" - - name: Import negtaive_vm_update.yml - ansible.builtin.import_tasks: "negtaive_vm_update.yml" + - name: Import create.yml + ansible.builtin.import_tasks: "create.yml" + - name: Import negtaive_scenarios.yml + ansible.builtin.import_tasks: "negtaive_scenarios.yml" + - name: Import delete.yml + ansible.builtin.import_tasks: "delete.yml" + - name: Import vm_operations.yml + ansible.builtin.import_tasks: "vm_operations.yml" + - name: Import vm_update.yml + ansible.builtin.import_tasks: "vm_update.yml" + - name: Import negtaive_vm_update.yml + ansible.builtin.import_tasks: "negtaive_vm_update.yml"