From 65db4a71ee253c5710e5d58e124b06c08b2ef5b3 Mon Sep 17 00:00:00 2001 From: John O Loughlin Date: Fri, 18 Jan 2019 09:16:31 +0000 Subject: Add Warning for key issue ixload Currently there is a section of code that assigns a gateway links[name]["ip"]["gateway"] = gateway If the ip field has not already been defined a key error is thrown and not handled. This error is then suppressed so the program fails silently and thus causes the test case to hang. JIRA: YARDSTICK-1586 Change-Id: I94a1081a2038fb58989b3033444ea5f3a6e178f0 Signed-off-by: John O Loughlin --- yardstick/network_services/vnf_generic/vnf/tg_ixload.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yardstick/network_services/vnf_generic/vnf/tg_ixload.py b/yardstick/network_services/vnf_generic/vnf/tg_ixload.py index d25402740..495b14d2d 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_ixload.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_ixload.py @@ -143,7 +143,12 @@ class IxLoadTrafficGen(sample_vnf.SampleVNFTrafficGen): "external-interface"] if intf["virtual-interface"]["vld_id"] == name) - links[name]["ip"]["gateway"] = gateway + try: + links[name]["ip"]["gateway"] = gateway + except KeyError: + LOG.error("Invalid traffic profile: No IP section defined for %s", name) + raise + except StopIteration: LOG.debug("Cant find gateway for link %s", name) links[name]["ip"]["gateway"] = "0.0.0.0" -- cgit 1.2.3-korg