summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ansible/roles/archive_spec_cpu2006_result/tasks/main.yaml15
-rw-r--r--ansible/roles/fetch_spec_cpu2006_result/tasks/main.yaml16
-rw-r--r--ansible/roles/install_spec_cpu2006/tasks/main.yaml24
-rw-r--r--ansible/roles/unarchive_spec_cpu2006_result/tasks/main.yaml16
-rw-r--r--ansible/roles/uninstall_spec_cpu2006/tasks/main.yaml28
-rw-r--r--ansible/spec_cpu2006_install.yaml13
-rw-r--r--ansible/spec_cpu2006_uninstall.yaml22
-rw-r--r--docs/testing/user/userguide/opnfv_yardstick_tc078.rst133
-rw-r--r--gui/app/images/logo.pngbin0 -> 4323 bytes
-rw-r--r--gui/app/scripts/controllers/report.controller.js2
-rw-r--r--gui/app/views/environmentList.html11
-rw-r--r--gui/app/views/layout/header.html9
-rw-r--r--gui/app/views/layout/sideNav.html2
-rw-r--r--gui/app/views/layout/sideNav2.html2
-rw-r--r--gui/app/views/main.html4
-rw-r--r--gui/app/views/main2.html4
-rw-r--r--gui/app/views/modal/environmentDialog.html6
-rw-r--r--gui/app/views/projectList.html8
-rw-r--r--gui/app/views/projectdetail.html10
-rw-r--r--gui/app/views/suite.html51
-rw-r--r--gui/app/views/testcaselist.html16
-rw-r--r--gui/bower.json3
-rwxr-xr-xinstall.sh1
-rwxr-xr-xrun_tests.sh3
-rw-r--r--samples/container_ping_vm.yaml57
-rw-r--r--samples/migrate-node-context.yaml40
-rw-r--r--samples/spec_cpu.yaml44
-rw-r--r--tests/ci/cover.sh10
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc001.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc002.yaml12
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc005.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc008.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc009.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc010.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml13
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc012.yaml12
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc014.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc023.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc037.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc038.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc069.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc070.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc072.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc076.yaml11
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl-sfc-ha_daily.yaml62
-rw-r--r--tests/unit/apiserver/resources/test_env_action.py4
-rw-r--r--tests/unit/benchmark/scenarios/compute/test_qemumigrate.py166
-rw-r--r--tests/unit/benchmark/scenarios/compute/test_spec_cpu.py86
-rw-r--r--yardstick/benchmark/contexts/model.py7
-rw-r--r--yardstick/benchmark/scenarios/compute/qemu_migrate.py155
-rw-r--r--yardstick/benchmark/scenarios/compute/qemu_migrate_benchmark.bash68
-rw-r--r--yardstick/benchmark/scenarios/compute/spec_cpu.py141
-rwxr-xr-xyardstick/cmd/NSBperf.py7
-rw-r--r--yardstick/cmd/commands/task.py8
55 files changed, 1372 insertions, 73 deletions
diff --git a/ansible/roles/archive_spec_cpu2006_result/tasks/main.yaml b/ansible/roles/archive_spec_cpu2006_result/tasks/main.yaml
new file mode 100644
index 000000000..7f72e1394
--- /dev/null
+++ b/ansible/roles/archive_spec_cpu2006_result/tasks/main.yaml
@@ -0,0 +1,15 @@
+---
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: archive_spec_cpu2006_result
+ archive:
+ path: /usr/cpu2006/result
+ dest: /usr/cpu2006/spec_cpu2006_result.zip
+ become: true
diff --git a/ansible/roles/fetch_spec_cpu2006_result/tasks/main.yaml b/ansible/roles/fetch_spec_cpu2006_result/tasks/main.yaml
new file mode 100644
index 000000000..370ec7a0c
--- /dev/null
+++ b/ansible/roles/fetch_spec_cpu2006_result/tasks/main.yaml
@@ -0,0 +1,16 @@
+---
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: fetch_spec_cpu2006_result
+ fetch:
+ src: /usr/cpu2006/spec_cpu2006_result.zip
+ dest: /tmp/
+ flat: yes
+ become: true
diff --git a/ansible/roles/install_spec_cpu2006/tasks/main.yaml b/ansible/roles/install_spec_cpu2006/tasks/main.yaml
new file mode 100644
index 000000000..baa9f6ca0
--- /dev/null
+++ b/ansible/roles/install_spec_cpu2006/tasks/main.yaml
@@ -0,0 +1,24 @@
+---
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: upload SPEC CPU2006 ISO
+ 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;
+ cd /mnt;
+ ./install.sh -fd /usr/cpu2006;
+ args:
+ executable: /bin/bash
+ become: true
diff --git a/ansible/roles/unarchive_spec_cpu2006_result/tasks/main.yaml b/ansible/roles/unarchive_spec_cpu2006_result/tasks/main.yaml
new file mode 100644
index 000000000..86dcc1aeb
--- /dev/null
+++ b/ansible/roles/unarchive_spec_cpu2006_result/tasks/main.yaml
@@ -0,0 +1,16 @@
+---
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: unarchive_spec_cpu2006_result
+ unarchive:
+ src: /tmp/spec_cpu2006_result.zip
+ dest: /tmp/
+ remote_src: True
+ become: true
diff --git a/ansible/roles/uninstall_spec_cpu2006/tasks/main.yaml b/ansible/roles/uninstall_spec_cpu2006/tasks/main.yaml
new file mode 100644
index 000000000..72d8c93ee
--- /dev/null
+++ b/ansible/roles/uninstall_spec_cpu2006/tasks/main.yaml
@@ -0,0 +1,28 @@
+---
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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: remove SPEC CPU 2006
+ file:
+ path: /usr/cpu2006
+ state: absent
+ become: true
+
+- name: umount SPEC CPU 2006 ISO
+ shell:
+ umount -l /mnt;
+ args:
+ executable: /bin/bash
+ become: true
+
+- name: remove SPEC CPU 2006 ISO
+ file:
+ path: ~/cpu2006-1.2.iso
+ state: absent
+ become: true
diff --git a/ansible/spec_cpu2006_install.yaml b/ansible/spec_cpu2006_install.yaml
new file mode 100644
index 000000000..470f5c8d8
--- /dev/null
+++ b/ansible/spec_cpu2006_install.yaml
@@ -0,0 +1,13 @@
+---
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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
+##############################################################################
+
+- hosts: spec_target
+ roles:
+ - install_spec_cpu2006
diff --git a/ansible/spec_cpu2006_uninstall.yaml b/ansible/spec_cpu2006_uninstall.yaml
new file mode 100644
index 000000000..4991c98b0
--- /dev/null
+++ b/ansible/spec_cpu2006_uninstall.yaml
@@ -0,0 +1,22 @@
+---
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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
+##############################################################################
+
+- hosts: spec_target
+ roles:
+ - archive_spec_cpu2006_result
+ - fetch_spec_cpu2006_result
+
+- hosts: localhost
+ roles:
+ - unarchive_spec_cpu2006_result
+
+- hosts: spec_target
+ roles:
+ - uninstall_spec_cpu2006
diff --git a/docs/testing/user/userguide/opnfv_yardstick_tc078.rst b/docs/testing/user/userguide/opnfv_yardstick_tc078.rst
new file mode 100644
index 000000000..560d55e07
--- /dev/null
+++ b/docs/testing/user/userguide/opnfv_yardstick_tc078.rst
@@ -0,0 +1,133 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International
+.. License.
+.. http://creativecommons.org/licenses/by/4.0
+.. (c) OPNFV, Huawei Technologies Co.,Ltd and others.
+
+*************************************
+Yardstick Test Case Description TC078
+*************************************
+
+.. _spec_cpu2006: https://www.spec.org/cpu2006/
+
++-----------------------------------------------------------------------------+
+|Compute Performance |
+| |
++--------------+--------------------------------------------------------------+
+|test case id | OPNFV_YARDSTICK_TC078_SPEC CPU 2006 |
+| | |
++--------------+--------------------------------------------------------------+
+|metric | compute-intensive performance |
+| | |
++--------------+--------------------------------------------------------------+
+|test purpose | The purpose of TC078 is to evaluate the IaaS compute |
+| | performance by using SPEC CPU 2006 benchmark. The SPEC CPU |
+| | 2006 benchmark has several different ways to measure |
+| | computer performance. One way is to measure how fast the |
+| | computer completes a single task; this is called a speed |
+| | measurement. Another way is to measure how many tasks |
+| | computer can accomplish in a certain amount of time; this is |
+| | called a throughput, capacity or rate measurement. |
+| | |
++--------------+--------------------------------------------------------------+
+|test tool | SPEC CPU 2006 |
+| | |
+| | The SPEC CPU 2006 benchmark is SPEC's industry-standardized, |
+| | CPU-intensive benchmark suite, stressing a system's |
+| | processor, memory subsystem and compiler. This benchmark |
+| | suite includes the SPECint benchmarks and the SPECfp |
+| | benchmarks. The SPECint 2006 benchmark contains 12 different |
+| | enchmark tests and the SPECfp 2006 benchmark contains 19 |
+| | different benchmark tests. |
+| | |
+| | SPEC CPU 2006 is not always part of a Linux distribution. |
+| | SPEC requires that users purchase a license and agree with |
+| | their terms and conditions. For this test case, users must |
+| | manually download cpu2006-1.2.iso from the SPEC website and |
+| | save it under the yardstick/resources folder (e.g. /home/ |
+| | opnfv/repos/yardstick/yardstick/resources/cpu2006-1.2.iso) |
+| | SPEC CPU® 2006 benchmark is available for purchase via the |
+| | SPEC order form (https://www.spec.org/order.html). |
+| | |
++--------------+--------------------------------------------------------------+
+|test | This test case uses SPEC CPU 2006 benchmark to measure |
+|description | compute-intensive performance of hosts. |
+| | |
++--------------+--------------------------------------------------------------+
+|configuration | file: spec_cpu.yaml (in the 'samples' directory) |
+| | |
+| | benchmark_subset is set to int. |
+| | |
+| | SLA is not available in this test case. |
+| | |
++--------------+--------------------------------------------------------------+
+|applicability | Test can be configured with different: |
+| | |
+| | * benchmark_subset - a subset of SPEC CPU2006 benchmarks to |
+| | run; |
+| | * SPECint_benchmark - a SPECint benchmark to run; |
+| | * SPECint_benchmark - a SPECfp benchmark to run; |
+| | * output_format - desired report format; |
+| | * runspec_config - SPEC CPU2006 config file provided to the |
+| | runspec binary; |
+| | * runspec_iterations - the number of benchmark iterations |
+| | to execute. For a reportable run, must be 3; |
+| | * runspec_tune - tuning to use (base, peak, or all). For a |
+| | reportable run, must be either base or all. Reportable |
+| | runs do base first, then (optionally) peak; |
+| | * runspec_size - size of input data to run (test, train, or |
+| | ref). Reportable runs ensure that your binaries can |
+| | produce correct results with the test and train workloads |
+| | |
++--------------+--------------------------------------------------------------+
+|usability | This test case is used for executing SPEC CPU 2006 benchmark |
+| | physical servers. The SPECint 2006 benchmark takes |
+| | approximately 5 hours. |
+| | |
++--------------+--------------------------------------------------------------+
+|references | spec_cpu2006_ |
+| | |
+| | ETSI-NFV-TST001 |
+| | |
++--------------+--------------------------------------------------------------+
+|pre-test | To run and install SPEC CPU2006, the following are required: |
+|conditions | * For SPECint2006: Both C99 and C++98 compilers; |
+| | * For SPECfp2006: All three of C99, C++98 and Fortran-95 |
+| | compilers; |
+| | * At least 8GB of disk space availabile on the system. |
+| | |
++--------------+--------------------------------------------------------------+
+|test sequence | description and expected result |
+| | |
++--------------+--------------------------------------------------------------+
+|step 1 | cpu2006-1.2.iso has been saved under the yardstick/resources |
+| | folder (e.g. /home/opnfv/repos/yardstick/yardstick/resources |
+| | /cpu2006-1.2.iso). Additional, to use your custom runspec |
+| | config file you can save it under the yardstick/resources/ |
+| | files folder and specify the config file name in the |
+| | runspec_config parameter. |
+| | |
++--------------+--------------------------------------------------------------+
+|step 2 | Upload SPEC CPU2006 ISO to the target server and install |
+| | SPEC CPU2006 via ansible. |
+| | |
++--------------+--------------------------------------------------------------+
+|step 3 | Yardstick is connected with the target server by using ssh. |
+| | If custom runspec config file is used, this file is copyied |
+| | from yardstick to the target server via the ssh tunnel. |
+--------------+---------------------------------------------------------------+
+|step 4 | SPEC CPU2006 benchmark is invoked and SPEC CPU 2006 metrics |
+| | are generated. |
+| | |
++--------------+--------------------------------------------------------------+
+|step 5 | Text, HTML, CSV, PDF, and Configuration file outputs for the |
+| | SPEC CPU 2006 metrics are fetch from the server and stored |
+| | under /tmp/result folder. |
+| | |
++--------------+--------------------------------------------------------------+
+|step 6 | uninstall SPEC CPU2006 and remove cpu2006-1.2.iso from the |
+| | target server . |
+| | |
++--------------+--------------------------------------------------------------+
+|test verdict | None. SPEC CPU2006 results are collected and stored. |
+| | |
++--------------+--------------------------------------------------------------+
diff --git a/gui/app/images/logo.png b/gui/app/images/logo.png
new file mode 100644
index 000000000..c67c0d635
--- /dev/null
+++ b/gui/app/images/logo.png
Binary files differ
diff --git a/gui/app/scripts/controllers/report.controller.js b/gui/app/scripts/controllers/report.controller.js
index 9b6b5958b..6a62cf8ea 100644
--- a/gui/app/scripts/controllers/report.controller.js
+++ b/gui/app/scripts/controllers/report.controller.js
@@ -54,7 +54,7 @@ angular.module('yardStickGui2App')
}
$scope.goToExternal = function goToExternal(id) {
- var url = External_URL + ':' + $scope.jumpPort + '/dashboard/db' + '/' + id;
+ var url = Grafana_URL +':'+$scope.jumpPort+'/dashboard/db'+ '/' + id;
window.open(url, '_blank');
}
diff --git a/gui/app/views/environmentList.html b/gui/app/views/environmentList.html
index 29273a724..1b00b1cc6 100644
--- a/gui/app/views/environmentList.html
+++ b/gui/app/views/environmentList.html
@@ -22,21 +22,18 @@
<div dir-paginate="env in environmentList | orderBy:'-id' | itemsPerPage: 10 ">
<div style="display:flex;flex-direction:row;justify-content:space-between;padding:8px;border-top: 1px solid #e9ecec;">
- <div> <a style="color:#e95420" ng-click="gotoDetail('false',env.uuid)">{{env.name}}</a></div>
+ <div> <a style="color:#4dc5cf" ng-click="gotoDetail('false',env.uuid)">{{env.name}}</a></div>
<div>
<!-- <button class="btn btn-default btn-sm" ng-click="openDeleteEnv(env.uuid,'environment')">Delete</button> -->
<div class="btn-group" uib-dropdown is-open="status.isopen" style="margin-right:60px;">
<button id="single-button" type="button" class="btn btn-default btn-sm" uib-dropdown-toggle>
- Modify <span class="caret"></span>
+ delete <span class="caret"></span>
</button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">
- <li role="menuitem"><a ng-click="openDeleteEnv(env.uuid,'environment')">Delete</a></li>
- <!-- <li role="menuitem"><a href="#">Another action</a></li>
- <li role="menuitem"><a href="#">Something else here</a></li>
- <li class="divider"></li>
- <li role="menuitem"><a href="#">Separated link</a></li> -->
+ <li role="menuitem"><a ng-click="openDeleteEnv(env.uuid,'environment')">delete</a></li>
+
</ul>
</div>
</div>
diff --git a/gui/app/views/layout/header.html b/gui/app/views/layout/header.html
index 033322a62..ad90de952 100644
--- a/gui/app/views/layout/header.html
+++ b/gui/app/views/layout/header.html
@@ -4,8 +4,9 @@
<div class="navbar-header">
-
+ <img src="images/logo.png" style="width:50px;height:50px;float:left;margin-left:20px;" />
<a class="navbar-brand" href="#/">Yardstick</a>
+
</div>
@@ -33,11 +34,11 @@
.navbar {
border-radius: 0px;
- background-color: #e95420;
+ background-color: #CAEEF1;
color: #fff;
}
.navbar-default .navbar-brand {
- color: #fff;
+ color: #333;
}
-</style>
+</style> \ No newline at end of file
diff --git a/gui/app/views/layout/sideNav.html b/gui/app/views/layout/sideNav.html
index 42dcbbc6e..4fc99cd4f 100644
--- a/gui/app/views/layout/sideNav.html
+++ b/gui/app/views/layout/sideNav.html
@@ -90,7 +90,7 @@
<style>
.bs-sidenav {
- margin-top: 40px;
+ margin-top: 21px;
margin-bottom: 20px;
width: 124px;
}
diff --git a/gui/app/views/layout/sideNav2.html b/gui/app/views/layout/sideNav2.html
index 104a9c6cf..93e0de4be 100644
--- a/gui/app/views/layout/sideNav2.html
+++ b/gui/app/views/layout/sideNav2.html
@@ -66,7 +66,7 @@
<style>
.bs-sidenav {
- margin-top: 40px;
+ margin-top: 21px;
margin-bottom: 20px;
width: 124px;
}
diff --git a/gui/app/views/main.html b/gui/app/views/main.html
index d5f7a3af3..36bcbbd3c 100644
--- a/gui/app/views/main.html
+++ b/gui/app/views/main.html
@@ -105,13 +105,13 @@
}
.progressDefine>li.is-complete {
- color: #e95420;
+ color: #4dc5cf;
}
.progressDefine>li.is-complete:before,
.progressDefine>li.is-complete:after {
color: #FFF;
- background: #e95420;
+ background: #4dc5cf;
}
.progressDefine>li.is-active {
diff --git a/gui/app/views/main2.html b/gui/app/views/main2.html
index 661d604c6..3f49e82e0 100644
--- a/gui/app/views/main2.html
+++ b/gui/app/views/main2.html
@@ -105,13 +105,13 @@
}
.progressDefine>li.is-complete {
- color: #e95420;
+ color: #4dc5cf;
}
.progressDefine>li.is-complete:before,
.progressDefine>li.is-complete:after {
color: #FFF;
- background: #e95420;
+ background: #4dc5cf;
}
.progressDefine>li.is-active {
diff --git a/gui/app/views/modal/environmentDialog.html b/gui/app/views/modal/environmentDialog.html
index a5b88d240..389de8340 100644
--- a/gui/app/views/modal/environmentDialog.html
+++ b/gui/app/views/modal/environmentDialog.html
@@ -104,7 +104,7 @@
Next
</button>
<button class="btn btn-default" ng-click="goToPodPrev()" style="margin-right:5px;float:right">
- Previous
+ Back
</button>
</h3>
@@ -165,7 +165,7 @@
<h3>{{name}} -- Pod File
<div style="float:right">
- <button class="btn btn-default" ng-click="skipPodPrev()">Previous</button>
+ <button class="btn btn-default" ng-click="skipPodPrev()">Back</button>
<button class="btn btn-default" ng-click="skipPod()" ng-show="podData==null">Skip</button>
<button class="btn btn-default" ng-click="skipPod()" ng-show="podData!=null">Next</button>
@@ -234,7 +234,7 @@
<h3>{{name}} -- Container
<div style="float:right">
- <button class="btn btn-default" ng-click="skipContainerPrev()">Previous</button>
+ <button class="btn btn-default" ng-click="skipContainerPrev()">Back</button>
<button class="btn btn-default" ng-click="skipContainer()" ng-show="ifskipOrClose!=1">
Skip
</button>
diff --git a/gui/app/views/projectList.html b/gui/app/views/projectList.html
index ea6e63d6b..6edc32fc1 100644
--- a/gui/app/views/projectList.html
+++ b/gui/app/views/projectList.html
@@ -11,21 +11,21 @@
<div dw-loading="key" dw-loading-options="{text:'loading'}">
<div style="display:flex;flex-direction:row;justify-content:space-between;padding:8px;border-top: 1px solid #e9ecec;background-color:#f9f9f9;">
<div style="font-weight:600">Name</div>
- <div style="font-weight:600;margin-right:4px;">Action</div>
+ <div style="font-weight:600;margin-right:20px;">Action</div>
</div>
<div dir-paginate="project in projectListData | orderBy:'-id' | itemsPerPage: 10 ">
<div style="display:flex;flex-direction:row;justify-content:space-between;padding:8px;border-top: 1px solid #e9ecec;">
<div>
- <a ng-click="gotoDetail(project.uuid)" style="color:#e95420"> {{project.name}}</a>
+ <a ng-click="gotoDetail(project.uuid)" style="color:#4dc5cf"> {{project.name}}</a>
</div>
<div>
<!-- <button class="btn btn-default btn-sm" ng-click="gotoDetail(project.uuid)">Detail</button> -->
<!--<button class="btn btn-default btn-sm" ng-click="openDeleteEnv(project.uuid,'project')">Delete</button>-->
- <div class="btn-group" uib-dropdown is-open="status.isopen" style="margin-right:20px;">
+ <div class="btn-group" uib-dropdown is-open="status.isopen" >
<button id="single-button" type="button" class="btn btn-default btn-sm" uib-dropdown-toggle>
- Modify <span class="caret"></span>
+ delete <span class="caret"></span>
</button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">
<li role="menuitem" ng-show="task.status!=0"><a ng-click="openDeleteEnv(project.uuid,'project')">delete</a></li>
diff --git a/gui/app/views/projectdetail.html b/gui/app/views/projectdetail.html
index ff61c5fed..357a26add 100644
--- a/gui/app/views/projectdetail.html
+++ b/gui/app/views/projectdetail.html
@@ -24,8 +24,8 @@
</tr>
<tr dir-paginate="task in finalTaskListDisplay | orderBy:'-id' | itemsPerPage: 6 " pagination-id="table">
- <td width="10%"> <a ng-click="gotoDetail(task.uuid)" style="color:#e95420"> {{task.name}} </a></td>
- <td width="40%">
+ <td width="20%"> <a ng-click="gotoDetail(task.uuid)" style="color:#4dc5cf"> {{task.name}} </a></td>
+ <td width="70%">
<div class="progree-parent" ng-show="task.status!=2">
<div class="progree-child" ng-style="{'width':task.stausWidth}">
</div>
@@ -37,11 +37,11 @@
</td>
- <td width="50%">
+ <td width="10%">
- <div class="btn-group" uib-dropdown is-open="status.isopen" style="margin-right:20px;">
+ <div class="btn-group" uib-dropdown is-open="status.isopen">
<button id="single-button" type="button" class="btn btn-default btn-sm" uib-dropdown-toggle>
- Modify <span class="caret"></span>
+ modify <span class="caret"></span>
</button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">
<li role="menuitem" ng-show="task.status!=0"><a ng-click="runAtaskForTable(task.uuid)">run</a></li>
diff --git a/gui/app/views/suite.html b/gui/app/views/suite.html
index 8e1348333..652cf1e0e 100644
--- a/gui/app/views/suite.html
+++ b/gui/app/views/suite.html
@@ -9,39 +9,44 @@
</button>
- <!--<div ng-show="displayOpenrcFile!=null || displayOpenrcFile!=undefined">
- {{displayOpenrcFile.name}} last modified: {{filelastModified}}
- </div>-->
+
<hr/>
- <!--<div ng-repeat="env in environmentList">
- {{env.name}}
- </div>-->
+
<div dw-loading="key" dw-loading-options="{text:'loading'}">
- <div style="display:flex;flex-direction:row;justify-content:space-between;padding:8px;border-top: 1px solid #e9ecec;background-color: #f9f9f9;" >
- <div style="font-weight:600">Name</div>
- <div style="font-weight:600;margin-right:4px;">Operate</div>
+ <div style="display:flex;flex-direction:row;justify-content:space-between;padding:8px;border-top: 1px solid #e9ecec;background-color: #f9f9f9;">
+ <div style="font-weight:600">Name</div>
+ <div style="font-weight:600;margin-right:20px;">Action</div>
- </div>
+ </div>
- <div dir-paginate="suite in testsuitlist | itemsPerPage: 10">
- <div style="display:flex;flex-direction:row;justify-content:space-between;padding:8px;border-top: 1px solid #e9ecec;">
- <div>
- <a style="color:#e95420" ng-click="gotoDetail(suite)"> {{suite}}
+ <div dir-paginate="suite in testsuitlist | itemsPerPage: 10">
+ <div style="display:flex;flex-direction:row;justify-content:space-between;padding:8px;border-top: 1px solid #e9ecec;">
+ <div>
+ <a style="color:#4dc5cf" ng-click="gotoDetail(suite)"> {{suite}}
</a>
</div>
- <div>
- <!-- <button class="btn btn-default btn-sm" ng-click="gotoDetail(suite)">Detail</button> -->
- <button class="btn btn-default btn-sm" ng-click="openDeleteEnv(suite,'test suite')">Delete</button>
+ <div>
+ <!-- <button class="btn btn-default btn-sm" ng-click="openDeleteEnv(suite,'test suite')">Delete</button> -->
+ <div class="btn-group" uib-dropdown is-open="status.isopen">
+ <button id="single-button" type="button" class="btn btn-default btn-sm" uib-dropdown-toggle>
+ delete <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">
+ <li role="menuitem"><a ng-click="openDeleteEnv(suite,'test suite')">delete</a></li>
+
+ </ul>
+ </div>
+
+ </div>
+
</div>
</div>
-
- </div>
- <center>
- <dir-pagination-controls></dir-pagination-controls>
- </center>
+ <center>
+ <dir-pagination-controls></dir-pagination-controls>
+ </center>
</div>
@@ -146,4 +151,4 @@
background-color: #EEEEEE;
border-radius: 5px;
}
-</style>
+</style> \ No newline at end of file
diff --git a/gui/app/views/testcaselist.html b/gui/app/views/testcaselist.html
index 3e8cfccf9..62237faa8 100644
--- a/gui/app/views/testcaselist.html
+++ b/gui/app/views/testcaselist.html
@@ -20,7 +20,7 @@
<div dw-loading="key" dw-loading-options="{text:'loading'}">
<div style="display:flex;flex-direction:row;justify-content:space-between;padding:8px;border-top: 1px solid #e9ecec;background-color: #f9f9f9">
<div style="font-weight:600">Name</div>
- <div style="font-weight:600;margin-right:4px;">Operate</div>
+ <div style="font-weight:600;margin-right:20px;">Action</div>
</div>
@@ -28,14 +28,22 @@
<div style="display:flex;flex-direction:row;justify-content:space-between;padding:8px;border-top: 1px solid #e9ecec;">
<div>
- <a style="color:#e95420" ng-click="gotoDetail(test.Name)">
+ <a style="color:#4dc5cf" ng-click="gotoDetail(test.Name)">
{{test.Name}}
</a>
</div>
<div style="font-size:10px;">{{test.Description}}</div>
<div>
- <!-- <button class="btn btn-default btn-sm" ng-click="gotoDetail(test.Name)">Detail</button> -->
- <button class="btn btn-default btn-sm" ng-click="openDeleteEnv(test.Name,'test case')">Delete</button>
+ <!-- <button class="btn btn-default btn-sm" ng-click="openDeleteEnv(test.Name,'test case')">Delete</button> -->
+ <div class="btn-group" uib-dropdown is-open="status.isopen" >
+ <button id="single-button" type="button" class="btn btn-default btn-sm" uib-dropdown-toggle>
+ delete <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">
+ <li role="menuitem"><a ng-click="openDeleteEnv(test.Name,'test case')">delete</a></li>
+
+ </ul>
+ </div>
</div>
</div>
diff --git a/gui/bower.json b/gui/bower.json
index 6da3bee3c..d1d934f64 100644
--- a/gui/bower.json
+++ b/gui/bower.json
@@ -21,6 +21,9 @@
"angular-bootstrap": "^2.5.0",
"angular-sanitize": "^1.6.5"
},
+ "resolutions": {
+ "angular": "~1.6.x"
+ },
"devDependencies": {
"angular-mocks": "^1.4.0"
},
diff --git a/install.sh b/install.sh
index e82ae0233..8a5050a61 100755
--- a/install.sh
+++ b/install.sh
@@ -89,6 +89,7 @@ pip install -e .
/bin/bash "${PWD}/docker/uwsgi.sh"
/bin/bash "${PWD}/docker/nginx.sh"
cd "${PWD}/gui" && /bin/bash gui.sh
+mkdir -p /etc/nginx/yardstick
mv dist /etc/nginx/yardstick/gui
service nginx restart
diff --git a/run_tests.sh b/run_tests.sh
index 2519d94f6..2cf54c708 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -13,6 +13,9 @@
getopts ":f" FILE_OPTION
+# don't write .pyc files this can cause odd unittest results
+export PYTHONDONTWRITEBYTECODE=1
+
run_flake8() {
echo "Running flake8 ... "
logfile=test_results.log
diff --git a/samples/container_ping_vm.yaml b/samples/container_ping_vm.yaml
new file mode 100644
index 000000000..4b7b64f68
--- /dev/null
+++ b/samples/container_ping_vm.yaml
@@ -0,0 +1,57 @@
+##############################################################################
+# Copyright (c) 2017 Huawei AB 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
+##############################################################################
+
+---
+# Sample benchmark task config file
+# measure network latency using ping in container
+
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: Ping
+ options:
+ packetsize: 200
+
+ host: host-k8s
+ target: target.openstack
+
+ runner:
+ type: Duration
+ duration: 60
+ interval: 1
+
+ sla:
+ max_rtt: 10
+ action: monitor
+
+contexts:
+-
+ type: Kubernetes
+ name: k8s
+
+ servers:
+ host:
+ image: openretriever/yardstick
+ command: /bin/bash
+ args: ['-c', 'chmod 700 ~/.ssh; chmod 600 ~/.ssh/*; service ssh restart;while true ; do sleep 10000; done']
+-
+ type: Heat
+ name: openstack
+ image: cirros-0.3.5
+ flavor: yardstick-flavor
+ user: cirros
+
+ servers:
+ target:
+ floating_ip: true
+
+ networks:
+ test:
+ cidr: '10.0.1.0/24'
diff --git a/samples/migrate-node-context.yaml b/samples/migrate-node-context.yaml
new file mode 100644
index 000000000..9fe1acf78
--- /dev/null
+++ b/samples/migrate-node-context.yaml
@@ -0,0 +1,40 @@
+---
+
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: QemuMigrate
+ options:
+ smp: 2
+ migrate_to_port: 4444
+ incoming_ip: 0
+ qmp_src_path: "/tmp/qmp-sock-src"
+ qmp_dst_path: "/tmp/qmp-sock-dst"
+ max_down_time: "0.10"
+ host: kvm.LF
+ runner:
+ type: Duration
+ duration: 1
+ interval: 1
+ sla:
+ max_totaltime: 10
+ max_downtime: 0.10
+ max_setuptime: 0.50
+ action: monitor
+ setup_options:
+ rpm_dir: "/opt/rpm"
+ script_dir: "/opt/scripts"
+ image_dir: "/opt/image"
+ host_setup_seqs:
+ - "host-setup0.sh"
+ - "reboot"
+ - "host-setup1.sh"
+ - "setup-ovsdpdk.sh"
+ - "host-install-qemu.sh"
+ - "host-run-qemu4lm.sh"
+
+context:
+ type: Node
+ name: LF
+ file: /root/yardstick/pod.yaml
diff --git a/samples/spec_cpu.yaml b/samples/spec_cpu.yaml
new file mode 100644
index 000000000..227c3e9d2
--- /dev/null
+++ b/samples/spec_cpu.yaml
@@ -0,0 +1,44 @@
+---
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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
+##############################################################################
+
+schema: "yardstick:task:0.1"
+
+{% set file = file or "/etc/yardstick/pod.yaml" %}
+
+scenarios:
+-
+ type: SpecCPU2006
+
+ options:
+ benchmark_subset: int
+ #runspec_tune: all
+ #output_format: all
+ #SPECint_benchmark: perlbench
+ #SPECfp_benchmark: bwaves
+ #runspec_config: yardstick_spec_cpu2006.cfg
+ #runspec_iterations: 1
+ #runspec_tune: base
+ #runspec_size: test
+
+ host: node1.spec_cpu2006
+
+ runner:
+ type: Iteration
+ iterations: 1
+
+context:
+ type: Node
+ name: spec_cpu2006
+ file: {{ file }}
+
+ env:
+ type: ansible
+ setup: spec_cpu2006_install.yaml
+ teardown: spec_cpu2006_uninstall.yaml
diff --git a/tests/ci/cover.sh b/tests/ci/cover.sh
index 71833757a..822ed2ff2 100644
--- a/tests/ci/cover.sh
+++ b/tests/ci/cover.sh
@@ -34,7 +34,10 @@ run_coverage_test() {
git checkout HEAD^
baseline_report=$(mktemp -t yardstick_coverageXXXXXXX)
- find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --testr-args="$*"
+ # workaround 'db type could not be determined' bug
+ # https://bugs.launchpad.net/testrepository/+bug/1229445
+ rm -rf .testrepository
+ find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --slowest --testr-args="$*"
coverage report > $baseline_report
baseline_missing=$(awk 'END { print $3 }' $baseline_report)
@@ -44,7 +47,10 @@ run_coverage_test() {
# Generate and save coverage report
current_report=$(mktemp -t yardstick_coverageXXXXXXX)
- find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --testr-args="$*"
+ # workaround 'db type could not be determined' bug
+ # https://bugs.launchpad.net/testrepository/+bug/1229445
+ rm -rf .testrepository
+ find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --slowest --testr-args="$*"
coverage report > $current_report
current_missing=$(awk 'END { print $3 }' $current_report)
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc001.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc001.yaml
index 57f9e958a..4faa0bc5a 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc001.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc001.yaml
@@ -15,6 +15,10 @@ description: >
Different amounts of flows are tested with, from 2 up to 1001000;
All tests are run twice. First twice with the least amount of ports and further on.
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
{% for num_ports in [1, 10, 50, 100, 500, 1000] %}
-
@@ -58,3 +62,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %}
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc002.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc002.yaml
index 1de573d83..58f5b783a 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc002.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc002.yaml
@@ -14,6 +14,11 @@ description: >
measure network latency using ping;
{% set image = image or "cirros-0.3.5" %}
+
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
{% for i in range(2) %}
-
@@ -53,3 +58,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %} \ No newline at end of file
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc005.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc005.yaml
index e77fd50a5..101c4210e 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc005.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc005.yaml
@@ -13,6 +13,10 @@ description: >
Yardstick TC005 config file;
Measure Storage IOPS, throughput and latency using fio.
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
{% for rw in ['read', 'write', 'randwrite', 'randread', 'rw'] %}
{% for bs in ['4k', '64k', '1024k'] %}
@@ -56,3 +60,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %} \ No newline at end of file
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc008.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc008.yaml
index f5ccb255a..22e576015 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc008.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc008.yaml
@@ -20,6 +20,10 @@ description: >
packet size, and so on. The test sequence continues with the next
packet size, with same ports/flows sequence as before.
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
{% for pkt_size in [64, 128, 256, 512, 1024, 1280, 1518] %}
{% for num_ports in [1, 10, 50, 100, 500, 1000] %}
@@ -74,6 +78,13 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %}
#test-sriov:
#cidr: '10.0.1.0/24'
#provider: "sriov"
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc009.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc009.yaml
index c4e24c499..3c5f72d5a 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc009.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc009.yaml
@@ -17,6 +17,10 @@ description: >
amount of ports, then 10 times with the next amount of ports,
and so on until all packet sizes have been run with;
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
{% for num_ports in [1, 10, 50, 100, 500, 1000] %}
-
@@ -60,3 +64,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %} \ No newline at end of file
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc010.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc010.yaml
index 2ef3c54fb..cf9706847 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc010.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc010.yaml
@@ -13,6 +13,10 @@ description: >
Yardstick TC010 config file;
measure memory read latency using lmbench.
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: Lmbench
@@ -45,3 +49,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %} \ No newline at end of file
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml
index b826a7d5e..eef1a7a62 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml
@@ -13,12 +13,18 @@ description: >
Yardstick TC011 config file;
Measure packet delay variation (jitter) using iperf3.
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: Iperf3
options:
udp: udp
bandwidth: 20m
+ length: 8K
+ window: 29200
host: zeus.demo
target: hera.demo
@@ -51,3 +57,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %}
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc012.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc012.yaml
index f995b2b52..b8b208f12 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc012.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc012.yaml
@@ -13,6 +13,10 @@ description: >
Yardstick TC012 config file;
Measure memory read and write bandwidth using lmbench.
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: Lmbench
@@ -46,5 +50,11 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
-
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %}
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc014.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc014.yaml
index dd686a6b4..bd0fe3627 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc014.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc014.yaml
@@ -13,6 +13,10 @@ description: >
Yardstick TC014 config file;
Measure Processing speed using unixbench.
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: UnixBench
@@ -39,3 +43,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %} \ No newline at end of file
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc023.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc023.yaml
index 2804f25a2..f2cad4cc8 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc023.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc023.yaml
@@ -19,6 +19,10 @@ schema: "yardstick:task:0.1"
{% set vcpus = vcpus or "2" %}
{% set disk = disk or "3" %}
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: GetServer
@@ -174,3 +178,10 @@ contexts:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %}
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc037.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc037.yaml
index 6a64f0be8..3622b40d7 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc037.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc037.yaml
@@ -19,6 +19,10 @@ description: >
During the measurements system load and network latency are
recorded/measured using ping and mpstat, respectively;
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: CPUload
@@ -91,3 +95,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %} \ No newline at end of file
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc038.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc038.yaml
index ba0f2f298..59fb95d07 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc038.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc038.yaml
@@ -19,6 +19,10 @@ description: >
During the measurements system load and network latency are
recorded/measured using ping and mpstat, respectively;
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: CPUload
@@ -91,3 +95,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %} \ No newline at end of file
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc069.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc069.yaml
index c55639a04..2a4082310 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc069.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc069.yaml
@@ -13,6 +13,10 @@ description: >
Yardstick TC069 config file;
Measure memory read and write bandwidth using ramspeed.
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: Ramspeed
@@ -45,3 +49,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %}
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc070.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc070.yaml
index f9d57c6c8..7ea10d8a4 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc070.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc070.yaml
@@ -19,6 +19,10 @@ description: >
During the measurements memory usage statistics and network latency are
recorded/measured using free and ping, respectively;
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: MEMORYload
@@ -93,3 +97,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %} \ No newline at end of file
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml
index 0911d8e68..b6a944bbb 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml
@@ -19,6 +19,10 @@ description: >
During the measurements cache hit/miss ration, cache usage statistics and
network latency are recorded/measured using cachestat and ping, respectively;
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: CACHEstat
@@ -91,3 +95,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %} \ No newline at end of file
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc072.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc072.yaml
index ca3198448..09930d442 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc072.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc072.yaml
@@ -19,6 +19,10 @@ description: >
During the measurements network usage statistics and network latency are
recorded/measured using sar and ping, respectively;
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: NetUtilization
@@ -93,3 +97,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %}
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc076.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc076.yaml
index c23ee97c2..8c0edac83 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc076.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc076.yaml
@@ -8,6 +8,10 @@ description: >
IP datagram error rate, ICMP message error rate, TCP segment error rate and
UDP datagram error rate.
+{% set provider = provider or none %}
+{% set physical_network = physical_network or 'physnet1' %}
+{% set segmentation_id = segmentation_id or none %}
+
scenarios:
-
type: Ping
@@ -54,3 +58,10 @@ context:
networks:
test:
cidr: '10.0.1.0/24'
+ {% if provider == "vlan" %}
+ provider: {{provider}}
+ physical_network: {{physical_network}}
+ {% if segmentation_id %}
+ segmentation_id: {{segmentation_id}}
+ {% endif %}
+ {% endif %}
diff --git a/tests/opnfv/test_suites/opnfv_os-odl-sfc-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl-sfc-ha_daily.yaml
new file mode 100644
index 000000000..b464bfeae
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-odl-sfc-ha_daily.yaml
@@ -0,0 +1,62 @@
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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
+##############################################################################
+---
+# os-odl-sfc-ha daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-odl-sfc-ha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
+-
+ file_name: opnfv_yardstick_tc010.yaml
+-
+ file_name: opnfv_yardstick_tc011.yaml
+-
+ file_name: opnfv_yardstick_tc012.yaml
+-
+ file_name: opnfv_yardstick_tc014.yaml
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC055"}'
+-
+ file_name: opnfv_yardstick_tc063.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC063"}'
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
+-
+ file_name: opnfv_yardstick_tc075.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node1.LF"}'
diff --git a/tests/unit/apiserver/resources/test_env_action.py b/tests/unit/apiserver/resources/test_env_action.py
index d61092dbc..31afa4862 100644
--- a/tests/unit/apiserver/resources/test_env_action.py
+++ b/tests/unit/apiserver/resources/test_env_action.py
@@ -21,13 +21,13 @@ class EnvTestCase(APITestCase):
data = {'action': 'create_grafana'}
resp = self._post(url, data)
- time.sleep(1)
+ time.sleep(0)
task_id = resp['result']['task_id']
url = '/yardstick/asynctask?task_id={}'.format(task_id)
resp = self._get(url)
- time.sleep(2)
+ time.sleep(0)
self.assertTrue(u'status' in resp)
diff --git a/tests/unit/benchmark/scenarios/compute/test_qemumigrate.py b/tests/unit/benchmark/scenarios/compute/test_qemumigrate.py
new file mode 100644
index 000000000..9514729ba
--- /dev/null
+++ b/tests/unit/benchmark/scenarios/compute/test_qemumigrate.py
@@ -0,0 +1,166 @@
+#!/usr/bin/env python
+
+##############################################################################
+# Copyright (c) 2015 Huawei Technologies Co.,Ltd and other.
+#
+# 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
+##############################################################################
+
+# Unittest for yardstick.benchmark.scenarios.compute.qemu_migrate.QemuMigrate
+
+from __future__ import absolute_import
+
+import unittest
+
+import mock
+from oslo_serialization import jsonutils
+
+from yardstick.benchmark.scenarios.compute import qemu_migrate
+
+
+@mock.patch('yardstick.benchmark.scenarios.compute.qemu_migrate.ssh')
+class QemuMigrateTestCase(unittest.TestCase):
+
+ def setUp(self):
+ self.scenario_cfg = {
+ "host": "kvm.LF",
+ "setup_options": {
+ "rpm_dir": "/opt/rpm",
+ "script_dir": "/opt/scripts",
+ "image_dir": "/opt/image",
+ "host_setup_seqs": [
+ "host-setup0.sh",
+ "host-setup1.sh",
+ "setup-ovsdpdk.sh",
+ "host-install-qemu.sh",
+ "host-run-qemu4lm.sh"
+ ]
+ },
+ "sla": {
+ "action": "monitor",
+ "max_totaltime": 10,
+ "max_downtime": 0.10,
+ "max_setuptime": 0.50
+ },
+ "options": {
+ "smp": 99,
+ "migrate_to_port": 4444,
+ "incoming_ip": 0,
+ "qmp_src_path": "/tmp/qmp-sock-src",
+ "qmp_dst_path": "/tmp/qmp-sock-dst",
+ "max_down_time": "0.10"
+ }
+ }
+ self.context_cfg = {
+ "host": {
+ "ip": "10.229.43.154",
+ "key_filename": "/yardstick/resources/files/yardstick_key",
+ "role": "BareMetal",
+ "name": "kvm.LF",
+ "user": "root"
+ }
+ }
+
+ def test_qemu_migrate_successful_setup(self, mock_ssh):
+
+ q = qemu_migrate.QemuMigrate(self.scenario_cfg, self.context_cfg)
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+
+ q.setup()
+ self.assertIsNotNone(q.host)
+ self.assertEqual(q.setup_done, True)
+
+ def test_qemu_migrate_successful_no_sla(self, mock_ssh):
+ result = {}
+ self.scenario_cfg.pop("sla", None)
+ q = qemu_migrate.QemuMigrate(self.scenario_cfg, self.context_cfg)
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+ q.setup()
+
+ sample_output = '{"totaltime": 15, "downtime": 2, "setuptime": 1}'
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
+
+ q.run(result)
+ expected_result = jsonutils.loads(sample_output)
+ self.assertEqual(result, expected_result)
+
+ def test_qemu_migrate_successful_sla(self, mock_ssh):
+ result = {}
+ self.scenario_cfg.update({"sla": {
+ "action": "monitor",
+ "max_totaltime": 15,
+ "max_downtime": 2,
+ "max_setuptime": 1
+ }
+ })
+ q = qemu_migrate.QemuMigrate(self.scenario_cfg, self.context_cfg)
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+ q.setup()
+
+ sample_output = '{"totaltime": 15, "downtime": 2, "setuptime": 1}'
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
+
+ q.run(result)
+ expected_result = jsonutils.loads(sample_output)
+ self.assertEqual(result, expected_result)
+
+ def test_qemu_migrate_unsuccessful_sla_totaltime(self, mock_ssh):
+
+ result = {}
+ self.scenario_cfg.update({"sla": {"max_totaltime": 10}})
+ q = qemu_migrate.QemuMigrate(self.scenario_cfg, self.context_cfg)
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+ q.setup()
+
+ sample_output = '{"totaltime": 15, "downtime": 2, "setuptime": 1}'
+
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
+ self.assertRaises(AssertionError, q.run, result)
+
+ def test_qemu_migrate_unsuccessful_sla_downtime(self, mock_ssh):
+
+ result = {}
+ self.scenario_cfg.update({"sla": {"max_downtime": 0.10}})
+ q = qemu_migrate.QemuMigrate(self.scenario_cfg, self.context_cfg)
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+ q.setup()
+
+ sample_output = '{"totaltime": 15, "downtime": 2, "setuptime": 1}'
+
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
+ self.assertRaises(AssertionError, q.run, result)
+
+ def test_qemu_migrate_unsuccessful_sla_setuptime(self, mock_ssh):
+
+ result = {}
+ self.scenario_cfg.update({"sla": {"max_setuptime": 0.50}})
+ q = qemu_migrate.QemuMigrate(self.scenario_cfg, self.context_cfg)
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+ q.setup()
+
+ sample_output = '{"totaltime": 15, "downtime": 2, "setuptime": 1}'
+
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
+ self.assertRaises(AssertionError, q.run, result)
+
+ def test_qemu_migrate_unsuccessful_script_error(self, mock_ssh):
+
+ result = {}
+ self.scenario_cfg.update({"sla": {"max_totaltime": 10}})
+ q = qemu_migrate.QemuMigrate(self.scenario_cfg, self.context_cfg)
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+ q.setup()
+
+
+ mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR')
+ self.assertRaises(RuntimeError, q.run, result)
+
+
+def main():
+ unittest.main()
+
+if __name__ == '__main__':
+ main()
diff --git a/tests/unit/benchmark/scenarios/compute/test_spec_cpu.py b/tests/unit/benchmark/scenarios/compute/test_spec_cpu.py
new file mode 100644
index 000000000..40423b9da
--- /dev/null
+++ b/tests/unit/benchmark/scenarios/compute/test_spec_cpu.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python
+
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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
+##############################################################################
+
+# Unittest for yardstick.benchmark.scenarios.compute.spec_cpu.SpecCPU
+
+from __future__ import absolute_import
+
+import unittest
+
+import mock
+
+from yardstick.common import utils
+from yardstick.benchmark.scenarios.compute import spec_cpu
+
+
+@mock.patch('yardstick.benchmark.scenarios.compute.spec_cpu.ssh')
+class SpecCPUTestCase(unittest.TestCase):
+
+ def setUp(self):
+ self.ctx = {
+ 'host': {
+ 'ip': '172.16.0.137',
+ 'user': 'root',
+ 'key_filename': "mykey.key"
+ }
+ }
+
+ self.result = {}
+
+ def test_spec_cpu_successful_setup(self, mock_ssh):
+
+ options = {
+ "SPECint_benchmark": "perlbench",
+ "runspec_tune": "all",
+ "output_format": "all",
+ "runspec_iterations": "1",
+ "runspec_tune": "base",
+ "runspec_size": "test"
+ }
+ args = {"options": options}
+ s = spec_cpu.SpecCPU(args, self.ctx)
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+
+ s.setup()
+ self.assertIsNotNone(s.client)
+ self.assertTrue(s.setup_done, True)
+
+ def test_spec_cpu_successful__run_no_sla(self, mock_ssh):
+
+ options = {
+ "SPECint_benchmark": "perlbench",
+ "runspec_tune": "all",
+ "output_format": "all"
+ }
+ args = {"options": options}
+ s = spec_cpu.SpecCPU(args, self.ctx)
+
+ sample_output = ''
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+ s.run(self.result)
+ expected_result = {}
+ self.assertEqual(self.result, expected_result)
+
+ def test_ramspeed_unsuccessful_script_error(self, mock_ssh):
+ options = {
+ "benchmark_subset": "int"
+ }
+ args = {"options": options}
+ s = spec_cpu.SpecCPU(args, self.ctx)
+
+ mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR')
+ self.assertRaises(RuntimeError, s.run, self.result)
+
+def main():
+ unittest.main()
+
+if __name__ == '__main__':
+ main()
diff --git a/yardstick/benchmark/contexts/model.py b/yardstick/benchmark/contexts/model.py
index aed1a3f60..2db96bade 100644
--- a/yardstick/benchmark/contexts/model.py
+++ b/yardstick/benchmark/contexts/model.py
@@ -257,10 +257,11 @@ class Server(Object): # pragma: no cover
port_name = server_name + "-" + network.name + "-port"
self.ports[network.name] = {"stack_name": port_name}
# we can't use secgroups if port_security_enabled is False
- if network.port_security_enabled:
- sec_group_id = self.secgroup_name
- else:
+ if network.port_security_enabled is False:
sec_group_id = None
+ else:
+ # if port_security_enabled is None we still need to add to secgroup
+ sec_group_id = self.secgroup_name
# don't refactor to pass in network object, that causes JSON
# circular ref encode errors
template.add_port(port_name, network.stack_name, network.subnet_stack_name,
diff --git a/yardstick/benchmark/scenarios/compute/qemu_migrate.py b/yardstick/benchmark/scenarios/compute/qemu_migrate.py
new file mode 100644
index 000000000..cee87a545
--- /dev/null
+++ b/yardstick/benchmark/scenarios/compute/qemu_migrate.py
@@ -0,0 +1,155 @@
+from __future__ import absolute_import
+from __future__ import print_function
+
+import logging
+import os
+import re
+import time
+
+
+import pkg_resources
+from oslo_serialization import jsonutils
+
+import yardstick.ssh as ssh
+from yardstick.benchmark.scenarios import base
+
+LOG = logging.getLogger(__name__)
+LOG.setLevel(logging.DEBUG)
+
+
+class QemuMigrate(base.Scenario):
+ """
+ Execute a live migration for two host using qemu
+
+ """
+
+ __scenario_type__ = "QemuMigrate"
+
+ TARGET_SCRIPT = "qemu_migrate_benchmark.bash"
+ WORKSPACE = "/root/workspace"
+ REBOOT_CMD_PATTERN = r";\s*reboot\b"
+
+ def __init__(self, scenario_cfg, context_cfg):
+ self.scenario_cfg = scenario_cfg
+ self.context_cfg = context_cfg
+ self.setup_done = False
+
+ def _connect_host(self):
+ host = self.context_cfg["host"]
+ self.host = ssh.SSH.from_node(host, defaults={"user": "root"})
+ self.host.wait(timeout=600)
+
+ def _put_files(self, client):
+ setup_options = self.scenario_cfg["setup_options"]
+ script_dir = setup_options["script_dir"]
+ LOG.debug("Send scripts from %s to workspace %s",
+ script_dir, self.WORKSPACE)
+ client.put(script_dir, self.WORKSPACE, recursive=True)
+
+ def _run_setup_cmd(self, client, cmd):
+ LOG.debug("Run cmd: %s", cmd)
+ status, stdout, stderr = client.execute(cmd)
+ if status:
+ if re.search(self.REBOOT_CMD_PATTERN, cmd):
+ LOG.debug("Error on reboot")
+ else:
+ raise RuntimeError(stderr)
+
+ def _run_host_setup_scripts(self, scripts):
+ setup_options = self.scenario_cfg["setup_options"]
+ script_dir = os.path.basename(setup_options["script_dir"])
+
+ for script in scripts:
+ cmd = "cd %s/%s; export PATH=./:$PATH; %s" %\
+ (self.WORKSPACE, script_dir, script)
+ self._run_setup_cmd(self.host, cmd)
+
+ if re.search(self.REBOOT_CMD_PATTERN, cmd):
+ time.sleep(3)
+ self._connect_host()
+
+ def setup(self):
+ """scenario setup"""
+ setup_options = self.scenario_cfg["setup_options"]
+ host_setup_seqs = setup_options["host_setup_seqs"]
+
+ self._connect_host()
+ self._put_files(self.host)
+ self._run_host_setup_scripts(host_setup_seqs)
+
+ # copy script to host
+ self.target_script = pkg_resources.resource_filename(
+ "yardstick.benchmark.scenarios.compute",
+ QemuMigrate.TARGET_SCRIPT)
+ self.host.put_file(self.target_script, "~/qemu_migrate_benchmark.sh")
+
+ self.setup_done = True
+
+ def run(self, result):
+ """execute the benchmark"""
+
+ options = self.scenario_cfg["options"]
+ smp = options.get("smp", 2)
+ qmp_sock_src = options.get("qmp_src_path", "/tmp/qmp-sock-src")
+ qmp_sock_dst = options.get("qmp_dst_path", "/tmp/qmp-sock-dst")
+ incoming_ip = options.get("incoming_ip", 0)
+ migrate_to_port = options.get("migrate_to_port", 4444)
+ max_down_time = options.get("max_down_time", 0.10)
+ cmd_args = " %s %s %s %s %s %s" %\
+ (smp, qmp_sock_src, qmp_sock_dst, incoming_ip,
+ migrate_to_port, max_down_time)
+ cmd = "bash migrate_benchmark.sh %s" % (cmd_args)
+ LOG.debug("Executing command: %s", cmd)
+ status, stdout, stderr = self.host.execute(cmd)
+ if status:
+ raise RuntimeError(stderr)
+
+ result.update(jsonutils.loads(stdout))
+
+ if "sla" in self.scenario_cfg:
+ sla_error = ""
+ for t, timevalue in result.items():
+ if 'max_%s' % t not in self.scenario_cfg['sla']:
+ continue
+
+ sla_time = int(self.scenario_cfg['sla'][
+ 'max_%s' % t])
+ timevalue = int(timevalue)
+ if timevalue > sla_time:
+ sla_error += "%s timevalue %d > sla:max_%s(%d); " % \
+ (t, timevalue, t, sla_time)
+ assert sla_error == "", sla_error
+
+
+def _test(): # pragma: no cover
+ """internal test function"""
+ key_filename = pkg_resources.resource_filename("yardstick.resources",
+ "files/yardstick_key")
+ ctx = {
+ "host": {
+ "ip": "10.229.47.137",
+ "user": "root",
+ "key_filename": key_filename
+ }
+ }
+
+ logger = logging.getLogger("yardstick")
+ logger.setLevel(logging.DEBUG)
+ options = {
+ "smp": 2,
+ "migrate_to_port": 4444,
+ "incoming_ip": 0,
+ "qmp_sock_src": "/tmp/qmp-sock-src",
+ "qmp_sock_dst": "/tmp/qmp-sock-dst",
+ "max_down_time": 0.10
+ }
+ args = {
+ "options": options
+ }
+ result = {}
+ migrate = QemuMigrate(args, ctx)
+ migrate.run(result)
+ print(result)
+
+if __name__ == '__main__': # pragma: no cover
+ _test()
diff --git a/yardstick/benchmark/scenarios/compute/qemu_migrate_benchmark.bash b/yardstick/benchmark/scenarios/compute/qemu_migrate_benchmark.bash
new file mode 100644
index 000000000..552098103
--- /dev/null
+++ b/yardstick/benchmark/scenarios/compute/qemu_migrate_benchmark.bash
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+#############################################################################
+#Copyright (c) 2015 Huawei Technologies Co.,Ltd 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
+##############################################################################
+
+set -e
+
+# Commandline arguments
+
+src=$2
+dst_ip=$4
+migrate_to_port=$5
+max_down_time=$6
+
+OUTPUT_FILE=/tmp/output-qemu.log
+
+do_migrate()
+{
+# local src=`echo $OPTIONS | cut -d ':' -f 2 | cut -d ',' -f 1`
+ echo "info status" | nc -U $src
+ # with no speed limit
+ echo "migrate_set_speed 0" |nc -U $src
+ # set the expected max downtime
+ echo "migrate_set_downtime ${max_down_time}" |nc -U $src
+ # start live migration
+ echo "migrate -d tcp:${dst_ip}:$migrate_to_port" |nc -U $src
+ # wait until live migration completed
+ status=""
+ while [ "${status}" == "" ]
+ do
+ status=`echo "info migrate" | nc -U $src |grep completed | cut -d: -f2`
+ echo ${status}
+ sleep 1;
+ done
+} >/dev/null
+
+output_qemu()
+{
+ # print detail information
+ echo "info migrate" | nc -U $src
+ echo "quit" | nc -U $src
+ sleep 5
+
+} > $OUTPUT_FILE
+
+output_json()
+{
+totaltime=$(grep "total time" $OUTPUT_FILE | cut -d' ' -f3)
+downtime=$(grep "downtime" $OUTPUT_FILE | cut -d' ' -f2)
+setuptime=$(grep "setup" $OUTPUT_FILE | cut -d' ' -f2)
+echo -e "{ \
+ \"totaltime\":\"$totaltime\", \
+ \"downtime\":\"$downtime\", \
+ \"setuptime\":\"$setuptime\" \
+ }"
+}
+# main entry
+main()
+{
+ do_migrate
+}
+main
diff --git a/yardstick/benchmark/scenarios/compute/spec_cpu.py b/yardstick/benchmark/scenarios/compute/spec_cpu.py
new file mode 100644
index 000000000..520618631
--- /dev/null
+++ b/yardstick/benchmark/scenarios/compute/spec_cpu.py
@@ -0,0 +1,141 @@
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd 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
+##############################################################################
+from __future__ import absolute_import
+
+import logging
+import pkg_resources
+
+import yardstick.ssh as ssh
+from yardstick.benchmark.scenarios import base
+
+LOG = logging.getLogger(__name__)
+
+
+class SpecCPU(base.Scenario):
+ """Spec CPU2006 benchmark
+
+ Parameters
+ benchmark_subset - Specifies a subset of SPEC CPU2006 benchmarks to run
+ type: string
+ unit: na
+ default: na
+
+ SPECint_benchmark - A SPECint benchmark to run
+ type: string
+ unit: na
+ default: na
+
+ SPECint_benchmark - A SPECfp benchmark to run
+ type: string
+ unit: na
+ default: na
+
+ output_format - Desired report format
+ type: string
+ unit: na
+ default: na
+
+ runspec_config - SPEC CPU2006 config file provided to the runspec binary
+ type: string
+ unit: na
+ default: "Example-linux64-amd64-gcc43+.cfg"
+
+ runspec_iterations - The number of benchmark iterations to execute.
+ For a reportable run, must be 3.
+ type: int
+ unit: na
+ default: na
+
+ runspec_tune - Tuning to use (base, peak, or all). For a reportable run, must be either
+ base or all. Reportable runs do base first, then (optionally) peak.
+ type: string
+ unit: na
+ default: na
+
+ runspec_size - Size of input data to run (test, train, or ref). Reportable runs ensure
+ that your binaries can produce correct results with the test and train
+ workloads.
+ type: string
+ unit: na
+ default: na
+ """
+ __scenario_type__ = "SpecCPU2006"
+
+ def __init__(self, scenario_cfg, context_cfg):
+ self.scenario_cfg = scenario_cfg
+ self.context_cfg = context_cfg
+ self.setup_done = False
+ self.options = self.scenario_cfg['options']
+
+ def setup(self):
+ """scenario setup"""
+ host = self.context_cfg['host']
+ LOG.info("user:%s, host:%s", host['user'], host['ip'])
+ self.client = ssh.SSH.from_node(host, defaults={"user": "ubuntu"})
+ self.client.wait(timeout=600)
+
+ if "runspec_config" in self.options:
+ self.runspec_config = self.options["runspec_config"]
+
+ self.runspec_config_file = pkg_resources.resource_filename(
+ "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')
+ else:
+ self.runspec_config = "Example-linux64-amd64-gcc43+.cfg"
+
+ self.setup_done = True
+
+ def run(self, result):
+ """execute the benchmark"""
+
+ if not self.setup_done:
+ self.setup()
+
+ cmd = "cd /usr/cpu2006/ && . ./shrc && runspec --config %s" % self.runspec_config
+ cmd_args = ""
+
+ if "output_format" in self.options:
+ cmd_args += " --output_format %s" % self.options["output_format"]
+
+ if "runspec_tune" in self.options:
+ cmd_args += " --tune %s" % self.options["runspec_tune"]
+
+ benchmark_subset = self.options.get('benchmark_subset', None)
+ specint_benchmark = self.options.get('SPECint_benchmark', None)
+ specfp_benchmark = self.options.get('SPECfp_benchmark', None)
+
+ if benchmark_subset:
+ cmd_args += " %s" % benchmark_subset
+ else:
+ cmd_args += " --noreportable"
+
+ if "runspec_iterations" in self.options:
+ cmd_args += " --iterations %s" % self.options["runspec_iterations"]
+
+ if "runspec_size" in self.options:
+ cmd_args += " --size %s" % self.options["runspec_size"]
+
+ if specint_benchmark:
+ cmd_args += " %s" % specint_benchmark
+
+ if specfp_benchmark:
+ cmd_args += " %s" % specfp_benchmark
+
+ cmd += "%s" % cmd_args
+
+ LOG.debug("Executing command: %s", cmd)
+ status, stdout, stderr = self.client.execute(cmd, timeout=86400)
+ if status:
+ raise RuntimeError(stderr)
+
+ LOG.info('SPEC CPU2006 benchmark completed, please find benchmark reports \
+ at /tmp/result directory')
diff --git a/yardstick/cmd/NSBperf.py b/yardstick/cmd/NSBperf.py
index 4e7590ea5..2dc0f65e7 100755
--- a/yardstick/cmd/NSBperf.py
+++ b/yardstick/cmd/NSBperf.py
@@ -30,13 +30,6 @@ from six.moves import input
CLI_PATH = os.path.dirname(os.path.realpath(__file__))
REPO_PATH = os.path.abspath(os.path.join(CLI_PATH, os.pardir))
-PYTHONPATH = os.environ.get("PYTHONPATH", False)
-VIRTUAL_ENV = os.environ.get("VIRTUAL_ENV", False)
-
-
-if not PYTHONPATH or not VIRTUAL_ENV:
- print("Please setup env PYTHONPATH & VIRTUAL_ENV environment varaible.")
- raise SystemExit(1)
def sigint_handler(*args, **kwargs):
diff --git a/yardstick/cmd/commands/task.py b/yardstick/cmd/commands/task.py
index 03f6b1b1e..8d8ea2b3c 100644
--- a/yardstick/cmd/commands/task.py
+++ b/yardstick/cmd/commands/task.py
@@ -51,11 +51,17 @@ class TaskCommands(object): # pragma: no cover
self.output_file = param.output_file
try:
- Task().start(param, **kwargs)
+ result = Task().start(param, **kwargs)
except Exception as e:
self._write_error_data(e)
LOG.exception("")
+ if result.get('result', {}).get('criteria') == 'PASS':
+ LOG.info('Task Success')
+ else:
+ LOG.info('Task Failed')
+ raise RuntimeError('Task Failed')
+
def _write_error_data(self, error):
data = {'status': 2, 'result': str(error)}
write_json_to_file(self.output_file, data)