1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/eos_l2_interface/tests/cli/basic.yaml
Ricardo Carrillo Cruz b7f4504a36
Add eos_l2_interface module and integration tests (#35162)
* Add eos_l2_interface module and integration tests

* Address PR review comments

* Fix pylint issues
2018-01-22 20:00:39 +01:00

137 lines
2.7 KiB
YAML

---
- debug: msg="START eos_l2_interface cli/basic.yaml on connection={{ ansible_connection }}"
- name: Delete test interface switchports
eos_l2_interface:
name: Ethernet1
state: absent
- name: Set switchport mode to access on vlan 4000
eos_l2_interface:
name: Ethernet1
state: present
mode: access
access_vlan: 4000
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == true'
- name: Set switchport mode to access on vlan 4000 again (idempotent)
eos_l2_interface:
name: Ethernet1
state: present
mode: access
access_vlan: 4000
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == false'
- name: Change access vlan to 4001
eos_l2_interface:
name: Ethernet1
state: present
mode: access
access_vlan: 4001
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == true'
- name: Change access vlan to 4001 again (idempotent)
eos_l2_interface:
name: Ethernet1
state: present
mode: access
access_vlan: 4001
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == false'
- name: Change switchport mode to trunk and set native vlan to 4001
eos_l2_interface:
name: Ethernet1
state: present
mode: trunk
native_vlan: 4001
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == true'
- name: Change switchport mode to trunk and set native vlan to 4001 again (idempotent)
eos_l2_interface:
name: Ethernet1
state: present
mode: trunk
native_vlan: 4001
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == false'
- name: Set trunk allowed vlans to 20 and 4000
eos_l2_interface:
name: Ethernet1
state: present
mode: trunk
trunk_allowed_vlans: 20,4000
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == true'
- name: Set trunk allowed vlans to 20 and 4000 again (idempotent)
eos_l2_interface:
name: Ethernet1
state: present
mode: trunk
trunk_allowed_vlans: 20,4000
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == false'
- name: Tear down switchports
eos_l2_interface:
name: Ethernet1
state: absent
authorize: yes
provider: "{{ cli }}"
become: yes
- debug: msg="END eos_l3_interface cli/basic.yaml on connection={{ ansible_connection }}"