Skip to content

Commit 0601979

Browse files
committed
tests: lldp: Add testcases for lldp/neighbor.
Signed-off-by: Changliang Wu <changliang.wu@smartx.com>
1 parent 65d6e07 commit 0601979

File tree

3 files changed

+234
-0
lines changed

3 files changed

+234
-0
lines changed

tests/automake.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ TESTSUITE_AT = \
6868
tests/tunnel.at \
6969
tests/tunnel-push-pop.at \
7070
tests/tunnel-push-pop-ipv6.at \
71+
tests/ovs-lldp.at \
7172
tests/ovs-router.at \
7273
tests/lockfile.at \
7374
tests/reconnect.at \

tests/ovs-lldp.at

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
AT_BANNER([ovs-lldp])
2+
3+
AT_SETUP([lldp - check lldp neighbor display])
4+
5+
OVS_VSWITCHD_START([])
6+
7+
AT_CHECK([
8+
ovs-vsctl set bridge br0 \
9+
datapath_type=dummy
10+
], [0])
11+
12+
AT_CHECK([
13+
ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy \
14+
lldp:enable=true
15+
], [0])
16+
17+
AT_CHECK([ovs-appctl netdev-dummy/receive p1 \
18+
'0180c200000e38a91c18a12688cc020704aaaaaaaaaaaa0416054769676162697445746865726e6574312f302f313506020079081f4769676162697445746865726e6574312f302f313520496e746572666163650a0e46616b6553797374656d4e616d650c0e46616b6553797374656d446573630e0403140114100c0501c0a80001020000027b00fe060080c2010001fe070080c202020000fe100080c203000109564c414e2030303031fe060080c2060000fe090080c2070100000000fe0900120f01036c01001efe0c00120f0203010113000000fffe0600120f042800fe0900120f0301000000000000'])
19+
20+
AT_CHECK([ovs-appctl lldp/neighbor p1], [0], [dnl
21+
LLDP neighbor:
22+
Interface: p1
23+
Chassis:
24+
Chassis ID: aa:aa:aa:aa:aa:aa
25+
SysName: FakeSystemName
26+
SysDescr: FakeSystemDesc
27+
MgmtIP: 192.168.0.1
28+
MgmtIface: 635
29+
Capability: Bridge, on
30+
Capability: Router, on
31+
Port:
32+
PortID: GigabitEthernet1/0/15
33+
PortDescr: GigabitEthernet1/0/15 Interface
34+
TTL: 121
35+
MFS: 10240
36+
PMD autoneg: supported: yes, enabled: yes
37+
Adv: 10Base-T, HD: yes, FD: yes
38+
Adv: 100Base-TX, HD: yes, FD: yes
39+
Adv: 1000Base-T, HD: no, FD: yes
40+
MAU oper type: 30
41+
MDI Power: supported: yes, enabled: no, pair control: no
42+
VLAN: 1, pvid: yes, VLAN 0001
43+
PPVID: supported: yes,enabled no
44+
])
45+
46+
AT_CHECK([ovs-appctl --format json --pretty lldp/neighbor p1 ], [0], [dnl
47+
[{
48+
"lldp": {
49+
"interface": {
50+
"p1": {
51+
"chassis": {
52+
"FakeSystemName": {
53+
"capability": [
54+
{
55+
"enabled": true,
56+
"type": "Bridge"},
57+
{
58+
"enabled": true,
59+
"type": "Router"}],
60+
"descr": "FakeSystemDesc",
61+
"id": {
62+
"type": "mac",
63+
"value": "aa:aa:aa:aa:aa:aa"},
64+
"mgmt-iface": [
65+
635],
66+
"mgmt-ip": [
67+
"192.168.0.1"]}},
68+
"port": {
69+
"auto-negotiation": {
70+
"current": 30,
71+
"enabled": true,
72+
"supported": true},
73+
"desc": "GigabitEthernet1/0/15 Interface",
74+
"id": {
75+
"type": "ifname",
76+
"value": "GigabitEthernet1/0/15"},
77+
"mfs": 10240,
78+
"power": {
79+
"enabled": false,
80+
"paircontrol": false,
81+
"supported": true},
82+
"ttl": 121},
83+
"ppvid": {
84+
"enabled": false,
85+
"supported": true},
86+
"vlan": {
87+
"pvid": true,
88+
"value": "VLAN 0001",
89+
"vlan-id": 1}}}}}]
90+
])
91+
92+
AT_CHECK([ovs-appctl netdev-dummy/receive p1 \
93+
'0180c200000e38a91c18a11c88cc020704aaaaaaaaaaaa0415054769676162697445746865726e6574312f302f3506020079081e4769676162697445746865726e6574312f302f3520496e746572666163650a0e46616b6553797374656d4e616d650c0e46616b6553797374656d446573630e0403140114100c0501c0a80001020000027b00fe060080c2010001fe070080c202020000fe100080c203000109564c414e2030303031fe060080c2060000fe090080c2070100000000fe0900120f01036c01001efe0c00120f0203010113000000fffe0600120f042800fe0900120f0301000000000000'])
94+
95+
AT_CHECK([ovs-appctl lldp/neighbor p1], [0], [dnl
96+
LLDP neighbor:
97+
Interface: p1
98+
Chassis:
99+
Chassis ID: aa:aa:aa:aa:aa:aa
100+
SysName: FakeSystemName
101+
SysDescr: FakeSystemDesc
102+
MgmtIP: 192.168.0.1
103+
MgmtIface: 635
104+
Capability: Bridge, on
105+
Capability: Router, on
106+
Port:
107+
PortID: GigabitEthernet1/0/15
108+
PortDescr: GigabitEthernet1/0/15 Interface
109+
TTL: 121
110+
MFS: 10240
111+
PMD autoneg: supported: yes, enabled: yes
112+
Adv: 10Base-T, HD: yes, FD: yes
113+
Adv: 100Base-TX, HD: yes, FD: yes
114+
Adv: 1000Base-T, HD: no, FD: yes
115+
MAU oper type: 30
116+
MDI Power: supported: yes, enabled: no, pair control: no
117+
VLAN: 1, pvid: yes, VLAN 0001
118+
PPVID: supported: yes,enabled no
119+
120+
Interface: p1
121+
Chassis:
122+
Chassis ID: aa:aa:aa:aa:aa:aa
123+
SysName: FakeSystemName
124+
SysDescr: FakeSystemDesc
125+
MgmtIP: 192.168.0.1
126+
MgmtIface: 635
127+
Capability: Bridge, on
128+
Capability: Router, on
129+
Port:
130+
PortID: GigabitEthernet1/0/5
131+
PortDescr: GigabitEthernet1/0/5 Interface
132+
TTL: 121
133+
MFS: 10240
134+
PMD autoneg: supported: yes, enabled: yes
135+
Adv: 10Base-T, HD: yes, FD: yes
136+
Adv: 100Base-TX, HD: yes, FD: yes
137+
Adv: 1000Base-T, HD: no, FD: yes
138+
MAU oper type: 30
139+
MDI Power: supported: yes, enabled: no, pair control: no
140+
VLAN: 1, pvid: yes, VLAN 0001
141+
PPVID: supported: yes,enabled no
142+
])
143+
144+
AT_CHECK([ovs-appctl --format json --pretty lldp/neighbor p1 ], [0], [dnl
145+
[{
146+
"lldp": {
147+
"interface": [
148+
{
149+
"p1": {
150+
"chassis": {
151+
"FakeSystemName": {
152+
"capability": [
153+
{
154+
"enabled": true,
155+
"type": "Bridge"},
156+
{
157+
"enabled": true,
158+
"type": "Router"}],
159+
"descr": "FakeSystemDesc",
160+
"id": {
161+
"type": "mac",
162+
"value": "aa:aa:aa:aa:aa:aa"},
163+
"mgmt-iface": [
164+
635],
165+
"mgmt-ip": [
166+
"192.168.0.1"]}},
167+
"port": {
168+
"auto-negotiation": {
169+
"current": 30,
170+
"enabled": true,
171+
"supported": true},
172+
"desc": "GigabitEthernet1/0/15 Interface",
173+
"id": {
174+
"type": "ifname",
175+
"value": "GigabitEthernet1/0/15"},
176+
"mfs": 10240,
177+
"power": {
178+
"enabled": false,
179+
"paircontrol": false,
180+
"supported": true},
181+
"ttl": 121},
182+
"ppvid": {
183+
"enabled": false,
184+
"supported": true},
185+
"vlan": {
186+
"pvid": true,
187+
"value": "VLAN 0001",
188+
"vlan-id": 1}}},
189+
{
190+
"p1": {
191+
"chassis": {
192+
"FakeSystemName": {
193+
"capability": [
194+
{
195+
"enabled": true,
196+
"type": "Bridge"},
197+
{
198+
"enabled": true,
199+
"type": "Router"}],
200+
"descr": "FakeSystemDesc",
201+
"id": {
202+
"type": "mac",
203+
"value": "aa:aa:aa:aa:aa:aa"},
204+
"mgmt-iface": [
205+
635],
206+
"mgmt-ip": [
207+
"192.168.0.1"]}},
208+
"port": {
209+
"auto-negotiation": {
210+
"current": 30,
211+
"enabled": true,
212+
"supported": true},
213+
"desc": "GigabitEthernet1/0/5 Interface",
214+
"id": {
215+
"type": "ifname",
216+
"value": "GigabitEthernet1/0/5"},
217+
"mfs": 10240,
218+
"power": {
219+
"enabled": false,
220+
"paircontrol": false,
221+
"supported": true},
222+
"ttl": 121},
223+
"ppvid": {
224+
"enabled": false,
225+
"supported": true},
226+
"vlan": {
227+
"pvid": true,
228+
"value": "VLAN 0001",
229+
"vlan-id": 1}}}]}}]
230+
])
231+
232+
AT_CLEANUP

tests/testsuite.at

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ m4_include([tests/ofproto-dpif.at])
6666
m4_include([tests/bridge.at])
6767
m4_include([tests/netdev-type.at])
6868
m4_include([tests/ovsdb.at])
69+
m4_include([tests/ovs-lldp.at])
6970
m4_include([tests/ovs-vsctl.at])
7071
m4_include([tests/stp.at])
7172
m4_include([tests/rstp.at])

0 commit comments

Comments
 (0)