ansible/test/integration/targets/nxos_logging/tests/common/basic.yaml
Trishna Guha 48ecbb8fb9
fix connection gets overridden by network_cli for transport nxapi,eapi net_* modules (#34778)
* fix connection gets overridden by network_cli for transport nxapi,eapi net_* modules

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Define functions in individual action plugins to avoid code duplication

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add net_* eos tests for eapi

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* update plugin code
2018-01-15 13:16:41 +05:30

96 lines
2.2 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} nxos_logging basic test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: Set up console logging
nxos_logging:
dest: console
dest_level: 0
state: present
provider: "{{ connection }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"logging console 0" in result.commands'
- name: Set up console logging again (idempotent)
nxos_logging:
dest: console
dest_level: 0
state: present
provider: "{{ connection }}"
register: result
- assert:
that:
- 'result.changed == false'
- name: Delete/disable console logging
nxos_logging:
dest: console
dest_level: 0
state: absent
provider: "{{ connection }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"no logging console" in result.commands'
- name: Delete/disable console logging (idempotent)
nxos_logging:
dest: console
dest_level: 0
state: absent
provider: "{{ connection }}"
register: result
- assert:
that:
- 'result.changed == false'
- name: Logfile logging with level
nxos_logging:
dest: logfile
name: test
dest_level: 0
state: present
provider: "{{ connection }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"logging logfile test 0" in result.commands'
- name: Configure facility with level
nxos_logging:
facility: daemon
facility_level: 0
provider: "{{ connection }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"logging level daemon 0" in result.commands'
- name: remove logging as collection tearDown
nxos_logging:
aggregate:
- { dest: logfile, name: test, dest_level: 0, state: absent }
- { facility: daemon, facility_level: 0, state: absent }
provider: "{{ connection }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"no logging logfile" in result.commands'
- '"no logging level daemon" in result.commands'
- debug: msg="END connection={{ ansible_connection }} nxos_logging basic test"