diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_chains.py | 4 | ||||
-rw-r--r-- | test/test_nfvbench.py | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/test/test_chains.py b/test/test_chains.py index 5490dfc..5fd1ce6 100644 --- a/test/test_chains.py +++ b/test/test_chains.py @@ -271,6 +271,7 @@ def _mock_get_mac(dummy): @patch.object(Compute, 'find_image', _mock_find_image) @patch.object(TrafficClient, 'skip_sleep', lambda x: True) @patch.object(ChainVnfPort, 'get_mac', _mock_get_mac) +@patch.object(TrafficClient, 'is_udp', lambda x, y: True) @patch('nfvbench.chaining.Client') @patch('nfvbench.chaining.neutronclient') @patch('nfvbench.chaining.glanceclient') @@ -287,6 +288,7 @@ def test_nfvbench_run(mock_cred, mock_glance, mock_neutron, mock_client): @patch.object(Compute, 'find_image', _mock_find_image) @patch.object(TrafficClient, 'skip_sleep', lambda x: True) +@patch.object(TrafficClient, 'is_udp', lambda x, y: True) @patch('nfvbench.chaining.Client') @patch('nfvbench.chaining.neutronclient') @patch('nfvbench.chaining.glanceclient') @@ -302,6 +304,7 @@ def test_nfvbench_ext_arp(mock_cred, mock_glance, mock_neutron, mock_client): @patch.object(Compute, 'find_image', _mock_find_image) @patch.object(TrafficClient, 'skip_sleep', lambda x: True) +@patch.object(TrafficClient, 'is_udp', lambda x, y: True) @patch('nfvbench.chaining.Client') @patch('nfvbench.chaining.neutronclient') @patch('nfvbench.chaining.glanceclient') @@ -466,6 +469,7 @@ def test_summarizer(): assert stats == exp_stats @patch.object(TrafficClient, 'skip_sleep', lambda x: True) +@patch.object(TrafficClient, 'is_udp', lambda x, y: True) def test_fixed_rate_no_openstack(): """Test FIxed Rate run - no openstack.""" config = _get_chain_config(ChainType.EXT, 1, True, rate='100%') diff --git a/test/test_nfvbench.py b/test/test_nfvbench.py index 2a7ca77..7c5fb83 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' @@ -341,7 +354,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) |