diff options
27 files changed, 1620 insertions, 326 deletions
diff --git a/dashboard/opnfv_yardstick_tc015.json b/dashboard/opnfv_yardstick_tc015.json new file mode 100644 index 000000000..a077d27de --- /dev/null +++ b/dashboard/opnfv_yardstick_tc015.json @@ -0,0 +1,355 @@ +{ + "__inputs": [ + { + "name": "DS_YARDSTICK", + "label": "yardstick", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "4.4.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + } + ], + "annotations": { + "list": [] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "hideControls": false, + "id": null, + "links": [], + "refresh": false, + "rows": [ + { + "collapse": false, + "height": 359, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_YARDSTICK}", + "editable": true, + "error": false, + "fill": 1, + "grid": {}, + "hideTimeOverride": false, + "id": 1, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "cpu_use", + "yaxis": 2 + } + ], + "spaceLength": 10, + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "energy", + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "opnfv_yardstick_tc015", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "power" + ], + "type": "field" + } + ] + ], + "tags": [] + }, + { + "alias": "cpu_use", + "dsType": "influxdb", + "groupBy": [], + "hide": false, + "measurement": "opnfv_yardstick_tc015", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT \"mpstat_average.cpu.%usr\" FROM \"opnfv_yardstick_tc015\" WHERE $timeFilter", + "rawQuery": false, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "mpstat_average.cpu.%usr" + ], + "type": "field" + } + ] + ], + "tags": [] + } + ], + "thresholds": [ + { + "colorMode": "custom", + "fill": true, + "fillColor": "rgba(234, 112, 112, 0.22)", + "op": "gt", + "value": 400 + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Energy measurement of bare-metal node - Energy", + "tooltip": { + "msResolution": true, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "transparent": true, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "watt", + "label": "energy measurement (watts)", + "logBase": 1, + "max": 500, + "min": 0, + "show": true + }, + { + "format": "percent", + "label": "cpu_stat", + "logBase": 1, + "max": "100", + "min": "0", + "show": true + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Row", + "titleSize": "h6" + }, + { + "collapse": false, + "height": 250, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_YARDSTICK}", + "fill": 1, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "single_score", + "dsType": "influxdb", + "groupBy": [], + "measurement": "opnfv_yardstick_tc015", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "single_score" + ], + "type": "field" + } + ] + ], + "tags": [] + }, + { + "alias": "parallel_score", + "dsType": "influxdb", + "groupBy": [], + "measurement": "opnfv_yardstick_tc015", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "parallel_score" + ], + "type": "field" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "cpu score", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "transparent": true, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" + } + ], + "schemaVersion": 14, + "style": "dark", + "tags": [ + "Energy" + ], + "templating": { + "list": [] + }, + "time": { + "from": "2019-09-09T02:01:53.297Z", + "to": "2019-09-09T02:06:47.647Z" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "opnfv_yardstick_tc015", + "version": 4 +} diff --git a/docker/Dockerfile b/docker/Dockerfile index 31f7d5dfc..00613a10f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,6 +12,7 @@ FROM ubuntu:16.04 LABEL image=opnfv/yardstick ARG BRANCH=master +ARG OPENSTACK_TAG=stable/stein # GIT repo directory ENV REPOS_DIR="/home/opnfv/repos" \ @@ -26,7 +27,10 @@ ENV YARDSTICK_REPO_DIR="${REPOS_DIR}/yardstick/" \ RUN apt-get update && apt-get install -y git python python-setuptools python-pip iputils-ping && apt-get -y autoremove && apt-get clean RUN easy_install -U setuptools==30.0.0 -RUN pip install appdirs==1.4.0 pyopenssl==17.5.0 openstacksdk==0.11.3 python-openstackclient==3.14.2 python-heatclient==1.14.0 ansible==2.5.5 +RUN pip install \ + -chttps://opendev.org/openstack/requirements/raw/branch/$OPENSTACK_TAG/upper-constraints.txt \ + -chttps://git.opnfv.org/yardstick/plain/upper-constraints.txt?h=$BRANCH \ + appdirs==1.4.0 pyopenssl==17.5.0 openstacksdk==0.11.3 python-heatclient==1.14.0 ansible==2.5.5 RUN mkdir -p ${REPOS_DIR} diff --git a/docs/release/release-notes/release-notes.rst b/docs/release/release-notes/release-notes.rst index 282c9de19..b3f3e1aed 100644 --- a/docs/release/release-notes/release-notes.rst +++ b/docs/release/release-notes/release-notes.rst @@ -21,7 +21,7 @@ Yardstick Release Notes Abstract ======== -This document compiles the release notes for the Hunter release of OPNFV Yardstick. +This document compiles the release notes for the Iruya release of OPNFV Yardstick. Version History @@ -30,7 +30,7 @@ Version History | *Date* | *Version* | *Comment* | | | | | +-------------------+-----------+---------------------------------+ -| May 10, 2019 | 8.0.0 | Yardstick for Hunter release | +| Jan 10, 2020 | 9.0.0 | Yardstick for Iruya release | | | | | +-------------------+-----------+---------------------------------+ @@ -45,10 +45,10 @@ the methodology in ETSI-ISG NFV-TST001_. The *Yardstick* framework is *installer*, *infrastructure* and *application* independent. -OPNFV Hunter Release +OPNFV Iruya Release ==================== -This Hunter release provides *Yardstick* as a framework for NFVI testing +This Iruya release provides *Yardstick* as a framework for NFVI testing and OPNFV feature testing, automated in the OPNFV CI pipeline, including: * Documentation generated with Sphinx @@ -73,7 +73,7 @@ and OPNFV feature testing, automated in the OPNFV CI pipeline, including: * Yardstick plug-in configuration yaml files, plug-in install/remove scripts -For Hunter release, the *Yardstick framework* is used for the following +For Iruya release, the *Yardstick framework* is used for the following testing: * OPNFV platform testing - generic test cases to measure the categories: @@ -111,19 +111,19 @@ Release Data | **Project** | Yardstick | | | | +--------------------------------+-----------------------+ -| **Repo/tag** | yardstick/opnfv-8.0.0 | +| **Repo/tag** | yardstick/opnfv-9.0.0 | | | | +--------------------------------+-----------------------+ -| **Yardstick Docker image tag** | opnfv-8.0.0 | +| **Yardstick Docker image tag** | opnfv-9.0.0 | | | | +--------------------------------+-----------------------+ -| **Release designation** | Hunter 8.0 | +| **Release designation** | Iruya 9.0 | | | | +--------------------------------+-----------------------+ -| **Release date** | May 10, 2019 | +| **Release date** | Jan 10, 2020 | | | | +--------------------------------+-----------------------+ -| **Purpose of the delivery** | OPNFV Hunter 8.0.0 | +| **Purpose of the delivery** | OPNFV Iruya 9.0.0 | | | | +--------------------------------+-----------------------+ @@ -142,7 +142,7 @@ Documents Software Deliverables --------------------- - - The Yardstick Docker image: https://hub.docker.com/r/opnfv/yardstick (tag: opnfv-8.0.0) + - The Yardstick Docker image: https://hub.docker.com/r/opnfv/yardstick (tag: opnfv-9.0.0) List of Contexts ^^^^^^^^^^^^^^^^ @@ -267,8 +267,17 @@ List of Scenarios New Test cases -------------- -.. note:: Yardstick Hunter 8.0.0 adds no new test cases. +opnfv_yardstick_tc015: Processing speed with impact on energy consumption +and CPU load. +The purpose of TC015 is to evaluate the IaaS compute performance with +regards to CPU processing speed with its impact on the energy consumption. +It measures score of single cpu running and parallel running. Energy +consumption and cpu load are monitored while the cpu test is running. +The purpose is also to be able to spot the trends. Test results, graphs +and similar shall be stored for comparison reasons and product evolution +understanding between different OPNFV versions and/or configurations, +different server types. Version Change @@ -280,7 +289,7 @@ Module Version Changes This is the seventh tracked release of Yardstick. It is based on following upstream versions: -- OpenStack Rocky +- OpenStack Stein Document Version Changes @@ -297,25 +306,6 @@ It includes the following documentation updates: Feature additions ----------------- -- Add TRex Baremetal/SA scale up test cases. -- Add possibility to distribute DPDK/vhost-user ports/queues between CPU cores. -- Adding scale up test case for l3fwd OvS-DPDK. -- Add Testcase Prox Standalone SRIOV. -- Add vBNG PPPoE test cases functionality. -- Add IXIA Baremetal scale up testcases. -- Add vIPSEC testcases. -- Add TRex Baremetal/SA scale up test cases. -- Add OpenStack test cases with different framesize and IMIX. -- Add new scenario NSPerf-RFC3511. -- Add VPP traffic profiles for TRex traffic generator. -- Add Trex traffic generator to initate Traffic for VPP IPSEC. -- Add IxNextgen API for setting IP priority, flow tracking options, creating BGP protocol layer. -- Add Pktgen traffic generator for vCMTS. -- Add Trex traffic generator to initate Traffic for VPP IPSEC. -- Add sipp trafficgen based SampleVNFTrafficGen. -- Add ansible scripts to deploy Kubernetes. -- Update NSB report to use Barometer metrics. -- Support using existing private key when using external heat template file. Scenario Matrix =============== @@ -337,7 +327,7 @@ Corrected Faults ---------------- -Hunter 8.0.0 known restrictions/issues +Iruya 9.0.0 known restrictions/issues ====================================== @@ -346,7 +336,7 @@ Useful links - wiki project page: https://wiki.opnfv.org/display/yardstick/Yardstick - - wiki Yardstick Hunter release planning page: https://wiki.opnfv.org/display/yardstick/Release+Hunter + - wiki Yardstick Iruya release planning page: https://wiki.opnfv.org/display/yardstick/Release+Iruya - Yardstick repo: https://git.opnfv.org/yardstick diff --git a/docs/testing/user/userguide/02-methodology.rst b/docs/testing/user/userguide/02-methodology.rst index b1eee9781..bb490c404 100644 --- a/docs/testing/user/userguide/02-methodology.rst +++ b/docs/testing/user/userguide/02-methodology.rst @@ -108,6 +108,10 @@ options). | | * Latency for storage read/write operations | | | * Throughput for storage read/write operations | | | | ++---------+-------------------------------------------------------------------| +| Energy | * Energy consumption in Watts (transversal to all others | +| | scenario) | +| | | +---------+-------------------------------------------------------------------+ .. _table2_2: @@ -183,6 +187,7 @@ options). | | TC010 | TC024 | | | | TC012 | TC055 | | | | TC014 | | | +| | TC015 | | | | | TC069 | | | +---------+-------------------+----------------+------------------------------+ | Network | TC001 | TC044 | TC016 [1]_ | diff --git a/docs/testing/user/userguide/15-list-of-tcs.rst b/docs/testing/user/userguide/15-list-of-tcs.rst index 8990800c1..b727aa3c9 100644 --- a/docs/testing/user/userguide/15-list-of-tcs.rst +++ b/docs/testing/user/userguide/15-list-of-tcs.rst @@ -1,135 +1,136 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International -.. License. -.. http://creativecommons.org/licenses/by/4.0 -.. (c) OPNFV, Ericsson AB and others. - -==================== -Yardstick Test Cases -==================== - -Abstract -======== - -This chapter lists available Yardstick test cases. -Yardstick test cases are divided in two main categories: - -* *Generic NFVI Test Cases* - Test Cases developed to realize the methodology - described in :doc:`02-methodology` - -* *OPNFV Feature Test Cases* - Test Cases developed to verify one or more - aspect of a feature delivered by an OPNFV Project. - -Generic NFVI Test Case Descriptions -=================================== - -.. toctree:: - :maxdepth: 1 - - opnfv_yardstick_tc001.rst - opnfv_yardstick_tc002.rst - opnfv_yardstick_tc004.rst - opnfv_yardstick_tc005.rst - opnfv_yardstick_tc006.rst - opnfv_yardstick_tc008.rst - opnfv_yardstick_tc009.rst - opnfv_yardstick_tc010.rst - opnfv_yardstick_tc011.rst - opnfv_yardstick_tc012.rst - opnfv_yardstick_tc014.rst - opnfv_yardstick_tc024.rst - opnfv_yardstick_tc037.rst - opnfv_yardstick_tc038.rst - opnfv_yardstick_tc042.rst - opnfv_yardstick_tc043.rst - opnfv_yardstick_tc044.rst - opnfv_yardstick_tc055.rst - opnfv_yardstick_tc061.rst - opnfv_yardstick_tc063.rst - opnfv_yardstick_tc069.rst - opnfv_yardstick_tc070.rst - opnfv_yardstick_tc071.rst - opnfv_yardstick_tc072.rst - opnfv_yardstick_tc073.rst - opnfv_yardstick_tc074.rst - opnfv_yardstick_tc075.rst - opnfv_yardstick_tc076.rst - opnfv_yardstick_tc078.rst - opnfv_yardstick_tc079.rst - opnfv_yardstick_tc080.rst - opnfv_yardstick_tc081.rst - opnfv_yardstick_tc083.rst - opnfv_yardstick_tc084.rst - -OPNFV Feature Test Cases -======================== - -H A ---- - -.. toctree:: - :maxdepth: 1 - - opnfv_yardstick_tc019.rst - opnfv_yardstick_tc025.rst - opnfv_yardstick_tc045.rst - opnfv_yardstick_tc046.rst - opnfv_yardstick_tc047.rst - opnfv_yardstick_tc048.rst - opnfv_yardstick_tc049.rst - opnfv_yardstick_tc050.rst - opnfv_yardstick_tc051.rst - opnfv_yardstick_tc052.rst - opnfv_yardstick_tc053.rst - opnfv_yardstick_tc054.rst - opnfv_yardstick_tc056.rst - opnfv_yardstick_tc057.rst - opnfv_yardstick_tc058.rst - opnfv_yardstick_tc087.rst - opnfv_yardstick_tc088.rst - opnfv_yardstick_tc089.rst - opnfv_yardstick_tc090.rst - opnfv_yardstick_tc091.rst - opnfv_yardstick_tc092.rst - opnfv_yardstick_tc093.rst - -IPv6 ----- - -.. toctree:: - :maxdepth: 1 - - opnfv_yardstick_tc027.rst - -KVM ---- - -.. toctree:: - :maxdepth: 1 - - opnfv_yardstick_tc028.rst - -Parser ------- - -.. toctree:: - :maxdepth: 1 - - opnfv_yardstick_tc040.rst - -StorPerf --------- - -.. toctree:: - :maxdepth: 1 - - opnfv_yardstick_tc074.rst - -Templates -========= - -.. toctree:: - :maxdepth: 1 - - testcase_description_v2_template - Yardstick_task_templates - +.. This work is licensed under a Creative Commons Attribution 4.0 International
+.. License.
+.. http://creativecommons.org/licenses/by/4.0
+.. (c) OPNFV, Ericsson AB and others.
+
+====================
+Yardstick Test Cases
+====================
+
+Abstract
+========
+
+This chapter lists available Yardstick test cases.
+Yardstick test cases are divided in two main categories:
+
+* *Generic NFVI Test Cases* - Test Cases developed to realize the methodology
+ described in :doc:`02-methodology`
+
+* *OPNFV Feature Test Cases* - Test Cases developed to verify one or more
+ aspect of a feature delivered by an OPNFV Project.
+
+Generic NFVI Test Case Descriptions
+===================================
+
+.. toctree::
+ :maxdepth: 1
+
+ opnfv_yardstick_tc001.rst
+ opnfv_yardstick_tc002.rst
+ opnfv_yardstick_tc004.rst
+ opnfv_yardstick_tc005.rst
+ opnfv_yardstick_tc006.rst
+ opnfv_yardstick_tc008.rst
+ opnfv_yardstick_tc009.rst
+ opnfv_yardstick_tc010.rst
+ opnfv_yardstick_tc011.rst
+ opnfv_yardstick_tc012.rst
+ opnfv_yardstick_tc014.rst
+ opnfv_yardstick_tc015.rst
+ opnfv_yardstick_tc024.rst
+ opnfv_yardstick_tc037.rst
+ opnfv_yardstick_tc038.rst
+ opnfv_yardstick_tc042.rst
+ opnfv_yardstick_tc043.rst
+ opnfv_yardstick_tc044.rst
+ opnfv_yardstick_tc055.rst
+ opnfv_yardstick_tc061.rst
+ opnfv_yardstick_tc063.rst
+ opnfv_yardstick_tc069.rst
+ opnfv_yardstick_tc070.rst
+ opnfv_yardstick_tc071.rst
+ opnfv_yardstick_tc072.rst
+ opnfv_yardstick_tc073.rst
+ opnfv_yardstick_tc074.rst
+ opnfv_yardstick_tc075.rst
+ opnfv_yardstick_tc076.rst
+ opnfv_yardstick_tc078.rst
+ opnfv_yardstick_tc079.rst
+ opnfv_yardstick_tc080.rst
+ opnfv_yardstick_tc081.rst
+ opnfv_yardstick_tc083.rst
+ opnfv_yardstick_tc084.rst
+
+OPNFV Feature Test Cases
+========================
+
+H A
+---
+
+.. toctree::
+ :maxdepth: 1
+
+ opnfv_yardstick_tc019.rst
+ opnfv_yardstick_tc025.rst
+ opnfv_yardstick_tc045.rst
+ opnfv_yardstick_tc046.rst
+ opnfv_yardstick_tc047.rst
+ opnfv_yardstick_tc048.rst
+ opnfv_yardstick_tc049.rst
+ opnfv_yardstick_tc050.rst
+ opnfv_yardstick_tc051.rst
+ opnfv_yardstick_tc052.rst
+ opnfv_yardstick_tc053.rst
+ opnfv_yardstick_tc054.rst
+ opnfv_yardstick_tc056.rst
+ opnfv_yardstick_tc057.rst
+ opnfv_yardstick_tc058.rst
+ opnfv_yardstick_tc087.rst
+ opnfv_yardstick_tc088.rst
+ opnfv_yardstick_tc089.rst
+ opnfv_yardstick_tc090.rst
+ opnfv_yardstick_tc091.rst
+ opnfv_yardstick_tc092.rst
+ opnfv_yardstick_tc093.rst
+
+IPv6
+----
+
+.. toctree::
+ :maxdepth: 1
+
+ opnfv_yardstick_tc027.rst
+
+KVM
+---
+
+.. toctree::
+ :maxdepth: 1
+
+ opnfv_yardstick_tc028.rst
+
+Parser
+------
+
+.. toctree::
+ :maxdepth: 1
+
+ opnfv_yardstick_tc040.rst
+
+StorPerf
+--------
+
+.. toctree::
+ :maxdepth: 1
+
+ opnfv_yardstick_tc074.rst
+
+Templates
+=========
+
+.. toctree::
+ :maxdepth: 1
+
+ testcase_description_v2_template
+ Yardstick_task_templates
+
diff --git a/docs/testing/user/userguide/opnfv_yardstick_tc015.rst b/docs/testing/user/userguide/opnfv_yardstick_tc015.rst new file mode 100755 index 000000000..277614ad4 --- /dev/null +++ b/docs/testing/user/userguide/opnfv_yardstick_tc015.rst @@ -0,0 +1,141 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International
+.. License.
+.. http://creativecommons.org/licenses/by/4.0
+.. (c) OPNFV, Orange and others.
+
+*************************************
+Yardstick Test Case Description TC015
+*************************************
+
+.. _unixbench: https://github.com/kdlucas/byte-unixbench/blob/master/UnixBench
+
++-----------------------------------------------------------------------------+
+| Processing speed with impact on energy consumption and CPU load |
+| |
++--------------+--------------------------------------------------------------+
+|test case id | OPNFV_YARDSTICK_TC015_PROCESSING SPEED |
+| | |
++--------------+--------------------------------------------------------------+
+|metric | score of single cpu running, |
+| | score of parallel running, |
+| | energy consumption |
+| | cpu load |
+| | |
++--------------+--------------------------------------------------------------+
+|test purpose | The purpose of TC015 is to evaluate the IaaS compute |
+| | performance with regards to CPU processing speed with |
+| | its impact on the energy consumption |
+| | It measures score of single cpu running and parallel |
+| | running. Energy consumption and cpu load are monitored while |
+| | the cpu test is running. |
+| | |
+| | The purpose is also to be able to spot the trends. |
+| | Test results, graphs and similar shall be stored for |
+| | comparison reasons and product evolution understanding |
+| | between different OPNFV versions and/or configurations, |
+| | different server types. |
+| | |
++--------------+--------------------------------------------------------------+
+|test tool | UnixBench |
+| | |
+| | Unixbench is the most used CPU benchmarking software tool. |
+| | It can measure the performance of bash scripts, CPUs in |
+| | multithreading and single threading. It can also measure the |
+| | performance for parallel tasks. Also, specific disk IO for |
+| | small and large files are performed. You can use it to |
+| | measure either linux dedicated servers and linux vps |
+| | servers, running CentOS, Debian, Ubuntu, Fedora and other |
+| | distros. |
+| | |
+| | (UnixBench is not always part of a Linux distribution, hence |
+| | it needs to be installed. As an example see the |
+| | /yardstick/tools/ directory for how to generate a Linux |
+| | image with UnixBench included.) |
+| | |
+| | Redfish API |
+| | This HTTPS interface is provided by BMC of every telco grade |
+| | server. Is is a standard interface. |
+| | |
++--------------+--------------------------------------------------------------+
+|test | The UnixBench runs system benchmarks on a compute, getting |
+|description | information on the CPUs in the system. If the system has |
+| | more than one CPU, the tests will be run twice -- once with |
+| | a single copy of each test running at once, and once with N |
+| | N copies, where N is the number of CPUs. |
+| | |
+| | UnixBench will process a set of results from a single test |
+| | by averaging the individual pass results into a single final |
+| | value. |
+| | |
+| | While the cpu test is running Energy scenario run in |
+| | background to monitor the number of watt consumed by the |
+| | compute server on the fly. The same is done using Cpuload |
+| | scenario to monitor the overall percentage of CPU used on |
+| | the fly. This enables to balance the CPU score with its |
+| | impact on energy consumption. Synchronized measurements |
+| | enables to look at any relation between CPU load and energy |
+| | consumption. |
+| | |
++--------------+--------------------------------------------------------------+
+|configuration | file: opnfv_yardstick_tc015.yaml |
+| | |
+| | run_mode: |
+| | Run Energy and Cpuload in background |
+| | Run unixbench in quiet mode or verbose mode |
+| | test_type: dhry2reg, whetstone and so on |
+| | |
+| | Duration and Interval are set globally for Energy and |
+| | Cpuload, aligned with duration of UnixBench test. |
+| | SLA can be set for each scenario type. Default is NA. |
+| | For SLA with single_score and parallel_score, both can be |
+| | set by user, default is NA. |
+| | |
++--------------+--------------------------------------------------------------+
+|applicability | Test shall be applied to node context only |
+| | It can be configured with different: |
+| | |
+| | * test types: dhry2reg, whetstone |
+| | |
+| | Default values exist. |
+| | |
+| | SLA (optional) : min_score: The minimun UnixBench score that |
+| | is accepted. |
+| | |
++--------------+--------------------------------------------------------------+
+|usability | This test case is one of Yardstick's generic test. Thus it |
+| | is runnable on most of the scenarios. |
+| | |
++--------------+--------------------------------------------------------------+
+|references | unixbench_ |
+| | |
+| | ETSI-NFV-TST001 |
+| | |
++--------------+--------------------------------------------------------------+
+|pre-test | The target shall have unixbench installed on it. |
+|conditions | |
+| | |
++--------------+--------------------------------------------------------------+
+|test sequence | description and expected result |
+| | |
++--------------+--------------------------------------------------------------+
+|step 1 | Yardstick is connected with the target node using ssh. |
+| | |
++--------------+--------------------------------------------------------------+
+|step 2 | Energy and Cpuload are launched silently in background one |
+| | after the other. |
+| | Then UnixBench is invoked. All the tests are executed using |
+| | the "Run" script in the top-level of UnixBench directory. |
+| | The "Run" script will run a standard "index" test, and save |
+| | the report in the "results" directory. Then the report is |
+| | processed by "unixbench_benchmark" and checked against the |
+| | SLA. |
+| | While unibench runs energy and cpu load are catched |
+| | periodically according to interval value. |
+| | |
+| | 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/gui/gui.sh b/gui/gui.sh index 12a14923e..0746fb4a4 100755 --- a/gui/gui.sh +++ b/gui/gui.sh @@ -1,5 +1,6 @@ +curl -sL https://deb.nodesource.com/setup_8.x -o /tmp/nodesource_setup.sh +bash /tmp/nodesource_setup.sh apt-get install -y nodejs -apt-get install -y npm ln -s /usr/bin/nodejs /usr/bin/node npm install npm install -g grunt diff --git a/requirements.txt b/requirements.txt index cb2a99a26..c441900e7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,6 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. ############################################################################## # Copyright (c) 2015 Ericsson AB and others. # @@ -7,63 +10,63 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -Babel==2.3.4 # BSD; OSI Approved BSD License -Jinja2==2.9.6 # BSD; OSI Approved BSD License -SQLAlchemy==1.1.12 # MIT License; OSI Approved MIT License -PTable==0.9.2 # BSD (3 clause); OSI Approved BSD License -ansible==2.5.5 # GPLv3; OSI Approved GNU General Public License v3 or later (GPLv3+) -backport-ipaddress==0.1; python_version <= "2.7" # OSI Approved Python Software Foundation License -chainmap==1.0.2 # Python Software Foundation License; OSI Approved Python Software Foundation License -cmd2==0.8.6 # MIT License; OSI Approved MIT License -docker-py==1.10.6 # OSI Approved Apache Software License -extras==1.0.0 # OSI Approved MIT License -flasgger==0.5.13 # MIT -flask-restful-swagger==0.19 # MIT -flask-restful==0.3.5 # BSD; OSI Approved BSD License -flask==0.11.1 # BSD; OSI Approved BSD License -functools32==3.2.3.post2; python_version <= "2.7" # PSF license -futures==3.1.1;python_version=='2.7' # BSD; OSI Approved BSD License -influxdb==4.1.1 # MIT License; OSI Approved MIT License -IxNetwork==8.40.1124.9 # MIT License; OSI Approved MIT License -jinja2schema==0.1.4 # OSI Approved BSD License -keystoneauth1==3.3.0 # OSI Approved Apache Software License -kubernetes==6.0.0 # OSI Approved Apache Software License -mock==2.0.0 # OSI Approved BSD License; `BSD License`_; http://github.com/testing-cabal/mock/blob/master/LICENSE.txt -msgpack-python==0.4.8 # OSI Approved Apache Software License -netaddr==0.7.19 # BSD License; OSI Approved BSD License; OSI Approved MIT License -netifaces==0.10.6 # MIT License; OSI Approved MIT License -os-client-config==1.28.0 # OSI Approved Apache Software License -osc-lib==1.8.0 # OSI Approved Apache Software License -oslo.log==3.41.0 # OSI Approved Apache Software License -oslo.config==5.1.0 # OSI Approved Apache Software License -oslo.i18n==3.17.0 # OSI Approved Apache Software License -oslo.messaging==5.36.0 # OSI Approved Apache Software License -oslo.privsep==1.23.0 # OSI Approved Apache Software License -oslo.serialization==2.20.1 # OSI Approved Apache Software License -oslo.utils==3.33.0 # OSI Approved Apache Software License -paramiko==2.2.1 # LGPL; OSI Approved GNU Library or Lesser General Public License (LGPL) -pbr==3.1.1 # OSI Approved Apache Software License; Apache License, Version 2.0 -pika==0.10.0 # BSD; OSI Approved BSD License -pip==9.0.1 # MIT -positional==1.1.2 # OSI Approved Apache Software License -pycrypto==2.6.1 # Public Domain -pyparsing==2.2.0 # MIT License; OSI Approved MIT License -pyroute2==0.4.21 # dual license GPLv2+ and Apache v2; OSI Approved GNU General Public License v2 or later (GPLv2+); OSI Approved Apache Software License -pyrsistent==0.14.1 # LICENSE.mit; OSI Approved MIT License -python-cinderclient==3.3.0 # OSI Approved Apache Software License -python-glanceclient==2.8.0 # OSI Approved Apache Software License -python-keystoneclient==3.13.0 # OSI Approved Apache Software License -python-neutronclient==6.5.0 # OSI Approved Apache Software License -python-novaclient==9.1.1 # OSI Approved Apache Software License -python-openstackclient==3.18.0 # Apache Software License -pyzmq==16.0.2 # LGPL+BSD; OSI Approved GNU Library or Lesser General Public License (LGPL); OSI Approved BSD License -requests==2.14.2 # Apache 2.0; OSI Approved Apache Software License -requestsexceptions==1.3.0 # OSI Approved Apache Software License -scp==0.10.2 # LGPL -shade==1.22.2 # OSI Approved Apache Software License -simplejson==3.13.2 # MIT License; OSI Approved MIT License; OSI Approved Academic Free License (AFL) -six==1.10.0 # MIT; OSI Approved MIT License -stevedore==1.25.0 # OSI Approved Apache Software License -traceback2==1.4.0 # OSI Approved Python Software Foundation License -unicodecsv==0.14.1 # BSD License; OSI Approved BSD License -wrapt==1.10.10 # BSD +Babel!=2.4.0 # BSD +Jinja2 # BSD License (3 clause) +SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8 # MIT +PTable # BSD (3 clause); OSI Approved BSD License +ansible # GPLv3; OSI Approved GNU General Public License v3 or later (GPLv3+) +backport-ipaddress;python_version <= "2.7" # OSI Approved Python Software Foundation License +chainmap # Python Software Foundation License; OSI Approved Python Software Foundation License +cmd2!=0.8.3,<0.9.0 # MIT +docker-py # OSI Approved Apache Software License +extras # MIT +flasgger # MIT +flask-restful-swagger # MIT +Flask-RESTful # BSD +Flask!=0.11 # BSD +functools32;python_version <= "2.7" # PSF license +futures!=0.17.0;python_version=='2.7' or python_version=='2.6' # PSF +influxdb!=5.2.0,!=5.2.1 # MIT +IxNetwork # MIT License; OSI Approved MIT License +jinja2schema # OSI Approved BSD License +keystoneauth1 # Apache-2.0 +kubernetes # Apache-2.0 +mock # BSD +msgpack-python # OSI Approved Apache Software License +netaddr # BSD +netifaces!=0.10.0,!=0.10.1 # MIT +os-client-config # Apache-2.0 +osc-lib # Apache-2.0 +oslo.log # Apache-2.0 +oslo.config!=4.3.0,!=4.4.0 # Apache-2.0 +oslo.i18n # Apache-2.0 +oslo.messaging!=9.0.0 # Apache-2.0 +oslo.privsep # Apache-2.0 +oslo.serialization!=2.19.1 # Apache-2.0 +oslo.utils!=3.39.1,!=3.40.0,!=3.40.1 # Apache-2.0 +paramiko # LGPLv2.1+ +pbr!=2.1.0 # Apache-2.0 +pika # BSD +pip # MIT +positional # OSI Approved Apache Software License +pycrypto # Public Domain +pyparsing # MIT +pyroute2;sys_platform!='win32' # Apache-2.0 (+ dual licensed GPL2) +pyrsistent # LICENSE.mit; OSI Approved MIT License +python-cinderclient!=4.0.0 # Apache-2.0 +python-glanceclient # Apache-2.0 +python-keystoneclient!=2.1.0 # Apache-2.0 +python-neutronclient # Apache-2.0 +python-novaclient # Apache-2.0 +python-openstackclient # Apache-2.0 +pyzmq # LGPL+BSD +requests!=2.20.0 # Apache-2.0 +requestsexceptions # Apache-2.0 +scp # LGPL +shade # Apache-2.0 +simplejson # MIT +six # MIT +stevedore # Apache-2.0 +traceback2 # OSI Approved Python Software Foundation License +unicodecsv;python_version<'3.0' # BSD +wrapt # BSD License diff --git a/samples/energy.yaml b/samples/energy.yaml new file mode 100755 index 000000000..bc8f8228b --- /dev/null +++ b/samples/energy.yaml @@ -0,0 +1,53 @@ +##############################################################################
+# Copyright (c) 2019 Orange and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+# Sample benchmark task config file
+# Monitor energy consumption during a cpu test
+# Should be used inside test cases where UnixBench is replaced by other
+# scenario type. This enables to easily consider energy consumption as a
+# mandatory metric for any performance test
+
+schema: "yardstick:task:0.1"
+
+{% set target = target or "node5"%}
+{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set duree = 60 %}
+{% set intervalle = 5 %}
+scenarios:
+
+-
+ type: Energy
+ run_in_background: true
+ target: {{target}}.LF
+
+ runner:
+ type: Duration
+ duration: {{duree}}
+ interval: {{intervalle}}
+
+ sla:
+ action: monitor
+
+-
+ type: UnixBench
+ options:
+ run_mode: 'verbose'
+ test_type: 'dhry2reg'
+ host: {{target}}.LF
+
+ runner:
+ type: Iteration
+ iterations: 1
+ interval: 1
+
+
+context:
+ type: Node
+ name: LF
+ file: {{file}}
diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..b82819d2c --- /dev/null +++ b/setup.cfg @@ -0,0 +1,43 @@ +[metadata] +name = yardstick +home-page = https://www.opnfv.org +version = 0.1.dev0 + +[files] +packages = yardstick +scripts = + tools/yardstick-img-modify + tools/yardstick-img-lxd-modify + tools/yardstick-img-dpdk-modify +package-data = + yardstick = + benchmark/scenarios/availability/*.yaml + benchmark/scenarios/availability/attacker/*.yaml + benchmark/scenarios/availability/ha_tools/*.bash + benchmark/scenarios/availability/ha_tools/*/*.bash + benchmark/scenarios/availability/attacker/scripts/*.bash + benchmark/scenarios/availability/monitor/*.yaml + benchmark/scenarios/availability/monitor/script_tools/*.bash + benchmark/scenarios/compute/*.bash + benchmark/scenarios/networking/*.bash + benchmark/scenarios/networking/*.txt + benchmark/scenarios/parser/*.sh + benchmark/scenarios/storage/*.bash + network_services/nfvi/collectd.conf + network_services/nfvi/collectd.sh + resources/files/* + resources/scripts/install/*.bash + resources/scripts/remove/*.bash + resources/templates/*.vat + etc = + yardstick/nodes/*/*.yaml + yardstick/*.sample + tests = + opnfv/*/*.yaml + ci/*.sh + +[entry_points] +console_scripts = + yardstick=yardstick.main:main + yardstick-plot=yardstick.plot.plotter:main [plot] +yardstick.scenario = diff --git a/setup.py b/setup.py index cbf8b15c6..7fcba2b50 100755..100644 --- a/setup.py +++ b/setup.py @@ -1,64 +1,29 @@ -############################################################################## -# Copyright (c) 2017 Ericsson AB and others. +# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -from __future__ import absolute_import -from setuptools import setup, find_packages +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT +import setuptools +# In python < 2.7.4, a lazy loading of package `pbr` will break +# setuptools if some other modules registered functions in `atexit`. +# solution from: http://bugs.python.org/issue15881#msg170215 +try: + import multiprocessing # noqa # pylint:disable=unused-import +except ImportError: + pass -setup( - name="yardstick", - version="0.1.dev0", - packages=find_packages(), - include_package_data=True, - package_data={ - 'yardstick': [ - 'benchmark/scenarios/availability/*.yaml', - 'benchmark/scenarios/availability/attacker/*.yaml', - 'benchmark/scenarios/availability/ha_tools/*.bash', - 'benchmark/scenarios/availability/ha_tools/*/*.bash', - 'benchmark/scenarios/availability/attacker/scripts/*.bash', - 'benchmark/scenarios/availability/monitor/*.yaml', - 'benchmark/scenarios/availability/monitor/script_tools/*.bash', - 'benchmark/scenarios/compute/*.bash', - 'benchmark/scenarios/networking/*.bash', - 'benchmark/scenarios/networking/*.txt', - 'benchmark/scenarios/parser/*.sh', - 'benchmark/scenarios/storage/*.bash', - 'network_services/nfvi/collectd.conf', - 'network_services/nfvi/collectd.sh', - 'resources/files/*', - 'resources/scripts/install/*.bash', - 'resources/scripts/remove/*.bash', - 'resources/templates/*.vat' - ], - 'etc': [ - 'yardstick/nodes/*/*.yaml', - 'yardstick/*.sample' - ], - 'tests': [ - 'opnfv/*/*.yaml', - 'ci/*.sh' - ] - }, - url="https://www.opnfv.org", - extras_require={ - 'plot': ["matplotlib>=1.4.2"] - }, - entry_points={ - 'console_scripts': [ - 'yardstick=yardstick.main:main', - 'yardstick-plot=yardstick.plot.plotter:main [plot]' - ], - 'yardstick.scenario': [] - }, - scripts=[ - 'tools/yardstick-img-modify', - 'tools/yardstick-img-lxd-modify', - 'tools/yardstick-img-dpdk-modify' - ] -) +setuptools.setup( + setup_requires=['pbr>=2.0.0'], + pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt index 7825cc5d2..1500541a9 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,20 +2,20 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -coverage==4.4.2 # Apache 2.0; OSI Approved Apache Software License; http://www.apache.org/licenses/LICENSE-2.0; http://www.apache.org/licenses/LICENSE-2.0 -fixtures==3.0.0 # OSI Approved BSD License; OSI Approved Apache Software License -oslotest===2.17.1 # OSI Approved Apache Software License -packaging==16.8.0 # BSD or Apache License, Version 2.0 -pyflakes==1.0.0 # MIT; OSI Approved MIT License -pylint==1.8.1 # GPLv2 -python-subunit==1.2.0 # OSI Approved Apache Software License; OSI Approved BSD License -testrepository==0.0.20 # OSI Approved BSD License; OSI Approved Apache Software License -testtools==2.3.0 # OSI Approved MIT License -unittest2==1.1.0 # OSI Approved BSD License +coverage!=4.4 # Apache-2.0 +fixtures # Apache-2.0/BSD +oslotest # Apache-2.0 +packaging # Apache-2.0 +pyflakes # MIT; OSI Approved MIT License +pylint # GPLv2 +python-subunit # Apache-2.0/BSD +testrepository # Apache-2.0/BSD +testtools # MIT +unittest2 # BSD # NOTE(ralonsoh): to be removed, only for coverage support -python-heatclient==1.11.0 # OSI Approved Apache Software License +python-heatclient # Apache-2.0 + +# Yardstick I release <-> OpenStack Stein release +-e git+https://github.com/openstack/requirements.git@stable/stein#egg=os_requirements -# Yardstick G release <-> OpenStack Queens release -openstack_requirements==1.2.0 # OSI Approved Apache Software License --e git+https://github.com/openstack/requirements.git@stable/queens#egg=os_requirements diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc015.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc015.yaml new file mode 100755 index 000000000..f35c83377 --- /dev/null +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc015.yaml @@ -0,0 +1,60 @@ +##############################################################################
+# Copyright (c) 2019 Orange and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+
+schema: "yardstick:task:0.1"
+description: >
+ Yardstick TC015 config file;
+ Measure Processing speed using unixbench with its impact on energy consumption and CPU load.
+
+{% set target = target or "node5"%}
+{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set duree = 60 %}
+{% set intervalle = 5 %}
+scenarios:
+
+-
+ type: Energy
+ run_in_background: true
+ target: {{target}}.LF
+
+ runner:
+ type: Duration
+ duration: {{duree}}
+ interval: {{intervalle}}
+
+-
+ type: CPUload
+ run_in_background: true
+ options:
+ interval: 1
+ count: 1
+ host: {{target}}.LF
+ runner:
+ type: Duration
+ duration: {{duree}}
+ interval: {{intervalle}}
+
+-
+ type: UnixBench
+ options:
+ run_mode: 'verbose'
+ test_type: 'dhry2reg'
+ host: {{target}}.LF
+
+ runner:
+ type: Iteration
+ iterations: 1
+ interval: 1
+
+
+context:
+ type: Node
+ name: LF
+ file: {{file}}
@@ -1,7 +1,7 @@ [tox] minversion = 2.0 skipsdist = True -envlist = py{27,3},pep8,functional{,-py3},coverage +envlist = py3,pep8,functional-py3,coverage [testenv] usedevelop=True @@ -9,8 +9,11 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY BRANCH setenv = VIRTUAL_ENV={envdir} deps = + -chttps://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt + -c{toxinidir}/upper-constraints.txt -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt + whitelist_externals = /bin/bash [testenv:py27] diff --git a/upper-constraints.txt b/upper-constraints.txt new file mode 100644 index 000000000..bbde3c734 --- /dev/null +++ b/upper-constraints.txt @@ -0,0 +1,18 @@ +PTable===0.9.2 +ansible===2.5.5 +backport-ipaddress===0.1 +chainmap===1.0.2 +docker-py===1.10.6 +flasgger===0.5.13 +flask-restful-swagger===0.20.1 +functools32===3.2.3.post2 +IxNetwork===8.40.1124.9 +jinja2schema===0.1.4 +msgpack-python===0.4.8 +positional===1.1.2 +pycrypto===2.6.1 +pyrsistent===0.14.1 +scp===0.10.2 +traceback2===1.4.0 +pyflakes===1.0.0 +pylint===1.8.1 diff --git a/yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash b/yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash index 9f1804819..0f0122e51 100644 --- a/yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash +++ b/yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash @@ -25,8 +25,8 @@ run_unixbench() # write the result to stdout in json format output_json() { - single_score=$(awk '/Score/{print $7}' $OUTPUT_FILE | head -1 ) - parallel_score=$(awk '/Score/{print $7}' $OUTPUT_FILE | tail -1 ) + single_score=$(awk '/Score/{print $NF}' $OUTPUT_FILE | head -1 ) + parallel_score=$(awk '/Score/{print $NF}' $OUTPUT_FILE | tail -1 ) echo -e "{ \ \"single_score\":\"$single_score\", \ \"parallel_score\":\"$parallel_score\" \ diff --git a/yardstick/benchmark/scenarios/energy/__init__.py b/yardstick/benchmark/scenarios/energy/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/yardstick/benchmark/scenarios/energy/__init__.py diff --git a/yardstick/benchmark/scenarios/energy/energy.py b/yardstick/benchmark/scenarios/energy/energy.py new file mode 100644 index 000000000..7440835be --- /dev/null +++ b/yardstick/benchmark/scenarios/energy/energy.py @@ -0,0 +1,139 @@ +############################################################################## +# Copyright (c) 2019 Lenovo Group Limited Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +from __future__ import print_function +from __future__ import absolute_import +import logging +import requests +import json +from yardstick.benchmark.scenarios import base + +LOG = logging.getLogger(__name__) +logging.captureWarnings(True) + + +class Energy(base.Scenario): + """Get current energy consumption of target host + + This scenario sends a REDFISH request to a host BMC + to request current energy consumption. + The response returns a number of Watts. + Usually this is an average of a rolling windows + taken from server internal sensor. + This is dependant of the server provider. + + This scenario should be used with node context + + As this scenario usually run background with other scenarios, + error of api query or data parse will not terminate task runner. + If any error occured, energy consumption will be set to -1. + + Parameters + None + """ + + __scenario_type__ = "Energy" + + def __init__(self, scenario_cfg, context_cfg): + self.scenario_cfg = scenario_cfg + self.context_cfg = context_cfg + self.target = self.context_cfg['target'] + self.setup_done = False + self.get_response = False + + def _send_request(self, url): + LOG.info("Send request to %s", url) + pod_auth = (self.target["redfish_user"], self.target["redfish_pwd"]) + response = requests.get(url, auth=pod_auth, verify=False) + return response + + def setup(self): + url = "https://{}/redfish/v1/".format(self.target["redfish_ip"]) + response = self._send_request(url) + if response.status_code != 200: + LOG.info("Don't get right response from %s", url) + self.get_response = False + else: + LOG.info("Get response from %s", url) + self.get_response = True + + self.setup_done = True + + def load_chassis_list(self): + chassis_list = [] + + # Get Chassis list + request_url = "https://" + self.target["redfish_ip"] + request_url += "/redfish/v1/Chassis/" + response = self._send_request(request_url) + if response.status_code != 200: + LOG.info("Do not get proper response from %s", request_url) + return chassis_list + + try: + chassis_data = json.loads(response.text) + except(TypeError, ValueError) as e: + LOG.info("Invalid response data, %s", e) + return chassis_list + + try: + for chassis in chassis_data['Members']: + chassis_list.append(chassis["@odata.id"]) + except KeyError as e: + LOG.info("Error data format of chassis data or invalid key.") + + return chassis_list + + def get_power(self, chassis_uri): + """Get PowerMetter values from Redfish API.""" + if chassis_uri[-1:] != '/': + chassis_uri += '/' + request_url = "https://" + self.target['redfish_ip'] + request_url += chassis_uri + request_url += "Power/" + response = self._send_request(request_url) + if response.status_code != 200: + LOG.info("Do not get proper response from %s", request_url) + power = -1 + return power + + try: + power_metrics = json.loads(response.text) + except(TypeError, ValueError) as e: + LOG.info("Invalid response data, %s", e) + power = -1 + return power + + try: + power = power_metrics["PowerControl"][0]["PowerConsumedWatts"] + except KeyError as e: + LOG.info("Error data format of power metrics or invalid key.") + power = -1 + + return power + + def run(self, result): + """execute the benchmark""" + if not self.setup_done: + self.setup() + chassis_list = self.load_chassis_list() + if not self.get_response or not chassis_list: + power = -1 + data = { + "power": power, + } + result.update(data) + else: + power = 0 + for chassis in chassis_list: + power += self.get_power(chassis) + data = { + "power": power, + } + result.update(data) diff --git a/yardstick/benchmark/scenarios/networking/ping.py b/yardstick/benchmark/scenarios/networking/ping.py index 6caeab5ef..1c9510220 100644 --- a/yardstick/benchmark/scenarios/networking/ping.py +++ b/yardstick/benchmark/scenarios/networking/ping.py @@ -103,12 +103,14 @@ class Ping(base.Scenario): rtt_result[target_vm_name] = float(self.PING_ERROR_RTT) # store result before potential AssertionError result.update(utils.flatten_dict_key(ping_result)) - self.verify_SLA(sla_max_rtt is None, - "packet dropped rtt %f > sla: max_rtt(%f)" - % (rtt_result[target_vm_name], sla_max_rtt)) - self.verify_SLA(False, - "packet dropped rtt %f" - % (rtt_result[target_vm_name])) + if sla_max_rtt is not None: + self.verify_SLA(rtt_result[target_vm_name] <= sla_max_rtt, + "packet dropped rtt %f > sla: max_rtt(%f)" + % (rtt_result[target_vm_name], sla_max_rtt)) + else: + self.verify_SLA(False, + "packet dropped rtt %f" + % (rtt_result[target_vm_name])) def _test(): # pragma: no cover diff --git a/yardstick/common/packages.py b/yardstick/common/packages.py index f20217fdc..c65eab2ba 100644 --- a/yardstick/common/packages.py +++ b/yardstick/common/packages.py @@ -15,9 +15,9 @@ import logging import re -import pip -from pip import exceptions as pip_exceptions -from pip.operations import freeze +from pip._internal.main import main +from pip._internal import exceptions as pip_exceptions +from pip._internal.operations import freeze from yardstick.common import privsep @@ -36,7 +36,7 @@ def _pip_main(package, action, target=None): cmd = [action, package, '--upgrade'] if target: cmd.append('--target=%s' % target) - return pip.main(cmd) + return main(cmd) def _pip_execute_action(package, action=ACTION_INSTALL, target=None): diff --git a/yardstick/tests/functional/common/test_packages.py b/yardstick/tests/functional/common/test_packages.py index 14de46bcf..e15f72898 100644 --- a/yardstick/tests/functional/common/test_packages.py +++ b/yardstick/tests/functional/common/test_packages.py @@ -15,6 +15,7 @@ import os from os import path import re +import unittest from yardstick.common import packages from yardstick.common import utils @@ -69,6 +70,7 @@ class PipPackagesTestCase(base.BaseFunctionalTestCase): self.assertEqual(0, packages.pip_install(package_dir, self.TMP_FOLDER)) self.assertTrue(package_name in self._list_packages()) + @unittest.skip("see https://github.com/pypa/pip/issues/3889") def test_install_from_pip_package(self): dirname = path.dirname(__file__) package_path = (dirname + @@ -89,11 +91,10 @@ class PipPackagesTestCase(base.BaseFunctionalTestCase): # NOTE (ralonsoh): from requirements.txt file. The best way to test # this function is to parse requirements.txt and test-requirements.txt # and check all packages. - pkgs_ref = {'Babel': '2.3.4', - 'SQLAlchemy': '1.1.12', - 'influxdb': '4.1.1', - 'netifaces': '0.10.6', - 'unicodecsv': '0.14.1'} + pkgs_ref = {'Babel': '2.6.0', + 'SQLAlchemy': '1.2.18', + 'influxdb': '5.1.0', + 'netifaces': '0.10.9'} pkgs = packages.pip_list() for name, version in (pkgs_ref.items()): self.assertEqual(version, pkgs[name]) diff --git a/yardstick/tests/unit/benchmark/scenarios/energy/__init__.py b/yardstick/tests/unit/benchmark/scenarios/energy/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/yardstick/tests/unit/benchmark/scenarios/energy/__init__.py diff --git a/yardstick/tests/unit/benchmark/scenarios/energy/energy_sample_chassis_output.txt b/yardstick/tests/unit/benchmark/scenarios/energy/energy_sample_chassis_output.txt new file mode 100644 index 000000000..9b3afd1fb --- /dev/null +++ b/yardstick/tests/unit/benchmark/scenarios/energy/energy_sample_chassis_output.txt @@ -0,0 +1,14 @@ +{ + "@odata.id": "/redfish/v1/Chassis", + "Name": "ChassisCollection", + "@odata.context": "/redfish/v1/$metadata#ChassisCollection.ChassisCollection", + "Members": [ + { + "@odata.id": "/redfish/v1/Chassis/1" + } + ], + "@odata.type": "#ChassisCollection.ChassisCollection", + "@odata.etag": "\"af5a94479815eb5f87fe91ea08fde0ac\"", + "Members@odata.count": 1, + "Description": "A collection of Chassis resource instances." +} diff --git a/yardstick/tests/unit/benchmark/scenarios/energy/energy_sample_power_metrics.txt b/yardstick/tests/unit/benchmark/scenarios/energy/energy_sample_power_metrics.txt new file mode 100644 index 000000000..343ed3667 --- /dev/null +++ b/yardstick/tests/unit/benchmark/scenarios/energy/energy_sample_power_metrics.txt @@ -0,0 +1,300 @@ +{ + "PowerControl@odata.count": 1, + "@odata.id": "/redfish/v1/Chassis/1/Power", + "Redundancy@odata.count": 1, + "@odata.context": "/redfish/v1/$metadata#Power.Power", + "Voltages": [ + { + "MaxReadingRange": 14.28, + "RelatedItem": [ + { + "@odata.id": "/redfish/v1/Systems/1" + }, + { + "@odata.id": "/redfish/v1/Chassis/1" + } + ], + "@odata.id": "/redfish/v1/Chassis/1/Power#/Voltages/0", + "Status": { + "State": "Enabled" + }, + "SensorNumber": 140, + "Name": "SysBrd 12V", + "PhysicalContext": "VoltageRegulator", + "LowerThresholdCritical": 10.81, + "RelatedItem@odata.count": 2, + "MemberId": "0", + "MinReadingRange": null, + "ReadingVolts": 12.15, + "UpperThresholdCritical": 13.22 + }, + { + "MaxReadingRange": 3.95, + "RelatedItem": [ + { + "@odata.id": "/redfish/v1/Systems/1" + }, + { + "@odata.id": "/redfish/v1/Chassis/1" + } + ], + "@odata.id": "/redfish/v1/Chassis/1/Power#/Voltages/1", + "Status": { + "State": "Enabled" + }, + "SensorNumber": 141, + "Name": "SysBrd 3.3V", + "PhysicalContext": "VoltageRegulator", + "LowerThresholdCritical": 2.98, + "RelatedItem@odata.count": 2, + "MemberId": "1", + "MinReadingRange": null, + "UpperThresholdCritical": 3.63, + "ReadingVolts": 3.36 + }, + { + "MaxReadingRange": 5.97, + "RelatedItem": [ + { + "@odata.id": "/redfish/v1/Systems/1" + }, + { + "@odata.id": "/redfish/v1/Chassis/1" + } + ], + "@odata.id": "/redfish/v1/Chassis/1/Power#/Voltages/2", + "Status": { + "State": "Enabled" + }, + "SensorNumber": 142, + "Name": "SysBrd 5V", + "PhysicalContext": "VoltageRegulator", + "LowerThresholdCritical": 4.49, + "RelatedItem@odata.count": 2, + "MemberId": "2", + "MinReadingRange": null, + "UpperThresholdCritical": 5.5, + "ReadingVolts": 5.03 + }, + { + "MaxReadingRange": 3.32, + "RelatedItem": [ + { + "@odata.id": "/redfish/v1/Systems/1" + }, + { + "@odata.id": "/redfish/v1/Chassis/1" + } + ], + "@odata.id": "/redfish/v1/Chassis/1/Power#/Voltages/3", + "Status": { + "State": "Enabled" + }, + "SensorNumber": 3, + "Name": "CMOS Battery", + "PhysicalContext": "VoltageRegulator", + "LowerThresholdCritical": 2.25, + "RelatedItem@odata.count": 2, + "MemberId": "3", + "MinReadingRange": null, + "LowerThresholdNonCritical": 2.39, + "ReadingVolts": 3.12 + } + ], + "Voltages@odata.count": 4, + "Redundancy": [ + { + "@odata.id": "/redfish/v1/Chassis/1/Power#/Redundancy/0", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "Name": "PSU Redundancy", + "MinNumNeeded": 2, + "Oem": { + "Lenovo": { + "NonRedundantAvailablePower": 1100, + "@odata.type": "#LenovoRedundancy.v1_0_0.LenovoRedundancyProperties", + "PowerRedundancySettings": { + "EstimatedUsage": "58.55%", + "MaxPowerLimitWatts": 1100, + "PowerFailureLimit": 0, + "PowerRedundancyPolicy": "RedundantWithThrottling" + } + } + }, + "RedundancyEnabled": true, + "RedundancySet": [ + { + "@odata.id": "/redfish/v1/Chassis/1/Power#/PowerSupplies/0" + }, + { + "@odata.id": "/redfish/v1/Chassis/1/Power#/PowerSupplies/1" + } + ], + "RedundancySet@odata.count": 2, + "MaxNumSupported": 2, + "Mode": "N+m", + "MemberId": "0" + } + ], + "Description": "Power Consumption and Power Limiting", + "Name": "Power", + "PowerSupplies@odata.count": 2, + "Oem": { + "Lenovo": { + "@odata.type": "#LenovoPower.v1_0_0.Capabilities", + "LocalPowerControlEnabled": true, + "PowerOnPermissionEnabled": true, + "PowerRestorePolicy": "Restore", + "WakeOnLANEnabled": true + } + }, + "@odata.type": "#Power.v1_5_1.Power", + "Id": "Power", + "@odata.etag": "\"ad85a1403e07a433386e9907d00565cc\"", + "PowerControl": [ + { + "PowerAllocatedWatts": 1100, + "RelatedItem": [ + { + "@odata.id": "/redfish/v1/Chassis/1" + } + ], + "@odata.id": "/redfish/v1/Chassis/1/Power#/PowerControl/0", + "Status": { + "HealthRollup": "Warning", + "State": "Enabled" + }, + "PowerLimit": { + "LimitException": "NoAction", + "LimitInWatts": null + }, + "Name": "Server Power Control", + "Oem": { + "Lenovo": { + "PowerUtilization": { + "MaxLimitInWatts": 1100, + "EnablePowerCapping": false, + "LimitMode": "AC", + "EnablePowerCapping@Redfish.Deprecated": "The property is deprecated. Please use LimitInWatts instead.", + "CapacityMinAC": 617, + "MinLimitInWatts": 0, + "GuaranteedInWatts": 617, + "CapacityMinDC": 578, + "CapacityMaxDC": 749, + "CapacityMaxAC": 802 + }, + "HistoryPowerMetric": { + "@odata.id": "/redfish/v1/Chassis/1/Power/PowerControl/0/Oem/Lenovo/HistoryPowerMetric" + }, + "@odata.type": "#LenovoPower.v1_0_0.PowerControl" + } + }, + "PowerAvailableWatts": 0, + "PowerMetrics": { + "IntervalInMin": 60, + "AverageConsumedWatts": 314.716675, + "MinConsumedWatts": 311, + "MaxConsumedWatts": 318 + }, + "RelatedItem@odata.count": 1, + "MemberId": "0", + "PowerRequestedWatts": 802, + "PowerConsumedWatts": 344, + "PowerCapacityWatts": 1100 + } + ], + "PowerSupplies": [ + { + "SerialNumber": "A4DB8BP11WJ", + "InputRanges": [ + { + "InputType": null, + "OutputWattage": null, + "MinimumVoltage": null, + "MaximumVoltage": null + } + ], + "@odata.id": "/redfish/v1/Chassis/1/Power#/PowerSupplies/0", + "RelatedItem@odata.count": 1, + "MemberId": "0", + "PartNumber": "SP57A02023", + "FirmwareVersion": "4.52", + "Status": { + "State": "Enabled", + "Health": "Warning" + }, + "LineInputVoltage": null, + "Name": "PSU1", + "PowerSupplyType": "Unknown", + "LastPowerOutputWatts": 316, + "Oem": { + "Lenovo": { + "Location": { + "InfoFormat": "Slot X", + "Info": "Slot 1" + }, + "HistoryPowerSupplyMetric": { + "@odata.id": "/redfish/v1/Chassis/1/Power/PowerSupplies/0/Oem/Lenovo/HistoryPowerSupplyMetric" + }, + "@odata.type": "#LenovoPower.v1_0_0.PowerSupply" + } + }, + "PowerCapacityWatts": null, + "Manufacturer": "ACBE", + "LineInputVoltageType": "Unknown", + "Model": "LENOVO-SP57A02023", + "RelatedItem": [ + { + "@odata.id": "/redfish/v1/Chassis/1" + } + ] + }, + { + "SerialNumber": "A4DB8BP12J7", + "InputRanges": [ + { + "InputType": "AC", + "OutputWattage": 1100, + "MinimumVoltage": 200, + "MaximumVoltage": 240 + } + ], + "@odata.id": "/redfish/v1/Chassis/1/Power#/PowerSupplies/1", + "RelatedItem@odata.count": 1, + "MemberId": "1", + "PartNumber": "SP57A02023", + "FirmwareVersion": "4.52", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "LineInputVoltage": 220, + "Name": "PSU2", + "PowerSupplyType": "AC", + "LastPowerOutputWatts": 316, + "Oem": { + "Lenovo": { + "Location": { + "InfoFormat": "Slot X", + "Info": "Slot 2" + }, + "HistoryPowerSupplyMetric": { + "@odata.id": "/redfish/v1/Chassis/1/Power/PowerSupplies/1/Oem/Lenovo/HistoryPowerSupplyMetric" + }, + "@odata.type": "#LenovoPower.v1_0_0.PowerSupply" + } + }, + "PowerCapacityWatts": 1100, + "Manufacturer": "ACBE", + "LineInputVoltageType": "ACMidLine", + "Model": "LENOVO-SP57A02023", + "RelatedItem": [ + { + "@odata.id": "/redfish/v1/Chassis/1" + } + ] + } + ] +} diff --git a/yardstick/tests/unit/benchmark/scenarios/energy/test_energy.py b/yardstick/tests/unit/benchmark/scenarios/energy/test_energy.py new file mode 100644 index 000000000..98daefeb7 --- /dev/null +++ b/yardstick/tests/unit/benchmark/scenarios/energy/test_energy.py @@ -0,0 +1,182 @@ +############################################################################## +# Copyright (c) 2019 Lenovo Group Limited 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.energy.energy.Energy + +from __future__ import absolute_import +import unittest +import mock +import os +from yardstick.benchmark.scenarios.energy import energy + + +class EnergyTestCase(unittest.TestCase): + + def setUp(self): + self.ctx = { + 'target': { + 'ip': '172.16.0.137', + 'user': 'root', + 'password': 'passw0rd', + 'redfish_ip': '10.229.17.105', + 'redfish_user': 'USERID', + 'redfish_pwd': "PASSW0RD", + } + } + self.result = {} + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_setup_response_success(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + mock_send_request.return_value.status_code = 200 + p.setup() + self.assertTrue(p.get_response) + self.assertTrue(p.setup_done) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_setup_response_failed(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + mock_send_request.return_value.status_code = 404 + p.setup() + self.assertFalse(p.get_response) + self.assertTrue(p.setup_done) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_load_chassis_list_success(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + expect_result = self._read_file("energy_sample_chassis_output.txt") + expect_result = str(expect_result) + expect_result = expect_result.replace("'", '"') + mock_send_request.return_value.status_code = 200 + mock_send_request.return_value.text = expect_result + self.result = p.load_chassis_list() + self.assertEqual(self.result, ["/redfish/v1/Chassis/1"]) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_load_chassis_response_fail(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + mock_send_request.return_value.status_code = 404 + self.result = p.load_chassis_list() + self.assertEqual(self.result, []) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_load_chassis_wrongtype_response(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + mock_send_request.return_value.status_code = 200 + expect_result = {} + mock_send_request.return_value.text = expect_result + self.result = p.load_chassis_list() + self.assertEqual(self.result, []) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_load_chassis_inproper_key(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + mock_send_request.return_value.status_code = 200 + expect_result = '{"some_key": "some_value"}' + mock_send_request.return_value.text = expect_result + self.result = p.load_chassis_list() + self.assertEqual(self.result, []) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_energy_getpower_success(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + expect_result = self._read_file("energy_sample_power_metrics.txt") + expect_result = str(expect_result) + expect_result = expect_result.replace("'", '"') + mock_send_request.return_value.status_code = 200 + mock_send_request.return_value.text = expect_result + self.result = p.get_power("/redfish/v1/Chassis/1") + self.assertEqual(self.result, 344) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_energy_getpower_response_fail(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + mock_send_request.return_value.status_code = 404 + self.result = p.get_power("/redfish/v1/Chassis/1") + self.assertEqual(self.result, -1) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_energy_getpower_wrongtype_response(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + mock_send_request.return_value.status_code = 200 + expect_result = {} + mock_send_request.return_value.text = expect_result + self.result = p.get_power("/redfish/v1/Chassis/1") + self.assertEqual(self.result, -1) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_energy_getpower_inproper_key(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + mock_send_request.return_value.status_code = 200 + expect_result = '{"some_key": "some_value"}' + mock_send_request.return_value.text = expect_result + self.result = p.get_power("/redfish/v1/Chassis/1") + self.assertEqual(self.result, -1) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_run_success(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + mock_send_request.return_value.status_code = 200 + chassis_list = mock.Mock(return_value=["/redfish/v1/Chassis/1"]) + p.load_chassis_list = chassis_list + power = mock.Mock(return_value=344) + p.get_power = power + p.run(self.result) + self.assertEqual(self.result, {"power": 344}) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_run_no_response(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + mock_send_request.return_value.status_code = 404 + chassis_list = mock.Mock(return_value=["/redfish/v1/Chassis/1"]) + p.load_chassis_list = chassis_list + p.run(self.result) + self.assertEqual(self.result, {"power": -1}) + + @mock.patch('yardstick.benchmark.scenarios.' + 'energy.energy.Energy._send_request') + def test_run_wrong_chassis(self, mock_send_request): + args = {} + p = energy.Energy(args, self.ctx) + mock_send_request.return_value.status_code = 200 + chassis_list = mock.Mock(return_value=[]) + p.load_chassis_list = chassis_list + p.run(self.result) + self.assertEqual(self.result, {"power": -1}) + + def _read_file(self, filename): + curr_path = os.path.dirname(os.path.abspath(__file__)) + output = os.path.join(curr_path, filename) + with open(output) as f: + sample_output = f.read() + return sample_output diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py index 559e0599e..944202658 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py @@ -91,3 +91,17 @@ class PingTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') self.assertRaises(RuntimeError, p.run, result) + + @mock.patch('yardstick.benchmark.scenarios.networking.ping.ssh') + def test_ping_unsuccessful_no_sla(self, mock_ssh): + + args = { + 'options': {'packetsize': 200}, + 'target': 'ares.demo' + } + result = {} + + p = ping.Ping(args, self.ctx) + + mock_ssh.SSH.from_node().execute.return_value = (0, '', '') + self.assertRaises(y_exc.SLAValidationError, p.run, result) diff --git a/yardstick/tests/unit/common/test_packages.py b/yardstick/tests/unit/common/test_packages.py index ba59a3015..09d76fe44 100644 --- a/yardstick/tests/unit/common/test_packages.py +++ b/yardstick/tests/unit/common/test_packages.py @@ -13,8 +13,8 @@ # limitations under the License. import mock -from pip import exceptions as pip_exceptions -from pip.operations import freeze +from pip._internal import exceptions as pip_exceptions +from pip._internal.operations import freeze import unittest from yardstick.common import packages |