mirror of https://github.com/ansible/ansible.git
Enable nxapi nxos_banner test (#35033)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>pull/35038/head
parent
f806a58a5e
commit
8a6d699198
@ -1,3 +1,3 @@
|
||||
---
|
||||
- { include: cli.yaml, tags: ['cli'] }
|
||||
#- { include: nxapi.yaml, tags: ['nxapi'] }
|
||||
- { include: nxapi.yaml, tags: ['nxapi'] }
|
||||
|
@ -0,0 +1,32 @@
|
||||
---
|
||||
- debug: msg="START nxapi/nxos_banner exec test"
|
||||
|
||||
- block:
|
||||
- name: setup - remove exec
|
||||
nxos_banner: &remove
|
||||
banner: exec
|
||||
state: absent
|
||||
provider: "{{ nxapi }}"
|
||||
|
||||
- name: Set exec
|
||||
nxos_banner: &exec
|
||||
banner: exec
|
||||
text: |
|
||||
this is my exec banner
|
||||
that has a multiline
|
||||
string
|
||||
state: present
|
||||
provider: "{{ nxapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "'banner exec @\nthis is my exec banner\nthat has a multiline\nstring\n@' in result.commands"
|
||||
|
||||
- name: teardown - remove exec
|
||||
nxos_banner: *remove
|
||||
|
||||
when: platform is match("N7K")
|
||||
|
||||
- debug: msg="END nxapi/nxos_banner exec test"
|
@ -0,0 +1,29 @@
|
||||
---
|
||||
- debug: msg="START nxapi/nxos_banner motd test"
|
||||
|
||||
- name: setup - remove motd
|
||||
nxos_banner: &remove
|
||||
banner: motd
|
||||
state: absent
|
||||
provider: "{{ nxapi }}"
|
||||
|
||||
- name: Set motd
|
||||
nxos_banner: &motd
|
||||
banner: motd
|
||||
text: |
|
||||
this is my motd banner
|
||||
that has a multiline
|
||||
string
|
||||
state: present
|
||||
provider: "{{ nxapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "'banner motd @\nthis is my motd banner\nthat has a multiline\nstring\n@' in result.commands"
|
||||
|
||||
- name: teardown - remove motd
|
||||
nxos_banner: *remove
|
||||
|
||||
- debug: msg="END nxapi/nxos_banner motd test"
|
@ -0,0 +1,25 @@
|
||||
---
|
||||
- debug: msg="START nxapi/nxos_banner no-motd test"
|
||||
|
||||
- name: Setup
|
||||
nxos_banner:
|
||||
banner: motd
|
||||
text: |
|
||||
Junk motd banner
|
||||
over multiple lines
|
||||
state: present
|
||||
provider: "{{ nxapi }}"
|
||||
|
||||
- name: remove motd
|
||||
nxos_banner: &rm-motd
|
||||
banner: motd
|
||||
state: absent
|
||||
provider: "{{ nxapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "'no banner motd' in result.commands"
|
||||
|
||||
- debug: msg="END nxapi/nxos_banner no-motd test"
|
Loading…
Reference in New Issue