From 6541779dd626eebe0b848ac396dcc3a5a3d32e5e Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 22 Apr 2018 03:21:59 +0100 Subject: [PATCH] tests: import Ansible file transfer benchmark --- tests/ansible/bench/all.yml | 1 + tests/ansible/bench/file_transfer.yml | 68 +++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 tests/ansible/bench/all.yml create mode 100644 tests/ansible/bench/file_transfer.yml diff --git a/tests/ansible/bench/all.yml b/tests/ansible/bench/all.yml new file mode 100644 index 00000000..453d0b42 --- /dev/null +++ b/tests/ansible/bench/all.yml @@ -0,0 +1 @@ +- import_playbook: file_transfer.yml diff --git a/tests/ansible/bench/file_transfer.yml b/tests/ansible/bench/file_transfer.yml new file mode 100644 index 00000000..99666b84 --- /dev/null +++ b/tests/ansible/bench/file_transfer.yml @@ -0,0 +1,68 @@ + +- name: bench/file_transfer.yml + hosts: all + any_errors_fatal: true + tasks: + + - name: Make 32MiB file + connection: local + shell: openssl rand 33554432 > /tmp/bigfile.in + + - name: Make 320MiB file + connection: local + shell: > + cat + /tmp/bigfile.in + /tmp/bigfile.in + /tmp/bigfile.in + /tmp/bigfile.in + /tmp/bigfile.in + /tmp/bigfile.in + /tmp/bigfile.in + /tmp/bigfile.in + /tmp/bigfile.in + /tmp/bigfile.in + > /tmp/bigbigfile.in + + - name: Delete SSH file is present. + file: + path: "{{item}}" + state: absent + become: true + with_items: + - /tmp/bigfile.out + - /tmp/bigbigfile.out + + - name: Copy 32MiB file via SSH + copy: + src: /tmp/bigfile.in + dest: /tmp/bigfile.out + + - name: Copy 320MiB file via SSH + copy: + src: /tmp/bigbigfile.in + dest: /tmp/bigbigfile.out + + - name: Delete localhost sudo file if present. + file: + path: "{{item}}" + state: absent + connection: local + become: true + with_items: + - /tmp/bigfile.out + - /tmp/bigbigfile.out + + - name: Copy 32MiB file via localhost sudo + connection: local + become: true + copy: + src: /tmp/bigfile.in + dest: /tmp/bigfile.out + + - name: Copy 320MiB file via localhost sudo + connection: local + become: true + copy: + src: /tmp/bigbigfile.in + dest: /tmp/bigbigfile.out