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/net_interface/tests/iosxr/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 net_interface cli/intent.yaml"
- name: Setup (interface is up)
net_interface:
name: GigabitEthernet0/0/0/5
enabled: True
state: present
provider: "{{ cli }}"
register: result
- name: Check intent arguments
net_interface:
name: GigabitEthernet0/0/0/5
state: up
delay: 20
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.failed == false"
- name: Check intent arguments (failed condition)
net_interface:
name: GigabitEthernet0/0/0/5
state: down
provider: "{{ cli }}"
ignore_errors: yes
register: result
- assert:
that:
- "result.failed == true"
- "'state eq(down)' in result.failed_conditions"
- name: Config + intent
net_interface:
name: GigabitEthernet0/0/0/5
enabled: False
state: down
delay: 20
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.failed == false"
- name: Config + intent (fail)
net_interface:
name: GigabitEthernet0/0/0/5
enabled: False
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)
net_interface:
aggregate:
- name: GigabitEthernet0/0/0/5
enabled: True
state: up
delay: 20
provider: "{{ cli }}"
ignore_errors: yes
register: result
- assert:
that:
- "result.failed == false"