Committers:
jorgen.w.karlsson@ericsson.com
-houjingwen@huawei.com
-wenjing_chu@dell.com
-liangqi1@huawei.com
jean.gaoliang@huawei.com
vincenzo.m.riccobene@intel.com
+lvjing5@huawei.com
+wu.zhihui1@zte.com.cn
+14_ykl@tongji.edu.cn
+limingjiang@huawei.com
Link to TSC approval: http://meetbot.opnfv.org/meetings/
-Link to approval of additional submitters:
+Link to approval of additional submitters:
Link to approval of new PTL: Done via Condorcet Internet Voting Service, avaliable from Raymond Piak
--- /dev/null
+{
+ "id": 42,
+ "title": "KVMFORNFV-Cyclictest",
+ "tags": [
+ "kvmfornfv-cyclictest"
+ ],
+ "style": "dark",
+ "timezone": "browser",
+ "editable": true,
+ "hideControls": false,
+ "sharedCrosshair": false,
+ "rows": [
+ {
+ "collapse": false,
+ "editable": true,
+ "height": "",
+ "panels": [
+ {
+ "content": "<h5 style=\"font-family:Verdana\"> <a style=\"color:#31A7D3\"><center>OPNFV_KVMFORNFV_Cyclictest - Real time benchmark</center> </a></h5>\n<center>\n<p>Cyclictest is used to test the guest timer latency with idle host/guest,Host memory stress and Host CPU stress.\nFor more information see <a style=\"color:#31A7D3\"; href=\"https://wiki.opnfv.org/display/kvm/KVM4NFV+Test++Environment\">Cyclictest</a></p>\n</center>\n\n\n",
+ "editable": true,
+ "error": false,
+ "id": 6,
+ "isNew": true,
+ "links": [],
+ "mode": "html",
+ "span": 12,
+ "title": "",
+ "type": "text"
+ }
+ ],
+ "title": "New row"
+ },
+ {
+ "collapse": false,
+ "editable": true,
+ "height": "",
+ "panels": [
+ {
+ "content": "",
+ "editable": true,
+ "error": false,
+ "id": 9,
+ "isNew": true,
+ "links": [],
+ "mode": "markdown",
+ "span": 12,
+ "style": {},
+ "title": "Test Case Execution",
+ "type": "text"
+ }
+ ],
+ "title": "New row"
+ },
+ {
+ "collapse": false,
+ "editable": true,
+ "height": "300px",
+ "panels": [
+ {
+ "aliasColors": {
+ "kvmfornfv_cyclictest_idle_idle.avg": "#7EB26D",
+ "kvmfornfv_cyclictest_idle_idle.max": "#6ED0E0",
+ "kvmfornfv_cyclictest_idle_idle.min": "#EAB839"
+ },
+ "bars": false,
+ "datasource": "yardstick-vtc",
+ "decimals": null,
+ "editable": true,
+ "error": false,
+ "fill": 0,
+ "grid": {
+ "threshold1": null,
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
+ "threshold2": null,
+ "threshold2Color": "rgba(234, 112, 112, 0.22)"
+ },
+ "id": 10,
+ "isNew": true,
+ "legend": {
+ "alignAsTable": true,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": true,
+ "rightSide": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "minSpan": 12,
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 2,
+ "points": true,
+ "renderer": "flot",
+ "seriesOverrides": [
+ {
+ "alias": "kvmfornfv_cyclictest_idle_idle.min",
+ "yaxis": 1
+ }
+ ],
+ "span": 12,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "dsType": "influxdb",
+ "groupBy": [],
+ "measurement": "kvmfornfv_cyclictest_idle_idle",
+ "policy": "default",
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "avg"
+ ],
+ "type": "field"
+ }
+ ],
+ [
+ {
+ "params": [
+ "max"
+ ],
+ "type": "field"
+ }
+ ],
+ [
+ {
+ "params": [
+ "min"
+ ],
+ "type": "field"
+ }
+ ]
+ ],
+ "tags": []
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "kvmfornfv_cyclictest_idle_idle",
+ "tooltip": {
+ "msResolution": true,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "xaxis": {
+ "show": true
+ },
+ "yaxes": [
+ {
+ "format": "µs",
+ "label": "Latency",
+ "logBase": 10,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ]
+ },
+ {
+ "aliasColors": {
+ "kvmfornfv_cyclictest_idle_idle.avg": "#7EB26D"
+ },
+ "bars": false,
+ "datasource": "yardstick-vtc",
+ "decimals": null,
+ "editable": true,
+ "error": false,
+ "fill": 2,
+ "grid": {
+ "threshold1": 100,
+ "threshold1Color": "rgb(227, 225, 213)",
+ "threshold2": null,
+ "threshold2Color": "rgba(199, 177, 177, 0)",
+ "thresholdLine": true
+ },
+ "hideTimeOverride": false,
+ "id": 11,
+ "isNew": true,
+ "legend": {
+ "alignAsTable": true,
+ "avg": false,
+ "current": true,
+ "hideEmpty": false,
+ "hideZero": false,
+ "max": true,
+ "min": true,
+ "rightSide": false,
+ "show": true,
+ "sideWidth": 100,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "minSpan": 5,
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 2,
+ "points": true,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "span": 6,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "dsType": "influxdb",
+ "groupBy": [],
+ "measurement": "kvmfornfv_cyclictest_idle_idle",
+ "policy": "default",
+ "query": "SELECT \"avg\" FROM \"kvmfornfv_cyclictest_idle_idle\" WHERE $timeFilter",
+ "rawQuery": true,
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "avg"
+ ],
+ "type": "field"
+ }
+ ]
+ ],
+ "tags": []
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "AVG Graph",
+ "tooltip": {
+ "msResolution": true,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "xaxis": {
+ "show": true
+ },
+ "yaxes": [
+ {
+ "format": "µs",
+ "label": "Latency",
+ "logBase": 1024,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": "",
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ]
+ },
+ {
+ "aliasColors": {
+ "kvmfornfv_cyclictest_idle_idle.min": "#EAB839"
+ },
+ "bars": false,
+ "datasource": "yardstick-vtc",
+ "editable": true,
+ "error": false,
+ "fill": 2,
+ "grid": {
+ "threshold1": 50,
+ "threshold1Color": "#ebe9d9",
+ "threshold2": null,
+ "threshold2Color": "#e9d8d8",
+ "thresholdLine": true
+ },
+ "id": 12,
+ "isNew": true,
+ "legend": {
+ "alignAsTable": true,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": true,
+ "rightSide": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "minSpan": 5,
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 2,
+ "points": true,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "span": 6,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "dsType": "influxdb",
+ "groupBy": [],
+ "measurement": "kvmfornfv_cyclictest_idle_idle",
+ "policy": "default",
+ "query": "SELECT \"min\" FROM \"kvmfornfv_cyclictest_idle_idle\" WHERE $timeFilter",
+ "rawQuery": false,
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "min"
+ ],
+ "type": "field"
+ }
+ ]
+ ],
+ "tags": []
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "MIN Graph",
+ "tooltip": {
+ "msResolution": true,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "xaxis": {
+ "show": true
+ },
+ "yaxes": [
+ {
+ "format": "µs",
+ "label": "Latency",
+ "logBase": 1024,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ]
+ },
+ {
+ "aliasColors": {
+ "kvmfornfv_cyclictest_idle_idle.max": "#6ED0E0"
+ },
+ "bars": false,
+ "datasource": "yardstick-vtc",
+ "editable": true,
+ "error": false,
+ "fill": 2,
+ "grid": {
+ "threshold1": 1000,
+ "threshold1Color": "#e9e7d6",
+ "threshold2": null,
+ "threshold2Color": "rgba(234, 112, 112, 0.22)",
+ "thresholdLine": true
+ },
+ "id": 13,
+ "isNew": true,
+ "legend": {
+ "alignAsTable": true,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": true,
+ "rightSide": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "minSpan": 5,
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 2,
+ "points": true,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "span": 6,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "dsType": "influxdb",
+ "groupBy": [],
+ "hide": false,
+ "measurement": "kvmfornfv_cyclictest_idle_idle",
+ "policy": "default",
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "max"
+ ],
+ "type": "field"
+ }
+ ]
+ ],
+ "tags": []
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "MAX Graph",
+ "tooltip": {
+ "msResolution": true,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "transparent": false,
+ "type": "graph",
+ "xaxis": {
+ "show": true
+ },
+ "yaxes": [
+ {
+ "format": "µs",
+ "label": "Latency",
+ "logBase": 1024,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ]
+ }
+ ],
+ "title": "Row"
+ }
+ ],
+ "time": {
+ "from": "now-7d",
+ "to": "now"
+ },
+ "timepicker": {
+ "refresh_intervals": [
+ "5s",
+ "10s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ],
+ "time_options": [
+ "5m",
+ "15m",
+ "1h",
+ "6h",
+ "12h",
+ "24h",
+ "2d",
+ "7d",
+ "30d"
+ ]
+ },
+ "templating": {
+ "list": []
+ },
+ "annotations": {
+ "list": []
+ },
+ "refresh": "1d",
+ "schemaVersion": 12,
+ "version": 1,
+ "links": [],
+ "gnetId": null
+}
| *Date* | *Version* | *Comment* |
| | | |
+----------------+--------------------+---------------------------------+
+| Oct 27nd, 2016 | 2.0 | Yardstick for Colorado release |
+| | | |
++----------------+--------------------+---------------------------------+
| Aug 22nd, 2016 | 1.0 | Yardstick for Colorado release |
| | | |
+----------------+--------------------+---------------------------------+
| **Project** | Yardstick |
| | |
+--------------------------------------+--------------------------------------+
-| **Repo/tag** | yardstick/colorado.1.0 |
+| **Repo/tag** | yardstick/colorado.2.0 |
| | |
+--------------------------------------+--------------------------------------+
-| **Yardstick Docker image tag** | colorado.1.0 |
+| **Yardstick Docker image tag** | colorado.2.0 |
| | |
+--------------------------------------+--------------------------------------+
-| **Release designation** | Colorado base release |
+| **Release designation** | Colorado |
| | |
+--------------------------------------+--------------------------------------+
-| **Release date** | September 22 2016 |
+| **Release date** | October 27 2016 |
| | |
+--------------------------------------+--------------------------------------+
-| **Purpose of the delivery** | Colorado base release |
+| **Purpose of the delivery** | OPNFV Colorado release 2.0 |
| | |
+--------------------------------------+--------------------------------------+
Software Deliverables
---------------------
-**Yardstick framework source code <colorado.1.0>**
+**Yardstick framework source code <colorado.2.0>**
+--------------------------------------+--------------------------------------+
| **Project** | Yardstick |
| | |
+--------------------------------------+--------------------------------------+
-| **Repo/tag** | yardstick/colorado.1.0 |
+| **Repo/tag** | yardstick/colorado.2.0 |
| | |
+--------------------------------------+--------------------------------------+
-| **Yardstick Docker image tag** | colorado.1.0 |
+| **Yardstick Docker image tag** | colorado.2.0 |
| | |
+--------------------------------------+--------------------------------------+
-| **Release designation** | colorado |
+| **Release designation** | Colorado |
| | |
+--------------------------------------+--------------------------------------+
-| **Release date** | September 22th, 2016 |
+| **Release date** | October 27th, 2016 |
| | |
+--------------------------------------+--------------------------------------+
| **Purpose of the delivery** | OPNFV Colorado release |
Module Version Changes
----------------------
-This is the third tracked release of Yardstick. It is based on following
+This is the second tracked release of Yardstick. It is based on following
upstream versions:
- ONOS Goldeneye
Document Version Changes
------------------------
-This is the first tracked version of the Yardstick framework in OPNFV.
+This is the second tracked version of the Yardstick framework in OPNFV.
It includes the following documentation updates:
- Yardstick User Guide: added yardstick plugin chapter; added Store Other
Feature additions
-----------------
- Yardstick plugin
+ - Yardstick reporting
+ - StorPerf Integration
Scenario Matrix
===============
-For Colorado 1.0, Yardstick was tested on the following scenarios:
+For Colorado 2.0, Yardstick was tested on the following scenarios:
+-------------------------+---------+---------+---------+---------+
| Scenario | Apex | Compass | Fuel | Joid |
+-------------------------+---------+---------+---------+---------+
| os-nosdn-kvm-noha | | X | | |
+-------------------------+---------+---------+---------+---------+
-| os-nosdn-ovs-ha | | | | |
+| os-nosdn-ovs-ha | | | X | |
+-------------------------+---------+---------+---------+---------+
-| os-nosdn-ovs-noha | X | X | | |
+| os-nosdn-ovs-noha | X | | X | |
+-------------------------+---------+---------+---------+---------+
| os-ocl-nofeature-ha | | | | |
+-------------------------+---------+---------+---------+---------+
Known Issues/Faults
------------
- - Boot up VM failed in joid-os-nosdn-lxd-ha and joid-os-nosdn-lxd-noha scenarios
- - Yardstick CI job timeout in fuel-os-onos-nofeature-ha scenario
- - SSH timeout in apex-os-onos-sfc-ha, apex-os-onos-nofeature-ha scenarios
+ - Floating IP not supported in bgpvpn scenario
- Floating IP not supported in apex-os-odl_l3-nofeature-ha scenario
- - Scp /home/stack/overcloudrc failed in apex-os-nosdn-ovs-noha and apex-os-odl_l2-sfc-noha scenarios
.. note:: The faults not related to *Yardstick* framework, addressing scenarios
which were not fully verified, are listed in the OPNFV installer's release
Corrected Faults
----------------
-* TODO *
-
-Colorado known restrictions/issues
+Colorado.2.0:
+
++----------------------------+------------------------------------------------+
+| **JIRA REFERENCE** | **SLOGAN** |
+| | |
++----------------------------+------------------------------------------------+
+| JIRA: YARDSTICK-325 | Provide raw format yardstick vm image for |
+| | nova-lxd scenario. |
+| | |
++----------------------------+------------------------------------------------+
+| JIRA: YARDSTICK-358 | tc027 ipv6 test case to de-coupling to the |
+| | installers. |
+| | |
++----------------------------+------------------------------------------------+
+| JIRA: YARDSTICK-359 | ipv6 testcase disable port-security on |
+| | vRouter. |
+| | |
++----------------------------+------------------------------------------------+
+| JIRA: YARDSTICK-363 | ipv6 testcase to support fuel. |
+| | |
++----------------------------+------------------------------------------------+
+| JIRA: YARDSTICK-367 | Add d3 graph presentation to yardstick |
+| | reporting. |
+| | |
++----------------------------+------------------------------------------------+
+| JIRA: YARDSTICK-371 | Provide raw format yardstick vm image for |
+| | nova-lxd scenario. |
+| | |
++----------------------------+------------------------------------------------+
+| JIRA: YARDSTICK-372 | cannot find yardstick-img-dpdk-modify and |
+| | yardstick-img-lxd-modify in environment |
+| | varibales. |
+| | |
++----------------------------+------------------------------------------------+
+
+
+Colorado 2.0 known restrictions/issues
==================================
+-----------+-----------+----------------------------------------------+
| Installer | Scenario | Issue |
| | | addresses fail because of a known ODL bug. |
| | | https://jira.opnfv.org/browse/APEX-112 |
+-----------+-----------+----------------------------------------------+
-| apex | *-fdio | Due to late integration, fdio scenarios' |
-| | | test suite file is not provided. |
-+-----------+-----------+----------------------------------------------+
-| joid | *-lxd | In the LXD scenarios, nova-lxd does not |
-| | | support qcow2 Images. |
-| | | https://jira.opnfv.org/browse/YARDSTICK-325 |
-+-----------+-----------+----------------------------------------------+
Open JIRA tickets
=================
-+------------------+-----------------------------------------------+
-| JIRA | Description |
-+==================+===============================================+
-| `YARDSTICK-325`_ | Add imge format support for LXD scenario |
-| | |
-+------------------+-----------------------------------------------+
-
Useful links
============
.. _`YARDSTICK-325` : https://jira.opnfv.org/browse/YARDSTICK-325
+.. _`YARDSTICK-358` : https://jira.opnfv.org/browse/YARDSTICK-358
+
+.. _`YARDSTICK-359` : https://jira.opnfv.org/browse/YARDSTICK-359
+
+.. _`YARDSTICK-363` : https://jira.opnfv.org/browse/YARDSTICK-363
+
+.. _`YARDSTICK-367` : https://jira.opnfv.org/browse/YARDSTICK-367
+
+.. _`YARDSTICK-371` : https://jira.opnfv.org/browse/YARDSTICK-371
+
+.. _`YARDSTICK-372` : https://jira.opnfv.org/browse/YARDSTICK-372
Detailed test results
---------------------
-The scenario was run on Intel POD5_ with:
+The scenario was run on Intel POD6_ with:
Joid
OpenStack Mitaka
Onos Goldeneye
os-odl_l2-bgpvpn-ha.rst
os-odl_l2-sfc-ha.rst
os-nosdn-kvm-ha.rst
- os-onos-nofeature-h.rst
+ os-onos-nofeature-ha.rst
os-onos-sfc-ha.rst
Test results of executed tests are avilable in Dashboard_ and logs in Jenkins_.
a) Running test cases in different enveriment deployed by different installers,
such as compass4nfv, apex and joid, with different versiones.
b) The period of each request is a little long, it needs more accurate test
- method.
+method.
c) More test cases with different faults and different monitors are needed.
+---------+-------------------+----------------+------------------------------+
| Compute | TC003 [1]_ | TC003 [1]_ | TC013 [1]_ |
| | TC004 | TC004 | TC015 [1]_ |
-| | TC014 | TC010 | |
-| | TC024 | TC012 | |
-| | TC069 | TC055 | |
+| | TC010 | TC024 | |
+| | TC012 | TC055 | |
+| | TC014 | | |
+| | TC069 | | |
+---------+-------------------+----------------+------------------------------+
-| Network | TC001 | TC001 | TC016 [1]_ |
-| | TC002 | TC008 | TC018 [1]_ |
-| | TC011 | TC009 | |
-| | TC073 | TC075 | |
+| Network | TC001 | TC044 | TC016 [1]_ |
+| | TC002 | TC073 | TC018 [1]_ |
+| | TC009 | TC075 | |
+| | TC011 | | |
+| | TC042 | | |
+| | TC043 | | |
+---------+-------------------+----------------+------------------------------+
-| Storage | TC005 | TC005 | TC017 [1]_ |
-| | | TC063 | |
+| Storage | TC005 | TC063 | TC017 [1]_ |
+---------+-------------------+----------------+------------------------------+
.. note:: The description in this OPNFV document is intended as a reference for
Abstract
--------
-Yardstick supports installation on Ubuntu 14.04 or by using a Docker image.
-The installation procedure on Ubuntu 14.04 or via the docker image are
-detailed in the section below.
+Yardstick supports installation on Ubuntu 14.04 or via a Docker image. The
+installation procedure on Ubuntu 14.04 or via the docker image are detailed in
+the section below.
-To use Yardstick you should have access to an OpenStack environment,
-with at least Nova, Neutron, Glance, Keystone and Heat installed.
+To use Yardstick you should have access to an OpenStack environment, with at
+least Nova, Neutron, Glance, Keystone and Heat installed.
The steps needed to run Yardstick are:
1. Install Yardstick.
-2. Create the test configuration .yaml file.
-3. Build a guest image。
-4. Load the image into the OpenStack environment.
-5. Create a Neutron external network.
-6. Load OpenStack environment variables.
-6. Run the test case.
+2. Load OpenStack environment variables.
+3. Create a Neutron external network.
+4. Build Yardstick flavor and a guest image.
+5. Load the guest image into the OpenStack environment.
+6. Create the test configuration .yaml file.
+7. Run the test case.
+
+
+Prerequisites
+-------------
+
+The OPNFV deployment is out of the scope of this document but it can be
+found in http://artifacts.opnfv.org/opnfvdocs/colorado/docs/configguide/index.html.
+The OPNFV platform is considered as the System Under Test (SUT) in this
+document.
+
+Several prerequisites are needed for Yardstick:
+
+ #. A Jumphost to run Yardstick on
+ #. A Docker daemon shall be installed on the Jumphost
+ #. A public/external network created on the SUT
+ #. Connectivity from the Jumphost to the SUT public/external network
+
+WARNING: Connectivity from Jumphost is essential and it is of paramount
+importance to make sure it is working before even considering to install
+and run Yardstick. Make also sure you understand how your networking is
+designed to work.
+
+NOTE: **Jumphost** refers to any server which meets the previous
+requirements. Normally it is the same server from where the OPNFV
+deployment has been triggered previously.
+
+NOTE: If your Jumphost is operating behind a company http proxy and/or
+Firewall, please consult first the section `Proxy Support`_, towards
+the end of this document. The section details some tips/tricks which
+*may* be of help in a proxified environment.
Installing Yardstick on Ubuntu 14.04
.. _install-framework:
You can install Yardstick framework directly on Ubuntu 14.04 or in an Ubuntu
-14.04 Docker image.
-No matter which way you choose to install Yardstick framework, the following
-installation steps are identical.
+14.04 Docker image. No matter which way you choose to install Yardstick
+framework, the following installation steps are identical.
+
If you choose to use the Ubuntu 14.04 Docker image, You can pull the Ubuntu
14.04 Docker image from Docker hub:
Installing Yardstick using Docker
---------------------------------
-Yardstick iteself has a Docker image, this Docker image (**Yardstick-stable**)
+Yardstick has a Docker image, this Docker image (**Yardstick-stable**)
serves as a replacement for installing the Yardstick framework in a virtual
environment (for example as done in :ref:`install-framework`).
It is recommended to use this Docker image to run Yardstick test.
-Yardstick-stable image
-^^^^^^^^^^^^^^^^^^^^^^
-Pull the Yardstick-stable Docker image from Docker hub:
+Pulling the Yardstick Docker image
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. _dockerhub: https://hub.docker.com/r/opnfv/yardstick/
+
+Pull the Yardstick Docker image ('opnfv/yardstick') from the public dockerhub
+registry under the OPNFV account: [dockerhub_], with the following docker
+command::
docker pull opnfv/yardstick:stable
+After pulling the Docker image, check that it is available with the
+following docker command::
+
+ [yardsticker@jumphost ~]$ docker images
+ REPOSITORY TAG IMAGE ID CREATED SIZE
+ opnfv/yardstick stable a4501714757a 1 day ago 915.4 MB
+
Run the Docker image:
::
- docker run --privileged=true -it openfv/yardstick /bin/bash
+ docker run --privileged=true -it opnfv/yardstick:stable /bin/bash
-In the container run yardstick task command to execute a test case.
-Before executing Yardstick test case, make sure that yardstick-trusty-server
-image and yardstick flavor is available in OpenStack.
-Detailed steps about creating yardstick flavor and building yardstick-trusty-server
-image can be found below.
+In the container the Yardstick repository is located in the /home/opnfv/repos
+directory.
OpenStack parameters and credentials
------------------------------------
-Yardstick-flavor
-^^^^^^^^^^^^^^^^
-Most of the sample test cases in Yardstick are using an OpenStack flavor called
-*yardstick-flavor* which deviates from the OpenStack standard m1.tiny flavor by the
-disk size - instead of 1GB it has 3GB. Other parameters are the same as in m1.tiny.
-
-Create yardstick-flavor:
-
-::
-
- nova flavor-create yardstick-flavor 100 512 3 1
-
Environment variables
^^^^^^^^^^^^^^^^^^^^^
Before running Yardstick it is necessary to export OpenStack environment variables
* OS_PASSWORD
* OS_TENANT_NAME
+A sample openrc file may look like this:
+
+* export OS_PASSWORD=console
+* export OS_TENANT_NAME=admin
+* export OS_AUTH_URL=http://172.16.1.222:35357/v2.0
+* export OS_USERNAME=admin
+* export OS_VOLUME_API_VERSION=2
+* export EXTERNAL_NETWORK=net04_ext
+
+
+Yardstick falvor and guest images
+---------------------------------
+
+Before executing Yardstick test cases, make sure that yardstick guest image and
+yardstick flavor are available in OpenStack.
+Detailed steps about creating yardstick flavor and building yardstick-trusty-server
+image can be found below.
+
+Yardstick-flavor
+^^^^^^^^^^^^^^^^
+Most of the sample test cases in Yardstick are using an OpenStack flavor called
+*yardstick-flavor* which deviates from the OpenStack standard m1.tiny flavor by the
+disk size - instead of 1GB it has 3GB. Other parameters are the same as in m1.tiny.
+
+Create yardstick-flavor:
+
+::
+
+ nova flavor-create yardstick-flavor 100 512 3 1
+
.. _guest-image:
Building a guest image
^^^^^^^^^^^^^^^^^^^^^^
-Yardstick has a tool for building an Ubuntu Cloud Server image containing all
-the required tools to run test cases supported by Yardstick. It is necessary to
-have sudo rights to use this tool.
+Most of the sample test cases in Yardstick are using a guest image called
+*yardstick-trusty-server* which deviates from an Ubuntu Cloud Server image
+containing all the required tools to run test cases supported by Yardstick.
+Yardstick has a tool for building this custom image. It is necessary to have
+sudo rights to use this tool.
Also you may need install several additional packages to use this tool, by
follwing the commands below:
**Warning:** the script will create files by default in:
``/tmp/workspace/yardstick`` and the files will be owned by root!
+
If you are building this guest image in inside a docker container make sure the
container is granted with privilege.
+
The created image can be added to OpenStack using the ``glance image-create`` or
via the OpenStack Dashboard.
--disk-format qcow2 --container-format bare \
--file /tmp/workspace/yardstick/yardstick-trusty-server.img
+Some Yardstick test cases use a Cirros image, you can find one at
+http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img
+
+
+Automatic flavor and image creation
+-----------------------------------
+Yardstick has a script for automatic creating yardstick flavor and building
+guest images. This script is mainly used in CI, but you can still use it in
+your local environment.
+
+Example command:
+
+::
+
+ export YARD_IMG_ARCH="amd64"
+ sudo echo "Defaults env_keep += \"YARD_IMG_ARCH\"" >> /etc/sudoers
+ source $YARDSTICK_REPO_DIR/tests/ci/load_images.sh
+
Yardstick default key pair
^^^^^^^^^^^^^^^^^^^^^^^^^^
test cases in the tag "test_cases" and also mark their relative directory in the
tag "test_cases_dir".
-Yardstick test suite also support constraints and task args for each test suite.
+Yardstick test suite also support constraints and task args for each test case.
Here is another sample to show this, which is digested from one big test suite.
os-nosdn-nofeature-ha.yaml
--- /dev/null
+.. This work is licensed under a Creative Commons Attribution 4.0 International
+.. License.
+.. http://creativecommons.org/licenses/by/4.0
+.. (c) 2016 Huawei Technologies Co.,Ltd and others
+
+=================
+Grafana dashboard
+=================
+
+
+Abstract
+========
+
+This chapter describes the Yardstick grafana dashboard. The Yardstick grafana
+dashboard can be found here: http://testresults.opnfv.org/grafana/
+
+
+.. image:: images/login.png
+ :width: 800px
+ :alt: Yardstick grafana dashboard
+
+
+Public access
+=============
+
+Yardstick provids a public account for accessing to the dashboard. The username
+and password are both set to ‘opnfv’.
+
+
+Testcase dashboard
+==================
+
+For each test case, there is a dedicated dashboard. Shown here is the dashboard
+of TC002.
+
+
+.. image:: images/TC002.png
+ :width: 800px
+ :alt:TC002 dashboard
+
+For each test case dashboard. On the top left, we have a dashboard selection,
+you can switch to different test cases using this pull-down menu.
+
+Underneath, we have a pod and scenario selection.
+All the pods and scenarios that have ever published test data to the InfluxDB
+will be shown here.
+
+You can check multiple pods or scenarios.
+
+For each test case, we have a short description and a link to detailed test
+case information in Yardstick user guide.
+
+Underneath, it is the result presentation section.
+You can use the time period selection on the top right corner to zoom in or
+zoom out the chart.
+
+
+Administration access
+=====================
+
+For a user with administration rights it is easy to update and save any
+dashboard configuration. Saved updates immediately take effect and become live.
+This may cause issues like:
+
+- Changes and updates made to the live configuration in Grafana can compromise
+ existing Grafana content in an unwanted, unpredicted or incompatible way.
+ Grafana as such is not version controlled, there exists one single Grafana
+ configuration per dashboard.
+- There is a risk several people can disturb each other when doing updates to
+ the same Grafana dashboard at the same time.
+
+Any change made by administrator should be careful.
+
+
+Add a dashboard into yardstick grafana
+======================================
+
+Due to security concern, users that using the public opnfv account are not able
+to edit the yardstick grafana directly.It takes a few more steps for a
+non-yardstick user to add a custom dashboard into yardstick grafana.
+
+There are 6 steps to go.
+
+
+.. image:: images/add.png
+ :width: 800px
+ :alt: Add a dashboard into yardstick grafana
+
+
+1. You need to build a local influxdb and grafana, so you can do the work
+ locally. You can refer to How to deploy InfluxDB and Grafana locally wiki
+ page about how to do this.
+
+2. Once step one is done, you can fetch the existing grafana dashboard
+ configuration file from the yardstick repository and import it to your local
+ grafana. After import is done, you grafana dashboard will be ready to use
+ just like the community’s dashboard.
+
+3. The third step is running some test cases to generate test results and
+ publishing it to your local influxdb.
+
+4. Now you have some data to visualize in your dashboard. In the fourth step,
+ it is time to create your own dashboard. You can either modify an existing
+ dashboard or try to create a new one from scratch. If you choose to modify
+ an existing dashboard then in the curtain menu of the existing dashboard do
+ a "Save As..." into a new dashboard copy instance, and then continue doing
+ all updates and saves within the dashboard copy.
+
+5. When finished with all Grafana configuration changes in this temporary
+ dashboard then chose "export" of the updated dashboard copy into a JSON file
+ and put it up for review in Gerrit, in file /yardstick/dashboard/Yardstick-TCxxx-yyyyyyyyyyyyy.
+ For instance a typical default name of the file would be "Yardstick-TC001 Copy-1234567891234".
+
+6. Once you finish your dashboard, the next step is exporting the configuration
+ file and propose a patch into Yardstick. Yardstick team will review and
+ merge it into Yardstick repository. After approved review Yardstick team
+ will do an "import" of the JSON file and also a "save dashboard" as soon as
+ possible to replace the old live dashboard configuration.
+
07-installation
08-yardstick_plugin
09-result-store-InfluxDB
- 10-list-of-tcs
+ 10-grafana
+ 11-list-of-tcs
glossary
references
|Network Latency Between NFVI Nodes |
| |
+--------------+--------------------------------------------------------------+
-|test case id | OPNFV_YARDSTICK_TC043_Latency_between_NFVI_nodes_ |
+|test case id | OPNFV_YARDSTICK_TC043_Latency_between_NFVI_nodes |
| | measurements |
| | |
+--------------+--------------------------------------------------------------+
| | For SLA max_mean_latency is set to 100. |
| | |
+--------------+--------------------------------------------------------------+
-|test tool | netperf |
+|test tool | netperf_ |
| | Netperf is a software application that provides network |
| | bandwidth testing between two hosts on a network. It |
| | supports Unix domain sockets, TCP, SCTP, DLPI and UDP via |
* Pharos wiki: https://wiki.opnfv.org/pharos
* VTC: https://wiki.opnfv.org/vtc
* Yardstick CI: https://build.opnfv.org/ci/view/yardstick/
-* Yardstick and ETSI TST001 presentation: https://wiki.opnfv.org/_media/opnfv_summit_-_bridging_opnfv_and_etsi.pdf
-* Yardstick Project presentation: https://wiki.opnfv.org/_media/opnfv_summit_-_yardstick_project.pdf
+* Yardstick and ETSI TST001 presentation: https://wiki.opnfv.org/display/yardstick/Yardstick?preview=%2F2925202%2F2925205%2Fopnfv_summit_-_bridging_opnfv_and_etsi.pdf
+* Yardstick Project presentation: https://wiki.opnfv.org/display/yardstick/Yardstick?preview=%2F2925202%2F2925208%2Fopnfv_summit_-_yardstick_project.pdf
* Yardstick wiki: https://wiki.opnfv.org/yardstick
References used in Test Cases
=========
* ETSI NFV: http://www.etsi.org/technologies-clusters/technologies/nfv
-* ETSI GS-NFV TST 001: https://docbox.etsi.org/ISG/NFV/Open/Drafts/TST001_-_Pre-deployment_Validation/
+* ETSI GS-NFV TST 001: http://www.etsi.org/deliver/etsi_gs/NFV-TST/001_099/001/01.01.01_60/gs_NFV-TST001v010101p.pdf
* RFC2544: https://www.ietf.org/rfc/rfc2544.txt
'yardstick-plot=yardstick.plot.plotter:main [plot]'
],
},
- scripts=['tools/yardstick-img-modify']
+ scripts=['tools/yardstick-img-modify',
+ 'tools/yardstick-img-lxd-modify',
+ 'tools/yardstick-img-dpdk-modify'
+ ]
)
scenario:
-
os-nosdn-ovs-noha
- -
- os-onos-sfc-ha
- -
- os-onos-nofeature-ha
- -
- name: fuel
- scenario:
- -
- os-odl_l2-sfc-noha
- -
- os-odl_l2-sfc-ha
- -
- os-nosdn-ovs-ha
file_name: opnfv_yardstick_tc012.yaml
-
file_name: opnfv_yardstick_tc014.yaml
--
- file_name: opnfv_yardstick_tc027.yaml
- constraint:
- installer: compass,fuel
- pod: huawei-pod1,lf-pod2,ericsson-pod3,ericsson-pod4
- task_args:
- huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml"}'
- lf-pod2: '{"pod_info": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}'
- ericsson-pod3: '{"pod_info": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}'
- ericsson-pod4: '{"pod_info": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}'
-
file_name: opnfv_yardstick_tc037.yaml
-
task_args:
huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
"host": "node1.LF"}'
+-
+ file_name: opnfv_yardstick_tc027.yaml
+ constraint:
+ installer: compass,fuel
+ pod: huawei-pod1,lf-pod2,ericsson-pod3,ericsson-pod4
+ task_args:
+ huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml"}'
+ lf-pod2: '{"pod_info": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}'
+ ericsson-pod3: '{"pod_info": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}'
+ ericsson-pod4: '{"pod_info": "etc/yardstick/nodes/fuel_baremetal/pod.yaml", "openrc":"/root/openrc", "external_network":"admin_floating_net"}'
-#!/usr/bin/env python\r
-\r
-##############################################################################\r
-# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.\r
-#\r
-# All rights reserved. This program and the accompanying materials\r
-# are made available under the terms of the Apache License, Version 2.0\r
-# which accompanies this distribution, and is available at\r
-# http://www.apache.org/licenses/LICENSE-2.0\r
-##############################################################################\r
-\r
-# Unittest for yardstick.benchmark.scenarios.networking.networkcapacity.NetworkCapacity\r
-\r
-import mock\r
-import unittest\r
-import os\r
-import json\r
-\r
-from yardstick.benchmark.scenarios.networking import networkcapacity\r
-\r
-SAMPLE_OUTPUT = '{"Number of connections":"308","Number of frames received": "166503"}'\r
-\r
-@mock.patch('yardstick.benchmark.scenarios.networking.networkcapacity.ssh')\r
-class NetworkCapacityTestCase(unittest.TestCase):\r
-\r
- def setUp(self):\r
- self.ctx = {\r
- 'host': {\r
- 'ip': '172.16.0.137',\r
- 'user': 'cirros',\r
- 'password': "root"\r
- },\r
- }\r
-\r
- self.result = {}\r
-\r
- def test_capacity_successful_setup(self, mock_ssh):\r
- c = networkcapacity.NetworkCapacity({}, self.ctx)\r
- mock_ssh.SSH().execute.return_value = (0, '', '')\r
- c.setup()\r
- self.assertIsNotNone(c.client)\r
- self.assertTrue(c.setup_done)\r
-\r
- def test_capacity_successful(self, mock_ssh):\r
- c = networkcapacity.NetworkCapacity({}, self.ctx)\r
-\r
- mock_ssh.SSH().execute.return_value = (0, SAMPLE_OUTPUT, '')\r
- c.run(self.result)\r
- expected_result = json.loads(SAMPLE_OUTPUT)\r
- self.assertEqual(self.result, expected_result)\r
-\r
- def test_capacity_unsuccessful_script_error(self, mock_ssh):\r
- c = networkcapacity.NetworkCapacity({}, self.ctx)\r
-\r
- mock_ssh.SSH().execute.return_value = (1, '', 'FOOBAR')\r
- self.assertRaises(RuntimeError, c.run, self.result)\r
+#!/usr/bin/env python
+
+##############################################################################
+# 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
+##############################################################################
+
+# Unittest for yardstick.benchmark.scenarios.networking.networkcapacity.NetworkCapacity
+
+import mock
+import unittest
+import os
+import json
+
+from yardstick.benchmark.scenarios.networking import networkcapacity
+
+SAMPLE_OUTPUT = '{"Number of connections":"308","Number of frames received": "166503"}'
+
+@mock.patch('yardstick.benchmark.scenarios.networking.networkcapacity.ssh')
+class NetworkCapacityTestCase(unittest.TestCase):
+
+ def setUp(self):
+ self.ctx = {
+ 'host': {
+ 'ip': '172.16.0.137',
+ 'user': 'cirros',
+ 'password': "root"
+ },
+ }
+
+ self.result = {}
+
+ def test_capacity_successful_setup(self, mock_ssh):
+ c = networkcapacity.NetworkCapacity({}, self.ctx)
+ mock_ssh.SSH().execute.return_value = (0, '', '')
+ c.setup()
+ self.assertIsNotNone(c.client)
+ self.assertTrue(c.setup_done)
+
+ def test_capacity_successful(self, mock_ssh):
+ c = networkcapacity.NetworkCapacity({}, self.ctx)
+
+ mock_ssh.SSH().execute.return_value = (0, SAMPLE_OUTPUT, '')
+ c.run(self.result)
+ expected_result = json.loads(SAMPLE_OUTPUT)
+ self.assertEqual(self.result, expected_result)
+
+ def test_capacity_unsuccessful_script_error(self, mock_ssh):
+ c = networkcapacity.NetworkCapacity({}, self.ctx)
+
+ mock_ssh.SSH().execute.return_value = (1, '', 'FOOBAR')
+ self.assertRaises(RuntimeError, c.run, self.result)
'host1': {
'ip': '172.16.0.137',
'user': 'cirros',
+ 'role': "Controller",
'key_filename': "mykey.key",
'password': "root"
},
+ 'host2': {
+ "ip": "172.16.0.138",
+ "key_filename": "/root/.ssh/id_rsa",
+ "role": "Compute",
+ "name": "node3.IPV6",
+ "user": "root"
+ },
}
}
+ def test_get_controller_node(self):
+ args = {
+ 'options': {'host': 'host1','packetsize': 200, 'ping_count': 5},
+ 'sla': {'max_rtt': 50}
+ }
+ p = ping6.Ping6(args, self.ctx)
+ controller_node = p._get_controller_node(['host1','host2'])
+ self.assertEqual(controller_node, 'host1')
+
@mock.patch('yardstick.benchmark.scenarios.networking.ping6.ssh')
def test_ping_successful_setup(self, mock_ssh):
args = {
--- /dev/null
+releng:
+ dir: /home/opnfv/repos/releng
mock_importutils.import_module.assert_called_with('bar.baz')
+class GetParaFromYaml(unittest.TestCase):
+
+ def test_get_para_from_yaml_file_not_exist(self):
+ file_path = '/etc/yardstick/hello.yaml'
+ args = 'hello.world'
+ para = utils.get_para_from_yaml(file_path, args)
+ self.assertIsNone(para)
+
+ def test_get_para_from_yaml_para_not_found(self):
+ file_path = 'config_sample.yaml'
+ file_path = self._get_file_abspath(file_path)
+ args = 'releng.file'
+ self.assertIsNone(utils.get_para_from_yaml(file_path, args))
+
+ def test_get_para_from_yaml_para_exists(self):
+ file_path = 'config_sample.yaml'
+ file_path = self._get_file_abspath(file_path)
+ args = 'releng.dir'
+ para = '/home/opnfv/repos/releng'
+ self.assertEqual(para, utils.get_para_from_yaml(file_path, args))
+
+ 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
+
+
def main():
unittest.main()
fi
# iperf3 only available for trusty in backports
-if [grep -q trusty /etc/apt/sources.list ]; then
+if [ grep -q trusty /etc/apt/sources.list ]; then
if [ $YARD_IMG_ARCH = "arm64" ]; then
echo "deb [arch=arm64] http://ports.ubuntu.com/ trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list
else
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+import os
import sys
import pkg_resources
+import paramiko
from yardstick.benchmark.contexts.base import Context
from yardstick.benchmark.contexts.model import Server
from yardstick.benchmark.contexts.model import Network
from yardstick.benchmark.contexts.model import update_scheduler_hints
from yardstick.orchestrator.heat import HeatTemplate
+from yardstick.definitions import YARDSTICK_ROOT_PATH
class HeatContext(Context):
self._user = None
self.template_file = None
self.heat_parameters = None
+ self.key_filename = YARDSTICK_ROOT_PATH + \
+ 'yardstick/resources/files/yardstick_key'
super(self.__class__, self).__init__()
def init(self, attrs):
self.servers.append(server)
self._server_map[server.dn] = server
+ print "Generating RSA host key ..."
+ rsa_key = paramiko.RSAKey.generate(bits=2048, progress_func=None)
+ print "Writing yardstick_key ..."
+ rsa_key.write_private_key_file(self.key_filename)
+ print "Writing yardstick_key.pub ..."
+ open(self.key_filename + ".pub", "w").write("%s %s\n" %
+ (rsa_key.get_name(),
+ rsa_key.get_base64()))
+ del rsa_key
+ print "... done!"
+
@property
def image(self):
'''returns application's default image name'''
self.stack = None
print "Context '%s' undeployed" % self.name
+ if os.path.exists(self.key_filename):
+ try:
+ os.remove(self.key_filename)
+ os.remove(self.key_filename + ".pub")
+ except OSError, e:
+ print ("Error: %s - %s." % (e.key_filename, e.strerror))
+
def _get_server(self, attr_name):
'''lookup server info by name from context
attr_name: either a name for a server created by yardstick or a dict
class BaremetalAttacker(BaseAttacker):
-
__attacker_type__ = 'bare-metal-down'
def setup(self):
host = self._context.get(self._config['host'], None)
ip = host.get("ip", None)
user = host.get("user", "root")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
key_filename = host.get("key_filename", "~/.ssh/id_rsa")
- self.connection = ssh.SSH(user, ip, key_filename=key_filename)
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.connection.wait(timeout=600)
LOG.debug("ssh host success!")
self.host_ip = ip
host = self._context.get(jump_host_name, None)
ip = host.get("ip", None)
user = host.get("user", "root")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
pwd = host.get("pwd", None)
LOG.debug("jump_host ip:%s user:%s" % (ip, user))
- self.jump_connection = ssh.SSH(user, ip, password=pwd)
+ self.jump_connection = ssh.SSH(user, ip, password=pwd,
+ port=ssh_port)
self.jump_connection.wait(timeout=600)
LOG.debug("ssh jump host success!")
host = self._context.get(self._config['host'], None)
ip = host.get("ip", None)
user = host.get("user", "root")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
key_filename = host.get("key_filename", "~/.ssh/id_rsa")
- self.connection = ssh.SSH(user, ip, key_filename=key_filename)
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.connection.wait(timeout=600)
LOG.debug("ssh host success!")
host = self._context.get(self._config['host'], None)
ip = host.get("ip", None)
user = host.get("user", "root")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
key_filename = host.get("key_filename", "~/.ssh/id_rsa")
- self.connection = ssh.SSH(user, ip, key_filename=key_filename)
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.connection.wait(timeout=600)
LOG.debug("ssh host success!")
host = self._context[node_name]
ip = host.get("ip", None)
user = host.get("user", "root")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
key_filename = host.get("key_filename", "~/.ssh/id_rsa")
- self.connection = ssh.SSH(user, ip, key_filename=key_filename)
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.connection.wait(timeout=600)
LOG.debug("ssh host success!")
host = self._context[self._config["host"]]
ip = host.get("ip", None)
user = host.get("user", "root")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
key_filename = host.get("key_filename", "~/.ssh/id_rsa")
self.key = self._config["key"]
self.monitor_key = self._config["monitor_key"]
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)
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.connection.wait(timeout=600)
LOG.debug("ssh host success!")
host = self._context[self._config["host"]]
ip = host.get("ip", None)
user = host.get("user", "root")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
key_filename = host.get("key_filename", "~/.ssh/id_rsa")
- self.connection = ssh.SSH(user, ip, key_filename=key_filename)
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.connection.wait(timeout=600)
LOG.debug("ssh host success!")
self.check_script = self.get_script_fullpath(
host = self._context.get(self._config['host'], None)
ip = host.get("ip", None)
user = host.get("user", "root")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
key_filename = host.get("key_filename", "~/.ssh/id_rsa")
- self.connection = ssh.SSH(user, ip, key_filename=key_filename)
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.connection.wait(timeout=600)
LOG.debug("ssh host success!")
class GeneralResultChecker(BaseResultChecker):
-
__result_checker__type__ = "general-result-checker"
def setup(self):
host = self._context.get(self._config['host'], None)
ip = host.get("ip", None)
user = host.get("user", "root")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
key_filename = host.get("key_filename", "~/.ssh/id_rsa")
- self.connection = ssh.SSH(user, ip, key_filename=key_filename)
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.connection.wait(timeout=600)
LOG.debug("ssh host success!")
host = self.context_cfg['host']
user = host.get('user', 'ubuntu')
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
ip = host.get('ip', None)
key_filename = host.get('key_filename', '~/.ssh/id_rsa')
LOG.info("user:%s, host:%s", user, ip)
- self.client = ssh.SSH(user, ip, key_filename=key_filename)
+ self.client = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.client.wait(timeout=600)
# copy scripts to host
nodes = self.context_cfg['nodes']
node = nodes.get('host', None)
host_user = node.get('user', 'ubuntu')
+ ssh_port = node.get('ssh_port', ssh.DEFAULT_PORT)
host_ip = node.get('ip', None)
host_pwd = node.get('password', 'root')
LOG.debug("user:%s, host:%s", host_user, host_ip)
- self.client = ssh.SSH(host_user, host_ip, password=host_pwd)
+ self.client = ssh.SSH(host_user, host_ip, password=host_pwd,
+ port=ssh_port)
self.client.wait(timeout=600)
# copy script to host
host = self.context_cfg['host']
user = host.get('user', 'ubuntu')
ip = host.get('ip', None)
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
key_filename = host.get('key_filename', '~/.ssh/id_rsa')
LOG.info("user:%s, host:%s", user, ip)
- self.client = ssh.SSH(user, ip, key_filename=key_filename)
+ self.client = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.client.wait(timeout=600)
# Check if mpstat prog is installed
host = self.context_cfg["host"]
user = host.get("user", "root")
ip = host.get("ip", None)
+ ssh_port = host.get("ssh_port", 5555)
key_filename = host.get("key_filename", "~/.ssh/id_rsa")
LOG.debug("user:%s, host:%s", user, ip)
- self.guest = ssh.SSH(user, ip, port=5555, key_filename=key_filename)
+ self.guest = ssh.SSH(user, ip, port=ssh_port,
+ key_filename=key_filename)
self.guest.wait(timeout=600)
def _run_setup_cmd(self, client, cmd):
Lmbench.LATENCY_CACHE_SCRIPT)
host = self.context_cfg["host"]
user = host.get("user", "ubuntu")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
ip = host.get("ip", None)
key_filename = host.get('key_filename', "~/.ssh/id_rsa")
LOG.info("user:%s, host:%s", user, ip)
- self.client = ssh.SSH(user, ip, key_filename=key_filename)
+ self.client = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.client.wait(timeout=600)
# copy scripts to host
"""Scenario setup."""
host = self.context_cfg['host']
user = host.get('user', 'ubuntu')
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
ip = host.get('ip', None)
key_filename = host.get('key_filename', '~/.ssh/id_rsa')
LOG.info("user:%s, host:%s", user, ip)
- self.client = ssh.SSH(user, ip, key_filename=key_filename)
+ self.client = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.client.wait(timeout=600)
self.setup_done = True
'yardstick.benchmark.scenarios.compute', Perf.TARGET_SCRIPT)
host = self.context_cfg['host']
user = host.get('user', 'ubuntu')
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
ip = host.get('ip', None)
key_filename = host.get('key_filename', '~/.ssh/id_rsa')
LOG.info("user:%s, host:%s", user, ip)
- self.client = ssh.SSH(user, ip, key_filename=key_filename)
+ self.client = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.client.wait(timeout=600)
# copy script to host
nodes = self.context_cfg['nodes']
node = nodes.get('host1', None)
host_user = node.get('user', 'ubuntu')
+ host_ssh_port = node.get('ssh_port', ssh.DEFAULT_PORT)
host_ip = node.get('ip', None)
host_pwd = node.get('password', 'root')
LOG.debug("user:%s, host:%s", host_user, host_ip)
- self.client = ssh.SSH(host_user, host_ip, password=host_pwd)
+ self.client = ssh.SSH(host_user, host_ip, password=host_pwd,
+ port=host_ssh_port)
self.client.wait(timeout=600)
self.setup_done = True
host = self.context_cfg["host"]
user = host.get("user", "ubuntu")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
ip = host.get("ip", None)
key_filename = host.get('key_filename', "~/.ssh/id_rsa")
LOG.info("user:%s, host:%s", user, ip)
- self.client = ssh.SSH(user, ip, key_filename=key_filename)
+ self.client = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.client.wait(timeout=600)
# copy scripts to host
host = self.context_cfg["host"]
user = host.get("user", "ubuntu")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
ip = host.get("ip", None)
key_filename = host.get('key_filename', "~/.ssh/id_rsa")
LOG.info("user:%s, host:%s", user, ip)
- self.client = ssh.SSH(user, ip, key_filename=key_filename)
+ self.client = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.client.wait(timeout=600)
# copy scripts to host
p.run(result)
print result
+
if __name__ == '__main__':
_test()
def setup(self):
host = self.context_cfg['host']
host_user = host.get('user', 'ubuntu')
+ host_ssh_port = host.get('ssh_port', ssh.DEFAULT_PORT)
host_ip = host.get('ip', None)
host_key_filename = host.get('key_filename', '~/.ssh/id_rsa')
target = self.context_cfg['target']
target_user = target.get('user', 'ubuntu')
+ target_ssh_port = target.get('ssh_port', ssh.DEFAULT_PORT)
target_ip = target.get('ip', None)
target_key_filename = target.get('key_filename', '~/.ssh/id_rsa')
LOG.info("user:%s, target:%s", target_user, target_ip)
self.target = ssh.SSH(target_user, target_ip,
- key_filename=target_key_filename)
+ key_filename=target_key_filename,
+ port=target_ssh_port)
self.target.wait(timeout=600)
LOG.info("user:%s, host:%s", host_user, host_ip)
self.host = ssh.SSH(host_user, host_ip,
- key_filename=host_key_filename)
+ key_filename=host_key_filename, port=host_ssh_port)
self.host.wait(timeout=600)
cmd = "iperf3 -s -D"
Netperf.TARGET_SCRIPT)
host = self.context_cfg['host']
host_user = host.get('user', 'ubuntu')
+ host_ssh_port = host.get('ssh_port', ssh.DEFAULT_PORT)
host_ip = host.get('ip', None)
host_key_filename = host.get('key_filename', '~/.ssh/id_rsa')
target = self.context_cfg['target']
target_user = target.get('user', 'ubuntu')
+ target_ssh_port = target.get('ssh_port', ssh.DEFAULT_PORT)
target_ip = target.get('ip', None)
target_key_filename = target.get('key_filename', '~/.ssh/id_rsa')
# netserver start automatically during the vm boot
LOG.info("user:%s, target:%s", target_user, target_ip)
self.server = ssh.SSH(target_user, target_ip,
- key_filename=target_key_filename)
+ key_filename=target_key_filename,
+ port=target_ssh_port)
self.server.wait(timeout=600)
LOG.info("user:%s, host:%s", host_user, host_ip)
self.client = ssh.SSH(host_user, host_ip,
- key_filename=host_key_filename)
+ key_filename=host_key_filename,
+ port=host_ssh_port)
self.client.wait(timeout=600)
# copy script to host
netperf.run(result)
print result
+
if __name__ == '__main__':
_test()
NetperfNode.TARGET_SCRIPT)
host = self.context_cfg['host']
host_user = host.get('user', 'ubuntu')
+ host_ssh_port = host.get('ssh_port', ssh.DEFAULT_PORT)
host_ip = host.get('ip', None)
target = self.context_cfg['target']
target_user = target.get('user', 'ubuntu')
+ target_ssh_port = target.get('ssh_port', ssh.DEFAULT_PORT)
target_ip = target.get('ip', None)
self.target_ip = target.get('ip', None)
host_password = host.get('password', None)
# netserver start automatically during the vm boot
LOG.info("user:%s, target:%s", target_user, target_ip)
self.server = ssh.SSH(target_user, target_ip,
- password=target_password)
+ password=target_password, port=target_ssh_port)
self.server.wait(timeout=600)
LOG.info("user:%s, host:%s", host_user, host_ip)
self.client = ssh.SSH(host_user, host_ip,
- password=host_password)
+ password=host_password, port=host_ssh_port)
self.client.wait(timeout=600)
# copy script to host
"""Scenario setup."""
host = self.context_cfg['host']
user = host.get('user', 'ubuntu')
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
ip = host.get('ip', None)
key_filename = host.get('key_filename', '~/.ssh/id_rsa')
LOG.info("user:%s, host:%s", user, ip)
- self.client = ssh.SSH(user, ip, key_filename=key_filename)
+ self.client = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.client.wait(timeout=600)
self.setup_done = True
-##############################################################################\r
-# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.\r
-#\r
-# All rights reserved. This program and the accompanying materials\r
-# are made available under the terms of the Apache License, Version 2.0\r
-# which accompanies this distribution, and is available at\r
-# http://www.apache.org/licenses/LICENSE-2.0\r
-##############################################################################\r
-import pkg_resources\r
-import logging\r
-import json\r
-\r
-import yardstick.ssh as ssh\r
-from yardstick.benchmark.scenarios import base\r
-\r
-LOG = logging.getLogger(__name__)\r
-\r
-\r
-class NetworkCapacity(base.Scenario):\r
- """Measure Network capacity and scale.\r
-\r
- This scenario reads network status including number of connections,\r
- number of frames sent/received.\r
- """\r
- __scenario_type__ = "NetworkCapacity"\r
- TARGET_SCRIPT = "networkcapacity.bash"\r
-\r
- def __init__(self, scenario_cfg, context_cfg):\r
- self.scenario_cfg = scenario_cfg\r
- self.context_cfg = context_cfg\r
- self.setup_done = False\r
-\r
- def setup(self):\r
- """scenario setup"""\r
- self.target_script = pkg_resources.resource_filename(\r
- "yardstick.benchmark.scenarios.networking",\r
- NetworkCapacity.TARGET_SCRIPT)\r
-\r
- host = self.context_cfg['host']\r
- if host is None:\r
- raise RuntimeError('No right node.please check the configuration')\r
- host_user = host.get('user', 'ubuntu')\r
- host_ip = host.get('ip', None)\r
- host_pwd = host.get('password', None)\r
-\r
- LOG.debug("user:%s, host:%s", host_user, host_ip)\r
- self.client = ssh.SSH(host_user, host_ip, password=host_pwd)\r
- self.client.wait(timeout=600)\r
-\r
- # copy script to host\r
- self.client.run("cat > ~/networkcapacity.sh",\r
- stdin=open(self.target_script, 'rb'))\r
-\r
- self.setup_done = True\r
-\r
- def run(self, result):\r
- """execute the benchmark"""\r
-\r
- if not self.setup_done:\r
- self.setup()\r
-\r
- cmd = "sudo bash networkcapacity.sh"\r
-\r
- LOG.debug("Executing command: %s", cmd)\r
- status, stdout, stderr = self.client.execute(cmd)\r
- if status:\r
- raise RuntimeError(stderr)\r
-\r
- result.update(json.loads(stdout))\r
+##############################################################################
+# 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
+##############################################################################
+import pkg_resources
+import logging
+import json
+
+import yardstick.ssh as ssh
+from yardstick.benchmark.scenarios import base
+
+LOG = logging.getLogger(__name__)
+
+
+class NetworkCapacity(base.Scenario):
+ """Measure Network capacity and scale.
+
+ This scenario reads network status including number of connections,
+ number of frames sent/received.
+ """
+ __scenario_type__ = "NetworkCapacity"
+ TARGET_SCRIPT = "networkcapacity.bash"
+
+ def __init__(self, scenario_cfg, context_cfg):
+ self.scenario_cfg = scenario_cfg
+ self.context_cfg = context_cfg
+ self.setup_done = False
+
+ def setup(self):
+ """scenario setup"""
+ self.target_script = pkg_resources.resource_filename(
+ "yardstick.benchmark.scenarios.networking",
+ NetworkCapacity.TARGET_SCRIPT)
+
+ host = self.context_cfg['host']
+ if host is None:
+ raise RuntimeError('No right node.please check the configuration')
+ host_user = host.get('user', 'ubuntu')
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
+ host_ip = host.get('ip', None)
+ host_pwd = host.get('password', None)
+
+ LOG.debug("user:%s, host:%s", host_user, host_ip)
+ self.client = ssh.SSH(host_user, host_ip, password=host_pwd,
+ port=ssh_port)
+ self.client.wait(timeout=600)
+
+ # copy script to host
+ self.client.run("cat > ~/networkcapacity.sh",
+ stdin=open(self.target_script, 'rb'))
+
+ self.setup_done = True
+
+ def run(self, result):
+ """execute the benchmark"""
+
+ if not self.setup_done:
+ self.setup()
+
+ cmd = "sudo bash networkcapacity.sh"
+
+ LOG.debug("Executing command: %s", cmd)
+ status, stdout, stderr = self.client.execute(cmd)
+ if status:
+ raise RuntimeError(stderr)
+
+ result.update(json.loads(stdout))
'yardstick.benchmark.scenarios.networking', Ping.TARGET_SCRIPT)
host = self.context_cfg['host']
user = host.get('user', 'ubuntu')
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
ip = host.get('ip', None)
key_filename = host.get('key_filename', '/root/.ssh/id_rsa')
password = host.get('password', None)
if password is not None:
LOG.info("Log in via pw, user:%s, host:%s, pw:%s",
user, ip, password)
- self.connection = ssh.SSH(user, ip, password=password)
+ self.connection = ssh.SSH(user, ip, password=password,
+ port=ssh_port)
else:
LOG.info("Log in via key, user:%s, host:%s, key_filename:%s",
user, ip, key_filename)
- self.connection = ssh.SSH(user, ip, key_filename=key_filename)
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.connection.wait()
# ssh host
node = self.nodes.get(node_name, None)
user = node.get('user', 'ubuntu')
+ ssh_port = node.get("ssh_port", ssh.DEFAULT_PORT)
ip = node.get('ip', None)
pwd = node.get('password', None)
key_fname = node.get('key_filename', '/root/.ssh/id_rsa')
-
if pwd is not None:
LOG.debug("Log in via pw, user:%s, host:%s, password:%s",
user, ip, pwd)
- self.client = ssh.SSH(user, ip, password=pwd)
+ self.client = ssh.SSH(user, ip, password=pwd, port=ssh_port)
else:
LOG.debug("Log in via key, user:%s, host:%s, key_filename:%s",
user, ip, key_fname)
- self.client = ssh.SSH(user, ip, key_filename=key_fname)
+ self.client = ssh.SSH(user, ip, key_filename=key_fname,
+ port=ssh_port)
self.client.wait(timeout=60)
def _pre_setup(self):
status, stdout, stderr = self.client.execute(
"sudo bash pre_setup.sh")
+ def _get_controller_node(self, host_list):
+ for host_name in host_list:
+ node = self.nodes.get(host_name, None)
+ node_role = node.get('role', None)
+ if node_role == 'Controller':
+ return host_name
+ return None
+
def setup(self):
'''scenario setup'''
self.setup_script = pkg_resources.resource_filename(
if pre_setup:
self._pre_setup()
- # ssh host1
- self._ssh_host(self.host_list[0])
-
+ # log in a contronller node to setup
+ controller_node_name = self._get_controller_node(self.host_list)
+ LOG.debug("The Controller Node is: %s", controller_node_name)
+ if controller_node_name is None:
+ LOG.exception("Can't find controller node in the context!!!")
+ self._ssh_host(controller_node_name)
self.client.run("cat > ~/metadata.txt",
stdin=open(self.ping6_metadata_script, "rb"))
external_network=$2
echo "openrc=$openrc"
echo "external_network=$external_network"
+echo "nameserver 8.8.4.4" >> /etc/resolv.conf
source $openrc
-wget https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-22-20150521.x86_64.qcow2 >/dev/null 2>&1
+
+fedora_img="Fedora-Cloud-Base-22-20150521.x86_64.qcow2"
+if [ ! -f "$fedora_img" ]; then
+ wget https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/${fedora_img} >/dev/null 2>&1
+fi
glance image-create --name 'Fedora22' --disk-format qcow2 \
--container-format bare --file ./Fedora-Cloud-Base-22-20150521.x86_64.qcow2
Pktgen.TARGET_SCRIPT)
host = self.context_cfg['host']
host_user = host.get('user', 'ubuntu')
+ host_ssh_port = host.get('ssh_port', ssh.DEFAULT_PORT)
host_ip = host.get('ip', None)
host_key_filename = host.get('key_filename', '~/.ssh/id_rsa')
target = self.context_cfg['target']
target_user = target.get('user', 'ubuntu')
+ target_ssh_port = target.get('ssh_port', ssh.DEFAULT_PORT)
target_ip = target.get('ip', None)
target_key_filename = target.get('key_filename', '~/.ssh/id_rsa')
LOG.info("user:%s, target:%s", target_user, target_ip)
self.server = ssh.SSH(target_user, target_ip,
- key_filename=target_key_filename)
+ key_filename=target_key_filename,
+ port=target_ssh_port)
self.server.wait(timeout=600)
LOG.info("user:%s, host:%s", host_user, host_ip)
self.client = ssh.SSH(host_user, host_ip,
- key_filename=host_key_filename)
+ key_filename=host_key_filename,
+ port=host_ssh_port)
self.client.wait(timeout=600)
# copy script to host
p.run(result)
print result
+
if __name__ == '__main__':
_test()
PktgenDPDKLatency.TESTPMD_SCRIPT)
host = self.context_cfg['host']
host_user = host.get('user', 'ubuntu')
+ host_ssh_port = host.get('ssh_port', ssh.DEFAULT_PORT)
host_ip = host.get('ip', None)
host_key_filename = host.get('key_filename', '~/.ssh/id_rsa')
target = self.context_cfg['target']
target_user = target.get('user', 'ubuntu')
+ target_ssh_port = target.get('ssh_port', ssh.DEFAULT_PORT)
target_ip = target.get('ip', None)
target_key_filename = target.get('key_filename', '~/.ssh/id_rsa')
LOG.info("user:%s, target:%s", target_user, target_ip)
self.server = ssh.SSH(target_user, target_ip,
- key_filename=target_key_filename)
+ key_filename=target_key_filename,
+ port=target_ssh_port)
self.server.wait(timeout=600)
# copy script to host
LOG.info("user:%s, host:%s", host_user, host_ip)
self.client = ssh.SSH(host_user, host_ip,
- key_filename=host_key_filename)
+ key_filename=host_key_filename,
+ port=host_ssh_port)
self.client.wait(timeout=600)
# copy script to host
target = self.context_cfg['target']
target_user = target.get('user', 'root')
+ target_ssh_port = target.get('ssh_port', ssh.DEFAULT_PORT)
target_pwd = target.get('password', 'opnfv')
target_ip = target.get('ip', None)
''' webserver start automatically during the vm boot '''
LOG.info("user:%s, target:%s", target_user, target_ip)
- self.server = ssh.SSH(target_user, target_ip, password=target_pwd)
+ self.server = ssh.SSH(target_user, target_ip, password=target_pwd,
+ port=target_ssh_port)
self.server.wait(timeout=600)
self.server.run("cat > ~/server.sh",
stdin=open(self.server_script, "rb"))
target = self.context_cfg['target']
SF1_user = target.get('user', 'root')
+ SF1_ssh_port = target.get('ssh_port', ssh.DEFAULT_PORT)
SF1_pwd = target.get('password', 'opnfv')
SF1_ip = ips[0]
LOG.info("user:%s, host:%s", SF1_user, SF1_ip)
- self.server = ssh.SSH(SF1_user, SF1_ip, password=SF1_pwd)
+ self.server = ssh.SSH(SF1_user, SF1_ip, password=SF1_pwd,
+ port=SF1_ssh_port)
self.server.wait(timeout=600)
cmd_SF1 = ("nohup python vxlan_tool.py -i eth0 "
"-d forward -v off -b 80 &")
LOG.debug("HTTP firewall started")
SF2_user = target.get('user', 'root')
+ SF2_ssh_port = target.get('ssh_port', ssh.DEFAULT_PORT)
SF2_pwd = target.get('password', 'opnfv')
SF2_ip = ips[1]
LOG.info("user:%s, host:%s", SF2_user, SF2_ip)
- self.server = ssh.SSH(SF2_user, SF2_ip, password=SF2_pwd)
+ self.server = ssh.SSH(SF2_user, SF2_ip, password=SF2_pwd,
+ port=SF2_ssh_port)
self.server.wait(timeout=600)
cmd_SF2 = ("nohup python vxlan_tool.py -i eth0 "
"-d forward -v off -b 22 &")
''' Creating client and server VMs to perform the test'''
host = self.context_cfg['host']
host_user = host.get('user', 'root')
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
host_pwd = host.get('password', 'opnfv')
host_ip = host.get('ip', None)
LOG.info("user:%s, host:%s", host_user, host_ip)
- self.client = ssh.SSH(host_user, host_ip, password=host_pwd)
+ self.client = ssh.SSH(host_user, host_ip, password=host_pwd,
+ port=ssh_port)
self.client.wait(timeout=600)
if not self.setup_done: # pragma: no cover
'''scenario setup'''
vsperf = self.context_cfg['host']
vsperf_user = vsperf.get('user', 'ubuntu')
+ vsperf_ssh_port = vsperf.get('ssh_port', ssh.DEFAULT_PORT)
vsperf_password = vsperf.get('password', 'ubuntu')
vsperf_ip = vsperf.get('ip', None)
# copy vsperf conf to VM
LOG.info("user:%s, host:%s", vsperf_user, vsperf_ip)
self.client = ssh.SSH(vsperf_user, vsperf_ip,
- password=vsperf_password)
+ password=vsperf_password, port=vsperf_ssh_port)
# traffic generation could last long
self.client.wait(timeout=1800)
Fio.TARGET_SCRIPT)
host = self.context_cfg["host"]
user = host.get("user", "root")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
ip = host.get("ip", None)
key_filename = host.get("key_filename", "~/.ssh/id_rsa")
LOG.info("user:%s, host:%s", user, ip)
- self.client = ssh.SSH(user, ip, key_filename=key_filename)
+ self.client = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)
self.client.wait(timeout=600)
# copy script to host
if host is None:
raise RuntimeError('No right node.Please check the configuration')
host_user = host.get('user', 'ubuntu')
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
host_ip = host.get('ip', None)
host_pwd = host.get('password', 'root')
LOG.debug("user:%s, host:%s", host_user, host_ip)
- self.client = ssh.SSH(host_user, host_ip, password=host_pwd)
+ self.client = ssh.SSH(host_user, host_ip, password=host_pwd,
+ port=ssh_port)
self.client.wait(timeout=600)
# copy script to host
cmd_subparsers = subparser.add_subparsers(title='subcommands')
self._find_actions(cmd_subparsers, command_object)
- def main(self, argv):
- '''run the command line interface'''
+ def _register_cli_opt(self):
# register subcommands to parse additional command line arguments
def parser(subparsers):
handler=parser)
CONF.register_cli_opt(category_opt)
+ def _load_cli_config(self, argv):
+
# load CLI args and config files
CONF(argv, project="yardstick", version=self._version,
default_config_files=find_config_files(CONFIG_SEARCH_PATHS))
+ def _handle_global_opts(self):
+
# handle global opts
logger = logging.getLogger('yardstick')
logger.setLevel(logging.WARNING)
if CONF.debug:
logger.setLevel(logging.DEBUG)
+ def _dispath_func_notask(self):
+
# dispatch to category parser
func = CONF.category.func
func(CONF.category)
+
+ def _dispath_func_task(self, task_id, timestamp):
+
+ # dispatch to category parser
+ func = CONF.category.func
+ func(CONF.category, task_id=task_id, timestamp=timestamp)
+
+ def main(self, argv): # pragma: no cover
+ '''run the command line interface'''
+ self._register_cli_opt()
+
+ self._load_cli_config(argv)
+
+ self._handle_global_opts()
+
+ self._dispath_func_notask()
+
+ def api(self, argv, task_id, timestamp): # pragma: no cover
+ '''run the api interface'''
+ self._register_cli_opt()
+
+ self._load_cli_config(argv)
+
+ self._handle_global_opts()
+
+ self._dispath_func_task(task_id, timestamp)
'yardstick.resources', 'scripts/install/' + target_script)
deployment_user = deployment.get("user")
+ deployment_ssh_port = deployment.get("ssh_port", ssh.DEFAULT_PORT)
deployment_ip = deployment.get("ip")
deployment_password = deployment.get("password")
LOG.info("user:%s, host:%s", deployment_user, installer_ip)
self.client = ssh.SSH(deployment_user, installer_ip,
- password=deployment_password)
+ password=deployment_password,
+ port=deployment_ssh_port)
self.client.wait(timeout=600)
else:
LOG.info("user:%s, host:%s", deployment_user, deployment_ip)
self.client = ssh.SSH(deployment_user, deployment_ip,
- password=deployment_password)
+ password=deployment_password,
+ port=deployment_ssh_port)
self.client.wait(timeout=600)
# copy script to host
'yardstick.resources', 'scripts/remove/' + target_script)
deployment_user = deployment.get("user")
+ deployment_ssh_port = deployment.get("ssh_port", ssh.DEFAULT_PORT)
deployment_ip = deployment.get("ip")
deployment_password = deployment.get("password")
LOG.info("user:%s, host:%s", deployment_user, installer_ip)
self.client = ssh.SSH(deployment_user, installer_ip,
- password=deployment_password)
+ password=deployment_password,
+ port=deployment_ssh_port)
self.client.wait(timeout=600)
else:
LOG.info("user:%s, host:%s", deployment_user, deployment_ip)
self.client = ssh.SSH(deployment_user, deployment_ip,
- password=deployment_password)
+ password=deployment_password,
+ port=deployment_ssh_port)
self.client.wait(timeout=600)
# copy script to host
class PluginParser(object):
'''Parser for plugin configration files in yaml format'''
+
def __init__(self, path):
self.path = path
output_file_default, default=output_file_default)
@cliargs("--suite", help="process test suite file instead of a task file",
action="store_true")
- def do_start(self, args):
+ def do_start(self, args, **kwargs):
'''Start a benchmark scenario.'''
atexit.register(atexit_handler)
--- /dev/null
+CONFIG_SAMPLE = '/etc/yardstick/config.yaml'
+
+RELENG_DIR = 'releng.dir'
import os
import sys
+import yaml
from oslo_utils import importutils
import yardstick
new_package = ".".join(root.split(os.sep)).split("....")[1]
module_name = "%s.%s" % (new_package, filename[:-3])
try_append_module(module_name, sys.modules)
+
+
+def get_para_from_yaml(file_path, args):
+
+ def func(a, b):
+ if a is None:
+ return None
+ return a.get(b)
+
+ if os.path.exists(file_path):
+ with open(file_path) as f:
+ value = yaml.safe_load(f)
+ value = reduce(func, args.split('.'), value)
+
+ if value is None:
+ print 'parameter not found'
+ return None
+
+ return value
+ else:
+ print 'file not exist'
+ return None
+++ /dev/null
------BEGIN RSA PRIVATE KEY-----
-MIIEowIBAAKCAQEA9EZF31uqZLHdXGZl7r12RfzJaqqt2oSBnBqFCzgve1zKbtL3
-cTKXFMHY8BqjMBF01cnx4nbtJffWy6jgqUlCgpm1sdzjSftZKhceB8LChFi4sg2K
-rLjKw3mU9XhYwuWrwqE3KyMNsKuTWgW9NJQxmoDWTnqKWi+WCGuPj4sxGNt/nIq9
-uA+uzVNtRYNyRPdgCHhpTWuI+ui92vpS9IWau+A4pZqeNsJuBrG6ZUTuiiX8mq2q
-MB29V/k5oQowYB5OjPzifcjwK6GciTXMIzALrsYQGFkbk90nW56FEdERtlYXw4dK
-jYne7zqi24Sj3miyxZs5DfvcN1nQqei20mLfOwIDAQABAoIBACdWccYoguY4ZoeM
-zfmGdVeL//u3hMvd7ulus+I8qBjbtpXmT4bhOMdU+FSiVYlWJlSPcu6fbE1i/ipK
-BfP9IkLZ8hK0mb2+RnuqwWFKkfyyNPwnhh+Omsij+cMWIGUyi1iKkdHWkUvUNaSX
-rAKdoudYvCpjPYiMhULR34qkRcHUtsswOeRHvxC8CXqk3fJJ/oLqCz2E4gNJs4v9
-aadxNu51ooK+srb2FcJ1zItg+NaG+Yp7aPbz+n1byH46lM4S2n9RkaoXPxUAmW9z
-RxHUDDQJ6d2hP6lNDlo21Z0vINazUOjUycZ8iS7vusA6vxkfIHhmX/4XGy0/1kEs
-JiUxEmECgYEA+wTqwY/LSCpcGkq+VUWG64c812ogPiRI+Wa/zJvZPL4wve3uy2e2
-Cx5auwwedracdigYr3jl85TSrXEhm2rWMkUhek+IY4jEzl2RH6/BeMenl5+Fh2Qw
-ZGg7Rukn60WVArgi3KH2ipzW33YZEb3cGLHSFPG79w31Aa0mqsBZVJMCgYEA+R8Y
-akSn3gOTevxczBl97BDdTndZ23+NHk52cj3TKwMnVHsAWF8ozBG7S/gjHY6Ongms
-z/erBMT8yDJbSeS/SqeFnPhuBoq2CIebAc5RLK9gHDZizf/r1gin5Fyl5jbTn5em
-JiOyYqVS43bAVpsJoNT9efdOFBzzNFqSOv9527kCgYEAmJ8huTSbrbILs/S0Cxat
-9PCSHoupNP9M208M2PP9PoCJFEHhigzx04rOMaIpt5ZKRVEVyULh1ZssCUaa32sy
-9vevZjWLQLF8r9iWD0UGhlAmZvsX7f0Nq07wk6nZmqQA+NlKYQmc5CR+RPoCPhZJ
-Bz6+8/sShSEYUb+cnf87kT8CgYAPTcO4M4OEdf/HXF1vBFnh+J8/xME2ZL2MkRFh
-rz6bs9PksrGwvBfLgYNaBWJS3IESYFHHbNWKs3c77SwCfBTsRyJEJFbN/BN2rq3t
-DHmcHyHuWcD0GraoLVvzAWYHoHKbqTtBuIuq17Eh3BewulF7GdqAdZrMTYL7Ql0d
-VrhrsQKBgBT3TOSJqc+idx58sMfZI/18GEI5PIkOuDtzgtqdwjUsIHaVnI0bVuzo
-tiEl8Ma36ZsDD5JLRUF90ckeMtjHawE4KimyO51dnE4AXsMACfbdtDc5KO+BNKJz
-6qw2SjRD7zlD6JYPVRERNFLGMIWLJbmD9tkswjuIOG/9ctWUC5FC
------END RSA PRIVATE KEY-----
+++ /dev/null
-ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD0RkXfW6pksd1cZmXuvXZF/Mlqqq3ahIGcGoULOC97XMpu0vdxMpcUwdjwGqMwEXTVyfHidu0l99bLqOCpSUKCmbWx3ONJ+1kqFx4HwsKEWLiyDYqsuMrDeZT1eFjC5avCoTcrIw2wq5NaBb00lDGagNZOeopaL5YIa4+PizEY23+cir24D67NU21Fg3JE92AIeGlNa4j66L3a+lL0hZq74Dilmp42wm4GsbplRO6KJfyaraowHb1X+TmhCjBgHk6M/OJ9yPAroZyJNcwjMAuuxhAYWRuT3SdbnoUR0RG2VhfDh0qNid7vOqLbhKPeaLLFmzkN+9w3WdCp6LbSYt87 yardstick@yardstick.opnfv.org
LOG = logging.getLogger(__name__)
+DEFAULT_PORT = 22
+
class SSHError(Exception):
pass
class SSH(object):
"""Represent ssh connection."""
- def __init__(self, user, host, port=22, pkey=None,
+ def __init__(self, user, host, port=DEFAULT_PORT, pkey=None,
key_filename=None, password=None):
"""Initialize SSH client.
self.user = user
self.host = host
- self.port = port
+ # we may get text port from YAML, convert to int
+ self.port = int(port)
self.pkey = self._get_pkey(pkey) if pkey else None
self.password = password
self.key_filename = key_filename