1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/ios_interface/tests/cli/intent.yaml
Ganesh Nalawade a12e9807ba Add intent arguments for ios and iosxr interface modules (#28018)
* Add intent arguments for ios_interface

*  Intent argument support
*  Integration test case for intent arguments

* Fix ci issue

* Add intent arguments for iosxr_interface

*  Add intent check support for iosxr_interface
*  Integration test for intent + configuration

* Fix ci failure
2017-08-15 19:20:28 +05:30

77 lines
1.5 KiB
YAML

---
- debug: msg="START ios_interface cli/intent.yaml"
- name: Check intent arguments
ios_interface:
name: GigabitEthernet0/2
state: up
tx_rate: ge(0)
rx_rate: le(0)
authorize: yes
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.failed == false"
- name: Check intent arguments (failed condition)
ios_interface:
name: GigabitEthernet0/2
state: down
tx_rate: gt(0)
rx_rate: lt(0)
authorize: yes
provider: "{{ cli }}"
ignore_errors: yes
register: result
- assert:
that:
- "result.failed == true"
- "'state eq(down)' in result.failed_conditions"
- "'tx_rate gt(0)' in result.failed_conditions"
- "'rx_rate lt(0)' in result.failed_conditions"
- name: Config + intent
ios_interface:
name: GigabitEthernet0/2
enabled: False
state: down
authorize: yes
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.failed == false"
- name: Config + intent (fail)
ios_interface:
name: GigabitEthernet0/2
enabled: False
authorize: yes
state: up
provider: "{{ cli }}"
ignore_errors: yes
register: result
- assert:
that:
- "result.failed == true"
- "'state eq(up)' in result.failed_conditions"
- name: Aggregate config + intent (pass)
ios_interface:
aggregate:
- name: GigabitEthernet0/2
enabled: True
state: up
authorize: yes
provider: "{{ cli }}"
ignore_errors: yes
register: result
- assert:
that:
- "result.failed == false"