Add UnixBench benchmarking role 27/33527/2
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Wed, 19 Apr 2017 07:06:28 +0000 (15:06 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Thu, 20 Apr 2017 03:34:11 +0000 (11:34 +0800)
Change-Id: I14e1630ff67bf4dff0998456e57fee2b1656f585
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
qtip/driver/playbook/unixbench/setup.yaml
resources/roles/unixbench/defaults/main.yml [new file with mode: 0644]
resources/roles/unixbench/meta/main.yml [new file with mode: 0644]
resources/roles/unixbench/tasks/main.yml [new file with mode: 0644]
tests/integration/ansible.cfg
tests/integration/run.yaml

index 4b9b524..4dcdd2c 100644 (file)
@@ -61,5 +61,5 @@
         repo: https://github.com/kdlucas/byte-unixbench.git
         dest: '{{ ansible_env.HOME }}/tempT/'
 
-    - name: Make UnixBench
+    - name: Make UnixBench1
       shell: make --directory $HOME/tempT/UnixBench/
\ No newline at end of file
diff --git a/resources/roles/unixbench/defaults/main.yml b/resources/roles/unixbench/defaults/main.yml
new file mode 100644 (file)
index 0000000..d1facef
--- /dev/null
@@ -0,0 +1,12 @@
+#############################################################################
+# Copyright (c) 2017 ZTE Corporation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#############################################################################
+
+cwd: "{{ ansible_env.HOME }}/qtip/unixbench"
+iterations: 1
+parallel_copies: 1
\ No newline at end of file
diff --git a/resources/roles/unixbench/meta/main.yml b/resources/roles/unixbench/meta/main.yml
new file mode 100644 (file)
index 0000000..03c96c4
--- /dev/null
@@ -0,0 +1,12 @@
+#############################################################################
+# Copyright (c) 2017 ZTE Corporation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#############################################################################
+
+---
+dependencies:
+  - { role: development-tools }
diff --git a/resources/roles/unixbench/tasks/main.yml b/resources/roles/unixbench/tasks/main.yml
new file mode 100644 (file)
index 0000000..d9d5c8f
--- /dev/null
@@ -0,0 +1,36 @@
+#############################################################################
+# Copyright (c) 2017 ZTE Corporation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#############################################################################
+
+- name: make unixbench working directory
+  file:
+    path: "{{ cwd }}"
+    state: directory
+
+- name: download unixbench source code
+  unarchive:
+    src: https://github.com/kdlucas/byte-unixbench/archive/v5.1.3.tar.gz
+    dest: "{{ cwd }}"
+    remote_src: yes
+
+- name: build UnixBench
+  command: "make"
+  args:
+    chdir: "{{ cwd }}/byte-unixbench-5.1.3/UnixBench"
+
+- name: run whetstone and dhrystone
+  shell: "./Run -i {{ iterations }} -c {{ parallel_copies }} dhrystone whetstone"
+  args:
+    chdir: "{{ cwd }}/byte-unixbench-5.1.3/UnixBench"
+
+- name: synchronize test results to local
+  synchronize:
+    mode: pull
+    src: "{{ cwd }}/byte-unixbench-5.1.3/UnixBench/results"
+    dest: "{{ qtip_dump }}/{{ inventory_hostname }}/unixbench"
+    use_ssh_args: yes
index 30e2848..a94cad0 100644 (file)
@@ -28,3 +28,7 @@ filter_plugins     = ../../qtip/ansible_library/plugins/filter
 #strategy_plugins   = /usr/share/ansible/plugins/strategy
 
 callback_whitelist = profile_tasks
+
+[ssh_connection]
+
+ssh_args = -F ./ssh.cfg
\ No newline at end of file
index bab88d7..696235c 100644 (file)
     - development-tools
   tags: [setup]
 
+- hosts: compute
+  roles:
+    - unixbench
+  tags: [unixbench]
+
 - hosts: compute
   tasks:
   - name: collect system information