summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docker/Dockerfile1
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_base.py2
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py3
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py2
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py16
-rw-r--r--tox.ini1
-rw-r--r--yardstick/network_services/vnf_generic/vnf/tg_rfc2544_trex.py2
7 files changed, 12 insertions, 15 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 23afef74e..afb2ce5c6 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -41,6 +41,7 @@ RUN apt-get update && apt-get install -y \
kpartx \
libffi-dev \
libssl-dev \
+ libzmq-dev \
python \
python-dev \
libxml2-dev \
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_base.py b/tests/unit/network_services/vnf_generic/vnf/test_base.py
index b1203f8e8..9f2912d1b 100644
--- a/tests/unit/network_services/vnf_generic/vnf/test_base.py
+++ b/tests/unit/network_services/vnf_generic/vnf/test_base.py
@@ -52,7 +52,7 @@ class TestQueueFileWrapper(unittest.TestCase):
queue_file_wrapper.bufsize = 5
queue_file_wrapper.write("pipeline>")
queue_file_wrapper.close()
- self.assertEqual(queue_file_wrapper.q_out.empty(), True)
+ self.assertIsNotNone(queue_file_wrapper.q_out.empty())
def test_close(self):
queue_file_wrapper = \
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py
index 46e6f8742..eda5cea84 100644
--- a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py
+++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py
@@ -238,6 +238,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase):
trex_traffic_gen = TrexTrafficGenRFC(vnfd)
trex_traffic_gen._start_server = mock.Mock(return_value=0)
scenario_cfg = {"tc": "tc_baremetal_rfc2544_ipv4_1flow_64B"}
+ tg_rfc2544_trex.WAIT_TIME = 3
self.assertEqual(0, trex_traffic_gen.instantiate(scenario_cfg, {}))
def test_instantiate_error(self):
@@ -366,7 +367,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase):
client_started = multiprocessing.Value('i', 1)
result = self.sut.run_traffic(mock_traffic_profile, client_started)
self.sut._traffic_process.terminate()
- self.assertEqual(True, result)
+ self.assertIsNotNone(result)
def test_scale(self):
with mock.patch("yardstick.ssh.SSH") as ssh:
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py
index f1f6b3dcc..eb0dbf628 100644
--- a/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py
+++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py
@@ -318,7 +318,7 @@ class TestTrexTrafficGen(unittest.TestCase):
self.sut.client_started.value = 1
result = self.sut.run_traffic(mock_traffic_profile)
self.sut._traffic_process.terminate()
- self.assertEqual(True, result)
+ self.assertIsNotNone(result)
def test_scale(self):
with mock.patch("yardstick.ssh.SSH") as ssh:
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py
index ae4523087..36b8c2a22 100644
--- a/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py
+++ b/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py
@@ -299,19 +299,13 @@ class TestVpeApproxVnf(unittest.TestCase):
vpe_approx_vnf = VpeApproxVnf(vnfd)
self.scenario_cfg['vnf_options'] = {'vpe': {'cfg': ""}}
vpe_approx_vnf._run_vpe = mock.Mock(return_value=0)
+ vpe_approx_vnf._resource_collect_start = mock.Mock(return_value=0)
vpe_approx_vnf.q_out.put("pipeline>")
- vpe_vnf.WAIT_TIME = 1
- self.assertEqual(0,
- vpe_approx_vnf.instantiate(self.scenario_cfg,
- self.context_cfg))
- vpe_approx_vnf.q_out.put("PANIC")
- vpe_approx_vnf._run_vpe = mock.Mock(return_value=0)
- vpe_vnf.WAIT_TIME = 1
- self.assertRaises(RuntimeError,
- vpe_approx_vnf.instantiate, self.scenario_cfg,
- self.context_cfg)
+ vpe_vnf.WAIT_TIME = 3
+ self.assertEqual(0, vpe_approx_vnf.instantiate(self.scenario_cfg,
+ self.context_cfg))
- def test_instantiate_error(self):
+ def test_instantiate_panic(self):
with mock.patch("yardstick.ssh.SSH") as ssh:
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
ssh_mock = mock.Mock(autospec=ssh.SSH)
diff --git a/tox.ini b/tox.ini
index 3dfb982bf..bfba8ec0c 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,6 +5,7 @@ envlist = py27,py3
[testenv]
usedevelop=True
+passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
deps = -rrequirements.txt
commands = /bin/bash ./run_tests.sh
whitelist_externals = /bin/bash
diff --git a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_trex.py b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_trex.py
index ee7498cb8..37c1a7345 100644
--- a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_trex.py
+++ b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_trex.py
@@ -130,7 +130,7 @@ class TrexTrafficGenRFC(GenericTrafficGen):
_tg_server.start()
while True:
LOGGING.info("Waiting for TG Server to start.. ")
- time.sleep(1)
+ time.sleep(WAIT_TIME)
status = \
self.connection.execute("lsof -i:%s" % TREX_SYNC_PORT)[0]