Skip to content

Commit

Permalink
Fix PBRS tests. Add correct value types for code and type in icmp spec
Browse files Browse the repository at this point in the history
  • Loading branch information
bhati-pradeep committed Mar 14, 2024
1 parent 05eae71 commit d90b687
Showing 1 changed file with 24 additions and 33 deletions.
57 changes: 24 additions & 33 deletions tests/integration/targets/nutanix_pbrs/tasks/negative_scenarios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
reroute: "{{reroute_ip}}"
protocol:
icmp:
type: "*"
code: "*"
register: result
code: "{{ icmp.code }}"
type: "{{ icmp.type }}"
register: result
ignore_errors: True

- name: Creation Status
assert:
that:
- result.failed is defined
success_msg: ' Success: returned error as expected '
##################################################################
##################################################################
- name: Create PBR with priority less than 10
ntnx_pbrs:
state: present
Expand All @@ -44,11 +44,11 @@
reroute: "{{reroute_ip}}"
protocol:
icmp:
type: "*"
code: "*"
register: result
code: "{{ icmp.code }}"
type: "{{ icmp.type }}"
register: result
ignore_errors: True

- name: Creation Status
assert:
that:
Expand All @@ -73,11 +73,15 @@
icmp:
code: "{{ icmp.code }}"
type: "{{ icmp.type }}"
register: result
register: result
ignore_errors: True

- set_fact:
todelete: "{{ todelete + [ result.pbr_uuid ] }}"
- name: Check failure status
assert:
that:
- result.failed == true
success_msg: ' Success: returned error as expected '

#################################################################
- name: Create PBR with unknown vpc uuid
ntnx_pbrs:
Expand All @@ -95,11 +99,11 @@
reroute: "{{reroute_ip}}"
protocol:
icmp:
type: "*"
code: "*"
register: result
code: "{{ icmp.code }}"
type: "{{ icmp.type }}"
register: result
ignore_errors: True

- name: Creation Status
assert:
that:
Expand All @@ -122,11 +126,11 @@
reroute: "{{reroute_ip}}"
protocol:
icmp:
type: "*"
code: "10"
register: result
type: 10
code: 10
register: result
ignore_errors: True

- name: Creation Status
assert:
that:
Expand All @@ -138,19 +142,6 @@
state: absent
pbr_uuid: 5
register: result
loop: "{{ todelete }}"
ignore_errors: True
- name: Creation Status
assert:
that:
- result.failed is defined
success_msg: ' Success: returned error as expected '
#######################################################################
- name: Delete pbrs with unknown uuid
ntnx_pbrs:
state: absent
register: result
loop: "{{ todelete }}"
ignore_errors: True
- name: Creation Status
assert:
Expand Down

0 comments on commit d90b687

Please sign in to comment.