]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: show interface status when wait_online() fails
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 20 May 2019 01:23:28 +0000 (10:23 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 22 May 2019 08:58:46 +0000 (17:58 +0900)
test/test-network/systemd-networkd-tests.py

index 6d5c8631bb9ed9c59667b7d05bf6dbe286f78d97..427d3840aa7af812c6f4fd62494c56497e3e8337 100755 (executable)
@@ -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()