summaryrefslogtreecommitdiff
path: root/test/integration/targets/eos_banner/tests/eapi/basic-login.yaml
blob: c9cd17931e84c9f7de18bc28f2a70a46e64e156c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---

- name: setup - remove login
  eos_banner:
    banner: login
    state: absent
    authorize: yes
    transport: "{{ eapi }}"

- name: Set login
  eos_banner:
    banner: login
    text: |
      this is my login banner
      that has a multiline
      string
    state: present
    authorize: yes
    transport: "{{ 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
    transport: "{{ 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"