X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=test%2Ftest_nfvbench.py;h=7a0a9edd22bc200dc98ff7ea5d310a8817dc5b93;hb=24314713446b6411cedce4329ab5ebfd6da678a2;hp=b430436df2918503e096a53bb0ec1ea509b29dd1;hpb=391dcf76fefb747888a3411ae3b8df7b1ad26685;p=nfvbench.git diff --git a/test/test_nfvbench.py b/test/test_nfvbench.py index b430436..7a0a9ed 100644 --- a/test/test_nfvbench.py +++ b/test/test_nfvbench.py @@ -152,6 +152,19 @@ def test_ip_block(): assert ipb.get_ip(255) == '10.0.0.255' with pytest.raises(IndexError): ipb.get_ip(256) + ipb = IpBlock('10.0.0.0', '0.0.0.1', 1) + assert ipb.get_ip() == '10.0.0.0' + with pytest.raises(IndexError): + ipb.get_ip(1) + + ipb = IpBlock('10.0.0.0', '0.0.0.2', 256) + assert ipb.get_ip() == '10.0.0.0' + assert ipb.get_ip(1) == '10.0.0.2' + assert ipb.get_ip(127) == '10.0.0.254' + assert ipb.get_ip(128) == '10.0.1.0' + with pytest.raises(IndexError): + ipb.get_ip(256) + # verify with step larger than 1 ipb = IpBlock('10.0.0.0', '0.0.0.2', 256) assert ipb.get_ip() == '10.0.0.0' @@ -215,7 +228,7 @@ def test_config(): expected = fail_pair[1] if expected is None: expected = fail_pair[0] - assert expected in e_info.value.message + assert expected in str(e_info) # whitelist keys flavor = {'flavor': {'vcpus': 2, 'ram': 8192, 'disk': 0, @@ -314,11 +327,21 @@ def _get_dummy_tg_config(chain_type, rate, scc=1, fc=10, step_ip='0.0.0.1', 'check_traffic_time_sec': 200, 'generic_poll_sec': 2, 'measurement': {'NDR': 0.001, 'PDR': 0.1, 'load_epsilon': 0.1}, - 'l2_loopback': False + 'l2_loopback': False, + 'cores': None, + 'mbuf_factor': None, + 'disable_hdrh': None, + 'mbuf_64': None, + 'service_mode': False, + 'no_flow_stats': False, + 'no_latency_stats': False, + 'no_latency_streams': False + }) def _get_traffic_client(): config = _get_dummy_tg_config('PVP', 'ndr_pdr') + config['vxlan'] = False config['ndr_run'] = True config['pdr_run'] = True config['generator_profile'] = 'dummy' @@ -338,7 +361,7 @@ def test_ndr_at_lr(): # 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() + # traffic_client.ensure_end_to_end() results = traffic_client.get_ndr_and_pdr() assert_ndr_pdr(results, 200.0, 0.0, 200.0, 0.0)