From: Yu Watanabe Date: Mon, 1 Jun 2020 05:23:03 +0000 (+0900) Subject: test-network: add test for wireguard without peers X-Git-Tag: v246-rc1~228^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=da3509f0f5f68ae59cd403468746396617cd779b;p=thirdparty%2Fsystemd.git test-network: add test for wireguard without peers --- diff --git a/test/test-network/conf/25-wireguard-no-peer.netdev b/test/test-network/conf/25-wireguard-no-peer.netdev new file mode 100644 index 00000000000..13fd55d2fbe --- /dev/null +++ b/test/test-network/conf/25-wireguard-no-peer.netdev @@ -0,0 +1,8 @@ +[NetDev] +Name=wg97 +Kind=wireguard + +[WireGuard] +PrivateKey=EEGlnEPYJV//kbvvIqxKkQwOiS+UENyPncC4bF46ong= +ListenPort=51821 +FwMark=1235 diff --git a/test/test-network/conf/25-wireguard-no-peer.network b/test/test-network/conf/25-wireguard-no-peer.network new file mode 100644 index 00000000000..5c29d643f5a --- /dev/null +++ b/test/test-network/conf/25-wireguard-no-peer.network @@ -0,0 +1,2 @@ +[Match] +Name=wg97 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 6dbc2b0c4f9..78309d26515 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -746,6 +746,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): 'vtitun99', 'vxcan99', 'vxlan99', + 'wg97', 'wg98', 'wg99', ] @@ -832,6 +833,8 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): '25-vxlan.netdev', '25-wireguard-23-peers.netdev', '25-wireguard-23-peers.network', + '25-wireguard-no-peer.netdev', + '25-wireguard-no-peer.network', '25-wireguard-preshared-key.txt', '25-wireguard-private-key.txt', '25-wireguard.netdev', @@ -1115,9 +1118,10 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): def test_wireguard(self): copy_unit_to_networkd_unit_path('25-wireguard.netdev', '25-wireguard.network', '25-wireguard-23-peers.netdev', '25-wireguard-23-peers.network', - '25-wireguard-preshared-key.txt', '25-wireguard-private-key.txt') + '25-wireguard-preshared-key.txt', '25-wireguard-private-key.txt', + '25-wireguard-no-peer.netdev', '25-wireguard-no-peer.network') start_networkd() - self.wait_online(['wg99:carrier', 'wg98:routable']) + self.wait_online(['wg99:carrier', 'wg98:routable', 'wg97:carrier']) if shutil.which('wg'): call('wg') @@ -1142,6 +1146,11 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): output = check_output('wg show wg98 private-key') self.assertRegex(output, r'CJQUtcS9emY2fLYqDlpSZiE/QJyHkPWr\+WHtZLZ90FU=') + output = check_output('wg show wg97 listen-port') + self.assertRegex(output, '51821') + output = check_output('wg show wg97 fwmark') + self.assertRegex(output, '0x4d3') + def test_geneve(self): copy_unit_to_networkd_unit_path('25-geneve.netdev', 'netdev-link-local-addressing-yes.network') start_networkd()