diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-10-13 05:36:26 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-10-13 13:32:17 +0200 |
commit | 21266e60e977afa6f4d654f8d812bc835f41ae1d (patch) | |
tree | b3083de6149b52957fa8d5acc1982dc0f1b094a2 /test/test-network | |
parent | network: constify arguments (diff) | |
download | systemd-21266e60e977afa6f4d654f8d812bc835f41ae1d.tar.xz systemd-21266e60e977afa6f4d654f8d812bc835f41ae1d.zip |
test-network: add test for issue #17304
Diffstat (limited to 'test/test-network')
-rw-r--r-- | test/test-network/conf/25-address-peer-ipv4.network | 9 | ||||
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 16 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/test-network/conf/25-address-peer-ipv4.network b/test/test-network/conf/25-address-peer-ipv4.network new file mode 100644 index 0000000000..362ea25a95 --- /dev/null +++ b/test/test-network/conf/25-address-peer-ipv4.network @@ -0,0 +1,9 @@ +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no + +[Address] +Address=100.64.0.1/32 +Peer=100.64.0.2/32 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index e4ac070787..3189302655 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -1742,6 +1742,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): '25-address-dad-veth-peer.network', '25-address-dad-veth99.network', '25-address-link-section.network', + '25-address-peer-ipv4.network', '25-address-preferred-lifetime-zero.network', '25-address-static.network', '25-bind-carrier.network', @@ -1886,6 +1887,21 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): print(output) self.assertNotRegex(output, '192.168.100.10/24') + def test_address_peer_ipv4(self): + # test for issue #17304 + copy_unit_to_networkd_unit_path('25-address-peer-ipv4.network', '12-dummy.netdev') + + for trial in range(2): + if trial == 0: + start_networkd() + else: + restart_networkd() + + self.wait_online(['dummy98:routable']) + + output = check_output('ip -4 address show dev dummy98') + self.assertIn('inet 100.64.0.1 peer 100.64.0.2/32 scope global', output) + @expectedFailureIfModuleIsNotAvailable('vrf') def test_prefix_route(self): copy_unit_to_networkd_unit_path('25-prefix-route-with-vrf.network', '12-dummy.netdev', |