diff options
author | Susant Sahani <susant@redhat.com> | 2018-04-29 09:32:22 +0530 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-05-10 10:41:30 -0700 |
commit | 4319c181d4fc29d82f9431e69c29d03e7beecc01 (patch) | |
tree | 392a008112f240e5cc75f997c1951d65a2e72d3f /test | |
parent | 68f21002b4dcb4c306cc47cc978640cac7b7ea70 (diff) | |
download | systemd-4319c181d4fc29d82f9431e69c29d03e7beecc01.tar.gz |
Networkd tests: add bridge link properties to test
Test the "[Bridge]" section keys
```
[Bridge]
UnicastFlood=true
HairPin=true
UseBPDU=true
FastLeave=true
AllowPortToBeRoot=true
Cost=555
Priority=23
```
```
test_bridge_init (__main__.BridgeTest) ... ok
test_bridge_port_priority (__main__.BridgeTest) ... ok
test_bridge_port_priority_set_zero (__main__.BridgeTest)
It should be possible to set the bridge port priority to 0 ... ok
test_bridge_port_property (__main__.BridgeTest)
Test the "[Bridge]" section keys ... ok
```
Diffstat (limited to 'test')
-rwxr-xr-x | test/networkd-test.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/networkd-test.py b/test/networkd-test.py index 81b4d2ceb5..a51b3ebde9 100755 --- a/test/networkd-test.py +++ b/test/networkd-test.py @@ -205,6 +205,29 @@ Priority=0 subprocess.check_call(['systemctl', 'restart', 'systemd-networkd']) self.assertEqual(self.read_attr('port2', 'brport/priority'), '0') + def test_bridge_port_property(self): + """Test the "[Bridge]" section keys""" + self.assertEqual(self.read_attr('port2', 'brport/priority'), '32') + self.write_network_dropin('port2.network', 'property', '''\ +[Bridge] +UnicastFlood=true +HairPin=true +UseBPDU=true +FastLeave=true +AllowPortToBeRoot=true +Cost=555 +Priority=23 +''') + subprocess.check_call(['systemctl', 'restart', 'systemd-networkd']) + + self.assertEqual(self.read_attr('port2', 'brport/priority'), '23') + self.assertEqual(self.read_attr('port2', 'brport/hairpin_mode'), '1') + self.assertEqual(self.read_attr('port2', 'brport/path_cost'), '555') + self.assertEqual(self.read_attr('port2', 'brport/multicast_fast_leave'), '1') + self.assertEqual(self.read_attr('port2', 'brport/unicast_flood'), '1') + self.assertEqual(self.read_attr('port2', 'brport/bpdu_guard'), '1') + self.assertEqual(self.read_attr('port2', 'brport/root_block'), '1') + class ClientTestBase(NetworkdTestingUtilities): """Provide common methods for testing networkd against servers.""" |