]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add testcases for address property change 22607/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 22 Feb 2022 21:16:17 +0000 (06:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 23 Feb 2022 22:37:50 +0000 (07:37 +0900)
This adds a testcase for issue #22515.

test/test-network/systemd-networkd-tests.py

index 39f5e58bef988711eabaa53ded5963781337394c..c5c1da96946f7b1230f3c8a140a298405d558305 100755 (executable)
@@ -2149,6 +2149,18 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
         call('ip netns del ns99', stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
 
     def test_address_static(self):
+        # test for #22515. The address will be removed and replaced with /64 prefix.
+        rc = call('ip link add dummy98 type dummy')
+        self.assertEqual(rc, 0)
+        rc = call('ip link set dev dummy98 up')
+        self.assertEqual(rc, 0)
+        rc = call('ip -6 address add 2001:db8:0:f101::15/128 dev dummy98')
+        self.assertEqual(rc, 0)
+        self.wait_address('dummy98', '2001:db8:0:f101::15/128', ipv='-6')
+        rc = call('ip -4 address add 10.3.2.3/16 brd 10.3.255.250 scope global label dummy98:hoge dev dummy98')
+        self.assertEqual(rc, 0)
+        self.wait_address('dummy98', '10.3.2.3/16 brd 10.3.255.250', ipv='-4')
+
         copy_unit_to_networkd_unit_path('25-address-static.network', '12-dummy.netdev')
         start_networkd()