-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,312 additions
and
435 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nutanix-ncp-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
- block: | ||
- import_tasks: "create_floating_ips.yml" | ||
|
||
- import_tasks: "negative_scenarios.yml" |
99 changes: 99 additions & 0 deletions
99
tests/integration/targets/nutanix_floating_ips/tasks/negative_scenarios.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
- debug: | ||
msg: "Started Negative Creation Cases" | ||
- name: Create floating ip with unknown external subnet name | ||
ntnx_floating_ips: | ||
validate_certs: False | ||
state: present | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
external_subnet: | ||
name: "external_subnet" | ||
register: result | ||
ignore_errors: True | ||
|
||
- name: Creation Status | ||
assert: | ||
that: | ||
- result.failed==True | ||
- result.msg=="Failed generating floating_ip spec" | ||
success_msg: ' Success: returned error as expected ' | ||
################################################################# | ||
- name: Create floating ip with unknown external subnet uuid | ||
ntnx_floating_ips: | ||
validate_certs: False | ||
state: present | ||
wait: false | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
external_subnet: | ||
uuid: 54e295c3-16d3-49de-96ba-b921948b3a | ||
register: result | ||
ignore_errors: True | ||
|
||
- name: Creation Status | ||
assert: | ||
that: | ||
- result.status_code==422 | ||
success_msg: ' Success: returned error as expected ' | ||
############################################################### | ||
- name: Create floating ip with unknown vpc | ||
ntnx_floating_ips: | ||
validate_certs: False | ||
state: present | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
external_subnet: | ||
name: "{{ external_subnet.name}}" | ||
vpc: | ||
name: vpc | ||
private_ip: "{{ private_ip }}" | ||
register: result | ||
ignore_errors: True | ||
|
||
- name: Creation Status | ||
assert: | ||
that: | ||
- result.failed==True | ||
- result.msg=="Failed generating floating_ip spec" | ||
success_msg: ' Success: returned error as expected ' | ||
############################################################### | ||
- name: Create floating ip with unknown vpc uuid | ||
ntnx_floating_ips: | ||
validate_certs: False | ||
state: present | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
external_subnet: | ||
name: "{{ external_subnet.name }}" | ||
vpc: | ||
uuid: 471181f8-eb2d-4303-9a61-6b25a1b3 | ||
private_ip: "{{ private_ip }}" | ||
register: result | ||
ignore_errors: True | ||
|
||
- name: Creation Status | ||
assert: | ||
that: | ||
- result.status_code==422 | ||
success_msg: ' Success: returned error as expected ' | ||
############################################################## | ||
- name: Delete floating ip with unknown uuid | ||
ntnx_floating_ips: | ||
state: absent | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
validate_certs: false | ||
fip_uuid: 5 | ||
register: result | ||
ignore_errors: True | ||
|
||
- name: Creation Status | ||
assert: | ||
that: | ||
- result.status_code==400 | ||
success_msg: ' Success: returned error as expected ' |
24 changes: 15 additions & 9 deletions
24
tests/integration/targets/nutanix_floating_ips/vars/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
IP: 10.44.76.88 | ||
ip: 10.44.76.88 | ||
username: admin | ||
password: Nutanix.123 | ||
|
||
external_subnet: | ||
subnet_name: ET_7 | ||
subnet_uuiid: 54e295c3-16d3-49de-96ba-b921948b3a4d | ||
name: Ext-Nat | ||
uuid: 581b6d25-4064-4cd0-b8ef-5aa0f3b98700 | ||
|
||
vpc: | ||
vpc_name: ET_8 | ||
vpc_uuiid: 471181f8-eb2d-4303-9a61-6b25a1b3553e | ||
name: ET_8 | ||
uuid: 55c50dad-7b45-4067-9ee9-97c0275a69f5 | ||
|
||
vm: | ||
vm_name: ET_11 | ||
vm_uuid: 83c9c094-2b18-4e65-bf6f-234640e07bc0 | ||
private_ip: 192.168.1.153 | ||
name: ET_11 | ||
uuid: a34604ae-a092-4994-ae29-50c906da41fa | ||
|
||
private_ip: 192.168.0.10 | ||
|
||
vm_subnet_name: Ext-Nat | ||
|
||
todelete: [] | ||
vm_subnet_name: Prod-NAT |
Oops, something went wrong.