test-network: add test for ConfigureWithoutCarrier=

This commit is contained in:
Yu Watanabe 2019-06-14 05:25:00 +09:00
parent 463797c104
commit 1285edf39c
2 changed files with 10 additions and 2 deletions

View file

@ -0,0 +1,7 @@
[Match]
Name=bridge99
[Network]
LinkLocalAddressing=yes
IPv6AcceptRA=no
ConfigureWithoutCarrier=yes

View file

@ -471,6 +471,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
'25-bond.netdev',
'25-bond-balanced-tlb.netdev',
'25-bridge.netdev',
'25-bridge-configure-without-carrier.network',
'25-bridge.network',
'25-erspan-tunnel-local-any.netdev',
'25-erspan-tunnel.netdev',
@ -585,10 +586,10 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
self.check_operstate('test1', 'degraded')
def test_bridge(self):
copy_unit_to_networkd_unit_path('25-bridge.netdev')
copy_unit_to_networkd_unit_path('25-bridge.netdev', '25-bridge-configure-without-carrier.network')
start_networkd(0)
wait_online(['bridge99:off'])
wait_online(['bridge99:no-carrier'])
tick = os.sysconf('SC_CLK_TCK')
self.assertEqual(9, round(float(read_link_attr('bridge99', 'bridge', 'hello_time')) / tick))