]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: use wait-online in NetworkdBondTests
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 17 Jun 2019 01:52:16 +0000 (10:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 18 Jun 2019 03:45:19 +0000 (12:45 +0900)
test/test-network/conf/23-test1-bond199.network [deleted file]
test/test-network/systemd-networkd-tests.py

diff --git a/test/test-network/conf/23-test1-bond199.network b/test/test-network/conf/23-test1-bond199.network
deleted file mode 100644 (file)
index 6e7c28d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-[Match]
-Name=test1
-
-[Network]
-Bond=bond199
-PrimarySlave=true
index 2f2b711888daa0d022fc4f82126f203b07856105..76481d45e9fda53c72a2d26b13de07e39e37e1d2 100755 (executable)
@@ -1684,7 +1684,6 @@ class NetworkdBondTests(unittest.TestCase, Utilities):
         '23-active-slave.network',
         '23-bond199.network',
         '23-primary-slave.network',
-        '23-test1-bond199.network',
         '25-bond-active-backup-slave.netdev',
         '25-bond.netdev',
         'bond99.network',
@@ -1699,34 +1698,27 @@ class NetworkdBondTests(unittest.TestCase, Utilities):
 
     def test_bond_active_slave(self):
         copy_unit_to_networkd_unit_path('23-active-slave.network', '23-bond199.network', '25-bond-active-backup-slave.netdev', '12-dummy.netdev')
-        start_networkd()
-
-        self.check_link_exists('dummy98')
-        self.check_link_exists('bond199')
+        start_networkd(0)
+        wait_online(['dummy98:enslaved', 'bond199:degraded'])
 
         output = check_output('ip -d link show bond199')
         print(output)
         self.assertRegex(output, 'active_slave dummy98')
 
     def test_bond_primary_slave(self):
-        copy_unit_to_networkd_unit_path('23-primary-slave.network', '23-test1-bond199.network', '25-bond-active-backup-slave.netdev', '11-dummy.netdev')
-        start_networkd()
-
-        self.check_link_exists('test1')
-        self.check_link_exists('bond199')
+        copy_unit_to_networkd_unit_path('23-primary-slave.network', '23-bond199.network', '25-bond-active-backup-slave.netdev', '12-dummy.netdev')
+        start_networkd(0)
+        wait_online(['dummy98:enslaved', 'bond199:degraded'])
 
         output = check_output('ip -d link show bond199')
         print(output)
-        self.assertRegex(output, 'primary test1')
+        self.assertRegex(output, 'primary dummy98')
 
     def test_bond_operstate(self):
         copy_unit_to_networkd_unit_path('25-bond.netdev', '11-dummy.netdev', '12-dummy.netdev',
                                         'bond99.network','bond-slave.network')
-        start_networkd()
-
-        self.check_link_exists('bond99')
-        self.check_link_exists('dummy98')
-        self.check_link_exists('test1')
+        start_networkd(0)
+        wait_online(['dummy98:enslaved', 'test1:enslaved', 'bond99:routable'])
 
         output = check_output('ip -d link show dummy98')
         print(output)