ansible/test/integration/targets/eos_config/tests/cli/sublevel_exact.yaml
Nathaniel Case 513c75079e
Port eos tests to network_cli (#33586)
* Add eos and fix tests to run multiple connections

* Update tests to report connection

* Add missing START messages

* Fix unspecified connection

* Python 3 updates

Exceptions don't have `.message` in Python 3

* Override `become` when using `connection=local`

* Slight restructuring to make eapi easier later on

* Move eapi toggle to prepare_eos
* Pull out connection on eapi tasks
2017-12-19 15:49:49 -05:00

69 lines
1.9 KiB
YAML

---
- debug: msg="START cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
- name: setup
eos_config:
lines:
- 10 permit ip host 1.1.1.1 any log
- 20 permit ip host 2.2.2.2 any log
- 30 permit ip host 3.3.3.3 any log
- 40 permit ip host 4.4.4.4 any log
- 50 permit ip host 5.5.5.5 any log
parents: ip access-list test
before: no ip access-list test
after: exit
match: none
provider: "{{ cli }}"
become: yes
- name: configure sub level command using exact match
eos_config:
lines:
- 10 permit ip host 1.1.1.1 any log
- 20 permit ip host 2.2.2.2 any log
- 30 permit ip host 3.3.3.3 any log
- 40 permit ip host 4.4.4.4 any log
parents: ip access-list test
before: no ip access-list test
after: exit
match: exact
replace: block
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- "result.changed == true"
- "'ip access-list test' in result.updates"
- "'10 permit ip host 1.1.1.1 any log' in result.updates"
- "'20 permit ip host 2.2.2.2 any log' in result.updates"
- "'30 permit ip host 3.3.3.3 any log' in result.updates"
- "'40 permit ip host 4.4.4.4 any log' in result.updates"
- "'50 permit ip host 5.5.5.5 any log' not in result.updates"
- name: check sub level command using exact match
eos_config:
lines:
- 10 permit ip host 1.1.1.1 any log
- 20 permit ip host 2.2.2.2 any log
- 30 permit ip host 3.3.3.3 any log
- 40 permit ip host 4.4.4.4 any log
parents: ip access-list test
match: exact
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
eos_config:
lines: no ip access-list test
match: none
provider: "{{ cli }}"
become: yes
- debug: msg="END cli/sublevel_exact.yaml on connection={{ ansible_connection }}"