summaryrefslogtreecommitdiff
path: root/test/integration/targets/eos_l2_interface/tests/eapi/no_interface.yaml
blob: a5b997751563d795bb6177c426238ae510866c01 (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
---
- debug:
    msg: "START eos_l2_interface/eapi/no_interface.yaml on connection={{ ansible_connection }}"

- name: Create fake interface
  eos_interface:
    name: Management0
  become: yes

- block:
  - name: eos_l2_interface shouldn't fail
    eos_l2_interface: &no_switchport
      name: Ethernet1
      state: absent
    become: yes
    register: result

  - assert:
      that: "'Interface does not exist' in result.warnings[0]"

  always:
  - name: Cleanup fake interface
    eos_config:
      lines:
        - no interface Management0
    become: yes

- name: eos_l2_interface should still not fail
  eos_l2_interface: *no_switchport
  become: yes
  register: result

- assert:
    that: "result.warnings is not defined"

- debug:
    msg: "END eos_l2_interface/eapi/no_interface.yaml on connection={{ ansible_connection }}"