]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add testcase that Neighbor.LinkLayerAddress= is IP address 13017/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 10 Jul 2019 18:26:30 +0000 (03:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 11 Jul 2019 13:22:29 +0000 (22:22 +0900)
test/test-network/conf/25-neighbor-ip-dummy.network [new file with mode: 0644]
test/test-network/conf/25-neighbor-ip.network [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py

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 (file)
index 0000000..d99d972
--- /dev/null
@@ -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 (file)
index 0000000..8865ccd
--- /dev/null
@@ -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
index f8bae1d2fcab3267e0e53fa93760b6ee89283c05..272d5453fe768246ac6959decf6b2624cb8b888d 100755 (executable)
@@ -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')