From: Yu Watanabe Date: Thu, 4 Aug 2022 16:03:54 +0000 (+0900) Subject: test-network: support the case that l2tp module is not supported X-Git-Tag: v252-rc1~513 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=49ad287292f3ed2e40d74ef95f2aa77142f643bb;p=thirdparty%2Fsystemd.git test-network: support the case that l2tp module is not supported Hopefully fixes the issue reported at https://github.com/systemd/systemd-centos-ci/pull/517#issuecomment-1205399798. --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 71f284fd180..9266441944c 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -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(',')