|
1 | 1 | #!/usr/bin/env python3
|
2 | 2 |
|
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. |
5 | 7 |
|
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[] |
16 | 10 |
|
17 | 11 | """
|
18 | 12 | import infamy
|
19 | 13 |
|
20 | 14 | with infamy.Test() as test:
|
21 | 15 | with test.step("Set up topology and attach to target DUT"):
|
22 |
| - env = infamy.Env() |
| 16 | + env = infamy.Env() |
23 | 17 | dut1 = env.attach("dut1", "mgmt")
|
24 | 18 | dut2 = env.attach("dut2", "mgmt")
|
25 | 19 |
|
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 |
| - |
30 | 20 | with test.step("Configure DUTs"):
|
31 | 21 | dut1.put_config_dict("ietf-interfaces", {
|
32 | 22 | "interfaces": {
|
33 | 23 | "interface": [
|
34 | 24 | {
|
35 | 25 | "name": "br0",
|
36 | 26 | "type": "infix-if-type:bridge",
|
37 |
| - "enabled": True, |
38 | 27 | "bridge": {
|
39 | 28 | "vlans": {
|
40 |
| - "pvid": 4094, |
41 | 29 | "vlan": [
|
42 | 30 | {
|
43 | 31 | "vid": 10,
|
44 |
| - "untagged": [ dut1_e0 ], |
45 |
| - "tagged": [ "br0", dut1_e1 ] |
| 32 | + "untagged": [dut1["data"]], |
| 33 | + "tagged": [dut1["link"], "br0"] |
46 | 34 | }
|
47 | 35 | ]
|
48 | 36 | }
|
49 | 37 | }
|
50 |
| - }, |
51 |
| - { |
| 38 | + }, { |
52 | 39 | "name": "vlan10",
|
53 | 40 | "type": "infix-if-type:vlan",
|
54 |
| - "enabled": True, |
55 | 41 | "vlan": {
|
56 | 42 | "lower-layer-if": "br0",
|
57 | 43 | "id": 10,
|
|
64 | 50 | }
|
65 | 51 | ]
|
66 | 52 | }
|
67 |
| - }, |
68 |
| - { |
69 |
| - "name": dut1_e0, |
70 |
| - "enabled": True, |
| 53 | + }, { |
| 54 | + "name": dut1["data"], |
71 | 55 | "infix-interfaces:bridge-port": {
|
72 | 56 | "pvid": 10,
|
73 | 57 | "bridge": "br0"
|
74 | 58 | }
|
75 |
| - }, |
76 |
| - { |
77 |
| - "name": dut1_e1, |
78 |
| - "enabled": True, |
| 59 | + }, { |
| 60 | + "name": dut1["link"], |
79 | 61 | "infix-interfaces:bridge-port": {
|
80 | 62 | "pvid": 10,
|
81 | 63 | "bridge": "br0"
|
|
91 | 73 | {
|
92 | 74 | "name": "br0",
|
93 | 75 | "type": "infix-if-type:bridge",
|
94 |
| - "enabled": True, |
95 | 76 | "ipv4": {
|
96 | 77 | "address": [
|
97 | 78 | {
|
|
100 | 81 | }
|
101 | 82 | ]
|
102 | 83 | }
|
103 |
| - }, |
104 |
| - { |
105 |
| - "name": dut2_e0, |
106 |
| - "enabled": True |
107 |
| - }, |
108 |
| - { |
| 84 | + }, { |
| 85 | + "name": dut2["link"], |
| 86 | + }, { |
109 | 87 | "name": "e0.10",
|
110 | 88 | "type": "infix-if-type:vlan",
|
111 |
| - "enabled": True, |
112 | 89 | "vlan": {
|
113 |
| - "lower-layer-if": dut2_e0, |
| 90 | + "lower-layer-if": dut2["link"], |
114 | 91 | "id": 10,
|
115 | 92 | },
|
116 | 93 | "infix-interfaces:bridge-port": {
|
|
0 commit comments