diff options
-rw-r--r-- | yardstick/network_services/traffic_profile/rfc2544.py | 2 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py | 1 |
2 files changed, 2 insertions, 1 deletions
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() |