mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
committed by
Nathaniel Case
parent
8a0347ac7a
commit
c9fea2b74b
2
test/integration/targets/cnos_lldp/aliases
Normal file
2
test/integration/targets/cnos_lldp/aliases
Normal file
@@ -0,0 +1,2 @@
|
||||
# No Lenovo Switch simulator yet, so not enabled
|
||||
unsupported
|
||||
2
test/integration/targets/cnos_lldp/defaults/main.yaml
Normal file
2
test/integration/targets/cnos_lldp/defaults/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
testcase: "*"
|
||||
22
test/integration/targets/cnos_lldp/tasks/cli.yaml
Normal file
22
test/integration/targets/cnos_lldp/tasks/cli.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: collect all cli test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/cli"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
register: test_cases
|
||||
delegate_to: localhost
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: run test cases (connection=network_cli)
|
||||
include: "{{ test_case_to_run }}"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
||||
|
||||
- name: run test case (connection=local)
|
||||
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||
with_first_found: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
||||
2
test/integration/targets/cnos_lldp/tasks/main.yaml
Normal file
2
test/integration/targets/cnos_lldp/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- { include: cli.yaml, tags: ['cli'] }
|
||||
44
test/integration/targets/cnos_lldp/tests/cli/basic.yaml
Normal file
44
test/integration/targets/cnos_lldp/tests/cli/basic.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
- debug: msg="START cnos_lldp cli/basic.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: Enable LLDP service
|
||||
cnos_lldp:
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- '"lldp receive" in result.commands'
|
||||
- '"lldp transmit" in result.commands'
|
||||
|
||||
- name: Enable LLDP service again (idempotent)
|
||||
cnos_lldp:
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
|
||||
- name: Disable LLDP service
|
||||
cnos_lldp:
|
||||
state: absent
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- '"no lldp receive" in result.commands'
|
||||
- '"no lldp transmit" in result.commands'
|
||||
|
||||
- name: Disable LLDP service (idempotent)
|
||||
cnos_lldp:
|
||||
state: absent
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
|
||||
- debug: msg="END cnos_lldp cli/basic.yaml on connection={{ ansible_connection }}"
|
||||
Reference in New Issue
Block a user