summaryrefslogtreecommitdiff
path: root/test/integration/targets/eos_config/tests/cli/config.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/eos_config/tests/cli/config.yaml')
-rw-r--r--test/integration/targets/eos_config/tests/cli/config.yaml46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/integration/targets/eos_config/tests/cli/config.yaml b/test/integration/targets/eos_config/tests/cli/config.yaml
new file mode 100644
index 0000000000..d95a491a4b
--- /dev/null
+++ b/test/integration/targets/eos_config/tests/cli/config.yaml
@@ -0,0 +1,46 @@
+---
+- debug: msg="START cli/config.yaml"
+
+- name: setup
+ eos_config:
+ lines: hostname {{ inventory_hostname }}
+ match: none
+ provider: "{{ cli }}"
+
+- name: get current running-config
+ eos_command:
+ commands: show running-config
+ provider: "{{ cli }}"
+ register: config
+
+- name: configure hostname
+ eos_config:
+ lines: hostname foo
+ config: "{{ config.stdout[0] }}"
+ provider: "{{ cli }}"
+ register: result
+
+- assert:
+ that:
+ - "result.changed == true"
+ - "'hostname foo' in result.updates"
+
+- name: configure hostname again
+ eos_config:
+ lines: hostname foo
+ config: "{{ config.stdout[0] }}"
+ provider: "{{ cli }}"
+ register: result
+
+- assert:
+ that:
+ - "result.changed == false"
+ - "'hostname foo' in result.updates"
+
+- name: teardown
+ eos_config:
+ lines: hostname {{ inventory_hostname }}
+ match: none
+ provider: "{{ cli }}"
+
+- debug: msg="END cli/config.yaml"