integration: Support of integration testcases
[vswitchperf.git] / docs / userguide / integration.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. (c) OPNFV, Intel Corporation, AT&T and others.
4
5 Integration tests
6 =================
7
8 VSPERF includes a set of integration tests defined in conf/integration.
9 These tests can be run by specifying --integration as a parameter to vsperf.
10 Current tests in conf/integration are Overlay tests.
11
12 VSPERF supports VXLAN, GRE and GENEVE tunneling protocols.
13 Testing of these protocols is limited to unidirectional traffic and
14 P2P (Physical to Physical scenarios).
15
16 NOTE: The configuration for overlay tests provided in this guide is for unidirectional traffic only.
17
18 Executing Tunnel encapsulation tests
19 ------------------------------------
20
21 The VXLAN OVS DPDK encapsulation tests requires IPs, MAC addresses,
22 bridge names and WHITELIST_NICS for DPDK.
23
24 Default values are already provided. To customize for your environment, override
25 the following variables in you user_settings.py file:
26
27   .. code-block:: python
28
29     # Variables defined in conf/integration/02_vswitch.conf
30     # Tunnel endpoint for Overlay P2P deployment scenario
31     # used for br0
32     VTEP_IP1 = '192.168.0.1/24'
33
34     # Used as remote_ip in adding OVS tunnel port and
35     # to set ARP entry in OVS (e.g. tnl/arp/set br-ext 192.168.240.10 02:00:00:00:00:02
36     VTEP_IP2 = '192.168.240.10'
37
38     # Network to use when adding a route for inner frame data
39     VTEP_IP2_SUBNET = '192.168.240.0/24'
40
41     # Bridge names
42     TUNNEL_INTEGRATION_BRIDGE = 'br0'
43     TUNNEL_EXTERNAL_BRIDGE = 'br-ext'
44
45     # IP of br-ext
46     TUNNEL_EXTERNAL_BRIDGE_IP = '192.168.240.1/24'
47
48     # vxlan|gre|geneve
49     TUNNEL_TYPE = 'vxlan'
50
51     # Variables defined conf/integration/03_traffic.conf
52     # For OP2P deployment scenario
53     TRAFFICGEN_PORT1_MAC = '02:00:00:00:00:01'
54     TRAFFICGEN_PORT2_MAC = '02:00:00:00:00:02'
55     TRAFFICGEN_PORT1_IP = '1.1.1.1'
56     TRAFFICGEN_PORT2_IP = '192.168.240.10'
57
58 To run VXLAN encapsulation tests:
59
60   .. code-block:: console
61
62     ./vsperf --conf-file user_settings.py --integration
63              --test-params 'tunnel_type=vxlan' overlay_p2p_tput
64
65 To run GRE encapsulation tests:
66
67   .. code-block:: console
68
69     ./vsperf --conf-file user_settings.py --integration
70              --test-params 'tunnel_type=gre' overlay_p2p_tput
71
72 To run GENEVE encapsulation tests:
73
74   .. code-block:: console
75
76     ./vsperf --conf-file user_settings.py --integration
77              --test-params 'tunnel_type=geneve' overlay_p2p_tput
78
79 To run OVS NATIVE tunnel tests (VXLAN/GRE/GENEVE):
80
81 1. Install the OVS kernel modules
82
83   .. code:: console
84
85     cd src/ovs/ovs
86     sudo -E make modules_install
87
88 2. Set the following variables:
89
90   .. code-block:: python
91
92     VSWITCH = 'OvsVanilla'
93     VSWITCH_VANILLA_PHY_PORT_NAMES = ['nic1name', 'nic2name']
94     # Specify vport_* kernel module to test.
95     VSWITCH_VANILLA_KERNEL_MODULES = ['vport_vxlan',
96                                       'vport_gre',
97                                       'vport_geneve',
98                                       os.path.join(OVS_DIR_VANILLA,
99                                       'datapath/linux/openvswitch.ko')]
100
101 3. Run tests:
102
103   .. code-block:: console
104
105     ./vsperf --conf-file user_settings.py --integration
106              --test-params 'tunnel_type=vxlan' overlay_p2p_tput
107
108
109 Executing VXLAN decapsulation tests
110 ------------------------------------
111
112 To run VXLAN decapsulation tests:
113
114 1. Set the variables used in "Executing Tunnel encapsulation tests"
115
116 2. Set dstmac of DUT_NIC2_MAC to the MAC adddress of the 2nd NIC of your DUT
117
118   .. code-block:: python
119
120     DUT_NIC2_MAC = '<DUT NIC2 MAC>'
121
122 3. Run test:
123
124   .. code-block:: console
125
126     ./vsperf --conf-file user_settings.py --integration overlay_p2p_decap_cont
127
128 If you want to use different values for your VXLAN frame, you may set:
129
130   .. code-block:: python
131
132     VXLAN_FRAME_L3 = {'proto': 'udp',
133                       'packetsize': 64,
134                       'srcip': TRAFFICGEN_PORT1_IP,
135                       'dstip': '192.168.240.1',
136                      }
137     VXLAN_FRAME_L4 = {'srcport': 4789,
138                       'dstport': 4789,
139                       'vni': VXLAN_VNI,
140                       'inner_srcmac': '01:02:03:04:05:06',
141                       'inner_dstmac': '06:05:04:03:02:01',
142                       'inner_srcip': '192.168.0.10',
143                       'inner_dstip': '192.168.240.9',
144                       'inner_proto': 'udp',
145                       'inner_srcport': 3000,
146                       'inner_dstport': 3001,
147                      }
148
149
150 Executing GRE decapsulation tests
151 ---------------------------------
152
153 To run GRE decapsulation tests:
154
155 1. Set the variables used in "Executing Tunnel encapsulation tests"
156
157 2. Set dstmac of DUT_NIC2_MAC to the MAC adddress of the 2nd NIC of your DUT
158
159   .. code-block:: python
160
161     DUT_NIC2_MAC = '<DUT NIC2 MAC>'
162
163 3. Run test:
164
165   .. code-block:: console
166
167     ./vsperf --conf-file user_settings.py --test-params 'tunnel_type=gre'
168              --integration overlay_p2p_decap_cont
169
170
171 If you want to use different values for your GRE frame, you may set:
172
173   .. code-block:: python
174
175     GRE_FRAME_L3 = {'proto': 'gre',
176                     'packetsize': 64,
177                     'srcip': TRAFFICGEN_PORT1_IP,
178                     'dstip': '192.168.240.1',
179                    }
180
181     GRE_FRAME_L4 = {'srcport': 0,
182                     'dstport': 0
183                     'inner_srcmac': '01:02:03:04:05:06',
184                     'inner_dstmac': '06:05:04:03:02:01',
185                     'inner_srcip': '192.168.0.10',
186                     'inner_dstip': '192.168.240.9',
187                     'inner_proto': 'udp',
188                     'inner_srcport': 3000,
189                     'inner_dstport': 3001,
190                    }
191
192
193 Executing GENEVE decapsulation tests
194 ------------------------------------
195
196 IxNet 7.3X does not have native support of GENEVE protocol. The
197 template, GeneveIxNetTemplate.xml_ClearText.xml, should be imported
198 into IxNET for this testcase to work.
199
200 To import the template do:
201
202 1. Run the IxNetwork TCL Server
203 2. Click on the Traffic menu
204 3. Click on the Traffic actions and click Edit Packet Templates
205 4. On the Template editor window, click Import. Select the template
206    tools/pkt_gen/ixnet/GeneveIxNetTemplate.xml_ClearText.xml
207    and click import.
208 5. Restart the TCL Server.
209
210 To run GENEVE decapsulation tests:
211
212 1. Set the variables used in "Executing Tunnel encapsulation tests"
213
214 2. Set dstmac of DUT_NIC2_MAC to the MAC adddress of the 2nd NIC of your DUT
215
216   .. code-block:: python
217
218     DUT_NIC2_MAC = '<DUT NIC2 MAC>'
219
220 3. Run test:
221
222   .. code-block:: console
223
224     ./vsperf --conf-file user_settings.py --test-params 'tunnel_type=geneve'
225              --integration overlay_p2p_decap_cont
226
227
228 If you want to use different values for your GENEVE frame, you may set:
229
230   .. code-block:: python
231
232     GENEVE_FRAME_L3 = {'proto': 'udp',
233                        'packetsize': 64,
234                        'srcip': TRAFFICGEN_PORT1_IP,
235                        'dstip': '192.168.240.1',
236                       }
237
238     GENEVE_FRAME_L4 = {'srcport': 6081,
239                        'dstport': 6081,
240                        'geneve_vni': 0,
241                        'inner_srcmac': '01:02:03:04:05:06',
242                        'inner_dstmac': '06:05:04:03:02:01',
243                        'inner_srcip': '192.168.0.10',
244                        'inner_dstip': '192.168.240.9',
245                        'inner_proto': 'udp',
246                        'inner_srcport': 3000,
247                        'inner_dstport': 3001,
248                       }
249
250
251 Executing Native/Vanilla OVS VXLAN decapsulation tests
252 ------------------------------------------------------
253
254 To run VXLAN decapsulation tests:
255
256 1. Set the following variables in your user_settings.py file:
257
258   .. code-block:: python
259
260     VSWITCH_VANILLA_KERNEL_MODULES = ['vport_vxlan',
261                                       os.path.join(OVS_DIR_VANILLA,
262                                       'datapath/linux/openvswitch.ko')]
263
264     DUT_NIC1_MAC = '<DUT NIC1 MAC ADDRESS>'
265
266     TRAFFICGEN_PORT1_IP = '172.16.1.2'
267     TRAFFICGEN_PORT2_IP = '192.168.1.11'
268
269     VTEP_IP1 = '172.16.1.2/24'
270     VTEP_IP2 = '192.168.1.1'
271     VTEP_IP2_SUBNET = '192.168.1.0/24'
272     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
273     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
274
275     VXLAN_FRAME_L2 = {'srcmac':
276                       '01:02:03:04:05:06',
277                       'dstmac': DUT_NIC1_MAC
278                      }
279
280     VXLAN_FRAME_L3 = {'proto': 'udp',
281                       'packetsize': 64,
282                       'srcip': TRAFFICGEN_PORT1_IP,
283                       'dstip': '172.16.1.1',
284                      }
285
286     VXLAN_FRAME_L4 = {
287                       'srcport': 4789,
288                       'dstport': 4789,
289                       'protocolpad': 'true',
290                       'vni': 99,
291                       'inner_srcmac': '01:02:03:04:05:06',
292                       'inner_dstmac': '06:05:04:03:02:01',
293                       'inner_srcip': '192.168.1.2',
294                       'inner_dstip': TRAFFICGEN_PORT2_IP,
295                       'inner_proto': 'udp',
296                       'inner_srcport': 3000,
297                       'inner_dstport': 3001,
298                      }
299
300 2. Run test:
301
302   .. code-block:: console
303
304     ./vsperf --conf-file user_settings.py --integration
305              --test-params 'tunnel_type=vxlan' overlay_p2p_decap_cont
306
307 Executing Native/Vanilla OVS GRE decapsulation tests
308 ----------------------------------------------------
309
310 To run GRE decapsulation tests:
311
312 1. Set the following variables in your user_settings.py file:
313
314   .. code-block:: python
315
316     VSWITCH_VANILLA_KERNEL_MODULES = ['vport_gre',
317                                       os.path.join(OVS_DIR_VANILLA,
318                                       'datapath/linux/openvswitch.ko')]
319
320     DUT_NIC1_MAC = '<DUT NIC1 MAC ADDRESS>'
321
322     TRAFFICGEN_PORT1_IP = '172.16.1.2'
323     TRAFFICGEN_PORT2_IP = '192.168.1.11'
324
325     VTEP_IP1 = '172.16.1.2/24'
326     VTEP_IP2 = '192.168.1.1'
327     VTEP_IP2_SUBNET = '192.168.1.0/24'
328     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
329     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
330
331     GRE_FRAME_L2 = {'srcmac':
332                     '01:02:03:04:05:06',
333                     'dstmac': DUT_NIC1_MAC
334                    }
335
336     GRE_FRAME_L3 = {'proto': 'udp',
337                     'packetsize': 64,
338                     'srcip': TRAFFICGEN_PORT1_IP,
339                     'dstip': '172.16.1.1',
340                    }
341
342     GRE_FRAME_L4 = {
343                     'srcport': 4789,
344                     'dstport': 4789,
345                     'protocolpad': 'true',
346                     'inner_srcmac': '01:02:03:04:05:06',
347                     'inner_dstmac': '06:05:04:03:02:01',
348                     'inner_srcip': '192.168.1.2',
349                     'inner_dstip': TRAFFICGEN_PORT2_IP,
350                     'inner_proto': 'udp',
351                     'inner_srcport': 3000,
352                     'inner_dstport': 3001,
353                    }
354
355 2. Run test:
356
357   .. code-block:: console
358
359     ./vsperf --conf-file user_settings.py --integration
360              --test-params 'tunnel_type=gre' overlay_p2p_decap_cont
361
362 Executing Native/Vanilla OVS GENEVE decapsulation tests
363 -------------------------------------------------------
364
365 To run GENEVE decapsulation tests:
366
367 1. Set the following variables in your user_settings.py file:
368
369   .. code-block:: python
370
371     VSWITCH_VANILLA_KERNEL_MODULES = ['vport_geneve',
372                                       os.path.join(OVS_DIR_VANILLA,
373                                       'datapath/linux/openvswitch.ko')]
374
375     DUT_NIC1_MAC = '<DUT NIC1 MAC ADDRESS>'
376
377     TRAFFICGEN_PORT1_IP = '172.16.1.2'
378     TRAFFICGEN_PORT2_IP = '192.168.1.11'
379
380     VTEP_IP1 = '172.16.1.2/24'
381     VTEP_IP2 = '192.168.1.1'
382     VTEP_IP2_SUBNET = '192.168.1.0/24'
383     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
384     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
385
386     GENEVE_FRAME_L2 = {'srcmac':
387                        '01:02:03:04:05:06',
388                        'dstmac': DUT_NIC1_MAC
389                       }
390
391     GENEVE_FRAME_L3 = {'proto': 'udp',
392                        'packetsize': 64,
393                        'srcip': TRAFFICGEN_PORT1_IP,
394                        'dstip': '172.16.1.1',
395                       }
396
397     GENEVE_FRAME_L4 = {'srcport': 6081,
398                        'dstport': 6081,
399                        'protocolpad': 'true',
400                        'geneve_vni': 0,
401                        'inner_srcmac': '01:02:03:04:05:06',
402                        'inner_dstmac': '06:05:04:03:02:01',
403                        'inner_srcip': '192.168.1.2',
404                        'inner_dstip': TRAFFICGEN_PORT2_IP,
405                        'inner_proto': 'udp',
406                        'inner_srcport': 3000,
407                        'inner_dstport': 3001,
408                       }
409
410 2. Run test:
411
412   .. code-block:: console
413
414     ./vsperf --conf-file user_settings.py --integration
415              --test-params 'tunnel_type=geneve' overlay_p2p_decap_cont
416