diff options
-rw-r--r-- | docker/Dockerfile | 4 | ||||
-rw-r--r-- | requirements.txt | 1 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/__init__.py (renamed from tests/unit/network_services/collector/__init__.py) | 0 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/collector/__init__.py (renamed from tests/unit/network_services/libs/__init__.py) | 0 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/collector/test_publisher.py (renamed from tests/unit/network_services/collector/test_publisher.py) | 3 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/collector/test_subscriber.py (renamed from tests/unit/network_services/collector/test_subscriber.py) | 3 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/libs/__init__.py (renamed from tests/unit/network_services/libs/ixia_libs/__init__.py) | 0 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/libs/ixia_libs/__init__.py | 0 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/libs/ixia_libs/test_IxNet.py (renamed from tests/unit/network_services/libs/ixia_libs/test_IxNet.py) | 14 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/test_utils.py (renamed from tests/unit/network_services/test_utils.py) | 2 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/test_yang_model.py (renamed from tests/unit/network_services/test_yang_model.py) | 12 |
11 files changed, 11 insertions, 28 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 709db317e..95ec1857e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -47,8 +47,8 @@ ADD http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-d COPY ./exec_tests.sh /usr/local/bin/ -ENV NSB_DIR="/opt/nsb_bin" \ - PYTHONPATH="${PYTHONPATH}:${NSB_DIR}/trex_client:${NSB_DIR}/trex_client/stl" +ENV NSB_DIR="/opt/nsb_bin" +ENV PYTHONPATH="${PYTHONPATH}:${NSB_DIR}/trex_client:${NSB_DIR}/trex_client/stl" WORKDIR ${REPOS_DIR} CMD ["/usr/bin/supervisord"] diff --git a/requirements.txt b/requirements.txt index 835ce011f..cd795fdd9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,6 +14,7 @@ PTable==0.9.2 # BSD (3 clause); OSI Approved BSD 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 +cmd2==0.8.6 # MIT License; OSI Approved MIT 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/ diff --git a/tests/unit/network_services/collector/__init__.py b/yardstick/tests/unit/network_services/__init__.py index e69de29bb..e69de29bb 100644 --- a/tests/unit/network_services/collector/__init__.py +++ b/yardstick/tests/unit/network_services/__init__.py diff --git a/tests/unit/network_services/libs/__init__.py b/yardstick/tests/unit/network_services/collector/__init__.py index e69de29bb..e69de29bb 100644 --- a/tests/unit/network_services/libs/__init__.py +++ b/yardstick/tests/unit/network_services/collector/__init__.py diff --git a/tests/unit/network_services/collector/test_publisher.py b/yardstick/tests/unit/network_services/collector/test_publisher.py index 4a175841d..145441ddd 100644 --- a/tests/unit/network_services/collector/test_publisher.py +++ b/yardstick/tests/unit/network_services/collector/test_publisher.py @@ -13,9 +13,6 @@ # limitations under the License. # -# Unittest for yardstick.network_services.collector.publisher - -from __future__ import absolute_import import unittest from yardstick.network_services.collector import publisher diff --git a/tests/unit/network_services/collector/test_subscriber.py b/yardstick/tests/unit/network_services/collector/test_subscriber.py index d4b4ecf7a..9b9649979 100644 --- a/tests/unit/network_services/collector/test_subscriber.py +++ b/yardstick/tests/unit/network_services/collector/test_subscriber.py @@ -13,9 +13,6 @@ # limitations under the License. # -# Unittest for yardstick.network_services.collector.subscriber - -from __future__ import absolute_import import unittest import mock diff --git a/tests/unit/network_services/libs/ixia_libs/__init__.py b/yardstick/tests/unit/network_services/libs/__init__.py index e69de29bb..e69de29bb 100644 --- a/tests/unit/network_services/libs/ixia_libs/__init__.py +++ b/yardstick/tests/unit/network_services/libs/__init__.py diff --git a/yardstick/tests/unit/network_services/libs/ixia_libs/__init__.py b/yardstick/tests/unit/network_services/libs/ixia_libs/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/yardstick/tests/unit/network_services/libs/ixia_libs/__init__.py diff --git a/tests/unit/network_services/libs/ixia_libs/test_IxNet.py b/yardstick/tests/unit/network_services/libs/ixia_libs/test_IxNet.py index 2a97048aa..fe750e5ba 100644 --- a/tests/unit/network_services/libs/ixia_libs/test_IxNet.py +++ b/yardstick/tests/unit/network_services/libs/ixia_libs/test_IxNet.py @@ -13,9 +13,6 @@ # limitations under the License. # -# Unittest for yardstick.network_services.libs.ixia_libs.IxNet - -from __future__ import absolute_import import unittest import mock @@ -23,10 +20,10 @@ from yardstick.network_services.libs.ixia_libs.IxNet.IxNet import IxNextgen from yardstick.network_services.libs.ixia_libs.IxNet.IxNet import IP_VERSION_4 from yardstick.network_services.libs.ixia_libs.IxNet.IxNet import IP_VERSION_6 - UPLINK = "uplink" DOWNLINK = "downlink" + class TestIxNextgen(unittest.TestCase): def test___init__(self): @@ -40,7 +37,8 @@ class TestIxNextgen(unittest.TestCase): ixnet_gen.get_config = mock.MagicMock() ixnet_gen.get_ixnet = mock.MagicMock() - self.assertRaises(ImportError, ixnet_gen._connect, {"py_lib_path": "/tmp"}) + self.assertRaises(ImportError, ixnet_gen._connect, + {"py_lib_path": "/tmp"}) def test_clear_ixia_config(self): ixnet = mock.MagicMock() @@ -628,11 +626,9 @@ class TestIxNextgen(unittest.TestCase): def test_set_random_ip_multi_attributes_bad_ip_version(self): bad_ip_version = object() ixnet_gen = IxNextgen(mock.Mock()) - mock1 = mock.Mock() - mock2 = mock.Mock() - mock3 = mock.Mock() with self.assertRaises(ValueError): - ixnet_gen.set_random_ip_multi_attributes(mock1, bad_ip_version, mock2, mock3) + ixnet_gen.set_random_ip_multi_attributes( + mock.Mock(), bad_ip_version, mock.Mock(), mock.Mock()) def test_get_config(self): tg_cfg = { diff --git a/tests/unit/network_services/test_utils.py b/yardstick/tests/unit/network_services/test_utils.py index bf98a4474..2b2eb7109 100644 --- a/tests/unit/network_services/test_utils.py +++ b/yardstick/tests/unit/network_services/test_utils.py @@ -13,8 +13,6 @@ # limitations under the License. # -# Unittest for yardstick.network_services.utils - import os import unittest import mock diff --git a/tests/unit/network_services/test_yang_model.py b/yardstick/tests/unit/network_services/test_yang_model.py index 0b29da701..a7eb36b8a 100644 --- a/tests/unit/network_services/test_yang_model.py +++ b/yardstick/tests/unit/network_services/test_yang_model.py @@ -13,14 +13,8 @@ # limitations under the License. # -# Unittest for yardstick.network_services.utils - -from __future__ import absolute_import - -import unittest import mock - -import yaml +import unittest from yardstick.network_services.yang_model import YangModel @@ -95,9 +89,9 @@ class YangModelTestCase(unittest.TestCase): y._get_entries() self.assertEqual(y._rules, '') - @mock.patch('yardstick.network_services.yang_model.yaml_load') @mock.patch('yardstick.network_services.yang_model.open') - def test__read_config(self, mock_open, mock_safe_load): + @mock.patch('yardstick.network_services.yang_model.yaml_load') + def test__read_config(self, mock_safe_load, *args): cfg = "yang.yaml" y = YangModel(cfg) mock_safe_load.return_value = expected = {'key1': 'value1', 'key2': 'value2'} |