blob: 4609aa10d22601cb0ae73d427ae1c185f6d7f59e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
# Copyright (c) 2016 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
*** Settings ***
| Resource | resources/libraries/robot/shared/default.robot
| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
| Resource | resources/libraries/robot/shared/testing_path.robot
| Resource | resources/libraries/robot/vm/qemu.robot
| Resource | resources/libraries/robot/overlay/vxlan.robot
| Library | resources.libraries.python.Trace
| Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
| Test Setup | Set up functional test
| Test Teardown | Run Keywords
| ... | resources.libraries.python.QemuUtils.Qemu Kill All | ${dut_node} | AND
| ... | Tear down functional test
| Documentation | *Vhost-User Interface Traffic Tests*
| ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
| ... | between nodes.
| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-VXLAN-ETH-IP on TG-DUT link.
| ... | ETH-IP on VirtualEthernet-VM interface.
| ... | *[Cfg] DUT configuration:* On DUT is running 2 VM with 2 vhost-user
| ... | interface on each VM. DUT is configured with VXLAN and vhost-user
| ... | interfaces in bridge-domain (L2BD).
| ... | *[Cfg] VM configuration:* VM has both vhost-user interfaces added into
| ... | Linux Bridge.
| ... | *[Ver] TG verification:*
| ... | VXLAN packet is send to DUT where is decapsulated and send bridged to
| ... | vhost-user inteface. VM forwards frame to its second interface and VPP
| ... | encapsulates it to another VXLAN tunnel. Packets
| ... | are sent and received by TG on link to DUT.
*** Variables ***
| ${tg_if1_ip}= | 192.168.0.1
| ${dut_if1_ip}= | 192.168.0.2
| ${prefix_length}= | ${24}
| ${sock_vm1_1}= | /tmp/sock1
| ${sock_vm1_2}= | /tmp/sock2
| ${sock_vm2_1}= | /tmp/sock3
| ${sock_vm2_2}= | /tmp/sock4
*** Test Cases ***
| TC01: Qemu reconnects to VPPs vhost-user when Qemu is killed and restarted
| | Given Configure path in 2-node circular topology
| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
| | And Set interfaces in 2-node circular topology up
| | And Set Interface Address | ${dut_node} | ${dut_to_tg_if1} | ${dut_if1_ip}
| | ... | ${prefix_length}
| | And Add IP Neighbor | ${dut_node} | ${dut_to_tg_if1} | ${tg_if1_ip}
| | ... | ${tg_to_dut_if1_mac}
| | ${vxlan1}= | And Create VXLAN interface | ${dut_node} | ${101}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | ${vxlan2}= | And Create VXLAN interface | ${dut_node} | ${102}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | ${vxlan3}= | And Create VXLAN interface | ${dut_node} | ${103}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | ${vxlan4}= | And Create VXLAN interface | ${dut_node} | ${104}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | And Set Interface State | ${dut_node} | ${vxlan1} | up
| | And Set Interface State | ${dut_node} | ${vxlan2} | up
| | And Set Interface State | ${dut_node} | ${vxlan3} | up
| | And Set Interface State | ${dut_node} | ${vxlan4} | up
| | ${vhost_if1}= | And Vpp Create Vhost User Interface
| | ... | ${dut_node} | ${sock_vm1_1}
| | ${vhost_if2}= | And Vpp Create Vhost User Interface
| | ... | ${dut_node} | ${sock_vm1_2}
| | ${vhost_if3}= | And Vpp Create Vhost User Interface
| | ... | ${dut_node} | ${sock_vm2_1}
| | ${vhost_if4}= | And Vpp Create Vhost User Interface
| | ... | ${dut_node} | ${sock_vm2_2}
| | And Set Interface State | ${dut_node} | ${vhost_if1} | up
| | And Set Interface State | ${dut_node} | ${vhost_if2} | up
| | And Set Interface State | ${dut_node} | ${vhost_if3} | up
| | And Set Interface State | ${dut_node} | ${vhost_if4} | up
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${101} | ${vxlan1}
| | ... | ${vhost_if1}
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${102} | ${vxlan2}
| | ... | ${vhost_if2}
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${103} | ${vxlan3}
| | ... | ${vhost_if3}
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${104} | ${vxlan4}
| | ... | ${vhost_if4}
| | And Configure QEMU vhost and run it VM | ${dut_node} | ${sock_vm1_1}
| | ... | ${sock_vm1_2} | ${1}
| | And Configure QEMU vhost and run it VM | ${dut_node} | ${sock_vm2_1}
| | ... | ${sock_vm2_2} | ${2}
| | And Check traffic through VM
| | When Run keyword | qemu-1.Qemu Kill
| | ${vm1}= | And Run Keyword | qemu-1.Qemu Start
| | ${vhost_int_1}= | And Get Vhost User If Name By Sock | ${vm1}
| | ... | ${sock_vm1_1}
| | ${vhost_int_2}= | And Get Vhost User If Name By Sock | ${vm1}
| | ... | ${sock_vm1_2}
| | And Linux Add Bridge | ${vm1} | br0 | ${vhost_int_1} | ${vhost_int_2}
| | And Set Interface State | ${vm1} | ${vhost_int_1} | up | if_type=name
| | And Set Interface State | ${vm1} | ${vhost_int_2} | up | if_type=name
| | Then Check traffic through VM
| TC02: VPP reconnects to Qemu vhost-user when Restart VPP and reconfigured
| | [Tags] | EXPECTED_FAILING
| | [Documentation]
| | ... | *Failing:* Qemu doesn't support reconnect prior to version 2.7.
| | Given Configure path in 2-node circular topology
| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
| | And Set interfaces in 2-node circular topology up
| | And Set Interface Address | ${dut_node} | ${dut_to_tg_if1} | ${dut_if1_ip}
| | ... | ${prefix_length}
| | And Add IP Neighbor | ${dut_node} | ${dut_to_tg_if1} | ${tg_if1_ip}
| | ... | ${tg_to_dut_if1_mac}
| | ${vxlan1}= | And Create VXLAN interface | ${dut_node} | ${101}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | ${vxlan2}= | And Create VXLAN interface | ${dut_node} | ${102}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | ${vxlan3}= | And Create VXLAN interface | ${dut_node} | ${103}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | ${vxlan4}= | And Create VXLAN interface | ${dut_node} | ${104}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | And Set Interface State | ${dut_node} | ${vxlan1} | up
| | And Set Interface State | ${dut_node} | ${vxlan2} | up
| | And Set Interface State | ${dut_node} | ${vxlan3} | up
| | And Set Interface State | ${dut_node} | ${vxlan4} | up
| | ${vhost_if1}= | And Vpp Create Vhost User Interface | ${dut_node}
| | ... | ${sock_vm1_1}
| | ${vhost_if2}= | And Vpp Create Vhost User Interface | ${dut_node}
| | ... | ${sock_vm1_2}
| | ${vhost_if3}= | And Vpp Create Vhost User Interface | ${dut_node}
| | ... | ${sock_vm2_1}
| | ${vhost_if4}= | And Vpp Create Vhost User Interface | ${dut_node}
| | ... | ${sock_vm2_2}
| | And Set Interface State | ${dut_node} | ${vhost_if1} | up
| | And Set Interface State | ${dut_node} | ${vhost_if2} | up
| | And Set Interface State | ${dut_node} | ${vhost_if3} | up
| | And Set Interface State | ${dut_node} | ${vhost_if4} | up
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${101} | ${vxlan1}
| | ... | ${vhost_if1}
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${102} | ${vxlan2}
| | ... | ${vhost_if2}
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${103} | ${vxlan3}
| | ... | ${vhost_if3}
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${104} | ${vxlan4}
| | ... | ${vhost_if4}
| | And Configure QEMU vhost and run it VM | ${dut_node} | ${sock_vm1_1}
| | ... | ${sock_vm1_2} | ${1}
| | And Configure QEMU vhost and run it VM | ${dut_node} | ${sock_vm2_1}
| | ... | ${sock_vm2_2} | ${2}
| | And Check traffic through VM
| | And Verify VPP PID in Teardown
| | When Setup All Duts | ${nodes}
| | And Save VPP PIDs
| | And Set interfaces in 2-node circular topology up
| | And Set Interface Address | ${dut_node} | ${dut_to_tg_if1} | ${dut_if1_ip}
| | ... | ${prefix_length}
| | And Add IP Neighbor | ${dut_node} | ${dut_to_tg_if1} | ${tg_if1_ip}
| | ... | ${tg_to_dut_if1_mac}
| | ${vxlan1}= | And Create VXLAN interface | ${dut_node} | ${101}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | ${vxlan2}= | And Create VXLAN interface | ${dut_node} | ${102}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | ${vxlan3}= | And Create VXLAN interface | ${dut_node} | ${103}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | ${vxlan4}= | And Create VXLAN interface | ${dut_node} | ${104}
| | ... | ${dut_if1_ip} | ${tg_if1_ip}
| | And Set Interface State | ${dut_node} | ${vxlan1} | up
| | And Set Interface State | ${dut_node} | ${vxlan2} | up
| | And Set Interface State | ${dut_node} | ${vxlan3} | up
| | And Set Interface State | ${dut_node} | ${vxlan4} | up
| | ${vhost_if1}= | And Vpp Create Vhost User Interface | ${dut_node}
| | ... | ${sock_vm1_1}
| | ${vhost_if2}= | And Vpp Create Vhost User Interface | ${dut_node}
| | ... | ${sock_vm1_2}
| | ${vhost_if3}= | And Vpp Create Vhost User Interface | ${dut_node}
| | ... | ${sock_vm2_1}
| | ${vhost_if4}= | And Vpp Create Vhost User Interface | ${dut_node}
| | ... | ${sock_vm2_2}
| | And Set Interface State | ${dut_node} | ${vhost_if1} | up
| | And Set Interface State | ${dut_node} | ${vhost_if2} | up
| | And Set Interface State | ${dut_node} | ${vhost_if3} | up
| | And Set Interface State | ${dut_node} | ${vhost_if4} | up
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${101} | ${vxlan1}
| | ... | ${vhost_if1}
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${102} | ${vxlan2}
| | ... | ${vhost_if2}
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${103} | ${vxlan3}
| | ... | ${vhost_if3}
| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${104} | ${vxlan4}
| | ... | ${vhost_if4}
| | Then Check traffic through VM
*** Keywords ***
| Configure QEMU vhost and run it VM
| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${qemu_id}
| | Import Library | resources.libraries.python.QemuUtils | qemu_id=${qemu_id}
| | ... | WITH NAME | qemu-${qemu_id}
| | ${q_add_vhost}= | Replace Variables | qemu-${qemu_id}.Qemu Add Vhost User If
| | ${q_set_node}= | Replace Variables | qemu-${qemu_id}.Qemu Set Node
| | ${q_start}= | Replace Variables | qemu-${qemu_id}.Qemu Start
| | Run keyword | ${q_set_node} | ${dut_node}
| | Run keyword | ${q_add_vhost} | ${sock1}
| | Run keyword | ${q_add_vhost} | ${sock2}
| | ${vm}= | Run keyword | ${q_start}
| | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1}
| | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2}
| | Linux Add Bridge | ${vm} | br0 | ${vhost1} | ${vhost2}
| | Set Interface State | ${vm} | ${vhost1} | up | if_type=name
| | Set Interface State | ${vm} | ${vhost2} | up | if_type=name
| | Set Test Variable | ${qemu-${qemu_id}} | ${vm}
| Check traffic through VM
| | [Documentation] | Send VXLAN traffic through both configured VMs.
| | Send VXLAN encapsulated packet and verify received packet | ${tg_node}
| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1}
| | ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
| | ... | ${tg_if1_ip} | ${dut_if1_ip} | ${101}
| | ... | ${dut_if1_ip} | ${tg_if1_ip} | ${102}
| | Send VXLAN encapsulated packet and verify received packet | ${tg_node}
| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1}
| | ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
| | ... | ${tg_if1_ip} | ${dut_if1_ip} | ${103}
| | ... | ${dut_if1_ip} | ${tg_if1_ip} | ${104}
|