ansible/test/integration/targets/eos_banner/tests/eapi/basic-login.yaml
Ricardo Carrillo Cruz d268471739 Fix basic-login eapi tests for eos_banner (#23304)
We should be passing the provider dict, not the transport.
2017-04-05 19:11:12 +02:00

55 lines
1.2 KiB
YAML

---
- name: setup - remove login
eos_banner:
banner: login
state: absent
authorize: yes
provider: "{{ eapi }}"
- name: Set login
eos_banner:
banner: login
text: |
this is my login banner
that has a multiline
string
state: present
authorize: yes
provider: "{{ eapi }}"
register: result
- debug:
msg: "{{ result }}"
- assert:
that:
- "result.changed == true"
- "'this is my login banner' in result.commands"
- "'that has a multiline' in result.commands"
# Ensure sessions contains epoc. Will fail after 18th May 2033
- "'ansible_1' in result.session_name"
- name: Set login again (idempotent)
eos_banner:
banner: login
text: |
this is my login banner
that has a multiline
string
state: present
authorize: yes
provider: "{{ eapi }}"
register: result
- assert:
that:
- "result.changed == false"
- "result.commands | length == 0"
# Ensure sessions contains epoc. Will fail after 18th May 2033
- "result.session_name is not defined"
# FIXME add in tests for everything defined in docs
# FIXME Test state:absent + test:
# FIXME Without powers ensure "privileged mode required"