aboutsummaryrefslogtreecommitdiffstats
path: root/test/framework.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-11-28 11:34:21 -0800
committerOle Trøan <otroan@employees.org>2019-02-26 09:39:00 +0000
commit38a4ec7342c27e675cc049d923e0075655fd91fd (patch)
treea9d42c77514ad103a8c7249a6cf88dc6bb988221 /test/framework.py
parent2bbbea0f88f24bc96198e841a7e8b984bfab87b3 (diff)
make test: Add exception handling around subprocess.
This cleans up exception catching to identify oserrors. By raising the specific exception closer to the offending call, we get additional stack history and can add clearer error logging to assist in troubleshooting. Change-Id: I592e4d46844b822a816485bf54910f8daed92088 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/framework.py')
-rw-r--r--test/framework.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/framework.py b/test/framework.py
index 13f94d66354..38a49859e14 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -367,7 +367,16 @@ class VppTestCase(unittest.TestCase):
stderr=subprocess.PIPE,
bufsize=1)
except subprocess.CalledProcessError as e:
- cls.logger.critical("Couldn't start vpp: %s" % e)
+ cls.logger.critical("Subprocess returned with non-0 return code: ("
+ "%s)", e.returncode)
+ raise
+ except OSError as e:
+ cls.logger.critical("Subprocess returned with OS error: "
+ "(%s) %s", e.errno, e.strerror)
+ raise
+ except Exception as e:
+ cls.logger.exception("Subprocess returned unexpected from "
+ "%s:", cmdline)
raise
cls.wait_for_enter()