bugfix: tc078 fails in some situations 23/49123/1
authorrexlee8776 <limingjiang@huawei.com>
Thu, 16 Nov 2017 08:49:16 +0000 (08:49 +0000)
committerRoss Brattain <ross.b.brattain@intel.com>
Sat, 16 Dec 2017 09:22:04 +0000 (09:22 +0000)
1. make  "SPECint_benchmark, runspec_iterations, runspec_tune, runspec_size,
runspec_rate" parameterized and change the default value "int^429" to "int"
2. remove "become: true" in some roles since it does not need root privilege

JIRA: YARDSTICK-852

Change-Id: Icb384bddc12911e2681a981d0504e0e142d1a8ec
Signed-off-by: rexlee8776 <limingjiang@huawei.com>
(cherry picked from commit 7bd43b239b7be6f478399526a177922d4482bcc2)

ansible/roles/archive_spec_cpu2006_result/tasks/main.yaml
ansible/roles/fetch_spec_cpu2006_result/tasks/main.yaml
ansible/roles/install_spec_cpu2006/tasks/main.yaml
ansible/roles/unarchive_spec_cpu2006_result/tasks/main.yaml
ansible/roles/uninstall_spec_cpu2006/tasks/main.yaml
tests/opnfv/test_cases/opnfv_yardstick_tc078.yaml [changed mode: 0644->0755]
yardstick/benchmark/scenarios/compute/spec_cpu.py

index 7f72e13..0282244 100644 (file)
@@ -10,6 +10,5 @@
 
 - name: archive_spec_cpu2006_result
   archive:
-    path: /usr/cpu2006/result
-    dest: /usr/cpu2006/spec_cpu2006_result.zip
-  become: true
+    path: ~/cpu2006/result
+    dest: ~/cpu2006/spec_cpu2006_result.zip
index 370ec7a..ccc8900 100644 (file)
@@ -10,7 +10,6 @@
 
 - name: fetch_spec_cpu2006_result
   fetch:
-    src: /usr/cpu2006/spec_cpu2006_result.zip
+    src: ~/cpu2006/spec_cpu2006_result.zip
     dest: /tmp/
     flat: yes
-  become: true
index baa9f6c..ea698f5 100644 (file)
   copy:
     src: /home/opnfv/repos/yardstick/yardstick/resources/cpu2006-1.2.iso
     dest: ~/cpu2006-1.2.iso
-  become: true
 
 - name: install SPEC CPU2006
   shell:
-    mount -t iso9660 -o ro,exec ~/cpu2006-1.2.iso /mnt;
+    sudo mount -t iso9660 -o ro,exec ~/cpu2006-1.2.iso /mnt;
     cd /mnt;
-    ./install.sh -fd /usr/cpu2006;
+    ./install.sh -fd ~/cpu2006;
   args:
       executable: /bin/bash
-  become: true
index 72d8c93..b2a5089 100644 (file)
@@ -10,9 +10,8 @@
 
 - name: remove SPEC CPU 2006
   file:
-    path: /usr/cpu2006
+    path: ~/cpu2006
     state: absent
-  become: true
 
 - name: umount SPEC CPU 2006 ISO
   shell:
@@ -25,4 +24,3 @@
   file:
     path: ~/cpu2006-1.2.iso
     state: absent
-  become: true
old mode 100644 (file)
new mode 100755 (executable)
index d20045b..e5cf6ce
 
 schema: "yardstick:task:0.1"
 description: >
-    Yardstick TC078 config file;
     Measure CPU performance using SPEC CPU2006;
 
 {% set file = file or "/etc/yardstick/pod.yaml" %}
 {% set host = host or 'node1' %}
+{% set benchmark = benchmark or 'int' %}
+{% set runspec_iterations = runspec_iterations or 1 %}
+{% set runspec_tune = runspec_tune or 'base' %}
+{% set runspec_size = runspec_size or 'ref' %}
+{% set runspec_rate = runspec_rate or 1 %}
 
 scenarios:
 -
   type: SpecCPU2006
 
   options:
-      SPECint_benchmark: int^429
-      runspec_iterations: 1
-      runspec_tune: base
-      runspec_size: ref
-      runspec_rate: 1
+      SPECint_benchmark: {{benchmark}}
+      runspec_iterations: {{runspec_iterations}}
+      runspec_tune: {{runspec_tune}}
+      runspec_size: {{runspec_size}}
+      runspec_rate: {{runspec_rate}}
 
   host: {{host}}.yardstick-TC078
 
index df361cd..0294f52 100644 (file)
@@ -10,6 +10,7 @@ from __future__ import absolute_import
 
 import logging
 import pkg_resources
+import os
 
 import yardstick.ssh as ssh
 from yardstick.benchmark.scenarios import base
@@ -66,6 +67,7 @@ class SpecCPU(base.Scenario):
             default:    na
     """
     __scenario_type__ = "SpecCPU2006"
+    CPU2006_DIR = "~/cpu2006"
 
     def __init__(self, scenario_cfg, context_cfg):
         self.scenario_cfg = scenario_cfg
@@ -87,8 +89,9 @@ class SpecCPU(base.Scenario):
                 "yardstick.resources", 'files/' + self.runspec_config)
 
             # copy SPEC CPU2006 config file to host if given
-            self.client._put_file_shell(self.runspec_config_file,
-                                        '/usr/cpu2006/config/yardstick_spec_cpu2006.cfg')
+            cfg_path = os.path.join(self.CPU2006_DIR,
+                                    'config/yardstick_spec_cpu2006.cfg')
+            self.client._put_file_shell(self.runspec_config_file, cfg_path)
         else:
             self.runspec_config = "Example-linux64-amd64-gcc43+.cfg"
 
@@ -100,7 +103,8 @@ class SpecCPU(base.Scenario):
         if not self.setup_done:
             self.setup()
 
-        cmd = "cd /usr/cpu2006/ && . ./shrc && runspec --config %s" % self.runspec_config
+        cmd = "cd %s && . ./shrc && runspec --config %s" % (
+            self.CPU2006_DIR, self.runspec_config)
         cmd_args = ""
 
         if "rate" in self.options: