summaryrefslogtreecommitdiff
path: root/test/integration/targets/ios_template/tests/cli/backup.yaml
diff options
context:
space:
mode:
authorJohn R Barker <john@johnrbarker.com>2016-10-28 19:50:29 +0100
committerGitHub <noreply@github.com>2016-10-28 19:50:29 +0100
commite0cc7b34151def2ce0b08dbe3cb995107a2d6a0f (patch)
tree09df24fe1a91723d5fe716d8b9da843b383d5204 /test/integration/targets/ios_template/tests/cli/backup.yaml
parent4a067c3f502aa2254d8f35d8598895df8f3d1365 (diff)
downloadansible-e0cc7b34151def2ce0b08dbe3cb995107a2d6a0f.tar.gz
Migrate Network Tests into ansible/ansible (#18233)
* Docs Networking tests * Copy networking tests from test-network-modules * Networking transport settings - group_vars * Network playbooks * Debug should be off by default * Update nxos.yaml * Remove items from top level * Use dependencies, not pre-tasks * Remove trailing blank lines * Remove backup files * newlines
Diffstat (limited to 'test/integration/targets/ios_template/tests/cli/backup.yaml')
-rw-r--r--test/integration/targets/ios_template/tests/cli/backup.yaml55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/integration/targets/ios_template/tests/cli/backup.yaml b/test/integration/targets/ios_template/tests/cli/backup.yaml
new file mode 100644
index 0000000000..87c37c9d00
--- /dev/null
+++ b/test/integration/targets/ios_template/tests/cli/backup.yaml
@@ -0,0 +1,55 @@
+---
+- debug: msg="START cli/backup.yaml"
+
+- name: setup
+ ios_config:
+ commands:
+ - no interface Loopback999
+ match: none
+ provider: "{{ cli }}"
+ ignore_errors: yes
+
+- name: collect any backup files
+ find:
+ paths: "{{ role_path }}/backup"
+ pattern: "{{ inventory_hostname }}_config*"
+ register: backup_files
+ delegate_to: localhost
+
+- name: delete backup files
+ file:
+ path: "{{ item.path }}"
+ state: absent
+ with_items: "{{backup_files.files|default([])}}"
+
+- name: configure device with config
+ ios_template:
+ src: basic/config.j2
+ backup: yes
+ provider: "{{ cli }}"
+ register: result
+
+- assert:
+ that:
+ - "result.changed == true"
+ - "result.updates is defined"
+
+- name: collect any backup files
+ find:
+ paths: "{{ role_path }}/backup"
+ pattern: "{{ inventory_hostname }}_config*"
+ register: backup_files
+ delegate_to: localhost
+
+- assert:
+ that:
+ - "backup_files.files is defined"
+
+- name: teardown
+ ios_config:
+ commands:
+ - no interface Loopback999
+ match: none
+ provider: "{{ cli }}"
+
+- debug: msg="END cli/backup.yaml"