From 8d7f098756b7523374f833fc44fc71b6df0d5fdc Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 20 May 2019 10:23:28 +0900 Subject: [PATCH] test-network: show interface status when wait_online() fails --- test/test-network/systemd-networkd-tests.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 6d5c863..427d384 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -219,7 +219,13 @@ class Utilities(): args = [wait_online_bin, f'--timeout={timeout}'] + [f'--interface={link}' for link in links_with_operstate] if bool_any: args += ['--any'] - subprocess.check_call(args) + try: + subprocess.check_call(args) + except subprocess.CalledProcessError: + for link in links_with_operstate: + output = subprocess.check_output(['networkctl', 'status', link.split(':')[0]], universal_newlines=True).rstrip() + print(output) + raise def get_operstate(self, link, show_status=True, setup_state='configured'): output = subprocess.check_output(['networkctl', 'status', link], universal_newlines=True).rstrip() -- 2.7.4