aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-04-12 15:08:58 +0100
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-06-12 08:32:46 +0100
commita3399d07b83ce0e50d9c0144d00a7ba83a73390f (patch)
tree4d9570dd53aebec27c70dd3c6ece0ff4363c401d /yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
parente5c78ae3ec1bcf0cb44646c6031fb9c04dd63e4a (diff)
Improve IXIA IxNetwork library and traffic profile (4)
This patch implements an active wait for the traffic injection. Once the traffic is started, the traffic generator class will poll periodically the IXIA traffic generator chassis to retrieve the status of the traffic ("started", "stopped"). Now the latency statistics are retrieved and reported for each injection period. JIRA: YARDSTICK-1116 Change-Id: I4422e2c88b4fc97b7cac3de8a82b2d75467c4117 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> Signed-off-by: Emma Foley <emma.l.foley@intel.com>
Diffstat (limited to 'yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py')
-rw-r--r--yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py23
1 files changed, 14 insertions, 9 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 e79461b78..956c192aa 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
@@ -30,7 +30,8 @@ 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(tg_rfc2544_ixia,
+ 'IxNextgen')
self.mock_IxNextgen = self._mock_IxNextgen.start()
self.addCleanup(self._stop_mocks)
@@ -54,13 +55,19 @@ class TestIxiaResourceHelper(unittest.TestCase):
ixia_resource_helper.stop_collect()
self.assertEqual(mock_client.ix_stop_traffic.call_count, 1)
- # NOTE(ralonsoh): to be updated in next patchset
- def test__initialise_client(self):
- pass
-
- # NOTE(ralonsoh): to be updated in next patchset
def test_run_traffic(self):
- pass
+ mock_tprofile = mock.Mock()
+ mock_tprofile.get_drop_percentage.return_value = True, 'fake_samples'
+ ixia_rhelper = tg_rfc2544_ixia.IxiaResourceHelper(mock.Mock())
+ ixia_rhelper.rfc_helper = mock.Mock()
+ ixia_rhelper.vnfd_helper = mock.Mock()
+ ixia_rhelper.vnfd_helper.port_pairs.all_ports = []
+ with mock.patch.object(ixia_rhelper, 'generate_samples'), \
+ mock.patch.object(ixia_rhelper, '_build_ports'), \
+ mock.patch.object(ixia_rhelper, '_initialize_client'):
+ ixia_rhelper.run_traffic(mock_tprofile)
+
+ self.assertEqual('fake_samples', ixia_rhelper._queue.get())
@mock.patch(
@@ -254,8 +261,6 @@ class TestIXIATrafficGen(unittest.TestCase):
sut = tg_rfc2544_ixia.IxiaTrafficGen('vnf1', vnfd)
sut._check_status()
- @mock.patch(
- "yardstick.network_services.vnf_generic.vnf.tg_rfc2544_ixia.time")
@mock.patch("yardstick.ssh.SSH")
def test_traffic_runner(self, mock_ssh, *args):
mock_traffic_profile = mock.Mock(autospec=tp_base.TrafficProfile)