aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-06-27 16:48:33 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-06-27 16:48:33 +0000
commite3df6a30f7953810e97d65b9aa51f069ce9d4007 (patch)
treebee48b31cbbf4303ba24c6825fdc55d374102cd5 /yardstick/tests
parent2ab8157726c651c44be4d2f3ba54157ce778a536 (diff)
parent193f7ae18298574cba4698859a27e2a3cdcf3534 (diff)
Merge "Change IxNextgen library load" into stable/fraser
Diffstat (limited to 'yardstick/tests')
-rw-r--r--yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
index 956c192aa..dca8098fa 100644
--- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
+++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
@@ -18,8 +18,9 @@ import mock
import six
import unittest
-from yardstick.network_services.vnf_generic.vnf import tg_rfc2544_ixia
+from yardstick.network_services.libs.ixia_libs.ixnet import ixnet_api
from yardstick.network_services.traffic_profile import base as tp_base
+from yardstick.network_services.vnf_generic.vnf import tg_rfc2544_ixia
TEST_FILE_YAML = 'nsb_test_case.yaml'
@@ -30,8 +31,7 @@ NAME = "tg__1"
class TestIxiaResourceHelper(unittest.TestCase):
def setUp(self):
- self._mock_IxNextgen = mock.patch.object(tg_rfc2544_ixia,
- 'IxNextgen')
+ self._mock_IxNextgen = mock.patch.object(ixnet_api, 'IxNextgen')
self.mock_IxNextgen = self._mock_IxNextgen.start()
self.addCleanup(self._stop_mocks)
@@ -48,12 +48,10 @@ class TestIxiaResourceHelper(unittest.TestCase):
def test_stop_collect_with_client(self):
mock_client = mock.Mock()
-
ixia_resource_helper = tg_rfc2544_ixia.IxiaResourceHelper(mock.Mock())
-
ixia_resource_helper.client = mock_client
ixia_resource_helper.stop_collect()
- self.assertEqual(mock_client.ix_stop_traffic.call_count, 1)
+ self.assertEqual(1, ixia_resource_helper._terminated.value)
def test_run_traffic(self):
mock_tprofile = mock.Mock()
@@ -70,8 +68,7 @@ class TestIxiaResourceHelper(unittest.TestCase):
self.assertEqual('fake_samples', ixia_rhelper._queue.get())
-@mock.patch(
- "yardstick.network_services.vnf_generic.vnf.tg_rfc2544_ixia.IxNextgen")
+@mock.patch.object(tg_rfc2544_ixia, 'ixnet_api')
class TestIXIATrafficGen(unittest.TestCase):
VNFD = {'vnfd:vnfd-catalog':
{'vnfd':