File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -738,3 +738,29 @@ def test_iproute2_netns(host):
738
738
namespaces = host .iproute2 .netns ()
739
739
assert len (namespaces ) == 1
740
740
assert namespaces [0 ].get ("name" ) == "test"
741
+
742
+ def test_iproute2_bridge_vlan (host ):
743
+ assert host .iproute2 .bridge_exists
744
+
745
+ vlans = host .iproute2 .bridge_vlan ()
746
+ assert len (vlans ) == 0
747
+
748
+ def test_iproute2_bridge_fdb (host ):
749
+ assert host .iproute2 .bridge_exists
750
+
751
+ fdb = host .iproute2 .bridge_fdb ()
752
+ assert len (fdb ) > 0
753
+
754
+ def test_iproute2_bridge_mdb (host ):
755
+ assert host .iproute2 .bridge_exists
756
+
757
+ mdb = host .iproute2 .bridge_mdb ()
758
+ assert len (mdb ) == 1
759
+ assert len (mdb [0 ].get ("mdb" )) == 0
760
+ assert len (mdb [0 ].get ("router" )) == 0
761
+
762
+ def test_iproute2_bridge_link (host ):
763
+ assert host .iproute2 .bridge_exists
764
+
765
+ links = host .iproute2 .bridge_link ()
766
+ assert len (links ) == 0
Original file line number Diff line number Diff line change @@ -221,3 +221,27 @@ def netns(self):
221
221
if not out : # ip netns returns null instead of [] in json mode
222
222
return json .loads ("[]\n " )
223
223
return json .loads (out )
224
+
225
+ def bridge_vlan (self ):
226
+ """Returns all configured vlans"""
227
+ cmd = f"{ self ._bridge } -json vlan show"
228
+ out = self .check_output (cmd )
229
+ return json .loads (out )
230
+
231
+ def bridge_fdb (self ):
232
+ """Returns all configured fdb entries"""
233
+ cmd = f"{ self ._bridge } -json fdb show"
234
+ out = self .check_output (cmd )
235
+ return json .loads (out )
236
+
237
+ def bridge_mdb (self ):
238
+ """Returns all configured mdb entries"""
239
+ cmd = f"{ self ._bridge } -json mdb show"
240
+ out = self .check_output (cmd )
241
+ return json .loads (out )
242
+
243
+ def bridge_link (self ):
244
+ """Returns all configured links"""
245
+ cmd = f"{ self ._bridge } -json link show"
246
+ out = self .check_output (cmd )
247
+ return json .loads (out )
You can’t perform that action at this time.
0 commit comments