summaryrefslogtreecommitdiffstats
path: root/test/test_nfvbench.py
diff options
context:
space:
mode:
authorfmenguy <francoisregis.menguy@orange.com>2020-09-22 17:10:10 +0200
committerfmenguy <francoisregis.menguy@orange.com>2020-10-05 11:34:07 +0200
commit94845d2bf7416d8b59e2eaf017244832cf3277f4 (patch)
tree945df71df19229ee5aa4ab227811bedece9442ff /test/test_nfvbench.py
parent64579b717d47ab7f654c574794831be984bf32e1 (diff)
NFVBENCH-177: Add a config item 'user_info' and theoretical max rate value
Change-Id: If96ccbffab67cfc0a08279d94cf7a5e81d958044 Signed-off-by: fmenguy <francoisregis.menguy@orange.com>
Diffstat (limited to 'test/test_nfvbench.py')
-rw-r--r--test/test_nfvbench.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/test/test_nfvbench.py b/test/test_nfvbench.py
index 5274557..fe8742f 100644
--- a/test/test_nfvbench.py
+++ b/test/test_nfvbench.py
@@ -466,11 +466,12 @@ def _get_dummy_tg_config(chain_type, rate, scc=1, fc=10, step_ip='0.0.0.1',
'service_mode': False,
'no_flow_stats': False,
'no_latency_stats': False,
- 'no_latency_streams': False
+ 'no_latency_streams': False,
+ 'intf_speed': '10Gbps'
})
-def _get_traffic_client():
+def _get_traffic_client(user_info=None):
config = _get_dummy_tg_config('PVP', 'ndr_pdr')
config['vxlan'] = False
config['mpls'] = False
@@ -478,6 +479,8 @@ def _get_traffic_client():
config['pdr_run'] = True
config['generator_profile'] = 'dummy'
config['single_run'] = False
+ if user_info:
+ config['user_info'] = user_info
traffic_client = TrafficClient(config)
traffic_client.start_traffic_generator()
traffic_client.set_traffic('64', True)
@@ -538,6 +541,22 @@ def test_ndr_pdr_low_cpu():
# pp.pprint(results)
@patch.object(TrafficClient, 'skip_sleep', lambda x: True)
+def test_ndr_at_lr_sdn_gw_encapsulation():
+ """Test NDR at line rate with traffic gen outside SUT and connected via SDN GW."""
+ user_info = {'extra_encapsulation_bytes': 28}
+ traffic_client = _get_traffic_client(user_info)
+ tg = traffic_client.gen
+ # this is a perfect sut with no loss at LR
+ tg.set_response_curve(lr_dr=0, ndr=100, max_actual_tx=100, max_11_tx=100)
+ # tx packets should be line rate for 64B and no drops...
+ assert tg.get_tx_pps_dropped_pps(100) == (LR_64B_PPS, 0)
+ # NDR and PDR should be at 100%
+ # traffic_client.ensure_end_to_end()
+ results = traffic_client.get_ndr_and_pdr()
+ assert results['ndr']['stats']['theoretical_tx_rate_bps'] == 15000000000.0
+ assert_ndr_pdr(results, 200.0, 0.0, 200.0, 0.0)
+
+@patch.object(TrafficClient, 'skip_sleep', lambda x: True)
def test_no_openstack():
"""Test nfvbench using main."""
config = _get_dummy_tg_config('EXT', '1000pps')