|
|
|
|
@@ -3125,40 +3125,56 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
|
|
|
|
self.assertRegex(output, f'2607:5300:203:5215:{i}::1 *proxy')
|
|
|
|
|
|
|
|
|
|
def test_neighbor_section(self):
|
|
|
|
|
copy_network_unit('25-neighbor-section.network', '12-dummy.netdev')
|
|
|
|
|
copy_network_unit('25-neighbor-section.network', '12-dummy.netdev', copy_dropins=False)
|
|
|
|
|
start_networkd()
|
|
|
|
|
self.wait_online(['dummy98:degraded'], timeout='40s')
|
|
|
|
|
self.wait_online(['dummy98:degraded'])
|
|
|
|
|
|
|
|
|
|
print('### ip neigh list dev dummy98')
|
|
|
|
|
output = check_output('ip neigh list dev dummy98')
|
|
|
|
|
print(output)
|
|
|
|
|
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')
|
|
|
|
|
self.assertIn('192.168.10.1 lladdr 00:00:5e:00:02:65 PERMANENT', output)
|
|
|
|
|
self.assertIn('2004:da8:1::1 lladdr 00:00:5e:00:02:66 PERMANENT', output)
|
|
|
|
|
self.assertNotIn('2004:da8:1:0::2', output)
|
|
|
|
|
self.assertNotIn('192.168.10.2', output)
|
|
|
|
|
self.assertNotIn('00:00:5e:00:02:67', output)
|
|
|
|
|
|
|
|
|
|
output = check_output(*networkctl_cmd, '--json=short', 'status', env=env)
|
|
|
|
|
check_json(output)
|
|
|
|
|
|
|
|
|
|
copy_network_unit('25-neighbor-section.network.d/override.conf')
|
|
|
|
|
networkctl_reload()
|
|
|
|
|
self.wait_online(['dummy98:degraded'])
|
|
|
|
|
|
|
|
|
|
print('### ip neigh list dev dummy98 (after reloading)')
|
|
|
|
|
output = check_output('ip neigh list dev dummy98')
|
|
|
|
|
print(output)
|
|
|
|
|
self.assertIn('192.168.10.1 lladdr 00:00:5e:00:03:65 PERMANENT', output)
|
|
|
|
|
self.assertIn('2004:da8:1::1 lladdr 00:00:5e:00:03:66 PERMANENT', output)
|
|
|
|
|
self.assertNotIn('2004:da8:1:0::2', output)
|
|
|
|
|
self.assertNotIn('192.168.10.2', output)
|
|
|
|
|
self.assertNotIn('00:00:5e:00:02', output)
|
|
|
|
|
|
|
|
|
|
def test_neighbor_reconfigure(self):
|
|
|
|
|
copy_network_unit('25-neighbor-section.network', '12-dummy.netdev')
|
|
|
|
|
copy_network_unit('25-neighbor-section.network', '12-dummy.netdev', copy_dropins=False)
|
|
|
|
|
start_networkd()
|
|
|
|
|
self.wait_online(['dummy98:degraded'], timeout='40s')
|
|
|
|
|
self.wait_online(['dummy98:degraded'])
|
|
|
|
|
|
|
|
|
|
print('### ip neigh list dev dummy98')
|
|
|
|
|
output = check_output('ip neigh list dev dummy98')
|
|
|
|
|
print(output)
|
|
|
|
|
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')
|
|
|
|
|
self.assertIn('192.168.10.1 lladdr 00:00:5e:00:02:65 PERMANENT', output)
|
|
|
|
|
self.assertIn('2004:da8:1::1 lladdr 00:00:5e:00:02:66 PERMANENT', output)
|
|
|
|
|
|
|
|
|
|
remove_network_unit('25-neighbor-section.network')
|
|
|
|
|
copy_network_unit('25-neighbor-next.network')
|
|
|
|
|
networkctl_reload()
|
|
|
|
|
self.wait_online(['dummy98:degraded'], timeout='40s')
|
|
|
|
|
self.wait_online(['dummy98:degraded'])
|
|
|
|
|
print('### ip neigh list dev dummy98')
|
|
|
|
|
output = check_output('ip neigh list dev dummy98')
|
|
|
|
|
print(output)
|
|
|
|
|
self.assertNotRegex(output, '192.168.10.1.*00:00:5e:00:02:65.*PERMANENT')
|
|
|
|
|
self.assertRegex(output, '192.168.10.1.*00:00:5e:00:02:66.*PERMANENT')
|
|
|
|
|
self.assertNotRegex(output, '2004:da8:1::1.*PERMANENT')
|
|
|
|
|
self.assertNotIn('00:00:5e:00:02:65', output)
|
|
|
|
|
self.assertIn('192.168.10.1 lladdr 00:00:5e:00:02:66 PERMANENT', output)
|
|
|
|
|
self.assertNotIn('2004:da8:1::1', output)
|
|
|
|
|
|
|
|
|
|
def test_neighbor_gre(self):
|
|
|
|
|
copy_network_unit('25-neighbor-ip.network', '25-neighbor-ipv6.network', '25-neighbor-ip-dummy.network',
|
|
|
|
|
@@ -3168,11 +3184,13 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
|
|
|
|
|
|
|
|
|
output = check_output('ip neigh list dev gretun97')
|
|
|
|
|
print(output)
|
|
|
|
|
self.assertRegex(output, '10.0.0.22 lladdr 10.65.223.239 PERMANENT')
|
|
|
|
|
self.assertIn('10.0.0.22 lladdr 10.65.223.239 PERMANENT', output)
|
|
|
|
|
self.assertNotIn('10.0.0.23', output)
|
|
|
|
|
|
|
|
|
|
output = check_output('ip neigh list dev ip6gretun97')
|
|
|
|
|
print(output)
|
|
|
|
|
self.assertRegex(output, '2001:db8:0:f102::17 lladdr 2a:?00:ff:?de:45:?67:ed:?de:[0:]*:49:?88 PERMANENT')
|
|
|
|
|
self.assertNotIn('2001:db8:0:f102::18', output)
|
|
|
|
|
|
|
|
|
|
output = check_output(*networkctl_cmd, '--json=short', 'status', env=env)
|
|
|
|
|
check_json(output)
|
|
|
|
|
|