]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add a testcase for recreating stacked netdevs 20432/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 12 Aug 2021 05:45:40 +0000 (14:45 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 12 Aug 2021 06:03:50 +0000 (15:03 +0900)
test/test-network/systemd-networkd-tests.py

index cccaddbc9bb5a3dec860f06f44bef6d8ee39671c..dffd728881af7f7c1dedaefc52316267585c551c 100755 (executable)
@@ -1183,6 +1183,25 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
                 self.assertRegex(output, ' mtu 2000 ')
                 self.assertRegex(output, 'macvlan mode ' + mode + ' ')
 
+                rc = call("ip link del test1")
+                self.assertEqual(rc, 0)
+                time.sleep(1)
+
+                rc = call("ip link add test1 type dummy")
+                self.assertEqual(rc, 0)
+                time.sleep(1)
+
+                self.wait_online(['macvlan99:degraded', 'test1:degraded'])
+
+                output = check_output('ip -d link show test1')
+                print(output)
+                self.assertRegex(output, ' mtu 2000 ')
+
+                output = check_output('ip -d link show macvlan99')
+                print(output)
+                self.assertRegex(output, ' mtu 2000 ')
+                self.assertRegex(output, 'macvlan mode ' + mode + ' ')
+
     @expectedFailureIfModuleIsNotAvailable('ipvlan')
     def test_ipvlan(self):
         for mode, flag in [['L2', 'private'], ['L3', 'vepa'], ['L3S', 'bridge']]: