Merge "update docs for procedure after host reboot"
authorRoss Brattain <ross.b.brattain@intel.com>
Sat, 20 Jan 2018 00:06:36 +0000 (00:06 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Sat, 20 Jan 2018 00:06:36 +0000 (00:06 +0000)
41 files changed:
.pylintrc
INFO
docker/Dockerfile
docker/Dockerfile.aarch64.patch
docs/testing/user/userguide/opnfv_yardstick_tc081.rst
docs/testing/user/userguide/opnfv_yardstick_tc084.rst [new file with mode: 0644]
requirements.txt
test-requirements.txt
tests/ci/load_images.sh
tests/unit/benchmark/contexts/standalone/test_model.py
tests/unit/test_cmd/__init__.py [moved from tests/functional/__init__.py with 100% similarity, mode: 0644]
tests/unit/test_cmd/commands/__init__.py [moved from tests/unit/apiserver/resources/__init__.py with 100% similarity]
tests/unit/test_cmd/commands/test_env.py [moved from tests/unit/cmd/commands/test_env.py with 90% similarity]
tests/unit/test_cmd/commands/test_testcase.py [moved from tests/unit/cmd/commands/test_testcase.py with 100% similarity]
tests/unit/test_cmd/test_NSBperf.py [moved from tests/unit/cmd/test_NSBperf.py with 99% similarity]
tools/coding-checks.sh
tools/cover.sh
tools/run_tests.sh
tox.ini
yardstick/benchmark/contexts/standalone/model.py
yardstick/network_services/vnf_generic/vnf/tg_ixload.py
yardstick/tests/__init__.py [moved from tests/unit/cmd/__init__.py with 100% similarity]
yardstick/tests/functional/__init__.py [moved from tests/unit/cmd/commands/__init__.py with 100% similarity]
yardstick/tests/functional/test_cli_runner.py [moved from tests/functional/test_cli_runner.py with 95% similarity]
yardstick/tests/functional/test_cli_scenario.py [moved from tests/functional/test_cli_scenario.py with 96% similarity]
yardstick/tests/functional/utils.py [moved from tests/functional/utils.py with 100% similarity]
yardstick/tests/unit/__init__.py [new file with mode: 0644]
yardstick/tests/unit/apiserver/__init__.py [moved from tests/unit/apiserver/__init__.py with 65% similarity]
yardstick/tests/unit/apiserver/resources/__init__.py [moved from tests/unit/common/__init__.py with 100% similarity]
yardstick/tests/unit/apiserver/resources/test_env_action.py [moved from tests/unit/apiserver/resources/test_env_action.py with 92% similarity]
yardstick/tests/unit/apiserver/utils/test_influx.py [moved from tests/unit/apiserver/utils/test_influx.py with 91% similarity]
yardstick/tests/unit/common/__init__.py [new file with mode: 0644]
yardstick/tests/unit/common/config_sample.yaml [moved from tests/unit/common/config_sample.yaml with 100% similarity]
yardstick/tests/unit/common/test_ansible_common.py [moved from tests/unit/common/test_ansible_common.py with 95% similarity]
yardstick/tests/unit/common/test_httpClient.py [moved from tests/unit/common/test_httpClient.py with 100% similarity]
yardstick/tests/unit/common/test_openstack_utils.py [moved from tests/unit/common/test_openstack_utils.py with 96% similarity]
yardstick/tests/unit/common/test_process.py [moved from tests/unit/common/test_process.py with 100% similarity]
yardstick/tests/unit/common/test_template_format.py [moved from tests/unit/common/test_template_format.py with 91% similarity]
yardstick/tests/unit/common/test_utils.py [moved from tests/unit/common/test_utils.py with 100% similarity]
yardstick/tests/unit/common/test_yaml_loader.py [moved from tests/unit/common/test_yaml_loader.py with 100% similarity]
yardstick/tests/unit/test_ssh.py [moved from tests/unit/test_ssh.py with 99% similarity]

index f5dd776..78f6562 100644 (file)
--- a/.pylintrc
+++ b/.pylintrc
@@ -36,6 +36,7 @@ disable=
  dangerous-default-value,
  deprecated-lambda,
  expression-not-assigned,
+ fixme,
  global-statement,
  literal-comparison,
  no-init,
diff --git a/INFO b/INFO
index c19a9d5..35b2828 100644 (file)
--- a/INFO
+++ b/INFO
@@ -13,13 +13,15 @@ Repository: yardstick
 Committers:
 jorgen.w.karlsson@ericsson.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
 trevor.cooper@intel.com
 ross.b.brattain@intel.com
+chenjiankun1@huawei.com
+rodolfo.alonso.hernandez@intel.com
+emma.l.foley@intel.com
 
 Link to TSC approval: http://meetbot.opnfv.org/meetings/
 Link to approval of additional submitters:
index b1eb505..2ee5b4c 100644 (file)
@@ -26,7 +26,7 @@ ENV YARDSTICK_REPO_DIR="${REPOS_DIR}/yardstick" \
 
 RUN apt-get update && apt-get install -y git python-setuptools python-pip && apt-get -y autoremove && apt-get clean
 RUN easy_install -U setuptools==30.0.0
-RUN pip install appdirs==1.4.0
+RUN pip install appdirs==1.4.0 pyopenssl==17.5.0
 
 RUN mkdir -p ${REPOS_DIR}
 
index 33c352a..ca93351 100644 (file)
@@ -1,14 +1,15 @@
-From: Alexandru Nemes <alexandru.nemes@enea.com>
-Date: Mon, 19 Jun 2017 14:18:24 +0300
+From: Cristina Pauna <cristina.pauna@enea.com>
+Date: Thu, 11 Jan 2018 19:06:26 +0200
 Subject: [PATCH] Patch for Yardstick AARCH64 Docker file
 
+Signed-off-by: Cristina Pauna <cristina.pauna@enea.com>
 Signed-off-by: Alexandru Nemes <alexandru.nemes@enea.com>
 ---
- docker/Dockerfile | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
+ docker/Dockerfile | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
 
 diff --git a/docker/Dockerfile b/docker/Dockerfile
-index 96a5d77..03307a2 100644
+index 2ee5b4c..23e5ea5 100644
 --- a/docker/Dockerfile
 +++ b/docker/Dockerfile
 @@ -1,5 +1,5 @@
@@ -22,15 +23,25 @@ index 96a5d77..03307a2 100644
  # http://www.apache.org/licenses/LICENSE-2.0
  ##############################################################################
 
--FROM ubuntu:14.04
-+FROM aarch64/ubuntu:14.04
+-FROM ubuntu:16.04
++FROM arm64v8/ubuntu:16.04
 
 -LABEL image=opnfv/yardstick
 +LABEL image=opnfv/yardstick_aarch64
 
  ARG BRANCH=master
 
-@@ -40,8 +40,8 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf
+@@ -24,7 +24,8 @@ ENV YARDSTICK_REPO_DIR="${REPOS_DIR}/yardstick" \
+     RELENG_REPO_DIR="${REPOS_DIR}/releng" \
+     STORPERF_REPO_DIR="${REPOS_DIR}/storperf"
+
+-RUN apt-get update && apt-get install -y git python-setuptools python-pip && apt-get -y autoremove && apt-get clean
++RUN apt-get update && apt-get install -y git python-setuptools python-pip && apt-get -y autoremove && \
++    apt-get install -y libssl-dev && apt-get -y install libffi-dev && apt-get clean
+ RUN easy_install -U setuptools==30.0.0
+ RUN pip install appdirs==1.4.0 pyopenssl==17.5.0
+
+@@ -43,8 +44,8 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf
 
  EXPOSE 5000
 
@@ -39,4 +50,5 @@ index 96a5d77..03307a2 100644
 +ADD http://download.cirros-cloud.net/daily/20161201/cirros-d161201-aarch64-disk.img ${IMAGE_DIR}
 +ADD http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-disk1.img ${IMAGE_DIR}
 
- COPY ./exec_tests.sh /usr/local/bin/
\ No newline at end of file
+ COPY ./exec_tests.sh /usr/local/bin/
+
index 90af8a3..793c3fd 100644 (file)
@@ -4,7 +4,7 @@
 .. (c) OPNFV, Huawei Technologies Co.,Ltd and others.
 
 *************************************
-Yardstick Test Case Description TC080
+Yardstick Test Case Description TC081
 *************************************
 
 .. _cirros-image: https://download.cirros-cloud.net
@@ -21,7 +21,7 @@ Yardstick Test Case Description TC080
 |metric        | RTT (Round Trip Time)                                        |
 |              |                                                              |
 +--------------+--------------------------------------------------------------+
-|test purpose  | The purpose of TC080 is to do a basic verification that      |
+|test purpose  | The purpose of TC081 is to do a basic verification that      |
 |              | network latency is within acceptable boundaries when packets |
 |              | travel between a containers and a VM.                        |
 |              |                                                              |
diff --git a/docs/testing/user/userguide/opnfv_yardstick_tc084.rst b/docs/testing/user/userguide/opnfv_yardstick_tc084.rst
new file mode 100644 (file)
index 0000000..2e7b28e
--- /dev/null
@@ -0,0 +1,140 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International
+.. License.
+.. http://creativecommons.org/licenses/by/4.0
+.. (c) OPNFV, Huawei Technologies Co.,Ltd and others.
+
+*************************************
+Yardstick Test Case Description TC084
+*************************************
+
+.. _spec_cpu_2006: https://www.spec.org/cpu2006/
+
++-----------------------------------------------------------------------------+
+|Compute Performance                                                          |
+|                                                                             |
++--------------+--------------------------------------------------------------+
+|test case id  | OPNFV_YARDSTICK_TC084_SPEC CPU 2006 FOR VM                   |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|metric        | compute-intensive performance                                |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|test purpose  | The purpose of TC084 is to evaluate the IaaS compute         |
+|              | performance by using SPEC CPU 2006 benchmark. The SPEC CPU   |
+|              | 2006 benchmark has several different ways to measure         |
+|              | computer performance. One way is to measure how fast the     |
+|              | computer completes a single task; this is called a speed     |
+|              | measurement. Another way is to measure how many tasks        |
+|              | computer can accomplish in a certain amount of time; this is |
+|              | called a throughput, capacity or rate measurement.           |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|test tool     | SPEC CPU 2006                                                |
+|              |                                                              |
+|              | The SPEC CPU 2006 benchmark is SPEC's industry-standardized, |
+|              | CPU-intensive benchmark suite, stressing a system's          |
+|              | processor, memory subsystem and compiler. This benchmark     |
+|              | suite includes the SPECint benchmarks and the SPECfp         |
+|              | benchmarks. The SPECint 2006 benchmark contains 12 different |
+|              | benchmark tests and the SPECfp 2006 benchmark contains 19    |
+|              | different benchmark tests.                                   |
+|              |                                                              |
+|              | SPEC CPU 2006 is not always part of a Linux distribution.    |
+|              | SPEC requires that users purchase a license and agree with   |
+|              | their terms and conditions. For this test case, users must   |
+|              | manually download cpu2006-1.2.iso from the SPEC website and  |
+|              | save it under the yardstick/resources folder (e.g. /home/    |
+|              | opnfv/repos/yardstick/yardstick/resources/cpu2006-1.2.iso)   |
+|              | SPEC CPU® 2006 benchmark is available for purchase via the   |
+|              | SPEC order form (https://www.spec.org/order.html).           |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|test          | This test case uses SPEC CPU 2006 benchmark to measure       |
+|description   | compute-intensive performance of VMs.                        |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|configuration | file: opnfv_yardstick_tc084.yaml                             |
+|              |                                                              |
+|              | benchmark_subset is set to int.                              |
+|              |                                                              |
+|              | SLA is not available in this test case.                      |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|applicability | Test can be configured with different:                       |
+|              |                                                              |
+|              |  * benchmark_subset - a subset of SPEC CPU 2006 benchmarks   |
+|              |    to run;                                                   |
+|              |  * SPECint_benchmark - a SPECint benchmark to run;           |
+|              |  * SPECint_benchmark - a SPECfp benchmark to run;            |
+|              |  * output_format - desired report format;                    |
+|              |  * runspec_config - SPEC CPU 2006 config file provided to    |
+|              |    the runspec binary;                                       |
+|              |  * runspec_iterations - the number of benchmark iterations   |
+|              |    to execute. For a reportable run, must be 3;              |
+|              |  * runspec_tune - tuning to use (base, peak, or all). For a  |
+|              |    reportable run, must be either base or all. Reportable    |
+|              |    runs do base first, then (optionally) peak;               |
+|              |  * runspec_size - size of input data to run (test, train, or |
+|              |    ref). Reportable runs ensure that your binaries can       |
+|              |    produce correct results with the test and train workloads |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|usability     | This test case is used for executing SPEC CPU 2006 benchmark |
+|              | on virtual machines. The SPECint 2006 benchmark takes        |
+|              | approximately 5 hours. (The time may vary due to different   |
+|              | VM cpu configurations)                                       |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|references    | spec_cpu_2006_                                               |
+|              |                                                              |
+|              | ETSI-NFV-TST001                                              |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|pre-test      | To run and install SPEC CPU 2006, the following are          |
+|conditions    | required:                                                    |
+|              |  * For SPECint 2006: Both C99 and C++98 compilers are        |
+|              |    installed in VM images;                                   |
+|              |  * For SPECfp 2006: All three of C99, C++98 and Fortran-95   |
+|              |    compilers installed in VM images;                         |
+|              |  * At least 4GB of disk space availabile on VM.              |
+|              |                                                              |
+|              |  gcc 4.8.* and g++ 4.8.* version have been tested in Ubuntu  |
+|              |  14.04, Ubuntu 16.04 and Redhat Enterprise Linux 7.4 image.  |
+|              |  Higher gcc and g++ version may cause compiling error.       |
+|              |                                                              |
+|              |  For more SPEC CPU 2006 dependencies please visit            |
+|              |  (https://www.spec.org/cpu2006/Docs/techsupport.html)        |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|test sequence | description and expected result                              |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|step 1        | cpu2006-1.2.iso has been saved under the yardstick/resources |
+|              | folder (e.g. /home/opnfv/repos/yardstick/yardstick/resources |
+|              | /cpu2006-1.2.iso). Additionally, to use your custom runspec  |
+|              | config file you can save it under the yardstick/resources/   |
+|              | files folder and specify the config file name in the         |
+|              | runspec_config parameter.                                    |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|step 2        | Upload SPEC CPU 2006 ISO to the target VM using scp and      |
+|              | install SPEC CPU 2006.                                       |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|step 3        | Connect to the target server using SSH.                      |
+|              | If custom runspec config file is used, copy this file from   |
+|              | yardstick to the target VM via the SSH tunnel.               |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|step 4        | SPEC CPU 2006 benchmark is invoked and SPEC CPU 2006 metrics |
+|              | are generated.                                               |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|step 5        | Text, HTML, CSV, PDF, and Configuration file outputs for the |
+|              | SPEC CPU 2006 metrics are fetched from the VM and stored     |
+|              | under /tmp/result folder.                                    |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
+|test verdict  | None. SPEC CPU 2006 results are collected and stored.        |
+|              |                                                              |
++--------------+--------------------------------------------------------------+
index dec58b6..88c0e65 100644 (file)
@@ -8,80 +8,59 @@
 ##############################################################################
 
 Babel==2.3.4            # BSD; OSI Approved  BSD License
-Jinja2==2.8.1           # BSD; OSI Approved  BSD License
-MarkupSafe==0.23        # 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
-PyYAML==3.12            # MIT; OSI Approved  MIT License
-SQLAlchemy==1.1.4       # MIT License; OSI Approved  MIT License
-ansible==2.3.2          # GPLv3; OSI Approved  GNU General Public License v3 or later (GPLv3+)
-appdirs==1.4.3          # MIT; OSI Approved  MIT License
+ansible==2.4.2          # 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
-cliff==2.4.0            # OSI Approved  Apache Software License
-cmd2==0.6.9             # MIT; OSI Approved  MIT License
-debtcollector==1.11.0   # OSI Approved  Apache Software License
 django==1.8.17          # BSD; OSI Approved  BSD License
+                        # NOTE(ralonsoh): django must be bumped to 1.11.8; consider the migration notes [1]
+                        # [1] https://docs.djangoproject.com/ja/1.11/ref/templates/upgrading/
 docker-py==1.10.6       # OSI Approved  Apache Software License
-ecdsa==0.13             # MIT
 extras==1.0.0           # OSI Approved  MIT License
 flasgger==0.5.13        # MIT
-flask-restful-swagger==0.19     # 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
-funcsigs==1.0.2         # ASL; OSI Approved  Apache Software License
 functools32==3.2.3.post2; python_version <= "2.7"    # PSF license
-futures==3.0.5          # BSD; OSI Approved  BSD License
-influxdb==4.0.0         # MIT License; OSI Approved  MIT License
-iso8601==0.1.11         # MIT; OSI Approved  MIT License
-jsonpatch==1.15         # Modified BSD License; OSI Approved  BSD License
-jsonpointer==1.10       # Modified BSD License; OSI Approved  BSD License
-jsonschema==2.5.1       # MIT; OSI Approved  MIT License
+futures==3.1.1;python_version=='2.7'    # BSD; OSI Approved  BSD License
+influxdb==4.1.1         # MIT License; OSI Approved  MIT License
 jinja2schema==0.1.4     # OSI Approved  BSD License
-keystoneauth1==2.18.0   # OSI Approved  Apache Software License
+keystoneauth1==3.1.0    # OSI Approved  Apache Software License
 kubernetes==3.0.0a1     # OSI Approved  Apache Software License
-linecache2==1.0.0       # OSI Approved  Python Software Foundation License
-lxml==3.7.2             # OSI Approved  BSD License
-# upgrade to version 2.0.0 to match python3 unittest.mock features
 mock==2.0.0             # OSI Approved  BSD License; `BSD License`_; http://github.com/testing-cabal/mock/blob/master/LICENSE.txt
-monotonic==1.2          # Apache; OSI Approved  Apache Software License
 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.5       # MIT License; OSI Approved  MIT License
-openstacksdk==0.9.13    # OSI Approved  Apache Software License
-os-client-config==1.26.0        # OSI Approved  Apache Software License
-osc-lib==1.3.0          # OSI Approved  Apache Software License
-oslo.config==3.22.0     # OSI Approved  Apache Software License
-oslo.i18n==3.12.0       # OSI Approved  Apache Software License
-oslo.serialization==2.16.0      # OSI Approved  Apache Software License
-oslo.utils==3.22.0      # OSI Approved  Apache Software License
-paramiko==2.1.1         # LGPL; OSI Approved  GNU Library or Lesser General Public License (LGPL)
-pbr==1.10.0             # OSI Approved  Apache Software License; Apache License, Version 2.0
-# version 14.5.0 for compatibility with trex traffic generator
+netifaces==0.10.6       # MIT License; OSI Approved  MIT License
+os-client-config==1.28.0    # OSI Approved  Apache Software License
+osc-lib==1.7.0          # OSI Approved  Apache Software License
+oslo.config==4.11.1     # OSI Approved  Apache Software License
+oslo.i18n==3.17.0       # OSI Approved  Apache Software License
+oslo.serialization==2.20.1  # OSI Approved  Apache Software License
+oslo.utils==3.28.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
-positional==1.1.1       # OSI Approved  Apache Software License
+positional==1.1.2       # OSI Approved  Apache Software License
 pycrypto==2.6.1         # Public Domain
-pyparsing==2.1.10       # MIT License; OSI Approved  MIT License
-pyroute2==0.4.12        # dual license GPLv2+ and Apache v2; OSI Approved  GNU General Public License v2 or later (GPLv2+); OSI Approved  Apache Software License
-pyrsistent==0.11.12     # LICENSE.mit; OSI Approved  MIT License
-python-cinderclient==1.11.0     # OSI Approved  Apache Software License
-python-glanceclient==2.6.0      # OSI Approved  Apache Software License
-python-heatclient==1.8.1        # OSI Approved  Apache Software License
-python-keystoneclient==3.10.0   # OSI Approved  Apache Software License
-python-mimeparse==1.6.0         # OSI Approved  MIT License
-python-neutronclient==6.1.0     # OSI Approved  Apache Software License
-python-novaclient==7.1.1        # OSI Approved  Apache Software License
-python-openstackclient==3.8.1   # OSI Approved  Apache Software License
-python-swiftclient==3.3.0       # OSI Approved  Apache Software License
-pytz==2016.10           # MIT; OSI Approved  MIT License
-pyzmq==14.5.0           # LGPL+BSD; OSI Approved  GNU Library or Lesser General Public License (LGPL); OSI Approved  BSD License
-requests==2.13.0        # Apache 2.0; OSI Approved  Apache Software License
-requestsexceptions==1.1.3       # OSI Approved  Apache Software License
+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.1.0      # OSI Approved  Apache Software License
+python-glanceclient==2.8.0      # OSI Approved  Apache Software License
+python-heatclient==1.11.1       # 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
+pyzmq==16.0.2           # LGPL+BSD; OSI Approved  GNU Library or Lesser General Public License (LGPL); OSI Approved  BSD License
+requests==2.18.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.17.0           # OSI Approved  Apache Software License
-simplejson==3.10.0      # MIT License; OSI Approved  MIT License; OSI Approved  Academic Free License (AFL)
+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.20.0       # OSI Approved  Apache Software 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
-warlock==1.2.0          # OSI Approved  Apache Software License
-wrapt==1.10.8           # BSD
+wrapt==1.10.10          # BSD
index 8c59e45..f933df2 100644 (file)
@@ -2,14 +2,14 @@
 # of appearance. Changing the order has an impact on the overall integration
 # process, which may cause wedges in the gate later.
 
-coverage==4.3.4             # Apache 2.0; OSI Approved  Apache Software License; http://www.apache.org/licenses/LICENSE-2.0; http://www.apache.org/licenses/LICENSE-2.0
+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
 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.2.0            # OSI Approved  MIT License
+testtools==2.3.0            # OSI Approved  MIT License
 unittest2==1.1.0            # OSI Approved  BSD License
 
 # Yardstick F release <-> OpenStack Pike release
index 80caf07..caaba9e 100755 (executable)
@@ -133,7 +133,7 @@ load_cirros_image()
         CIRROS_IMAGE_PATH="/home/opnfv/images/cirros-d161201-aarch64-disk.img"
         EXTRA_PARAMS="--property hw_video_model=vga --property short_id=ubuntu16.04"
     else
-        CIRROS_IMAGE_VERSION="Cirros-0.3.5"
+        CIRROS_IMAGE_VERSION="cirros-0.3.5"
         CIRROS_IMAGE_PATH="/home/opnfv/images/cirros-0.3.5-x86_64-disk.img"
     fi
 
index 31ec2b7..a8c54f1 100644 (file)
@@ -134,9 +134,9 @@ class ModelLibvirtTestCase(unittest.TestCase):
                 as mock_parse:
             xml = copy.deepcopy(self.xml)
             mock_parse.return_value = xml
-            vf_pci = '0001:05:04.2'
+            vm_pci = '0001:05:04.2'
             model.Libvirt.add_sriov_interfaces(
-                self.pci_address_str, vf_pci, self.mac, xml_input)
+                vm_pci, self.pci_address_str, self.mac, xml_input)
             mock_parse.assert_called_once_with(xml_input)
             self.mock_write_xml.assert_called_once_with(xml_input)
             interface = xml.find('devices').find('interface')
@@ -145,8 +145,29 @@ class ModelLibvirtTestCase(unittest.TestCase):
             mac = interface.find('mac')
             self.assertEqual(self.mac, mac.get('address'))
             source = interface.find('source')
+            source_address = source.find('address')
             self.assertIsNotNone(source.find('address'))
-            self.assertIsNotNone(interface.find('address'))
+
+            self.assertEqual('pci', source_address.get('type'))
+            self.assertEqual('0x' + self.pci_address_str.split(':')[0],
+                             source_address.get('domain'))
+            self.assertEqual('0x' + self.pci_address_str.split(':')[1],
+                             source_address.get('bus'))
+            self.assertEqual('0x' + self.pci_address_str.split(':')[2].split('.')[0],
+                             source_address.get('slot'))
+            self.assertEqual('0x' + self.pci_address_str.split(':')[2].split('.')[1],
+                             source_address.get('function'))
+
+            interface_address = interface.find('address')
+            self.assertEqual('pci', interface_address.get('type'))
+            self.assertEqual('0x' + vm_pci.split(':')[0],
+                             interface_address.get('domain'))
+            self.assertEqual('0x' + vm_pci.split(':')[1],
+                             interface_address.get('bus'))
+            self.assertEqual('0x' + vm_pci.split(':')[2].split('.')[0],
+                             interface_address.get('slot'))
+            self.assertEqual('0x' + vm_pci.split(':')[2].split('.')[1],
+                             interface_address.get('function'))
 
     def test_create_snapshot_qemu(self):
         result = "/var/lib/libvirt/images/0.qcow2"
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from tests/functional/__init__.py
rename to tests/unit/test_cmd/__init__.py
similarity index 90%
rename from tests/unit/cmd/commands/test_env.py
rename to tests/unit/test_cmd/commands/test_env.py
index 73cd5af..13c3ed4 100644 (file)
@@ -49,6 +49,9 @@ class EnvCommandTestCase(unittest.TestCase):
     @mock.patch('yardstick.cmd.commands.env.HttpClient.get')
     @mock.patch('yardstick.cmd.commands.env.EnvCommand._print_status')
     def test_check_status(self, print_mock, get_mock):
+        # pylint: disable=unused-argument
+        # NOTE(ralonsoh): the pylint exception must be removed. The mocked
+        # command call must be tested.
         task_id = str(uuid.uuid4())
         get_mock.return_value = {'status': 2, 'result': 'error'}
         status = EnvCommand()._check_status(task_id, 'hello world')
@@ -57,7 +60,8 @@ class EnvCommandTestCase(unittest.TestCase):
     def test_print_status(self):
         try:
             EnvCommand()._print_status('hello', 'word')
-        except Exception as e:
+        except Exception as e:  # pylint: disable=broad-except
+            # NOTE(ralonsoh): try to reduce the scope of this exception.
             self.assertIsInstance(e, IndexError)
 
 
similarity index 99%
rename from tests/unit/cmd/test_NSBperf.py
rename to tests/unit/test_cmd/test_NSBperf.py
index e1b4da7..19eb0af 100644 (file)
@@ -27,7 +27,8 @@ from yardstick.cmd import NSBperf
 
 @mock.patch('six.moves.input', return_value='0')
 class TestHandler(unittest.TestCase):
-    def test_handler(self, test):
+
+    def test_handler(self, *args):
         subprocess.call = mock.Mock(return_value=0)
         self.assertRaises(SystemExit, NSBperf.sigint_handler)
 
index 4ee9099..615f2c3 100644 (file)
@@ -28,6 +28,7 @@ process_options () {
 
 run_pylint () {
     local target="${scriptargs:-all}"
+    local output_format=""
 
     if [ "$target" = "all" ]; then
         files="ansible api tests yardstick"
@@ -37,11 +38,15 @@ run_pylint () {
             *) echo "$target is an unrecognized basecommit"; exit 1;;
         esac
     fi
-
+    # make Jenkins output parseable because Jenkins doesn't handle color
+    # enventually we should use the Jenkins Pylint plugin or other tools
+    if [ -n "${BRANCH:-}" ] ; then
+        output_format="--output-format=parseable"
+    fi
     echo "Running pylint..."
     echo "You can speed this up by running it on 'HEAD~[0-9]' (e.g. HEAD~0, this change only)..."
     if [ -n "${files}" ]; then
-        pylint --rcfile=.pylintrc ${files}
+        pylint --rcfile=.pylintrc ${output_format} ${files}
     else
         echo "No python changes in this commit, pylint check not required."
         exit 0
index 780a85a..c6e928d 100644 (file)
@@ -42,17 +42,17 @@ run_coverage_test() {
     git checkout HEAD^
 
     baseline_report=$(mktemp -t yardstick_coverageXXXXXXX)
-    ls -l .testrepository
 
-    # workaround 'db type could not be determined' bug
-    # https://bugs.launchpad.net/testrepository/+bug/1229445
-    rm -rf .testrepository
     find . -type f -name "*.pyc" -delete
 
-    #python setup.py testr --coverage --testr-args=""
-    python setup.py testr --coverage --slowest --testr-args="$*"
-    testr failing
-    coverage report > ${baseline_report}
+    # Temporarily run tests from two directories, until all tests have moved
+    coverage run -p -m unittest discover ./tests/unit
+    coverage run -p -m unittest discover ./yardstick/tests/unit
+    coverage combine
+
+    # Temporarily omit yardstick/tests from the report
+    coverage report --omit=yardstick/tests/*/* > ${baseline_report}
+    coverage erase
 
     # debug awk
     tail -1 ${baseline_report}
@@ -69,17 +69,17 @@ run_coverage_test() {
 
     # Generate and save coverage report
     current_report=$(mktemp -t yardstick_coverageXXXXXXX)
-    ls -l .testrepository
 
-    # workaround 'db type could not be determined' bug
-    # https://bugs.launchpad.net/testrepository/+bug/1229445
-    rm -rf .testrepository
     find . -type f -name "*.pyc" -delete
 
-    #python setup.py testr --coverage --testr-args=""
-    python setup.py testr --coverage --slowest --testr-args="$*"
-    testr failing
-    coverage report > ${current_report}
+    # Temporarily run tests from two directories, until all tests have moved
+    coverage run -p -m unittest discover ./tests/unit
+    coverage run -p -m unittest discover ./yardstick/tests/unit
+    coverage combine
+
+    # Temporarily omit yardstick/tests from the report
+    coverage report --omit=yardstick/tests/*/* > ${current_report}
+    coverage erase
 
     rm -rf cover-$PY_VER
     coverage html -d cover-$PY_VER
index f253327..32c4f19 100755 (executable)
@@ -29,8 +29,17 @@ run_tests() {
     echo "Running unittest ... "
     if [ $FILE_OPTION == "f" ]; then
         python -m unittest discover -v -s tests/unit > $logfile 2>&1
+        if [ $? -ne 0 ]; then
+            echo "FAILED, results in $logfile"
+            exit 1
+        fi
+        python -m unittest discover -v -s yardstick/tests/unit >> $logfile 2>&1
     else
         python -m unittest discover -v -s tests/unit
+        if [ $? -ne 0 ]; then
+            exit 1
+        fi
+        python -m unittest discover -v -s yardstick/tests/unit
     fi
 
     if [ $? -ne 0 ]; then
@@ -53,7 +62,7 @@ run_coverage() {
 run_functional_test() {
 
     mkdir -p .testrepository
-    python -m subunit.run discover tests/functional > .testrepository/subunit.log
+    python -m subunit.run discover yardstick/tests/functional > .testrepository/subunit.log
 
     subunit2pyunit < .testrepository/subunit.log
     EXIT_CODE=$?
diff --git a/tox.ini b/tox.ini
index 9a82878..822ffda 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -5,7 +5,7 @@ envlist = py{27,3},pep8,functional{,-py3},coverage
 
 [testenv]
 usedevelop=True
-passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
+passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY BRANCH
 deps =
     -r{toxinidir}/requirements.txt
     -r{toxinidir}/test-requirements.txt
index 85ae14b..0d58e91 100644 (file)
@@ -212,9 +212,8 @@ class Libvirt(object):
         mac.set('address', vf_mac)
 
         source = ET.SubElement(interface, 'source')
-        addr = ET.SubElement(source, 'address')
         pci_address = PciAddress(vf_pci.strip())
-        cls._add_interface_address(addr, pci_address)
+        cls._add_interface_address(source, pci_address)
 
         pci_vm_address = PciAddress(vm_pci.strip())
         cls._add_interface_address(interface, pci_vm_address)
index 61c0454..3ab30b5 100644 (file)
@@ -91,7 +91,7 @@ class IxLoadResourceHelper(ClientResourceHelper):
                     self.result[key].append(value)
 
     def setup(self):
-        # TODO: fixupt scenario_helper to hanlde ixia
+        # NOTE: fixup scenario_helper to hanlde ixia
         self.resource_file_name = \
             find_relative_file(self.scenario_helper.scenario_cfg['ixia_profile'],
                                self.scenario_helper.scenario_cfg["task_path"])
@@ -113,7 +113,7 @@ class IxLoadResourceHelper(ClientResourceHelper):
     def collect_kpi(self):
         if self.data:
             self._result.update(self.data)
-        LOG.info("Collect {0} KPIs {1}".format(self.RESOURCE_WORD, self._result))
+        LOG.info("Collect %s KPIs %s", self.RESOURCE_WORD, self._result)
         return self._result
 
     def log(self):
@@ -170,9 +170,6 @@ class IxLoadTrafficGen(SampleVNFTrafficGen):
         self.resource_helper.log()
         self.resource_helper.data = self.resource_helper.make_aggregates()
 
-    def instantiate(self, scenario_cfg, context_cfg):
-        super(IxLoadTrafficGen, self).instantiate(scenario_cfg, context_cfg)
-
     def terminate(self):
         call(["pkill", "-9", "http_ixload.py"])
         super(IxLoadTrafficGen, self).terminate()
similarity index 95%
rename from tests/functional/test_cli_runner.py
rename to yardstick/tests/functional/test_cli_runner.py
index 620edc3..2f2d7fe 100755 (executable)
@@ -7,11 +7,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-
-from __future__ import absolute_import
 import unittest
 
-from tests.functional import utils
+from yardstick.tests.functional import utils
 
 
 class RunnerTestCase(unittest.TestCase):
similarity index 96%
rename from tests/functional/test_cli_scenario.py
rename to yardstick/tests/functional/test_cli_scenario.py
index 63b533b..7aaacad 100755 (executable)
@@ -7,11 +7,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-
-from __future__ import absolute_import
 import unittest
 
-from tests.functional import utils
+from yardstick.tests.functional import utils
 
 
 class ScenarioTestCase(unittest.TestCase):
diff --git a/yardstick/tests/unit/__init__.py b/yardstick/tests/unit/__init__.py
new file mode 100644 (file)
index 0000000..a468b27
--- /dev/null
@@ -0,0 +1,76 @@
+# Copyright (c) 2017 Intel Corporation\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#      http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+from __future__ import absolute_import\r
+import mock\r
+\r
+\r
+STL_MOCKS = {\r
+    'trex_stl_lib': mock.MagicMock(),\r
+    'trex_stl_lib.base64': mock.MagicMock(),\r
+    'trex_stl_lib.binascii': mock.MagicMock(),\r
+    'trex_stl_lib.collections': mock.MagicMock(),\r
+    'trex_stl_lib.copy': mock.MagicMock(),\r
+    'trex_stl_lib.datetime': mock.MagicMock(),\r
+    'trex_stl_lib.functools': mock.MagicMock(),\r
+    'trex_stl_lib.imp': mock.MagicMock(),\r
+    'trex_stl_lib.inspect': mock.MagicMock(),\r
+    'trex_stl_lib.json': mock.MagicMock(),\r
+    'trex_stl_lib.linecache': mock.MagicMock(),\r
+    'trex_stl_lib.math': mock.MagicMock(),\r
+    'trex_stl_lib.os': mock.MagicMock(),\r
+    'trex_stl_lib.platform': mock.MagicMock(),\r
+    'trex_stl_lib.pprint': mock.MagicMock(),\r
+    'trex_stl_lib.random': mock.MagicMock(),\r
+    'trex_stl_lib.re': mock.MagicMock(),\r
+    'trex_stl_lib.scapy': mock.MagicMock(),\r
+    'trex_stl_lib.socket': mock.MagicMock(),\r
+    'trex_stl_lib.string': mock.MagicMock(),\r
+    'trex_stl_lib.struct': mock.MagicMock(),\r
+    'trex_stl_lib.sys': mock.MagicMock(),\r
+    'trex_stl_lib.threading': mock.MagicMock(),\r
+    'trex_stl_lib.time': mock.MagicMock(),\r
+    'trex_stl_lib.traceback': mock.MagicMock(),\r
+    'trex_stl_lib.trex_stl_async_client': mock.MagicMock(),\r
+    'trex_stl_lib.trex_stl_client': mock.MagicMock(),\r
+    'trex_stl_lib.trex_stl_exceptions': mock.MagicMock(),\r
+    'trex_stl_lib.trex_stl_ext': mock.MagicMock(),\r
+    'trex_stl_lib.trex_stl_jsonrpc_client': mock.MagicMock(),\r
+    'trex_stl_lib.trex_stl_packet_builder_interface': mock.MagicMock(),\r
+    'trex_stl_lib.trex_stl_packet_builder_scapy': mock.MagicMock(),\r
+    'trex_stl_lib.trex_stl_port': mock.MagicMock(),\r
+    'trex_stl_lib.trex_stl_stats': mock.MagicMock(),\r
+    'trex_stl_lib.trex_stl_streams': mock.MagicMock(),\r
+    'trex_stl_lib.trex_stl_types': mock.MagicMock(),\r
+    'trex_stl_lib.types': mock.MagicMock(),\r
+    'trex_stl_lib.utils': mock.MagicMock(),\r
+    'trex_stl_lib.utils.argparse': mock.MagicMock(),\r
+    'trex_stl_lib.utils.collections': mock.MagicMock(),\r
+    'trex_stl_lib.utils.common': mock.MagicMock(),\r
+    'trex_stl_lib.utils.json': mock.MagicMock(),\r
+    'trex_stl_lib.utils.os': mock.MagicMock(),\r
+    'trex_stl_lib.utils.parsing_opts': mock.MagicMock(),\r
+    'trex_stl_lib.utils.pwd': mock.MagicMock(),\r
+    'trex_stl_lib.utils.random': mock.MagicMock(),\r
+    'trex_stl_lib.utils.re': mock.MagicMock(),\r
+    'trex_stl_lib.utils.string': mock.MagicMock(),\r
+    'trex_stl_lib.utils.sys': mock.MagicMock(),\r
+    'trex_stl_lib.utils.text_opts': mock.MagicMock(),\r
+    'trex_stl_lib.utils.text_tables': mock.MagicMock(),\r
+    'trex_stl_lib.utils.texttable': mock.MagicMock(),\r
+    'trex_stl_lib.warnings': mock.MagicMock(),\r
+    'trex_stl_lib.yaml': mock.MagicMock(),\r
+    'trex_stl_lib.zlib': mock.MagicMock(),\r
+    'trex_stl_lib.zmq': mock.MagicMock(),\r
+}\r
similarity index 65%
rename from tests/unit/apiserver/__init__.py
rename to yardstick/tests/unit/apiserver/__init__.py
index 5e1ed2e..44d1634 100644 (file)
@@ -1,3 +1,12 @@
+##############################################################################
+# Copyright (c) 2017
+#
+# 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
+##############################################################################
+"""Tests for yardstick/api/server.py"""
 from __future__ import absolute_import
 
 import mock
@@ -12,14 +21,16 @@ from yardstick.common import constants as consts
 
 
 class APITestCase(unittest.TestCase):
-
+    """Tests for the YardStick API server"""
     def setUp(self):
         self.db_fd, self.db_path = tempfile.mkstemp()
         consts.SQLITE = 'sqlite:///{}'.format(self.db_path)
 
-        # server calls gethostbyname which takes 4 seconds, and we should mock it anyway
+        # server calls gethostbyname which takes 4 seconds, and we should mock
+        # it anyway
         self.socket_mock = mock.patch.dict("sys.modules", {"socket": mock.MagicMock(
-            **{"gethostbyname.return_value": "127.0.0.1", "gethostname.return_value": "localhost"})})
+            **{"gethostbyname.return_value": "127.0.0.1",
+               "gethostname.return_value": "localhost"})})
         self.socket_mock.start()
         try:
             from api import server
@@ -6,12 +6,11 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-from __future__ import absolute_import
 
 import time
 import unittest
 
-from tests.unit.apiserver import APITestCase
+from yardstick.tests.unit.apiserver import APITestCase
 
 
 class EnvTestCase(APITestCase):
@@ -6,13 +6,11 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-from __future__ import absolute_import
 import unittest
 import mock
 
 from api.utils import influx
-
-import six.moves.configparser as ConfigParser
+from six.moves import configparser as ConfigParser
 
 
 class GetDataDbClientTestCase(unittest.TestCase):
@@ -25,7 +23,7 @@ class GetDataDbClientTestCase(unittest.TestCase):
         mock_parser.NoOptionError = ConfigParser.NoOptionError
         try:
             influx.get_data_db_client()
-        except Exception as e:
+        except Exception as e:  # pylint: disable=broad-except
             self.assertIsInstance(e, RuntimeError)
 
 
@@ -50,7 +48,7 @@ class QueryTestCase(unittest.TestCase):
         try:
             sql = 'select * form tasklist'
             influx.query(sql)
-        except Exception as e:
+        except Exception as e:  # pylint: disable=broad-except
             self.assertIsInstance(e, RuntimeError)
 
 
diff --git a/yardstick/tests/unit/common/__init__.py b/yardstick/tests/unit/common/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
@@ -49,7 +49,7 @@ class OverwriteDictTestCase(unittest.TestCase):
 
 class FilenameGeneratorTestCase(unittest.TestCase):
     @mock.patch('{}.NamedTemporaryFile'.format(PREFIX))
-    def test__handle_existing_file(self, mock_tmp):
+    def test__handle_existing_file(self, _):
         ansible_common.FileNameGenerator._handle_existing_file("/dev/null")
 
     def test_get_generator_from_file(self):
@@ -184,7 +184,7 @@ class AnsibleCommonTestCase(unittest.TestCase):
         self.assertEqual(a.deploy_dir, "d")
 
     @mock.patch('{}.open'.format(PREFIX))
-    def test__gen_ansible_playbook_file_list(self, mock_open):
+    def test__gen_ansible_playbook_file_list(self, _):
         d = tempfile.mkdtemp()
         try:
             a = ansible_common.AnsibleCommon({})
@@ -194,7 +194,7 @@ class AnsibleCommonTestCase(unittest.TestCase):
 
     @mock.patch('{}.NamedTemporaryFile'.format(PREFIX))
     @mock.patch('{}.open'.format(PREFIX))
-    def test__gen_ansible_inventory_file(self, mock_open, mock_tmp):
+    def test__gen_ansible_inventory_file(self, _, __):
         nodes = [{
             "name": "name", "user": "user", "password": "PASS",
             "role": "role",
@@ -213,7 +213,7 @@ class AnsibleCommonTestCase(unittest.TestCase):
 
     @mock.patch('{}.NamedTemporaryFile'.format(PREFIX))
     @mock.patch('{}.open'.format(PREFIX))
-    def test__gen_ansible_playbook_file_list_multiple(self, mock_open, mock_tmp):
+    def test__gen_ansible_playbook_file_list_multiple(self, _, __):
         d = tempfile.mkdtemp()
         try:
             a = ansible_common.AnsibleCommon({})
@@ -224,7 +224,7 @@ class AnsibleCommonTestCase(unittest.TestCase):
     @mock.patch('{}.NamedTemporaryFile'.format(PREFIX))
     @mock.patch('{}.Popen'.format(PREFIX))
     @mock.patch('{}.open'.format(PREFIX))
-    def test_do_install_tmp_dir(self, mock_open, mock_popen, mock_tmp):
+    def test_do_install_tmp_dir(self, _, mock_popen, __):
         mock_popen.return_value.communicate.return_value = "", ""
         mock_popen.return_value.wait.return_value = 0
         d = tempfile.mkdtemp()
@@ -237,7 +237,7 @@ class AnsibleCommonTestCase(unittest.TestCase):
     @mock.patch('{}.NamedTemporaryFile'.format(PREFIX))
     @mock.patch('{}.Popen'.format(PREFIX))
     @mock.patch('{}.open'.format(PREFIX))
-    def test_execute_ansible_check(self, mock_open, mock_popen, mock_tmp):
+    def test_execute_ansible_check(self, _, mock_popen, __):
         mock_popen.return_value.communicate.return_value = "", ""
         mock_popen.return_value.wait.return_value = 0
         d = tempfile.mkdtemp()
@@ -21,7 +21,7 @@ from yardstick.common import openstack_utils
 class GetCredentialsTestCase(unittest.TestCase):
 
     @mock.patch('yardstick.common.openstack_utils.os')
-    def test_get_credentials(self, mock_os):
+    def test_get_credentials(self, _):
         with mock.patch.dict('os.environ', {'OS_IDENTITY_API_VERSION': '2'},
                              clear=True):
             openstack_utils.get_credentials()
@@ -24,6 +24,9 @@ class TemplateFormatTestCase(unittest.TestCase):
 
     def test_parse_to_value_exception(self):
 
+        # TODO(elfoley): Don't hide the error that occurs in
+        # template_format.parse
+        # TODO(elfoley): Separate these tests; one per error type
         with mock.patch.object(yaml, 'load') as yaml_loader:
             yaml_loader.side_effect = yaml.scanner.ScannerError()
             self.assertRaises(ValueError, template_format.parse, 'FOOBAR')
similarity index 99%
rename from tests/unit/test_ssh.py
rename to yardstick/tests/unit/test_ssh.py
index 88699fd..dbaae8c 100644 (file)
@@ -262,7 +262,7 @@ class SSHTestCase(unittest.TestCase):
                          self.test_client.execute.mock_calls)
 
     @mock.patch("yardstick.ssh.paramiko")
-    def test_send_command(self, mock_paramiko):
+    def test_send_command(self, _):
         paramiko_sshclient = self.test_client._get_client()
         with mock.patch.object(paramiko_sshclient, "exec_command") \
                 as mock_paramiko_exec_command: