Skip to content

Commit 3ef1da1

Browse files
troglobitwkz
authored andcommitted
test: minor cleanup using new APIs
Signed-off-by: Joachim Wiberg <[email protected]>
1 parent a90a39e commit 3ef1da1

File tree

3 files changed

+37
-51
lines changed

3 files changed

+37
-51
lines changed

test/case/ietf_interfaces/bridge_vlan/bridge-vlan.svg

+4
Loading

test/case/ietf_interfaces/bridge_vlan/bridge_vlan.adoc

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
=== Bridge VLAN
22
==== Description
3-
Basic test of VLAN functionality in a bridge, tagged/untagged traffic and a VLAN interface in the bridge.
4-
....
5-
¦ ¦
6-
¦ vlan10 IP:10.0.0.2 ¦ br0 IP:10.0.0.3
7-
¦ / ¦ /
8-
¦ br0 <-- VLAN filtering ¦ link.10
9-
¦ u/ \t ¦ /
10-
PC ------data link -----------------|-- link
11-
¦ dut1 ¦ dut2
12-
....
3+
Verify VLAN filtering bridge, with a VLAN trunk to a neighboring device,
4+
which in turn untags one VLAN outisde a non-VLAN filtering bridge.
5+
6+
.Logical network setup
7+
ifdef::topdoc[]
8+
image::../../test/case/ietf_interfaces/bridge_vlan/bridge-vlan.svg[]
9+
endif::topdoc[]
10+
ifndef::topdoc[]
11+
ifdef::testgroup[]
12+
image::bridge_vlan/bridge-vlan.svg[]
13+
endif::testgroup[]
14+
ifndef::testgroup[]
15+
image::bridge-vlan.svg[]
16+
endif::testgroup[]
17+
endif::topdoc[]
1318

1419
==== Topology
1520
ifdef::topdoc[]

test/case/ietf_interfaces/bridge_vlan/test.py

+18-41
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,43 @@
11
#!/usr/bin/env python3
22

3-
"""
4-
Bridge VLAN
3+
"""Bridge VLAN
4+
5+
Verify VLAN filtering bridge, with a VLAN trunk to a neighboring device,
6+
which in turn untags one VLAN outisde a non-VLAN filtering bridge.
57
6-
Basic test of VLAN functionality in a bridge, tagged/untagged traffic and a VLAN interface in the bridge.
7-
....
8-
¦ ¦
9-
¦ vlan10 IP:10.0.0.2 ¦ br0 IP:10.0.0.3
10-
¦ / ¦ /
11-
¦ br0 <-- VLAN filtering ¦ link.10
12-
¦ u/ \\t ¦ /
13-
PC ------data link -----------------|-- link
14-
¦ dut1 ¦ dut2
15-
....
8+
.Logical network setup
9+
image::bridge-vlan.svg[]
1610
1711
"""
1812
import infamy
1913

2014
with infamy.Test() as test:
2115
with test.step("Set up topology and attach to target DUT"):
22-
env = infamy.Env()
16+
env = infamy.Env()
2317
dut1 = env.attach("dut1", "mgmt")
2418
dut2 = env.attach("dut2", "mgmt")
2519

26-
_, dut1_e0 = env.ltop.xlate("dut1", "data")
27-
_, dut1_e1 = env.ltop.xlate("dut1", "link")
28-
_, dut2_e0 = env.ltop.xlate("dut2", "link")
29-
3020
with test.step("Configure DUTs"):
3121
dut1.put_config_dict("ietf-interfaces", {
3222
"interfaces": {
3323
"interface": [
3424
{
3525
"name": "br0",
3626
"type": "infix-if-type:bridge",
37-
"enabled": True,
3827
"bridge": {
3928
"vlans": {
40-
"pvid": 4094,
4129
"vlan": [
4230
{
4331
"vid": 10,
44-
"untagged": [ dut1_e0 ],
45-
"tagged": [ "br0", dut1_e1 ]
32+
"untagged": [dut1["data"]],
33+
"tagged": [dut1["link"], "br0"]
4634
}
4735
]
4836
}
4937
}
50-
},
51-
{
38+
}, {
5239
"name": "vlan10",
5340
"type": "infix-if-type:vlan",
54-
"enabled": True,
5541
"vlan": {
5642
"lower-layer-if": "br0",
5743
"id": 10,
@@ -64,18 +50,14 @@
6450
}
6551
]
6652
}
67-
},
68-
{
69-
"name": dut1_e0,
70-
"enabled": True,
53+
}, {
54+
"name": dut1["data"],
7155
"infix-interfaces:bridge-port": {
7256
"pvid": 10,
7357
"bridge": "br0"
7458
}
75-
},
76-
{
77-
"name": dut1_e1,
78-
"enabled": True,
59+
}, {
60+
"name": dut1["link"],
7961
"infix-interfaces:bridge-port": {
8062
"pvid": 10,
8163
"bridge": "br0"
@@ -91,7 +73,6 @@
9173
{
9274
"name": "br0",
9375
"type": "infix-if-type:bridge",
94-
"enabled": True,
9576
"ipv4": {
9677
"address": [
9778
{
@@ -100,17 +81,13 @@
10081
}
10182
]
10283
}
103-
},
104-
{
105-
"name": dut2_e0,
106-
"enabled": True
107-
},
108-
{
84+
}, {
85+
"name": dut2["link"],
86+
}, {
10987
"name": "e0.10",
11088
"type": "infix-if-type:vlan",
111-
"enabled": True,
11289
"vlan": {
113-
"lower-layer-if": dut2_e0,
90+
"lower-layer-if": dut2["link"],
11491
"id": 10,
11592
},
11693
"infix-interfaces:bridge-port": {

0 commit comments

Comments
 (0)