From 49ad287292f3ed2e40d74ef95f2aa77142f643bb Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 5 Aug 2022 01:03:54 +0900 Subject: [PATCH] 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. --- test/test-network/systemd-networkd-tests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(',') -- 2.47.3