diff options
author | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-08-14 14:50:27 +0100 |
---|---|---|
committer | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-08-14 15:36:13 +0100 |
commit | ae3505a798a19bb8422c9ddf3ea40d315312bdcf (patch) | |
tree | d2b6192427f272ac4ed55e13da5a94073bf1bc49 /yardstick/tests/unit/network_services/vnf_generic | |
parent | 799a7d36587b14cbc0a9e24da5ba627b7ccb935c (diff) |
Fix TRex RFC2544 traffic profile tolerance definition
In TRex RFC2544 traffic profile, the tolerance limit is not set correctly.
The parameters "tol_high" and "tol_low" in "get_drop_percentage" are
incorrect.
The tolerance limit should be reduced to 0.01.
JIRA: YARDSTICK-1382
Change-Id: If5fc1f3aec86effabd7903e0924724fe7eeb42ab
Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/tests/unit/network_services/vnf_generic')
-rw-r--r-- | yardstick/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py | 5 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py index c35d2db35..4a1d8c30e 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py @@ -1091,7 +1091,8 @@ class TestClientResourceHelper(unittest.TestCase): self.assertIs(client_resource_helper._connect(client), client) @mock.patch.object(ClientResourceHelper, '_build_ports') - @mock.patch.object(ClientResourceHelper, '_run_traffic_once') + @mock.patch.object(ClientResourceHelper, '_run_traffic_once', + return_value=(True, mock.ANY)) def test_run_traffic(self, mock_run_traffic_once, mock_build_ports): client_resource_helper = ClientResourceHelper(mock.Mock()) client = mock.Mock() @@ -1103,7 +1104,7 @@ class TestClientResourceHelper(unittest.TestCase): as mock_terminated: mock_connect.return_value = client type(mock_terminated).value = mock.PropertyMock( - side_effect=[0, 1, lambda x: x]) + side_effect=[0, 1, 1, lambda x: x]) client_resource_helper.run_traffic(traffic_profile, mq_producer) mock_build_ports.assert_called_once() diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py index 6aba41006..a5b9f258e 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py @@ -30,13 +30,14 @@ class TestTrexRfcResouceHelper(unittest.TestCase): mock_traffic_profile.config.duration = 3 mock_traffic_profile.execute_traffic.return_value = ('fake_ports', 'port_pg_id_map') - mock_traffic_profile.get_drop_percentage.return_value = 'percentage' + mock_traffic_profile.get_drop_percentage.return_value = (True, + 'percentage') rfc_rh = tg_rfc2544_trex.TrexRfcResourceHelper(mock_setup_helper) rfc_rh.TRANSIENT_PERIOD = 0 rfc_rh.rfc2544_helper = mock.Mock() with mock.patch.object(rfc_rh, '_get_samples') as mock_get_samples: - rfc_rh._run_traffic_once(mock_traffic_profile) + self.assertTrue(rfc_rh._run_traffic_once(mock_traffic_profile)) mock_traffic_profile.execute_traffic.assert_called_once_with(rfc_rh) mock_traffic_profile.stop_traffic.assert_called_once_with(rfc_rh) |