summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--docs/pre-hook.sh11
-rw-r--r--docs/userguide/opnfv_yardstick_tc044.rst82
-rw-r--r--docs/userguide/opnfv_yardstick_tc046.rst2
-rw-r--r--docs/userguide/opnfv_yardstick_tc069.rst95
-rw-r--r--docs/userguide/opnfv_yardstick_tc071.rst109
-rw-r--r--docs/userguide/opnfv_yardstick_tc072.rst110
-rwxr-xr-xfuel-plugin/deployment_scripts/install.sh6
-rw-r--r--fuel-plugin/deployment_tasks.yaml2
-rw-r--r--fuel-plugin/fuel_ping.yaml2
-rwxr-xr-xfuel-plugin/pre_build_hook4
-rw-r--r--plugin/storperf.yaml13
-rw-r--r--samples/computecapacity.yaml2
-rw-r--r--samples/memload.yaml7
-rwxr-xr-xsetup.py4
-rwxr-xr-xtests/ci/prepare_env.sh3
-rwxr-xr-xtests/ci/prepare_storperf_admin-rc.sh30
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml10
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc069.yaml38
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml85
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc072.yaml (renamed from tests/opnfv/test_cases/opnfv_yardstick_tc044.yaml)28
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-lxd-ha_daily.yaml22
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-lxd-noha_daily.yaml22
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml23
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-noha_daily.yaml22
-rw-r--r--tests/opnfv/test_suites/opnfv_os-ocl-nofeature-noha_daily.yaml22
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-noha_daily.yaml22
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-noha_daily.yaml22
-rw-r--r--tests/opnfv/test_suites/opnfv_os-onos-nofeature-noha_daily.yaml22
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_attacker_general.py3
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_basemonitor.py4
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_baseoperation.py6
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_director.py14
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_monitor_general.py10
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_operation_general.py2
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_result_checker_general.py1
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_scenario_general.py6
-rw-r--r--tests/unit/benchmark/scenarios/compute/test_computecapacity.py2
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_sfc.py18
-rw-r--r--tests/unit/cmd/commands/no_constraint_no_args_scenario_sample.yaml13
-rw-r--r--tests/unit/cmd/commands/no_constraint_with_args_scenario_sample.yaml15
-rw-r--r--tests/unit/cmd/commands/test_task.py77
-rw-r--r--tests/unit/cmd/commands/with_constraint_no_args_scenario_sample.yaml16
-rw-r--r--tests/unit/cmd/commands/with_constraint_with_args_scenario_sample.yaml18
-rw-r--r--yardstick/benchmark/contexts/node.py4
-rw-r--r--yardstick/benchmark/scenarios/availability/attacker/attacker_general.py3
-rw-r--r--yardstick/benchmark/scenarios/availability/attacker_conf.yaml2
-rw-r--r--yardstick/benchmark/scenarios/availability/monitor/monitor_general.py6
-rw-r--r--yardstick/benchmark/scenarios/availability/monitor_conf.yaml6
-rw-r--r--yardstick/benchmark/scenarios/availability/operation/operation_general.py4
-rw-r--r--yardstick/benchmark/scenarios/availability/operation_conf.yaml6
-rw-r--r--yardstick/benchmark/scenarios/availability/result_checker/result_checker_general.py3
-rw-r--r--yardstick/benchmark/scenarios/compute/computecapacity.py2
-rw-r--r--yardstick/benchmark/scenarios/networking/sfc_openstack.py2
-rw-r--r--yardstick/cmd/commands/plugin.py6
-rw-r--r--yardstick/cmd/commands/task.py96
-rw-r--r--yardstick/resources/script/install/storperf.bash27
-rw-r--r--yardstick/resources/script/remove/storperf.bash20
-rw-r--r--yardstick/resources/scripts/install/sample.bash (renamed from yardstick/resources/script/install/sample.bash)0
-rw-r--r--yardstick/resources/scripts/remove/sample.bash (renamed from yardstick/resources/script/remove/sample.bash)0
60 files changed, 1103 insertions, 111 deletions
diff --git a/.gitignore b/.gitignore
index 6f462f55a..4843ba8ba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,4 +28,4 @@ cover/
.*.sw?
/docs_build/
/docs_output/
-/releng/
+/docs/apidocs/yardstick*.rst
diff --git a/docs/pre-hook.sh b/docs/pre-hook.sh
new file mode 100644
index 000000000..4ecdb198e
--- /dev/null
+++ b/docs/pre-hook.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2016 NEC 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
+##############################################################################
+
+sphinx-apidoc -o docs/apidocs yardstick
diff --git a/docs/userguide/opnfv_yardstick_tc044.rst b/docs/userguide/opnfv_yardstick_tc044.rst
new file mode 100644
index 000000000..2be8517a1
--- /dev/null
+++ b/docs/userguide/opnfv_yardstick_tc044.rst
@@ -0,0 +1,82 @@
+.. 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 TC044
+*************************************
+
+.. _man-pages: http://manpages.ubuntu.com/manpages/trusty/en/man1/free.1.html
+
++-----------------------------------------------------------------------------+
+|Memory Utilization |
+| |
++--------------+--------------------------------------------------------------+
+|test case id | OPNFV_YARDSTICK_TC044_Memory Utilization |
+| | |
++--------------+--------------------------------------------------------------+
+|metric | Memory utilization |
+| | |
++--------------+--------------------------------------------------------------+
+|test purpose | To evaluate the IaaS compute capability with regards to |
+| | memory utilization.This test case should be run in parallel |
+| | to other Yardstick test cases and not run as a stand-alone |
+| | test case. |
+| | Measure the memory usage statistics including used memory, |
+| | free memory, buffer, cache and shared memory. |
+| | Both average and maximun values are obtained. |
+| | The purpose is also to be able to spot trends. |
+| | Test results, graphs and similar shall be stored for |
+| | comparison reasons and product evolution understanding |
+| | between different OPNFV versions and/or configurations. |
+| | |
++--------------+--------------------------------------------------------------+
+|configuration | File: memload.yaml (in the 'samples' directory) |
+| | |
+| | * interval: 1 - repeat, pausing every 1 seconds in-between. |
+| | * count: 10 - display statistics 10 times, then exit. |
+| | |
++--------------+--------------------------------------------------------------+
+|test tool | free |
+| | |
+| | free provides information about unused and used memory and |
+| | swap space on any computer running Linux or another Unix-like|
+| | operating system. |
+| | free is normally part of a Linux distribution, hence it |
+| | doesn't needs to be installed. |
+| | |
++--------------+--------------------------------------------------------------+
+|references | man-pages_ |
+| | |
+| | ETSI-NFV-TST001 |
+| | |
++--------------+--------------------------------------------------------------+
+|applicability | Test can be configured with different: |
+| | |
+| | * interval; |
+| | * count; |
+| | * runner Iteration and intervals. |
+| | |
+| | There are default values for each above-mentioned option. |
+| | Run in background with other test cases. |
+| | |
++--------------+--------------------------------------------------------------+
+|pre-test | The test case image needs to be installed into Glance |
+|conditions | with free included in the image. |
+| | |
+| | No POD specific requirements have been identified. |
+| | |
++--------------+--------------------------------------------------------------+
+|test sequence | description and expected result |
+| | |
++--------------+--------------------------------------------------------------+
+|step 1 | The host is installed as client. The related TC, or TCs, is |
+| | invoked and free logs are produced and stored. |
+| | |
+| | Result: logs are stored. |
+| | |
++--------------+--------------------------------------------------------------+
+|test verdict | None. Memory utilization results are fetched and stored. |
+| | |
++--------------+--------------------------------------------------------------+
diff --git a/docs/userguide/opnfv_yardstick_tc046.rst b/docs/userguide/opnfv_yardstick_tc046.rst
index 612676434..cce6c6884 100644
--- a/docs/userguide/opnfv_yardstick_tc046.rst
+++ b/docs/userguide/opnfv_yardstick_tc046.rst
@@ -2,7 +2,7 @@
.. License.
.. http://creativecommons.org/licenses/by/4.0
.. (c) OPNFV, Yin Kanglin and others.
-.. 14_ykl@tongji.edu.cn
+.. 14_ykl@tongji.edu.cn
*************************************
Yardstick Test Case Description TC046
diff --git a/docs/userguide/opnfv_yardstick_tc069.rst b/docs/userguide/opnfv_yardstick_tc069.rst
new file mode 100644
index 000000000..51807e246
--- /dev/null
+++ b/docs/userguide/opnfv_yardstick_tc069.rst
@@ -0,0 +1,95 @@
+.. 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 TC069
+*************************************
+
+.. _RAMspeed: http://alasir.com/software/ramspeed/
+
++-----------------------------------------------------------------------------+
+|Memory Bandwidth |
+| |
++--------------+--------------------------------------------------------------+
+|test case id | OPNFV_YARDSTICK_TC069_Memory Bandwidth |
+| | |
++--------------+--------------------------------------------------------------+
+|metric | Megabyte per second (MBps) |
+| | |
++--------------+--------------------------------------------------------------+
+|test purpose | To evaluate the IaaS compute performance with regards to |
+| | memory bandwidth. |
+| | Measure the maximum possible cache and memory performance |
+| | while reading and writing certain blocks of data (starting |
+| | from 1Kb and further in power of 2) continuously through ALU |
+| | and FPU respectively. |
+| | Measure different aspects of memory performance via synthetic|
+| | simulations. Each simulation consists of four performances |
+| | (Copy, Scale, Add, Triad). |
+| | Test results, graphs and similar shall be stored for |
+| | comparison reasons and product evolution understanding |
+| | between different OPNFV versions and/or configurations. |
+| | |
++--------------+--------------------------------------------------------------+
+|configuration | File: opnfv_yardstick_tc069.yaml |
+| | |
+| | * SLA (optional): 7000 (MBps) min_bandwidth: The minimum |
+| | amount of memory bandwidth that is accepted. |
+| | * type_id: 1 - runs a specified benchmark (by an ID number): |
+| | 1 -- INTmark [writing] 4 -- FLOATmark [writing] |
+| | 2 -- INTmark [reading] 5 -- FLOATmark [reading] |
+| | 3 -- INTmem 6 -- FLOATmem |
+| | * block_size: 64 Megabytes - the maximum block size per array|
+| | * load: 32 Gigabytes - the amount of data load per pass |
+| | * iterations: 5 - test is run 5 times iteratively. |
+| | * interval: 1 - there is 1 second delay between each |
+| | iteration. |
+| | |
++--------------+--------------------------------------------------------------+
+|test tool | RAMspeed |
+| | |
+| | RAMspeed is a free open source command line utility to |
+| | measure cache and memory performance of computer systems. |
+| | RAMspeed is not always part of a Linux distribution, hence it|
+| | needs to be installed in the test image. |
+| | |
++--------------+--------------------------------------------------------------+
+|references | RAMspeed_ |
+| | |
+| | ETSI-NFV-TST001 |
+| | |
++--------------+--------------------------------------------------------------+
+|applicability | Test can be configured with different: |
+| | |
+| | * benchmark operations (such as INTmark [writing], |
+| | INTmark [reading], FLOATmark [writing], |
+| | FLOATmark [reading], INTmem, FLOATmem); |
+| | * block size per array; |
+| | * load per pass; |
+| | * number of batch run iterations; |
+| | * iterations and intervals. |
+| | |
+| | There are default values for each above-mentioned option. |
+| | |
++--------------+--------------------------------------------------------------+
+|pre-test | The test case image needs to be installed into Glance |
+|conditions | with RAmspeed included in the image. |
+| | |
+| | No POD specific requirements have been identified. |
+| | |
++--------------+--------------------------------------------------------------+
+|test sequence | description and expected result |
+| | |
++--------------+--------------------------------------------------------------+
+|step 1 | The host is installed as client. RAMspeed is invoked and logs|
+| | are produced and stored. |
+| | |
+| | Result: logs are stored. |
+| | |
++--------------+--------------------------------------------------------------+
+|test verdict | Test fails if the measured memory bandwidth is below the SLA |
+| | value or if there is a test case execution problem. |
+| | |
++--------------+--------------------------------------------------------------+
diff --git a/docs/userguide/opnfv_yardstick_tc071.rst b/docs/userguide/opnfv_yardstick_tc071.rst
new file mode 100644
index 000000000..673480b55
--- /dev/null
+++ b/docs/userguide/opnfv_yardstick_tc071.rst
@@ -0,0 +1,109 @@
+.. 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 TC071
+*************************************
+
+.. _cirros: https://download.cirros-cloud.net
+.. _pktgen: https://www.kernel.org/doc/Documentation/networking/pktgen.txt
+.. _cachestat: https://github.com/brendangregg/perf-tools/tree/master/fs
+
++-----------------------------------------------------------------------------+
+|Latency, Cache Utilization, Throughput, Packet Loss |
+| |
++--------------+--------------------------------------------------------------+
+|test case id | OPNFV_YARDSTICK_TC071_Latency, Cache Utilization, |
+| | Throughput,Packet Loss |
+| | |
++--------------+--------------------------------------------------------------+
+|metric | Number of flows, latency, throughput, Cache Utilization, |
+| | packet loss |
+| | |
++--------------+--------------------------------------------------------------+
+|test purpose | To evaluate the IaaS network performance with regards to |
+| | flows and throughput, such as if and how different amounts |
+| | of flows matter for the throughput between hosts on different|
+| | compute blades. Typically e.g. the performance of a vSwitch |
+| | depends on the number of flows running through it. Also |
+| | performance of other equipment or entities can depend |
+| | on the number of flows or the packet sizes used. |
+| | The purpose is also to be able to spot trends. |
+| | Test results, graphs and similar shall be stored for |
+| | comparison reasons and product evolution understanding |
+| | between different OPNFV versions and/or configurations. |
+| | |
++--------------+--------------------------------------------------------------+
+|configuration | file: opnfv_yardstick_tc071.yaml |
+| | |
+| | Packet size: 64 bytes |
+| | Number of ports: 1, 10, 50, 100, 300, 500, 750 and 1000. |
+| | The amount configured ports map from 2 up to 1001000 flows, |
+| | respectively. Each port amount is run two times, for 20 |
+| | seconds each. Then the next port_amount is run, and so on. |
+| | During the test Cache Utilization on both client and server, |
+| | and the network latency between the client and server are |
+| | measured. |
+| | The client and server are distributed on different HW. |
+| | For SLA max_ppm is set to 1000. |
+| | |
++--------------+--------------------------------------------------------------+
+|test tool | pktgen |
+| | |
+| | Pktgen is not always part of a Linux distribution, hence it |
+| | needs to be installed. It is part of the Yardstick Glance |
+| | image. |
+| | (As an example see the /yardstick/tools/ directory for how |
+| | to generate a Linux image with pktgen included.) |
+| | |
+| | ping |
+| | |
+| | Ping is normally part of any Linux distribution, hence it |
+| | doesn't need to be installed. It is also part of the |
+| | Yardstick Glance image. |
+| | (For example also a cirros_ image can be downloaded, it |
+| | includes ping) |
+| | |
+| | cachestat |
+| | |
+| | cachestat is not always part of a Linux distribution, hence |
+| | it needs to be installed. |
+| | |
++--------------+--------------------------------------------------------------+
+|references | Ping man pages |
+| | |
+| | pktgen_ |
+| | |
+| | cachestat_ |
+| | |
+| | ETSI-NFV-TST001 |
+| | |
++--------------+--------------------------------------------------------------+
+|applicability | Test can be configured with different packet sizes, amount |
+| | of flows and test duration. Default values exist. |
+| | |
+| | SLA (optional): max_ppm: The number of packets per million |
+| | packets sent that are acceptable to lose, not received. |
+| | |
++--------------+--------------------------------------------------------------+
+|pre-test | The test case image needs to be installed into Glance |
+|conditions | with pktgen included in it. |
+| | |
+| | No POD specific requirements have been identified. |
+| | |
++--------------+--------------------------------------------------------------+
+|test sequence | description and expected result |
+| | |
++--------------+--------------------------------------------------------------+
+|step 1 | The hosts are installed, as server and client. pktgen is |
+| | invoked and logs are produced and stored. |
+| | |
+| | Result: Logs are stored. |
+| | |
++--------------+--------------------------------------------------------------+
+|test verdict | Fails only if SLA is not passed, or if there is a test case |
+| | execution problem. |
+| | |
++--------------+--------------------------------------------------------------+
diff --git a/docs/userguide/opnfv_yardstick_tc072.rst b/docs/userguide/opnfv_yardstick_tc072.rst
new file mode 100644
index 000000000..2e7ee057c
--- /dev/null
+++ b/docs/userguide/opnfv_yardstick_tc072.rst
@@ -0,0 +1,110 @@
+.. 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 TC072
+*************************************
+
+.. _cirros: https://download.cirros-cloud.net
+.. _pktgen: https://www.kernel.org/doc/Documentation/networking/pktgen.txt
+.. _sar: http://linux.die.net/man/1/sar
+
++-----------------------------------------------------------------------------+
+|Latency, Network Utilization, Throughput, Packet Loss |
+| |
++--------------+--------------------------------------------------------------+
+|test case id | OPNFV_YARDSTICK_TC072_Latency, Network Utilization, |
+| | Throughput,Packet Loss |
+| | |
++--------------+--------------------------------------------------------------+
+|metric | Number of flows, latency, throughput, Network Utilization, |
+| | packet loss |
+| | |
++--------------+--------------------------------------------------------------+
+|test purpose | To evaluate the IaaS network performance with regards to |
+| | flows and throughput, such as if and how different amounts |
+| | of flows matter for the throughput between hosts on different|
+| | compute blades. Typically e.g. the performance of a vSwitch |
+| | depends on the number of flows running through it. Also |
+| | performance of other equipment or entities can depend |
+| | on the number of flows or the packet sizes used. |
+| | The purpose is also to be able to spot trends. |
+| | Test results, graphs and similar shall be stored for |
+| | comparison reasons and product evolution understanding |
+| | between different OPNFV versions and/or configurations. |
+| | |
++--------------+--------------------------------------------------------------+
+|configuration | file: opnfv_yardstick_tc072.yaml |
+| | |
+| | Packet size: 64 bytes |
+| | Number of ports: 1, 10, 50, 100, 300, 500, 750 and 1000. |
+| | The amount configured ports map from 2 up to 1001000 flows, |
+| | respectively. Each port amount is run two times, for 20 |
+| | seconds each. Then the next port_amount is run, and so on. |
+| | During the test Network Utilization on both client and |
+| | server, and the network latency between the client and server|
+| | are measured. |
+| | The client and server are distributed on different HW. |
+| | For SLA max_ppm is set to 1000. |
+| | |
++--------------+--------------------------------------------------------------+
+|test tool | pktgen |
+| | |
+| | Pktgen is not always part of a Linux distribution, hence it |
+| | needs to be installed. It is part of the Yardstick Glance |
+| | image. |
+| | (As an example see the /yardstick/tools/ directory for how |
+| | to generate a Linux image with pktgen included.) |
+| | |
+| | ping |
+| | |
+| | Ping is normally part of any Linux distribution, hence it |
+| | doesn't need to be installed. It is also part of the |
+| | Yardstick Glance image. |
+| | (For example also a cirros_ image can be downloaded, it |
+| | includes ping) |
+| | |
+| | sar |
+| | |
+| | The sar command writes to standard output the contents of |
+| | selected cumulative activity counters in the operating |
+| | system. |
+| | sar is normally part of a Linux distribution, hence it |
+| | doesn't needs to be installed. |
+| | |
++--------------+--------------------------------------------------------------+
+|references | Ping and sar man pages |
+| | |
+| | pktgen_ |
+| | |
+| | ETSI-NFV-TST001 |
+| | |
++--------------+--------------------------------------------------------------+
+|applicability | Test can be configured with different packet sizes, amount |
+| | of flows and test duration. Default values exist. |
+| | |
+| | SLA (optional): max_ppm: The number of packets per million |
+| | packets sent that are acceptable to lose, not received. |
+| | |
++--------------+--------------------------------------------------------------+
+|pre-test | The test case image needs to be installed into Glance |
+|conditions | with pktgen included in it. |
+| | |
+| | No POD specific requirements have been identified. |
+| | |
++--------------+--------------------------------------------------------------+
+|test sequence | description and expected result |
+| | |
++--------------+--------------------------------------------------------------+
+|step 1 | The hosts are installed, as server and client. pktgen is |
+| | invoked and logs are produced and stored. |
+| | |
+| | Result: Logs are stored. |
+| | |
++--------------+--------------------------------------------------------------+
+|test verdict | Fails only if SLA is not passed, or if there is a test case |
+| | execution problem. |
+| | |
++--------------+--------------------------------------------------------------+
diff --git a/fuel-plugin/deployment_scripts/install.sh b/fuel-plugin/deployment_scripts/install.sh
index 84ef96c48..76ef433c2 100755
--- a/fuel-plugin/deployment_scripts/install.sh
+++ b/fuel-plugin/deployment_scripts/install.sh
@@ -8,7 +8,11 @@ VAR_HOME=/var/lib/yardstick
rm -rf $BIN_HOME; mkdir -p $BIN_HOME
rm -rf $VAR_HOME; mkdir -p $VAR_HOME
-sudo apt-get install -y python-dev python-pip libffi-dev libssl-dev libxml2-dev libxslt1-dev
+apt-get install -y python-dev python-pip libffi-dev libssl-dev libxml2-dev libxslt1-dev
+
+#apt-get install python-virtualenv cannot work
+#use pip to work around the issue
+
pip install virtualenv
# create python virtual env
diff --git a/fuel-plugin/deployment_tasks.yaml b/fuel-plugin/deployment_tasks.yaml
index 90fae7192..6d53198b7 100644
--- a/fuel-plugin/deployment_tasks.yaml
+++ b/fuel-plugin/deployment_tasks.yaml
@@ -3,7 +3,7 @@
role: [yardstick]
requires: [deploy_start]
required_for: [deploy_end]
- tasks: [hiera, setup_repositories, fuel_pkgs, globals, tools, logging, netconfig, yardstick-install]
+ tasks: [hiera, setup_repositories, fuel_pkgs, globals, tools, logging, netconfig]
parameters:
strategy:
type: parallel
diff --git a/fuel-plugin/fuel_ping.yaml b/fuel-plugin/fuel_ping.yaml
index e367e98d1..550dfbc42 100644
--- a/fuel-plugin/fuel_ping.yaml
+++ b/fuel-plugin/fuel_ping.yaml
@@ -40,4 +40,4 @@ context:
networks:
test:
- cidr: '192.169.111.0/24'
+ cidr: '192.168.111.0/24'
diff --git a/fuel-plugin/pre_build_hook b/fuel-plugin/pre_build_hook
index 9446d2a1a..9c0a40e65 100755
--- a/fuel-plugin/pre_build_hook
+++ b/fuel-plugin/pre_build_hook
@@ -10,7 +10,9 @@ function build_pkg {
ubuntu)
rm -rf ${DIR}/repositories/ubuntu; mkdir -p ${DIR}/repositories/ubuntu
- # don't support online installation now
+ # fixme: don't support offline installation now since pip in
+ # deployment_scripts/install.sh needs to access to internet
+ #
# cd ${DIR}/repositories/ubuntu
# Use aptititude; apt-get -d will skip download if package is already installed
# sudo apt-get install aptitude -y
diff --git a/plugin/storperf.yaml b/plugin/storperf.yaml
new file mode 100644
index 000000000..d08e26eb6
--- /dev/null
+++ b/plugin/storperf.yaml
@@ -0,0 +1,13 @@
+---
+# StorPerf plugin configration file
+# Used for integration StorPerf into Yardstick as a plugin
+
+schema: "yardstick:plugin:0.1"
+
+plugins:
+ name: storperf
+
+deployment:
+ ip: 192.168.23.2
+ user: root
+ password: root
diff --git a/samples/computecapacity.yaml b/samples/computecapacity.yaml
index 0c6d46bf1..006b3ef3d 100644
--- a/samples/computecapacity.yaml
+++ b/samples/computecapacity.yaml
@@ -12,7 +12,7 @@ scenarios:
options:
nodes:
- host1: node5.LF
+ host: node5.LF
runner:
type: Iteration
diff --git a/samples/memload.yaml b/samples/memload.yaml
index 0acba21b1..87d727707 100644
--- a/samples/memload.yaml
+++ b/samples/memload.yaml
@@ -9,13 +9,14 @@ scenarios:
type: MEMORYload
options:
interval: 1
- count: 1
+ count: 10
host: kratos.demo
runner:
- type: Duration
- duration: 60
+ type: Iteration
+ iterations: 5
+ interval: 1
context:
name: demo
diff --git a/setup.py b/setup.py
index 8b37943ea..35037382c 100755
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,9 @@ setup(
'benchmark/scenarios/networking/*.txt',
'benchmark/scenarios/parser/*.sh',
'benchmark/scenarios/storage/*.bash',
- 'resources/files/*'
+ 'resources/files/*',
+ 'resources/scripts/install/*.bash',
+ 'resources/scripts/remove/*.bash'
]
},
url="https://www.opnfv.org",
diff --git a/tests/ci/prepare_env.sh b/tests/ci/prepare_env.sh
index ed832bc47..723a04aa1 100755
--- a/tests/ci/prepare_env.sh
+++ b/tests/ci/prepare_env.sh
@@ -52,3 +52,6 @@ fi
source $OPENRC
export EXTERNAL_NETWORK INSTALLER_TYPE DEPLOY_TYPE NODE_NAME
+
+# Prepare a admin-rc file for StorPerf integration
+$YARDSTICK_REPO_DIR/tests/ci/prepare_storperf_admin-rc.sh
diff --git a/tests/ci/prepare_storperf_admin-rc.sh b/tests/ci/prepare_storperf_admin-rc.sh
new file mode 100755
index 000000000..0401719ff
--- /dev/null
+++ b/tests/ci/prepare_storperf_admin-rc.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2016 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
+##############################################################################
+
+AUTH_URL=${OS_AUTH_URL}
+USERNAME=${OS_USERNAME:-admin}
+PASSWORD=${OS_PASSWORD:-console}
+TENANT_NAME=${OS_TENANT_NAME:-admin}
+VOLUME_API_VERSION=${OS_VOLUME_API_VERSION:-2}
+PROJECT_NAME=${OS_PROJECT_NAME:-$TENANT_NAME}
+TENANT_ID=`keystone tenant-get admin|grep 'id'|awk -F '|' '{print $3}'|sed -e 's/^[[:space:]]*//'`
+
+
+rm -f ~/storperf_admin-rc
+touch ~/storperf_admin-rc
+
+echo "OS_AUTH_URL="$AUTH_URL >> ~/storperf_admin-rc
+echo "OS_USERNAME="$USERNAME >> ~/storperf_admin-rc
+echo "OS_PASSWORD="$PASSWORD >> ~/storperf_admin-rc
+echo "OS_TENANT_NAME="$TENANT_NAME >> ~/storperf_admin-rc
+echo "OS_VOLUME_API_VERSION="$VOLUME_API_VERSION >> ~/storperf_admin-rc
+echo "OS_PROJECT_NAME="$PROJECT_NAME >> ~/storperf_admin-rc
+echo "OS_TENANT_ID="$TENANT_ID >> ~/storperf_admin-rc
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml
index 6f2952f97..d5754b966 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml
@@ -3,14 +3,16 @@
# Measure latency between NFVI nodes using ping
schema: "yardstick:task:0.1"
-
+{% set host = host or "node1.LF" %}
+{% set target = target or "node2.LF" %}
+{% set pod_info = pod_info or "etc/yardstick/nodes/compass_sclab_physical/pod.yaml" %}
scenarios:
-
type: Ping
options:
packetsize: 100
- host: node4.LF
- target: node5.LF
+ host: {{host}}
+ target: {{target}}
runner:
type: Duration
@@ -25,5 +27,5 @@ scenarios:
context:
type: Node
name: LF
- file: etc/yardstick/nodes/compass_sclab_physical/pod.yaml
+ file: {{pod_info}}
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc069.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc069.yaml
new file mode 100644
index 000000000..637e160c6
--- /dev/null
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc069.yaml
@@ -0,0 +1,38 @@
+---
+# Yardstick TC069 config file
+# Measure memory read and write bandwidth using ramspeed
+
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: Ramspeed
+ options:
+ type_id: 1
+ load: 32
+ block_size: 64
+
+ host: kratos.yardstick-TC069
+
+ runner:
+ type: Iteration
+ iterations: 5
+ interval: 1
+
+ sla:
+ min_bandwidth: 7000
+ action: monitor
+
+context:
+ name: yardstick-TC069
+ image: yardstick-trusty-server
+ flavor: yardstick-flavor
+ user: ubuntu
+
+ servers:
+ kratos:
+ floating_ip: true
+
+ networks:
+ test:
+ cidr: '10.0.1.0/24'
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml
new file mode 100644
index 000000000..644010916
--- /dev/null
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml
@@ -0,0 +1,85 @@
+---
+# Yardstick TC071 config file
+# Measure cache hit/miss ratio and usage, network throughput and latency.
+# Different amounts of flows are tested with, from 2 up to 1001000.
+# All tests are run 2 times each. First 2 times with the least
+# amount of ports, then 2 times with the next amount of ports,
+# and so on until all packet sizes have been run with.
+#
+# During the measurements cache hit/miss ration, cache usage statistics and
+# network latency are recorded/measured using cachestat and ping, respectively.
+
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: CACHEstat
+ run_in_background: true
+
+ options:
+ interval: 1
+
+ host: demeter.yardstick-TC071
+-
+ type: CACHEstat
+ run_in_background: true
+
+ options:
+ interval: 1
+
+ host: poseidon.yardstick-TC071
+-
+ type: Ping
+ run_in_background: true
+
+ options:
+ packetsize: 100
+
+ host: demeter.yardstick-TC071
+ target: poseidon.yardstick-TC071
+
+ sla:
+ max_rtt: 10
+ action: monitor
+{% for num_ports in [1, 10, 50, 100, 300, 500, 750, 1000] %}
+-
+ type: Pktgen
+ options:
+ packetsize: 64
+ number_of_ports: {{num_ports}}
+ duration: 20
+
+ host: demeter.yardstick-TC071
+ target: poseidon.yardstick-TC071
+
+ runner:
+ type: Iteration
+ iterations: 2
+ interval: 1
+
+ sla:
+ max_ppm: 1000
+ action: monitor
+{% endfor %}
+
+context:
+ name: yardstick-TC071
+ image: yardstick-trusty-server
+ flavor: yardstick-flavor
+ user: ubuntu
+
+ placement_groups:
+ pgrp1:
+ policy: "availability"
+
+ servers:
+ demeter:
+ floating_ip: true
+ placement: "pgrp1"
+ poseidon:
+ floating_ip: true
+ placement: "pgrp1"
+
+ networks:
+ test:
+ cidr: '10.0.1.0/24'
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc044.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc072.yaml
index d7406832d..f3e6d4c40 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc044.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc072.yaml
@@ -1,35 +1,35 @@
---
-# Yardstick TC044 config file
-# Measure memory usage statistics, network throughput, latency and packet loss.
+# Yardstick TC072 config file
+# Measure network throughput and packet loss using pktgen.
# Different amounts of flows are tested with, from 2 up to 1001000.
# All tests are run 2 times each. First 2 times with the least
# amount of ports, then 2 times with the next amount of ports,
# and so on until all packet sizes have been run with.
#
-# During the measurements memory usage statistics and network latency are
+# During the measurements network usage statistics and network latency are
# recorded/measured using sar and ping, respectively.
schema: "yardstick:task:0.1"
scenarios:
-
- type: MEMORYload
+ type: NetUtilization
run_in_background: true
options:
interval: 1
- count: 1
+ count: 10
- host: demeter.yardstick-TC044
+ host: demeter.yardstick-TC072
-
- type: MEMORYload
+ type: NetUtilization
run_in_background: true
options:
interval: 1
- count: 1
+ count: 10
- host: poseidon.yardstick-TC044
+ host: poseidon.yardstick-TC072
-
type: Ping
run_in_background: true
@@ -37,8 +37,8 @@ scenarios:
options:
packetsize: 100
- host: demeter.yardstick-TC044
- target: poseidon.yardstick-TC044
+ host: demeter.yardstick-TC072
+ target: poseidon.yardstick-TC072
sla:
max_rtt: 10
@@ -51,8 +51,8 @@ scenarios:
number_of_ports: {{num_ports}}
duration: 20
- host: demeter.yardstick-TC044
- target: poseidon.yardstick-TC044
+ host: demeter.yardstick-TC072
+ target: poseidon.yardstick-TC072
runner:
type: Iteration
@@ -65,7 +65,7 @@ scenarios:
{% endfor %}
context:
- name: yardstick-TC044
+ name: yardstick-TC072
image: yardstick-trusty-server
flavor: yardstick-flavor
user: ubuntu
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-ha_daily.yaml
new file mode 100644
index 000000000..d40125e36
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-ha_daily.yaml
@@ -0,0 +1,22 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-lxd-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
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-noha_daily.yaml
new file mode 100644
index 000000000..7c0785fe5
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-noha_daily.yaml
@@ -0,0 +1,22 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-lxd-noha"
+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
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml
index d5f7bf824..c6dadac20 100644
--- a/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml
@@ -7,16 +7,25 @@ name: "os-nosdn-nofeature-ha"
test_cases_dir: "tests/opnfv/test_cases/"
test_cases:
-
- file_name: opnfv_yardstick_tc002.yaml
+ file_name: opnfv_yardstick_tc002.yaml
-
- file_name: opnfv_yardstick_tc005.yaml
+ file_name: opnfv_yardstick_tc005.yaml
-
- file_name: opnfv_yardstick_tc010.yaml
+ file_name: opnfv_yardstick_tc010.yaml
-
- file_name: opnfv_yardstick_tc011.yaml
+ file_name: opnfv_yardstick_tc011.yaml
-
- file_name: opnfv_yardstick_tc012.yaml
+ file_name: opnfv_yardstick_tc012.yaml
-
- file_name: opnfv_yardstick_tc014.yaml
+ file_name: opnfv_yardstick_tc014.yaml
-
- file_name: opnfv_yardstick_tc037.yaml
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc043.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei_pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node4.LF","target": "node5.LF"}'
+
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-noha_daily.yaml
new file mode 100644
index 000000000..b0a340dbf
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-noha_daily.yaml
@@ -0,0 +1,22 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-nofeature-noha"
+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
diff --git a/tests/opnfv/test_suites/opnfv_os-ocl-nofeature-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-ocl-nofeature-noha_daily.yaml
new file mode 100644
index 000000000..9888935cc
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-ocl-nofeature-noha_daily.yaml
@@ -0,0 +1,22 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-ocl-nofeature-noha"
+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
diff --git a/tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-noha_daily.yaml
new file mode 100644
index 000000000..b94cdf755
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-noha_daily.yaml
@@ -0,0 +1,22 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-odl_l2-nofeature-noha"
+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
diff --git a/tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-noha_daily.yaml
new file mode 100644
index 000000000..458afba13
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-noha_daily.yaml
@@ -0,0 +1,22 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-odl_l2-sfc-noha"
+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
diff --git a/tests/opnfv/test_suites/opnfv_os-onos-nofeature-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-onos-nofeature-noha_daily.yaml
new file mode 100644
index 000000000..fd76673de
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-onos-nofeature-noha_daily.yaml
@@ -0,0 +1,22 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-onos-nofeature-noha"
+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
diff --git a/tests/unit/benchmark/scenarios/availability/test_attacker_general.py b/tests/unit/benchmark/scenarios/availability/test_attacker_general.py
index d6488a9a7..aa2e0cc4d 100644
--- a/tests/unit/benchmark/scenarios/availability/test_attacker_general.py
+++ b/tests/unit/benchmark/scenarios/availability/test_attacker_general.py
@@ -32,7 +32,8 @@ class GeneralAttackerServiceTestCase(unittest.TestCase):
'fault_type': 'general-attacker',
'action_parameter':{'process_name':'nova_api'},
'rollback_parameter':{'process_name':'nova_api'},
- 'key':'stop_service',
+ 'key':'stop-service',
+ 'attack_key':'stop-service',
'host': 'node1',
}
diff --git a/tests/unit/benchmark/scenarios/availability/test_basemonitor.py b/tests/unit/benchmark/scenarios/availability/test_basemonitor.py
index 140841075..a20cf8187 100644
--- a/tests/unit/benchmark/scenarios/availability/test_basemonitor.py
+++ b/tests/unit/benchmark/scenarios/availability/test_basemonitor.py
@@ -23,7 +23,7 @@ class MonitorMgrTestCase(unittest.TestCase):
def setUp(self):
config = {
'monitor_type': 'openstack-api',
- 'key' : 'service_status'
+ 'key' : 'service-status'
}
self.monitor_configs = []
@@ -40,7 +40,7 @@ class MonitorMgrTestCase(unittest.TestCase):
def test_MonitorMgr_getitem(self, mock_monitor):
monitorMgr = basemonitor.MonitorMgr()
monitorMgr.init_monitors(self.monitor_configs, None)
- monitorIns = monitorMgr['service_status']
+ monitorIns = monitorMgr['service-status']
class BaseMonitorTestCase(unittest.TestCase):
diff --git a/tests/unit/benchmark/scenarios/availability/test_baseoperation.py b/tests/unit/benchmark/scenarios/availability/test_baseoperation.py
index 8c341913f..d85f1e19f 100644
--- a/tests/unit/benchmark/scenarios/availability/test_baseoperation.py
+++ b/tests/unit/benchmark/scenarios/availability/test_baseoperation.py
@@ -22,7 +22,7 @@ class OperationMgrTestCase(unittest.TestCase):
def setUp(self):
config = {
'operation_type': 'general-operation',
- 'key' : 'service_status'
+ 'key' : 'service-status'
}
self.operation_configs = []
@@ -31,7 +31,7 @@ class OperationMgrTestCase(unittest.TestCase):
def test_all_successful(self, mock_operation):
mgr_ins = baseoperation.OperationMgr()
mgr_ins.init_operations(self.operation_configs, None)
- operation_ins = mgr_ins["service_status"]
+ operation_ins = mgr_ins["service-status"]
mgr_ins.rollback()
def test_getitem_fail(self, mock_operation):
@@ -59,7 +59,7 @@ class BaseOperationTestCase(unittest.TestCase):
def setUp(self):
self.config = {
'operation_type': 'general-operation',
- 'key' : 'service_status'
+ 'key' : 'service-status'
}
def test_all_successful(self):
diff --git a/tests/unit/benchmark/scenarios/availability/test_director.py b/tests/unit/benchmark/scenarios/availability/test_director.py
index 887ddd631..06116725d 100644
--- a/tests/unit/benchmark/scenarios/availability/test_director.py
+++ b/tests/unit/benchmark/scenarios/availability/test_director.py
@@ -33,16 +33,16 @@ class DirectorTestCase(unittest.TestCase):
'key': "kill-process"}],
'monitors': [{
'monitor_type': "general-monitor",
- 'key': "service_status"}],
+ 'key': "service-status"}],
'operations': [{
'operation_type': 'general-operation',
- 'key' : 'service_status'}],
+ 'key' : 'service-status'}],
'resultCheckers': [{
'checker_type': 'general-result-checker',
'key' : 'process-checker',}],
'steps':[
{
- 'actionKey': "service_status",
+ 'actionKey': "service-status",
'actionType': "operation",
'index': 1},
{
@@ -54,7 +54,7 @@ class DirectorTestCase(unittest.TestCase):
'actionType': "resultchecker",
'index': 3},
{
- 'actionKey': "service_status",
+ 'actionKey': "service-status",
'actionType': "monitor",
'index': 4},
]
@@ -69,12 +69,12 @@ class DirectorTestCase(unittest.TestCase):
def test_director_all_successful(self, mock_checer, mock_opertion, mock_attacker, mock_monitor):
ins = Director(self.scenario_cfg, self.ctx)
- opertion_action = ins.createActionPlayer("operation", "service_status")
+ opertion_action = ins.createActionPlayer("operation", "service-status")
attacker_action = ins.createActionPlayer("attacker", "kill-process")
checker_action = ins.createActionPlayer("resultchecker", "process-checker")
- monitor_action = ins.createActionPlayer("monitor", "service_status")
+ monitor_action = ins.createActionPlayer("monitor", "service-status")
- opertion_rollback = ins.createActionRollbacker("operation", "service_status")
+ opertion_rollback = ins.createActionRollbacker("operation", "service-status")
attacker_rollback = ins.createActionRollbacker("attacker", "kill-process")
ins.executionSteps.append(opertion_rollback)
ins.executionSteps.append(attacker_rollback)
diff --git a/tests/unit/benchmark/scenarios/availability/test_monitor_general.py b/tests/unit/benchmark/scenarios/availability/test_monitor_general.py
index 85487a574..de7d26cbf 100644
--- a/tests/unit/benchmark/scenarios/availability/test_monitor_general.py
+++ b/tests/unit/benchmark/scenarios/availability/test_monitor_general.py
@@ -31,18 +31,20 @@ class GeneralMonitorServiceTestCase(unittest.TestCase):
self.context = {"node1": host}
self.monitor_cfg = {
'monitor_type': 'general-monitor',
- 'key': 'service_status',
+ 'key': 'service-status',
+ 'monitor_key': 'service-status',
'host': 'node1',
'monitor_time': 3,
'parameter': {'serviceName': 'haproxy'},
- 'sla': {'max_recover_time': 1}
+ 'sla': {'max_outage_time': 1}
}
self.monitor_cfg_noparam = {
'monitor_type': 'general-monitor',
- 'key': 'service_status',
+ 'key': 'service-status',
+ 'monitor_key': 'service-status',
'host': 'node1',
'monitor_time': 3,
- 'sla': {'max_recover_time': 1}
+ 'sla': {'max_outage_time': 1}
}
def test__monitor_general_all_successful(self, mock_open, mock_ssh):
diff --git a/tests/unit/benchmark/scenarios/availability/test_operation_general.py b/tests/unit/benchmark/scenarios/availability/test_operation_general.py
index 6713733a8..26cd3f7c4 100644
--- a/tests/unit/benchmark/scenarios/availability/test_operation_general.py
+++ b/tests/unit/benchmark/scenarios/availability/test_operation_general.py
@@ -34,11 +34,13 @@ class GeneralOperaionTestCase(unittest.TestCase):
'action_parameter': {'ins_cup': 2},
'rollback_parameter': {'ins_id': 'id123456'},
'key': 'nova-create-instance',
+ 'operation_key': 'nova-create-instance',
'host': 'node1',
}
self.operation_cfg_noparam = {
'operation_type': 'general-operation',
'key': 'nova-create-instance',
+ 'operation_key': 'nova-create-instance',
'host': 'node1',
}
diff --git a/tests/unit/benchmark/scenarios/availability/test_result_checker_general.py b/tests/unit/benchmark/scenarios/availability/test_result_checker_general.py
index 88a9b9d20..bbadf0ac3 100644
--- a/tests/unit/benchmark/scenarios/availability/test_result_checker_general.py
+++ b/tests/unit/benchmark/scenarios/availability/test_result_checker_general.py
@@ -38,6 +38,7 @@ class GeneralResultCheckerTestCase(unittest.TestCase):
'condition' : 'eq',
'expectedValue' : 1,
'key' : 'process-checker',
+ 'checker_key' : 'process-checker',
'host': 'node1'
}
diff --git a/tests/unit/benchmark/scenarios/availability/test_scenario_general.py b/tests/unit/benchmark/scenarios/availability/test_scenario_general.py
index c17edea45..bab9d62f1 100644
--- a/tests/unit/benchmark/scenarios/availability/test_scenario_general.py
+++ b/tests/unit/benchmark/scenarios/availability/test_scenario_general.py
@@ -29,14 +29,14 @@ class ScenarioGeneralTestCase(unittest.TestCase):
'key': "kill-process"}],
'monitors': [{
'monitor_type': "general-monitor",
- 'key': "service_status"}],
+ 'key': "service-status"}],
'steps':[
{
'actionKey': "kill-process",
'actionType': "attacker",
'index': 1},
{
- 'actionKey': "service_status",
+ 'actionKey': "service-status",
'actionType': "monitor",
'index': 2}]
}
@@ -62,4 +62,4 @@ class ScenarioGeneralTestCase(unittest.TestCase):
mock_obj.verify.return_value = False
ins.director = mock_obj
ins.run(None)
- ins.teardown() \ No newline at end of file
+ ins.teardown()
diff --git a/tests/unit/benchmark/scenarios/compute/test_computecapacity.py b/tests/unit/benchmark/scenarios/compute/test_computecapacity.py
index 5745b7ec9..660bb3391 100644
--- a/tests/unit/benchmark/scenarios/compute/test_computecapacity.py
+++ b/tests/unit/benchmark/scenarios/compute/test_computecapacity.py
@@ -29,7 +29,7 @@ class ComputeCapacityTestCase(unittest.TestCase):
def setUp(self):
self.ctx = {
'nodes': {
- 'host1': {
+ 'host': {
'ip': '172.16.0.137',
'user': 'cirros',
'key_filename': "mykey.key",
diff --git a/tests/unit/benchmark/scenarios/networking/test_sfc.py b/tests/unit/benchmark/scenarios/networking/test_sfc.py
index 2d7990e59..618efc32e 100644
--- a/tests/unit/benchmark/scenarios/networking/test_sfc.py
+++ b/tests/unit/benchmark/scenarios/networking/test_sfc.py
@@ -45,8 +45,22 @@ class SfcTestCase(unittest.TestCase):
def test_run_for_success(self, mock_subprocess, mock_openstack, mock_ssh):
# Mock a successfull SSH in Sfc.setup() and Sfc.run()
mock_ssh.SSH().execute.return_value = (0, '100', '')
- mock_openstack.return_value = "127.0.0.1"
- mock_subprocess.return_value = 'mocked!'
+ mock_openstack.get_an_IP.return_value = "127.0.0.1"
+ mock_subprocess.call.return_value = 'mocked!'
+
+ result = {}
+ self.sfc.setup()
+ self.sfc.run(result)
+ self.sfc.teardown()
+
+ @mock.patch('yardstick.benchmark.scenarios.networking.sfc.ssh')
+ @mock.patch('yardstick.benchmark.scenarios.networking.sfc.sfc_openstack')
+ @mock.patch('yardstick.benchmark.scenarios.networking.sfc.subprocess')
+ def test2_run_for_success(self, mock_subprocess, mock_openstack, mock_ssh):
+ # Mock a successfull SSH in Sfc.setup() and Sfc.run()
+ mock_ssh.SSH().execute.return_value = (0, 'vxlan_tool.py', 'succeeded timed out')
+ mock_openstack.get_an_IP.return_value = "127.0.0.1"
+ mock_subprocess.call.return_value = 'mocked!'
result = {}
self.sfc.setup()
diff --git a/tests/unit/cmd/commands/no_constraint_no_args_scenario_sample.yaml b/tests/unit/cmd/commands/no_constraint_no_args_scenario_sample.yaml
new file mode 100644
index 000000000..4933b93ae
--- /dev/null
+++ b/tests/unit/cmd/commands/no_constraint_no_args_scenario_sample.yaml
@@ -0,0 +1,13 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-nofeature-ha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc043.yaml
+
diff --git a/tests/unit/cmd/commands/no_constraint_with_args_scenario_sample.yaml b/tests/unit/cmd/commands/no_constraint_with_args_scenario_sample.yaml
new file mode 100644
index 000000000..f39df7346
--- /dev/null
+++ b/tests/unit/cmd/commands/no_constraint_with_args_scenario_sample.yaml
@@ -0,0 +1,15 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-nofeature-ha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc043.yaml
+ task_args:
+ huawei-pod1: '{"host": "node1.LF","target": "node2.LF"}'
+
diff --git a/tests/unit/cmd/commands/test_task.py b/tests/unit/cmd/commands/test_task.py
index ccb0f2aec..0177fd08a 100644
--- a/tests/unit/cmd/commands/test_task.py
+++ b/tests/unit/cmd/commands/test_task.py
@@ -11,6 +11,7 @@
# Unittest for yardstick.cmd.commands.task
+import os
import mock
import unittest
@@ -71,3 +72,79 @@ class TaskCommandsTestCase(unittest.TestCase):
mock_os.environ.get.side_effect = ['compass', 'os-nosdn', 'huawei-pod1']
result = t._check_precondition(cfg)
self.assertTrue(result)
+
+ @mock.patch('yardstick.cmd.commands.task.os.environ')
+ def test_parse_suite_no_constraint_no_args(self, mock_environ):
+ SAMPLE_SCENARIO_PATH = "no_constraint_no_args_scenario_sample.yaml"
+ t = task.TaskParser(self._get_file_abspath(SAMPLE_SCENARIO_PATH))
+ mock_environ.get.side_effect = ['huawei-pod1', 'compass']
+ task_files, task_args, task_args_fnames = t.parse_suite()
+ print ("files=%s, args=%s, fnames=%s" % (task_files, task_args,
+ task_args_fnames))
+ self.assertEqual(task_files[0],
+ 'tests/opnfv/test_cases/opnfv_yardstick_tc037.yaml')
+ self.assertEqual(task_files[1],
+ 'tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml')
+ self.assertEqual(task_args[0], None)
+ self.assertEqual(task_args[1], None)
+ self.assertEqual(task_args_fnames[0], None)
+ self.assertEqual(task_args_fnames[1], None)
+
+ @mock.patch('yardstick.cmd.commands.task.os.environ')
+ def test_parse_suite_no_constraint_with_args(self, mock_environ):
+ SAMPLE_SCENARIO_PATH = "no_constraint_with_args_scenario_sample.yaml"
+ t = task.TaskParser(self._get_file_abspath(SAMPLE_SCENARIO_PATH))
+ mock_environ.get.side_effect = ['huawei-pod1', 'compass']
+ task_files, task_args, task_args_fnames = t.parse_suite()
+ print ("files=%s, args=%s, fnames=%s" % (task_files, task_args,
+ task_args_fnames))
+ self.assertEqual(task_files[0],
+ 'tests/opnfv/test_cases/opnfv_yardstick_tc037.yaml')
+ self.assertEqual(task_files[1],
+ 'tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml')
+ self.assertEqual(task_args[0], None)
+ self.assertEqual(task_args[1],
+ '{"host": "node1.LF","target": "node2.LF"}')
+ self.assertEqual(task_args_fnames[0], None)
+ self.assertEqual(task_args_fnames[1], None)
+
+ @mock.patch('yardstick.cmd.commands.task.os.environ')
+ def test_parse_suite_with_constraint_no_args(self, mock_environ):
+ SAMPLE_SCENARIO_PATH = "with_constraint_no_args_scenario_sample.yaml"
+ t = task.TaskParser(self._get_file_abspath(SAMPLE_SCENARIO_PATH))
+ mock_environ.get.side_effect = ['huawei-pod1', 'compass']
+ task_files, task_args, task_args_fnames = t.parse_suite()
+ print ("files=%s, args=%s, fnames=%s" % (task_files, task_args,
+ task_args_fnames))
+ self.assertEqual(task_files[0],
+ 'tests/opnfv/test_cases/opnfv_yardstick_tc037.yaml')
+ self.assertEqual(task_files[1],
+ 'tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml')
+ self.assertEqual(task_args[0], None)
+ self.assertEqual(task_args[1], None)
+ self.assertEqual(task_args_fnames[0], None)
+ self.assertEqual(task_args_fnames[1], None)
+
+ @mock.patch('yardstick.cmd.commands.task.os.environ')
+ def test_parse_suite_with_constraint_with_args(self, mock_environ):
+ SAMPLE_SCENARIO_PATH = "with_constraint_with_args_scenario_sample.yaml"
+ t = task.TaskParser(self._get_file_abspath(SAMPLE_SCENARIO_PATH))
+ mock_environ.get.side_effect = ['huawei-pod1', 'compass']
+ task_files, task_args, task_args_fnames = t.parse_suite()
+ print ("files=%s, args=%s, fnames=%s" % (task_files, task_args,
+ task_args_fnames))
+ self.assertEqual(task_files[0],
+ 'tests/opnfv/test_cases/opnfv_yardstick_tc037.yaml')
+ self.assertEqual(task_files[1],
+ 'tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml')
+ self.assertEqual(task_args[0], None)
+ self.assertEqual(task_args[1],
+ '{"host": "node1.LF","target": "node2.LF"}')
+ self.assertEqual(task_args_fnames[0], None)
+ self.assertEqual(task_args_fnames[1], None)
+
+ def _get_file_abspath(self, filename):
+ curr_path = os.path.dirname(os.path.abspath(__file__))
+ file_path = os.path.join(curr_path, filename)
+ return file_path
+
diff --git a/tests/unit/cmd/commands/with_constraint_no_args_scenario_sample.yaml b/tests/unit/cmd/commands/with_constraint_no_args_scenario_sample.yaml
new file mode 100644
index 000000000..8194a2361
--- /dev/null
+++ b/tests/unit/cmd/commands/with_constraint_no_args_scenario_sample.yaml
@@ -0,0 +1,16 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-nofeature-ha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc043.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+
diff --git a/tests/unit/cmd/commands/with_constraint_with_args_scenario_sample.yaml b/tests/unit/cmd/commands/with_constraint_with_args_scenario_sample.yaml
new file mode 100644
index 000000000..86c9b2800
--- /dev/null
+++ b/tests/unit/cmd/commands/with_constraint_with_args_scenario_sample.yaml
@@ -0,0 +1,18 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-nofeature-ha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc043.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"host": "node1.LF","target": "node2.LF"}'
+
diff --git a/yardstick/benchmark/contexts/node.py b/yardstick/benchmark/contexts/node.py
index 54ee076f4..c3d652119 100644
--- a/yardstick/benchmark/contexts/node.py
+++ b/yardstick/benchmark/contexts/node.py
@@ -82,6 +82,8 @@ class NodeContext(Context):
LOG.error("Nodes: %r" % nodes)
sys.exit(-1)
- node = nodes[0]
+ # A clone is created in order to avoid affecting the
+ # original one.
+ node = dict(nodes[0])
node["name"] = attr_name
return node
diff --git a/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py b/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py
index 018362a15..816e7e37d 100644
--- a/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py
+++ b/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py
@@ -31,6 +31,7 @@ class GeneralAttacker(BaseAttacker):
LOG.debug("ssh host success!")
self.key = self._config['key']
+ self.attack_key = self._config['attack_key']
if "action_parameter" in self._config:
actionParameter = self._config['action_parameter']
@@ -50,7 +51,7 @@ class GeneralAttacker(BaseAttacker):
l = list(item for item in rollbackParameter.values())
self.rollback_param = str.format(*l)
- self.fault_cfg = BaseAttacker.attacker_cfgs.get(self.key)
+ self.fault_cfg = BaseAttacker.attacker_cfgs.get(self.attack_key)
self.inject_script = self.get_script_fullpath(
self.fault_cfg['inject_script'])
self.recovery_script = self.get_script_fullpath(
diff --git a/yardstick/benchmark/scenarios/availability/attacker_conf.yaml b/yardstick/benchmark/scenarios/availability/attacker_conf.yaml
index 16b3d735c..e5d1b9f0b 100644
--- a/yardstick/benchmark/scenarios/availability/attacker_conf.yaml
+++ b/yardstick/benchmark/scenarios/availability/attacker_conf.yaml
@@ -12,6 +12,6 @@ bare-metal-down:
check_script: ha_tools/check_host_ping.bash
recovery_script: ha_tools/ipmi_power.bash
-stop_service:
+stop-service:
inject_script: ha_tools/stop_service.bash
recovery_script: ha_tools/start_service.bash
diff --git a/yardstick/benchmark/scenarios/availability/monitor/monitor_general.py b/yardstick/benchmark/scenarios/availability/monitor/monitor_general.py
index 515514c29..61efc0520 100644
--- a/yardstick/benchmark/scenarios/availability/monitor/monitor_general.py
+++ b/yardstick/benchmark/scenarios/availability/monitor/monitor_general.py
@@ -27,6 +27,7 @@ class GeneralMonitor(basemonitor.BaseMonitor):
user = host.get("user", "root")
key_filename = host.get("key_filename", "~/.ssh/id_rsa")
self.key = self._config["key"]
+ self.monitor_key = self._config["monitor_key"]
self.monitor_type = self._config["monitor_type"]
if "parameter" in self._config:
@@ -35,7 +36,8 @@ class GeneralMonitor(basemonitor.BaseMonitor):
l = list(item for item in parameter.values())
self.cmd_param = str.format(*l)
- self.monitor_cfg = basemonitor.BaseMonitor.monitor_cfgs.get(self.key)
+ self.monitor_cfg = basemonitor.BaseMonitor.monitor_cfgs.get(
+ self.monitor_key)
self.monitor_script = self.get_script_fullpath(
self.monitor_cfg['monitor_script'])
self.connection = ssh.SSH(user, ip, key_filename=key_filename)
@@ -59,7 +61,7 @@ class GeneralMonitor(basemonitor.BaseMonitor):
def verify_SLA(self):
LOG.debug("the _result:%s" % self._result)
outage_time = self._result.get('outage_time', None)
- max_outage_time = self._config["sla"]["max_recover_time"]
+ max_outage_time = self._config["sla"]["max_outage_time"]
if outage_time is None:
LOG.error("There is no outage_time in monitor result.")
return False
diff --git a/yardstick/benchmark/scenarios/availability/monitor_conf.yaml b/yardstick/benchmark/scenarios/availability/monitor_conf.yaml
index 9efceed88..d7bbdfe60 100644
--- a/yardstick/benchmark/scenarios/availability/monitor_conf.yaml
+++ b/yardstick/benchmark/scenarios/availability/monitor_conf.yaml
@@ -3,9 +3,9 @@
#
schema: "yardstick:task:0.1"
-process_status:
+process-status:
monitor_script: ha_tools/check_process_python.bash
-nova_image_list:
+nova-image-list:
monitor_script: ha_tools/nova_image_list.bash
-service_status:
+service-status:
monitor_script: ha_tools/check_service.bash
diff --git a/yardstick/benchmark/scenarios/availability/operation/operation_general.py b/yardstick/benchmark/scenarios/availability/operation/operation_general.py
index d41371629..e43f6e1d5 100644
--- a/yardstick/benchmark/scenarios/availability/operation/operation_general.py
+++ b/yardstick/benchmark/scenarios/availability/operation/operation_general.py
@@ -30,6 +30,7 @@ class GeneralOperaion(BaseOperation):
LOG.debug("ssh host success!")
self.key = self._config['key']
+ self.operation_key = self._config['operation_key']
if "action_parameter" in self._config:
actionParameter = self._config['action_parameter']
@@ -43,7 +44,8 @@ class GeneralOperaion(BaseOperation):
l = list(item for item in rollbackParameter.values())
self.rollback_param = str.format(*l)
- self.operation_cfgs = BaseOperation.operation_cfgs.get(self.key)
+ self.operation_cfgs = BaseOperation.operation_cfgs.get(
+ self.operation_key)
self.action_script = self.get_script_fullpath(
self.operation_cfgs['action_script'])
self.rollback_script = self.get_script_fullpath(
diff --git a/yardstick/benchmark/scenarios/availability/operation_conf.yaml b/yardstick/benchmark/scenarios/availability/operation_conf.yaml
index 78c996d05..1e6746302 100644
--- a/yardstick/benchmark/scenarios/availability/operation_conf.yaml
+++ b/yardstick/benchmark/scenarios/availability/operation_conf.yaml
@@ -7,10 +7,10 @@ nova-create-instance:
action_script: ha_tools/nova/create_instance_from_image.bash
rollback_script: ha_tools/nova/delete_instance.bash
-swift_upload_file:
+swift-upload-file:
action_script: ha_tools/swift/upload.bash
rollback_script: ha_tools/swift/delete.bash
-swift_download_file:
+swift-download-file:
action_script: ha_tools/swift/download.bash
- rollback_script: ha_tools/file/remove_file.bash \ No newline at end of file
+ rollback_script: ha_tools/file/remove_file.bash
diff --git a/yardstick/benchmark/scenarios/availability/result_checker/result_checker_general.py b/yardstick/benchmark/scenarios/availability/result_checker/result_checker_general.py
index 70bf9aea6..681fbf63f 100644
--- a/yardstick/benchmark/scenarios/availability/result_checker/result_checker_general.py
+++ b/yardstick/benchmark/scenarios/availability/result_checker/result_checker_general.py
@@ -32,6 +32,7 @@ class GeneralResultChecker(BaseResultChecker):
LOG.debug("ssh host success!")
self.key = self._config['key']
+ self.resultchecker_key = self._config['checker_key']
self.type = self._config['checker_type']
self.condition = self._config['condition']
self.expectedResult = self._config['expectedValue']
@@ -45,7 +46,7 @@ class GeneralResultChecker(BaseResultChecker):
self.shell_cmd = str.format(*l)
self.resultchecker_cfgs = BaseResultChecker.resultchecker_cfgs.get(
- self.key)
+ self.resultchecker_key)
self.verify_script = self.get_script_fullpath(
self.resultchecker_cfgs['verify_script'])
diff --git a/yardstick/benchmark/scenarios/compute/computecapacity.py b/yardstick/benchmark/scenarios/compute/computecapacity.py
index 366b470e8..0d7d76143 100644
--- a/yardstick/benchmark/scenarios/compute/computecapacity.py
+++ b/yardstick/benchmark/scenarios/compute/computecapacity.py
@@ -38,7 +38,7 @@ class ComputeCapacity(base.Scenario):
ComputeCapacity.TARGET_SCRIPT)
nodes = self.context_cfg['nodes']
- node = nodes.get('host1', None)
+ node = nodes.get('host', None)
host_user = node.get('user', 'ubuntu')
host_ip = node.get('ip', None)
host_pwd = node.get('password', 'root')
diff --git a/yardstick/benchmark/scenarios/networking/sfc_openstack.py b/yardstick/benchmark/scenarios/networking/sfc_openstack.py
index 2a5fbde1c..d1d45d8e4 100644
--- a/yardstick/benchmark/scenarios/networking/sfc_openstack.py
+++ b/yardstick/benchmark/scenarios/networking/sfc_openstack.py
@@ -1,5 +1,5 @@
import os
-from novaclient.v2 import client as novaclient
+from novaclient import client as novaclient
from neutronclient.v2_0 import client as neutronclient
diff --git a/yardstick/cmd/commands/plugin.py b/yardstick/cmd/commands/plugin.py
index e65c818fa..8e3ddb5a5 100644
--- a/yardstick/cmd/commands/plugin.py
+++ b/yardstick/cmd/commands/plugin.py
@@ -50,6 +50,8 @@ class PluginCommands(object):
print("Done, exiting")
+ @cliargs("input_file", type=str, help="path to plugin configuration file",
+ nargs=1)
def do_remove(self, args):
'''Remove a plugin.'''
@@ -74,7 +76,7 @@ class PluginCommands(object):
'''Deployment environment setup'''
target_script = plugin_name + ".bash"
self.script = pkg_resources.resource_filename(
- 'yardstick.resources', 'script/install/' + target_script)
+ 'yardstick.resources', 'scripts/install/' + target_script)
deployment_user = deployment.get("user")
deployment_ip = deployment.get("ip")
@@ -93,7 +95,7 @@ class PluginCommands(object):
'''Deployment environment setup'''
target_script = plugin_name + ".bash"
self.script = pkg_resources.resource_filename(
- 'yardstick.resources', 'script/remove/' + target_script)
+ 'yardstick.resources', 'scripts/remove/' + target_script)
deployment_user = deployment.get("user")
deployment_ip = deployment.get("ip")
diff --git a/yardstick/cmd/commands/task.py b/yardstick/cmd/commands/task.py
index 587f62412..18b72e726 100644
--- a/yardstick/cmd/commands/task.py
+++ b/yardstick/cmd/commands/task.py
@@ -59,33 +59,29 @@ class TaskCommands(object):
total_start_time = time.time()
parser = TaskParser(args.inputfile[0])
- suite_params = {}
if args.suite:
- suite_params = parser.parse_suite()
- test_cases_dir = suite_params["test_cases_dir"]
- if test_cases_dir[-1] != os.sep:
- test_cases_dir += os.sep
- task_files = [test_cases_dir + task
- for task in suite_params["task_fnames"]]
+ # 1.parse suite, return suite_params info
+ task_files, task_args, task_args_fnames = \
+ parser.parse_suite()
else:
task_files = [parser.path]
+ task_args = [args.task_args]
+ task_args_fnames = [args.task_args_file]
- task_args = suite_params.get("task_args", [args.task_args])
- task_args_fnames = suite_params.get("task_args_fnames",
- [args.task_args_file])
+ LOG.info("\ntask_files:%s, \ntask_args:%s, \ntask_args_fnames:%s",
+ task_files, task_args, task_args_fnames)
if args.parse_only:
sys.exit(0)
if os.path.isfile(args.output_file):
os.remove(args.output_file)
-
+ # parse task_files
for i in range(0, len(task_files)):
one_task_start_time = time.time()
parser.path = task_files[i]
- task_name = os.path.splitext(os.path.basename(task_files[i]))[0]
scenarios, run_in_parallel, meet_precondition = parser.parse_task(
- task_name, task_args[i], task_args_fnames[i])
+ task_args[i], task_args_fnames[i])
if not meet_precondition:
LOG.info("meet_precondition is %s, please check envrionment",
@@ -167,10 +163,34 @@ class TaskParser(object):
def __init__(self, path):
self.path = path
+ def _meet_constraint(self, task, cur_pod, cur_installer):
+ if "constraint" in task:
+ constraint = task.get('constraint', None)
+ if constraint is not None:
+ tc_fit_pod = constraint.get('pod', None)
+ tc_fit_installer = constraint.get('installer', None)
+ LOG.info("cur_pod:%s, cur_installer:%s,tc_constraints:%s",
+ cur_pod, cur_installer, constraint)
+ if cur_pod and tc_fit_pod and cur_pod not in tc_fit_pod:
+ return False
+ if cur_installer and tc_fit_installer and \
+ cur_installer not in tc_fit_installer:
+ return False
+ return True
+
+ def _get_task_para(self, task, cur_pod):
+ task_args = task.get('task_args', None)
+ if task_args is not None:
+ task_args = task_args.get(cur_pod, None)
+ task_args_fnames = task.get('task_args_fnames', None)
+ if task_args_fnames is not None:
+ task_args_fnames = task_args_fnames.get(cur_pod, None)
+ return task_args, task_args_fnames
+
def parse_suite(self):
'''parse the suite file and return a list of task config file paths
and lists of optional parameters if present'''
- print "Parsing suite file:", self.path
+ LOG.info("\nParsing suite file:%s", self.path)
try:
with open(self.path) as stream:
@@ -179,35 +199,40 @@ class TaskParser(object):
sys.exit(ioerror)
self._check_schema(cfg["schema"], "suite")
- print "Starting suite:", cfg["name"]
+ LOG.info("\nStarting scenario:%s", cfg["name"])
test_cases_dir = cfg.get("test_cases_dir", test_cases_dir_default)
- task_fnames = []
- task_args = []
- task_args_fnames = []
+ if test_cases_dir[-1] != os.sep:
+ test_cases_dir += os.sep
+
+ cur_pod = os.environ.get('NODE_NAME', None)
+ cur_installer = os.environ.get('INSTALL_TYPE', None)
+
+ valid_task_files = []
+ valid_task_args = []
+ valid_task_args_fnames = []
for task in cfg["test_cases"]:
- task_fnames.append(task["file_name"])
- if "task_args" in task:
- task_args.append(task["task_args"])
+ # 1.check file_name
+ if "file_name" in task:
+ task_fname = task.get('file_name', None)
+ if task_fname is None:
+ continue
else:
- task_args.append(None)
-
- if "task_args_file" in task:
- task_args_fnames.append(task["task_args_file"])
+ continue
+ # 2.check constraint
+ if self._meet_constraint(task, cur_pod, cur_installer):
+ valid_task_files.append(test_cases_dir + task_fname)
else:
- task_args_fnames.append(None)
-
- suite_params = {
- "test_cases_dir": test_cases_dir,
- "task_fnames": task_fnames,
- "task_args": task_args,
- "task_args_fnames": task_args_fnames
- }
+ continue
+ # 3.fetch task parameters
+ task_args, task_args_fnames = self._get_task_para(task, cur_pod)
+ valid_task_args.append(task_args)
+ valid_task_args_fnames.append(task_args_fnames)
- return suite_params
+ return valid_task_files, valid_task_args, valid_task_args_fnames
- def parse_task(self, task_name, task_args=None, task_args_file=None):
+ def parse_task(self, task_args=None, task_args_file=None):
'''parses the task file and return an context and scenario instances'''
print "Parsing task config:", self.path
@@ -262,6 +287,7 @@ class TaskParser(object):
# add tc and task id for influxdb extended tags
task_id = str(uuid.uuid4())
for scenario in cfg["scenarios"]:
+ task_name = os.path.splitext(os.path.basename(self.path))[0]
scenario["tc"] = task_name
scenario["task_id"] = task_id
diff --git a/yardstick/resources/script/install/storperf.bash b/yardstick/resources/script/install/storperf.bash
new file mode 100644
index 000000000..9bbec7206
--- /dev/null
+++ b/yardstick/resources/script/install/storperf.bash
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2016 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
+##############################################################################
+
+# StorPerf plugin installation script
+# After installation, it will run StorPerf container on Jump Host
+# Requirements:
+# 1. docker has been installed on the Jump Host
+# 2. Openstack environment file for storperf, '~/storperf_admin-rc', is ready.
+
+set -e
+
+mkdir -p /tmp/storperf-yardstick
+
+docker pull opnfv/storperf
+docker run -t \
+--env-file ~/storperf_admin-rc \
+-p 5000:5000 -p 8000:8000 \
+-v /tmp/storperf-yardstick/carbon:/opt/graphite/storage/whisper \
+--name storperf-yardstick opnfv/storperf &
diff --git a/yardstick/resources/script/remove/storperf.bash b/yardstick/resources/script/remove/storperf.bash
new file mode 100644
index 000000000..a8eb51c89
--- /dev/null
+++ b/yardstick/resources/script/remove/storperf.bash
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2016 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
+##############################################################################
+
+# StorPerf plugin un-installation script
+
+set -e
+
+docker stop storperf-yardstick
+docker rm -f storperf-yardstick
+docker rmi opnfv/storperf
+
+rm -rf /tmp/storperf-yardstick
diff --git a/yardstick/resources/script/install/sample.bash b/yardstick/resources/scripts/install/sample.bash
index 21eb14680..21eb14680 100644
--- a/yardstick/resources/script/install/sample.bash
+++ b/yardstick/resources/scripts/install/sample.bash
diff --git a/yardstick/resources/script/remove/sample.bash b/yardstick/resources/scripts/remove/sample.bash
index 15618df2d..15618df2d 100644
--- a/yardstick/resources/script/remove/sample.bash
+++ b/yardstick/resources/scripts/remove/sample.bash