From: Yu Watanabe Date: Mon, 20 May 2019 01:23:28 +0000 (+0900) Subject: test-network: show interface status when wait_online() fails X-Git-Tag: v243-rc1~388^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d7f098756b7523374f833fc44fc71b6df0d5fdc;p=thirdparty%2Fsystemd.git test-network: show interface status when wait_online() fails --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 6d5c8631bb9..427d3840aa7 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()