summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/incidental_ios_file/tests/cli/net_put.yaml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
commit8a754e0858d922e955e71b253c139e071ecec432 (patch)
tree527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/incidental_ios_file/tests/cli/net_put.yaml
parentInitial commit. (diff)
downloadansible-core-upstream.tar.xz
ansible-core-upstream.zip
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/targets/incidental_ios_file/tests/cli/net_put.yaml')
-rw-r--r--test/integration/targets/incidental_ios_file/tests/cli/net_put.yaml73
1 files changed, 73 insertions, 0 deletions
diff --git a/test/integration/targets/incidental_ios_file/tests/cli/net_put.yaml b/test/integration/targets/incidental_ios_file/tests/cli/net_put.yaml
new file mode 100644
index 0000000..215b524
--- /dev/null
+++ b/test/integration/targets/incidental_ios_file/tests/cli/net_put.yaml
@@ -0,0 +1,73 @@
+---
+- debug:
+ msg: "START ios cli/net_put.yaml on connection={{ ansible_connection }}"
+
+# Add minimal testcase to check args are passed correctly to
+# implementation module and module run is successful.
+
+- name: setup
+ cisco.ios.ios_config:
+ lines:
+ - ip ssh version 2
+ - ip scp server enable
+ - username {{ ansible_ssh_user }} privilege 15
+ match: none
+
+- name: Delete existing files if present on remote host
+ cisco.ios.ios_command:
+ commands: "{{ item }}"
+ loop:
+ - delete /force ios1.cfg
+ - delete /force ios.cfg
+ - delete /force nonascii.bin
+ ignore_errors: true
+
+- name: copy file from controller to ios + scp (Default)
+ ansible.netcommon.net_put:
+ src: ios1.cfg
+ register: result
+
+- assert:
+ that:
+ - result.changed == true
+
+- name: Idempotency Check
+ ansible.netcommon.net_put:
+ src: ios1.cfg
+ register: result
+
+- assert:
+ that:
+ - result.changed == false
+
+- name: copy file from controller to ios + dest specified
+ ansible.netcommon.net_put:
+ src: ios1.cfg
+ dest: ios.cfg
+ register: result
+
+- assert:
+ that:
+ - result.changed == true
+
+- name: copy file with non-ascii characters to ios in template mode(Fail case)
+ ansible.netcommon.net_put:
+ src: nonascii.bin
+ mode: 'text'
+ register: result
+ ignore_errors: true
+
+- assert:
+ that:
+ - result.failed == true
+
+- name: copy file with non-ascii characters to ios in default mode(binary)
+ ansible.netcommon.net_put:
+ src: nonascii.bin
+ register: result
+
+- assert:
+ that:
+ - result.changed == true
+
+- debug: msg="END ios cli/net_put.yaml on connection={{ ansible_connection }}"