summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-07-07 07:46:08 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-07-12 09:39:43 +0900
commit5424fd9573e8c41660cc90c975fb2bee74d927b1 (patch)
treec3af0bcb9617c8f46556fc87a825f82acb250a18
parent6fa0524133ce54889f870d7ad17ab1d1832d7460 (diff)
downloadsystemd-5424fd9573e8c41660cc90c975fb2bee74d927b1.tar.gz
systemd-5424fd9573e8c41660cc90c975fb2bee74d927b1.tar.bz2
systemd-5424fd9573e8c41660cc90c975fb2bee74d927b1.zip
test-network: test more bridge properties
Imported from networkd-test.py
-rw-r--r--test/test-network/conf/26-bridge-slave-interface-1.network3
-rw-r--r--test/test-network/conf/26-bridge-slave-interface-2.network3
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py16
3 files changed, 17 insertions, 5 deletions
diff --git a/test/test-network/conf/26-bridge-slave-interface-1.network b/test/test-network/conf/26-bridge-slave-interface-1.network
index 1f8c5b5648..6aed178525 100644
--- a/test/test-network/conf/26-bridge-slave-interface-1.network
+++ b/test/test-network/conf/26-bridge-slave-interface-1.network
@@ -13,3 +13,6 @@ MulticastFlood = false
MulticastToUnicast = true
NeighborSuppression = true
Learning = false
+Priority = 23
+UseBPDU = true
+AllowPortToBeRoot=true
diff --git a/test/test-network/conf/26-bridge-slave-interface-2.network b/test/test-network/conf/26-bridge-slave-interface-2.network
index 45ec2de999..5fccfec5d1 100644
--- a/test/test-network/conf/26-bridge-slave-interface-2.network
+++ b/test/test-network/conf/26-bridge-slave-interface-2.network
@@ -3,3 +3,6 @@ Name=test1
[Network]
Bridge=bridge99
+
+[Bridge]
+Priority=0
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index 399824af5c..17ec04cbdb 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -2007,18 +2007,24 @@ class NetworkdBridgeTests(unittest.TestCase, Utilities):
output = check_output('bridge -d link show dummy98')
print(output)
- self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'hairpin_mode'), '1')
self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'path_cost'), '400')
+ self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'hairpin_mode'), '1')
+ self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'multicast_fast_leave'), '1')
self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'unicast_flood'), '1')
self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'multicast_flood'), '0')
- self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'multicast_fast_leave'), '1')
+ # CONFIG_BRIDGE_IGMP_SNOOPING=y
+ if (os.path.exists('/sys/devices/virtual/net/bridge00/lower_dummy98/brport/multicast_to_unicast')):
+ self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'multicast_to_unicast'), '1')
if (os.path.exists('/sys/devices/virtual/net/bridge99/lower_dummy98/brport/neigh_suppress')):
self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'neigh_suppress'), '1')
self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'learning'), '0')
+ self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'priority'), '23')
+ self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'bpdu_guard'), '1')
+ self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'root_block'), '1')
- # CONFIG_BRIDGE_IGMP_SNOOPING=y
- if (os.path.exists('/sys/devices/virtual/net/bridge00/lower_dummy98/brport/multicast_to_unicast')):
- self.assertEqual(read_bridge_port_attr('bridge99', 'dummy98', 'multicast_to_unicast'), '1')
+ output = check_output('bridge -d link show test1')
+ print(output)
+ self.assertEqual(read_bridge_port_attr('bridge99', 'test1', 'priority'), '0')
check_output('ip address add 192.168.0.16/24 dev bridge99')
time.sleep(1)