diff options
Diffstat (limited to 'tests/unit/benchmark/scenarios/networking')
-rw-r--r-- | tests/unit/benchmark/scenarios/networking/test_vnf_generic.py | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py b/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py index 651614d3e..8ce33625b 100644 --- a/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py +++ b/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py @@ -375,6 +375,9 @@ class TestNetworkServiceTestCase(unittest.TestCase): 'allowed_drop_rate': '0.8 - 1', }, }, + 'options': { + 'framesize': {'64B': 100} + }, 'runner': { 'object': 'NetworkServiceTestCase', 'interval': 35, @@ -414,17 +417,40 @@ class TestNetworkServiceTestCase(unittest.TestCase): def test___init__(self): assert self.topology + def test__get_ip_flow_range(self): + self.scenario_cfg["traffic_options"]["flow"] = \ + self._get_file_abspath("ipv4_1flow_Packets_vpe.yaml") + result = '152.16.100.1-152.16.100.254' + self.assertEqual(result, self.s._get_ip_flow_range({"tg__1": 'xe0'})) + def test___get_traffic_flow(self): self.scenario_cfg["traffic_options"]["flow"] = \ self._get_file_abspath("ipv4_1flow_Packets_vpe.yaml") - result = {'flow': {'dstip4_range': '152.40.0.20', - 'srcip4_range': '152.16.0.20', 'count': 1}} + self.scenario_cfg["options"] = {} + self.scenario_cfg['options'] = { + 'flow': { + 'src_ip': [ + { + 'tg__1': 'xe0', + }, + ], + 'dst_ip': [ + { + 'tg__1': 'xe1', + }, + ], + 'public_ip': ['1.1.1.1'], + }, + } + result = {'flow': {'dst_ip0': '152.16.40.1-152.16.40.254', + 'src_ip0': '152.16.100.1-152.16.100.254'}} + self.assertEqual(result, self.s._get_traffic_flow()) def test___get_traffic_flow_error(self): self.scenario_cfg["traffic_options"]["flow"] = \ "ipv4_1flow_Packets_vpe.yaml1" - self.assertEqual({}, self.s._get_traffic_flow()) + self.assertEqual({'flow': {}}, self.s._get_traffic_flow()) def test_get_vnf_imp(self): vnfd = COMPLETE_TREX_VNFD['vnfd:vnfd-catalog']['vnfd'][0]['class-name'] @@ -586,7 +612,7 @@ class TestNetworkServiceTestCase(unittest.TestCase): def test___get_traffic_imix_exception(self): with mock.patch.dict(self.scenario_cfg["traffic_options"], {'imix': ''}): - self.assertEqual({}, self.s._get_traffic_imix()) + self.assertEqual({'imix': {'64B': 100}}, self.s._get_traffic_imix()) def test__fill_traffic_profile(self): with mock.patch.dict("sys.modules", STL_MOCKS): |