ansible/test/integration/targets/eos_config/tests/cli/check_mode.yaml
Ganesh Nalawade ea6ef3fae8
Enable setting options for cliconf and other implementation plugins (if set to configurable) (#43368)
* Enable setting setting cliconf plugin options

Fixes #43367

* Add support to set configuration options for implementation plugins (eg: cliconf)
  from `ansible-connection`

* Fix CI failure
2018-07-30 21:53:44 -07:00

74 lines
1.6 KiB
YAML

---
- debug: msg="START cli/check_mode.yaml on connection={{ ansible_connection }}"
- name: invalid configuration in check mode
eos_config:
lines:
- ip address 119.31.1.1 255.255.255.256
parents: interface Loopback911
become: yes
check_mode: 1
vars:
ansible_eos_use_sessions: 1
register: result
ignore_errors: yes
- assert:
that:
- "result.msg is defined"
- "result.failed == true"
- "'Invalid input' in result.msg"
- name: valid configuration in check mode
eos_config:
before:
- "no ip access-list test"
src: basic/cmds.j2
become: yes
check_mode: yes
register: config
- name: check if session is removed
eos_command:
commands:
- show configuration sessions | json
become: yes
register: result
- assert:
that:
- "config.session not in result.stdout[0].sessions"
- name: invalid configuration in check mode + no config session
eos_config:
lines:
- ip address 119.31.1.1 255.255.255.256
parents: interface Loopback911
become: yes
check_mode: 1
vars:
ansible_eos_use_sessions: 0
register: result
ignore_errors: yes
- assert:
that:
- "result.changed == true"
- name: valid configuration in check mode + no config session
eos_config:
lines:
- ip address 119.31.1.1 255.255.255.255
parents: interface Loopback911
become: yes
check_mode: yes
register: result
vars:
ansible_eos_use_sessions: 0
- assert:
that:
- "result.changed == true"
- "'session' not in result"
- debug: msg="END cli/check_mode.yaml on connection={{ ansible_connection }}"