From 4ca2439d287efebb768087979b8516f14e108a1a Mon Sep 17 00:00:00 2001 From: "Mytnyk, Volodymyr" Date: Thu, 26 Jul 2018 09:47:19 +0100 Subject: NSB TREX RFC2544 scenario fails with correlated traffic When correlated traffic TC is running, the traffic is running only on uplink ports instead of both type of ports (yardstick/network_services/traffic_profile/rfc2544.py +113). Trex TG fails to get samples on downlink ports. JIRA: YARDSTICK-1357 Change-Id: I66d78b73f2dc5bb531fe8607d0e46f60b828953e Signed-off-by: Mytnyk, Volodymyr --- yardstick/network_services/traffic_profile/rfc2544.py | 2 +- yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/yardstick/network_services/traffic_profile/rfc2544.py b/yardstick/network_services/traffic_profile/rfc2544.py index c24e2f65a..0e1dbd592 100644 --- a/yardstick/network_services/traffic_profile/rfc2544.py +++ b/yardstick/network_services/traffic_profile/rfc2544.py @@ -52,7 +52,7 @@ class PortPgIDMap(object): self._port_pg_id_map[port] = [] def get_pg_ids(self, port): - return self._port_pg_id_map.get(port) + return self._port_pg_id_map.get(port, []) def increase_pg_id(self, port=None): port = self._last_port if not port else port diff --git a/yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py b/yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py index 0cf93f9ae..a4fdc8d04 100644 --- a/yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py +++ b/yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py @@ -266,6 +266,7 @@ class PortPgIDMapTestCase(base.BaseUnitTestCase): port_pg_id_map.increase_pg_id() self.assertEqual([1, 2], port_pg_id_map.get_pg_ids(10)) self.assertEqual([3], port_pg_id_map.get_pg_ids(20)) + self.assertEqual([], port_pg_id_map.get_pg_ids(30)) def test_increase_pg_id_no_port(self): port_pg_id_map = rfc2544.PortPgIDMap() -- cgit 1.2.3-korg