]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: support the case that l2tp module is not supported
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 4 Aug 2022 16:03:54 +0000 (01:03 +0900)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 4 Aug 2022 18:39:04 +0000 (18:39 +0000)
Hopefully fixes the issue reported at
https://github.com/systemd/systemd-centos-ci/pull/517#issuecomment-1205399798.

test/test-network/systemd-networkd-tests.py

index 71f284fd180331971075af846b82d43cfbbe0a62..9266441944cb30537005b1073ae9dcd737e9aaa4 100755 (executable)
@@ -475,8 +475,10 @@ def flush_fou_ports():
 
 def flush_l2tp_tunnels():
     tids = []
-    output = check_output('ip l2tp show tunnel')
-    for line in output.splitlines():
+    ret = run('ip l2tp show tunnel')
+    if ret.returncode != 0:
+        return # l2tp may not be supported
+    for line in ret.stdout.splitlines():
         words = line.split()
         if words[0] == 'Tunnel':
             tid = words[1].rstrip(',')