diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-04-22 10:29:12 +0800 |
---|---|---|
committer | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-04-22 10:29:12 +0800 |
commit | 385aa6e98428982802ea14a4f6a5a32d3f78c643 (patch) | |
tree | 8e85d85e927a5eb3d582f87110fb3875f17ab42d | |
parent | bb208192872c841cafdb27769f3680a56b18fa65 (diff) |
Organize results in folder named with pod and current date
Change-Id: I0882fb4548c3c3a6a72c6f752f8074e553ee3748
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
-rw-r--r-- | qtip/ansible_library/plugins/action/collect.py | 6 | ||||
-rw-r--r-- | resources/ansible_roles/inxi/tasks/main.yml | 2 | ||||
-rw-r--r-- | resources/ansible_roles/nDPI/tasks/main.yml | 2 | ||||
-rw-r--r-- | resources/ansible_roles/openssl/tasks/main.yml | 2 | ||||
-rw-r--r-- | resources/ansible_roles/qtip-workspace/files/defaults/run.yml | 12 | ||||
-rw-r--r-- | resources/ansible_roles/ramspeed/tasks/main.yml | 2 | ||||
-rw-r--r-- | resources/ansible_roles/unixbench/tasks/main.yml | 4 |
7 files changed, 20 insertions, 10 deletions
diff --git a/qtip/ansible_library/plugins/action/collect.py b/qtip/ansible_library/plugins/action/collect.py index 0ae3477d..f6ae7a5c 100644 --- a/qtip/ansible_library/plugins/action/collect.py +++ b/qtip/ansible_library/plugins/action/collect.py @@ -31,7 +31,7 @@ class ActionModule(ActionBase): if dump is not None: root = task_vars.get('qtip_results', 'results') base = task_vars.get('dump_base', 'dump') - dump_facts(task_vars['inventory_hostname'], [{'name': dump, 'content': string}], root, base) + dump_facts([{'name': dump, 'content': string}], root, base) return collect(patterns, string) @@ -52,8 +52,8 @@ def collect(patterns, string): return captured -def dump_facts(hostname, facts, root, base): - dest = os.path.join(root, hostname, base) +def dump_facts(facts, root, base): + dest = os.path.join(root, base) if not os.path.exists(dest): os.makedirs(dest) return [{'name': fact['name'], 'result': open(os.path.join(dest, fact['name']), 'w+').write(fact['content'])} diff --git a/resources/ansible_roles/inxi/tasks/main.yml b/resources/ansible_roles/inxi/tasks/main.yml index 66c83f9d..0267b680 100644 --- a/resources/ansible_roles/inxi/tasks/main.yml +++ b/resources/ansible_roles/inxi/tasks/main.yml @@ -46,6 +46,6 @@ - name: create system information report template: src: system-info.j2 - dest: "{{ qtip_results }}/{{ inventory_hostname }}/system-info" + dest: "{{ qtip_results }}/system-info" delegate_to: localhost tags: [report] diff --git a/resources/ansible_roles/nDPI/tasks/main.yml b/resources/ansible_roles/nDPI/tasks/main.yml index c53a22fc..d8bee591 100644 --- a/resources/ansible_roles/nDPI/tasks/main.yml +++ b/resources/ansible_roles/nDPI/tasks/main.yml @@ -62,6 +62,6 @@ - name: create dpi report template: src: dpi-metrics.j2 - dest: "{{ qtip_results }}/{{ inventory_hostname }}/dpi-metrics" + dest: "{{ qtip_results }}/dpi-metrics" delegate_to: localhost tags: [report] diff --git a/resources/ansible_roles/openssl/tasks/main.yml b/resources/ansible_roles/openssl/tasks/main.yml index 7975c177..864d0946 100644 --- a/resources/ansible_roles/openssl/tasks/main.yml +++ b/resources/ansible_roles/openssl/tasks/main.yml @@ -60,6 +60,6 @@ - name: create SSL report template: src: ssl-metrics.j2 - dest: "{{ qtip_results }}/{{ inventory_hostname }}/ssl-metrics" + dest: "{{ qtip_results }}/ssl-metrics" delegate_to: localhost tags: [report] diff --git a/resources/ansible_roles/qtip-workspace/files/defaults/run.yml b/resources/ansible_roles/qtip-workspace/files/defaults/run.yml index d0f452aa..31969281 100644 --- a/resources/ansible_roles/qtip-workspace/files/defaults/run.yml +++ b/resources/ansible_roles/qtip-workspace/files/defaults/run.yml @@ -13,6 +13,12 @@ # - test condition # - performance metrics +- hosts: localhost + tasks: + - name: setting result directory name + set_fact: + qtip_results_base: "{{ qtip_results }}/{{ pod_name }}-{{ lookup('pipe', 'date +%Y%m%d-%H%M') }}" + - hosts: compute pre_tasks: @@ -20,9 +26,13 @@ - name: check ssh connection ping: + - name: overriding result directory name + set_fact: + qtip_results: "{{ hostvars['localhost']['qtip_results_base']}}/{{ inventory_hostname }}" + - name: create result directory file: - path: "{{ qtip_results }}/{{ inventory_hostname }}" + path: "{{ qtip_results }}" state: directory delegate_to: localhost diff --git a/resources/ansible_roles/ramspeed/tasks/main.yml b/resources/ansible_roles/ramspeed/tasks/main.yml index 73df35de..2616cccc 100644 --- a/resources/ansible_roles/ramspeed/tasks/main.yml +++ b/resources/ansible_roles/ramspeed/tasks/main.yml @@ -70,6 +70,6 @@ - name: create memory metrics report template: src: "memory-metrics.j2" - dest: "{{ qtip_results }}/{{ inventory_hostname }}/memory-metrics" + dest: "{{ qtip_results }}/memory-metrics" delegate_to: localhost tags: [report] diff --git a/resources/ansible_roles/unixbench/tasks/main.yml b/resources/ansible_roles/unixbench/tasks/main.yml index 4c01609a..cce42fa1 100644 --- a/resources/ansible_roles/unixbench/tasks/main.yml +++ b/resources/ansible_roles/unixbench/tasks/main.yml @@ -32,13 +32,13 @@ synchronize: mode: pull src: "{{ cwd }}/byte-unixbench-5.1.3/UnixBench/results/" - dest: "{{ qtip_results }}/{{ inventory_hostname }}/unixbench" + dest: "{{ qtip_results }}/unixbench" use_ssh_args: yes - name: create integer and floating point report template: src: "{{ item }}.j2" - dest: "{{ qtip_results }}/{{ inventory_hostname }}/{{ item }}" + dest: "{{ qtip_results }}/{{ item }}" with_items: - floating-point - integer |