summaryrefslogtreecommitdiff
path: root/tests/integration/targets/vyos_lldp/tests/cli/basic.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/targets/vyos_lldp/tests/cli/basic.yaml')
-rw-r--r--tests/integration/targets/vyos_lldp/tests/cli/basic.yaml44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/integration/targets/vyos_lldp/tests/cli/basic.yaml b/tests/integration/targets/vyos_lldp/tests/cli/basic.yaml
new file mode 100644
index 0000000..badd3a9
--- /dev/null
+++ b/tests/integration/targets/vyos_lldp/tests/cli/basic.yaml
@@ -0,0 +1,44 @@
+---
+- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}"
+
+- name: Make sure LLDP is not running before tests
+ vyos.vyos.vyos_config:
+ lines: delete service lldp
+
+- name: Enable LLDP service
+ vyos.vyos.vyos_lldp:
+ state: present
+ register: result
+
+- assert:
+ that:
+ - 'result.changed == true'
+ - '"set service lldp" in result.commands'
+
+- name: Enable LLDP service again (idempotent)
+ vyos.vyos.vyos_lldp:
+ state: present
+ register: result
+
+- assert:
+ that:
+ - 'result.changed == false'
+
+- name: Disable LLDP service
+ vyos.vyos.vyos_lldp:
+ state: absent
+ register: result
+
+- assert:
+ that:
+ - 'result.changed == true'
+ - '"delete service lldp" in result.commands'
+
+- name:
+ vyos.vyos.vyos_lldp:
+ state: absent
+ register: result
+
+- assert:
+ that:
+ - 'result.changed == false'