aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/networking
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-08-23 21:03:45 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-23 21:03:45 +0000
commitc894c814d62f0c839d381b7370f3d20bf02db0b0 (patch)
tree4122dd4b649b0d12708ecb47d31810bde45cb6ff /tests/unit/benchmark/scenarios/networking
parent44d2cbdc16b543980d95e0d49456d48868d088d7 (diff)
parent952defd326974e7ae74ce366c6b5d32793d8d70c (diff)
Merge "Re-define the framesize and flow dynamic define in testcase"
Diffstat (limited to 'tests/unit/benchmark/scenarios/networking')
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_vnf_generic.py34
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):