From 74761cf37e7e283b928d289012c4d22fec1a34f0 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 11 Jul 2019 03:26:30 +0900 Subject: [PATCH] test-network: add testcase that Neighbor.LinkLayerAddress= is IP address --- .../conf/25-neighbor-ip-dummy.network | 6 ++++++ test/test-network/conf/25-neighbor-ip.network | 10 ++++++++++ test/test-network/systemd-networkd-tests.py | 17 ++++++++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 test/test-network/conf/25-neighbor-ip-dummy.network create mode 100644 test/test-network/conf/25-neighbor-ip.network diff --git a/test/test-network/conf/25-neighbor-ip-dummy.network b/test/test-network/conf/25-neighbor-ip-dummy.network new file mode 100644 index 00000000000..d99d97298a3 --- /dev/null +++ b/test/test-network/conf/25-neighbor-ip-dummy.network @@ -0,0 +1,6 @@ +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Tunnel=gretun97 diff --git a/test/test-network/conf/25-neighbor-ip.network b/test/test-network/conf/25-neighbor-ip.network new file mode 100644 index 00000000000..8865ccd9724 --- /dev/null +++ b/test/test-network/conf/25-neighbor-ip.network @@ -0,0 +1,10 @@ +[Match] +Name=gretun97 + +[Network] +IPv6AcceptRA=no +Address=10.0.0.21 + +[Neighbor] +Address=10.0.0.22 +LinkLayerAddress=10.65.223.239 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index f8bae1d2fca..272d5453fe7 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -1376,7 +1376,9 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): 'bond199', 'dummy98', 'dummy99', - 'test1'] + 'gretun97', + 'test1' + ] units = [ '11-dummy.netdev', @@ -1391,8 +1393,11 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): '25-bond-active-backup-slave.netdev', '25-fibrule-invert.network', '25-fibrule-port-range.network', + '25-gre-tunnel-remote-any.netdev', '25-ipv6-address-label-section.network', '25-neighbor-section.network', + '25-neighbor-ip-dummy.network', + '25-neighbor-ip.network', '25-link-local-addressing-no.network', '25-link-local-addressing-yes.network', '25-link-section-unmanaged.network', @@ -1630,6 +1635,16 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertRegex(output, '192.168.10.1.*00:00:5e:00:02:65.*PERMANENT') self.assertRegex(output, '2004:da8:1::1.*00:00:5e:00:02:66.*PERMANENT') + def test_neighbor_gre(self): + copy_unit_to_networkd_unit_path('25-neighbor-ip.network', '25-neighbor-ip-dummy.network', + '12-dummy.netdev', '25-gre-tunnel-remote-any.netdev') + start_networkd() + wait_online(['dummy98:degraded', 'gretun97:routable'], timeout='40s') + + output = check_output('ip neigh list dev gretun97') + print(output) + self.assertRegex(output, '10.0.0.22 lladdr 10.65.223.239 PERMANENT') + def test_link_local_addressing(self): copy_unit_to_networkd_unit_path('25-link-local-addressing-yes.network', '11-dummy.netdev', '25-link-local-addressing-no.network', '12-dummy.netdev') -- 2.47.3