diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-12-21 07:53:41 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-12-23 00:04:54 +0100 |
commit | ac60877f1de5cc0e6e10ec181477523c53b18af4 (patch) | |
tree | c82b816c12deab13d767dd7d75af6fb17e3c54b2 /test | |
parent | network: always check link is ready when address is updated (diff) | |
download | systemd-ac60877f1de5cc0e6e10ec181477523c53b18af4.tar.xz systemd-ac60877f1de5cc0e6e10ec181477523c53b18af4.zip |
test: add a testcase for Address.Peer= in .network unit
Diffstat (limited to 'test')
-rw-r--r-- | test/test-network/conf/25-address-section.network | 3 | ||||
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/test-network/conf/25-address-section.network b/test/test-network/conf/25-address-section.network index d0fae69361..4b22f7331a 100644 --- a/test/test-network/conf/25-address-section.network +++ b/test/test-network/conf/25-address-section.network @@ -1,6 +1,9 @@ [Match] Name=dummy98 +[Network] +IPv6AcceptRA=no + [Address] Address=10.2.3.4/16 Peer=10.2.3.5/16 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 19572be151..a13ed1ba19 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -650,6 +650,21 @@ class NetworkdNetWorkTests(unittest.TestCase, Utilities): subprocess.call(['ip', 'rule', 'del', 'table', '7']) + def test_address_peer(self): + self.copy_unit_to_networkd_unit_path('25-address-section.network', '12-dummy.netdev') + self.start_networkd() + + self.assertTrue(self.link_exits('dummy98')) + + output = subprocess.check_output(['ip', 'address', 'show', 'dummy98']).rstrip().decode('utf-8') + print(output) + self.assertRegex(output, 'inet 10.2.3.4 peer 10.2.3.5/16 scope global 32') + self.assertRegex(output, 'inet 10.6.7.8/16 brd 10.6.255.255 scope global 33') + + output = subprocess.check_output(['networkctl', 'status', 'dummy98']).rstrip().decode('utf-8') + print(output) + self.assertRegex(output, 'State: routable \(configured\)') + def test_address_preferred_lifetime_zero_ipv6(self): self.copy_unit_to_networkd_unit_path('25-address-section-miscellaneous.network', '12-dummy.netdev') self.start_networkd() |