vswitches/ovs: integration TCs refactoring
[vswitchperf.git] / docs / testing / user / 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, Tieto and others.
4
5 .. _integration-tests:
6
7 Integration tests
8 =================
9
10 VSPERF includes a set of integration tests defined in conf/integration.
11 These tests can be run by specifying --integration as a parameter to vsperf.
12 Current tests in conf/integration include switch functionality and Overlay
13 tests.
14
15 Tests in the conf/integration can be used to test scaling of different switch
16 configurations by adding steps into the test case.
17
18 For the overlay tests VSPERF supports VXLAN, GRE and GENEVE tunneling protocols.
19 Testing of these protocols is limited to unidirectional traffic and
20 P2P (Physical to Physical scenarios).
21
22 NOTE: The configuration for overlay tests provided in this guide is for
23 unidirectional traffic only.
24
25 NOTE: The overlay tests require an IxNet traffic generator. The tunneled traffic
26 is configured by ``ixnetrfc2544v2.tcl`` script. This script can be used
27 with all supported deployment scenarios for generation of frames with VXLAN, GRE
28 or GENEVE protocols. In that case options "Tunnel Operation" and
29 "TRAFFICGEN_IXNET_TCL_SCRIPT" must be properly configured at testcase definition.
30
31 Executing Integration Tests
32 ---------------------------
33
34 To execute integration tests VSPERF is run with the integration parameter. To
35 view the current test list simply execute the following command:
36
37 .. code-block:: console
38
39     ./vsperf --integration --list
40
41 The standard tests included are defined inside the
42 ``conf/integration/01_testcases.conf`` file.
43
44 Executing Tunnel encapsulation tests
45 ------------------------------------
46
47 The VXLAN OVS DPDK encapsulation tests requires IPs, MAC addresses,
48 bridge names and WHITELIST_NICS for DPDK.
49
50 NOTE: Only Ixia traffic generators currently support the execution of the tunnel
51 encapsulation tests. Support for other traffic generators may come in a future
52 release.
53
54 Default values are already provided. To customize for your environment, override
55 the following variables in you user_settings.py file:
56
57   .. code-block:: python
58
59     # Variables defined in conf/integration/02_vswitch.conf
60     # Tunnel endpoint for Overlay P2P deployment scenario
61     # used for br0
62     VTEP_IP1 = '192.168.0.1/24'
63
64     # Used as remote_ip in adding OVS tunnel port and
65     # to set ARP entry in OVS (e.g. tnl/arp/set br-ext 192.168.240.10 02:00:00:00:00:02
66     VTEP_IP2 = '192.168.240.10'
67
68     # Network to use when adding a route for inner frame data
69     VTEP_IP2_SUBNET = '192.168.240.0/24'
70
71     # Bridge names
72     TUNNEL_INTEGRATION_BRIDGE = 'br0'
73     TUNNEL_EXTERNAL_BRIDGE = 'br-ext'
74
75     # IP of br-ext
76     TUNNEL_EXTERNAL_BRIDGE_IP = '192.168.240.1/24'
77
78     # vxlan|gre|geneve
79     TUNNEL_TYPE = 'vxlan'
80
81     # Variables defined conf/integration/03_traffic.conf
82     # For OP2P deployment scenario
83     TRAFFICGEN_PORT1_MAC = '02:00:00:00:00:01'
84     TRAFFICGEN_PORT2_MAC = '02:00:00:00:00:02'
85     TRAFFICGEN_PORT1_IP = '1.1.1.1'
86     TRAFFICGEN_PORT2_IP = '192.168.240.10'
87
88 To run VXLAN encapsulation tests:
89
90   .. code-block:: console
91
92     ./vsperf --conf-file user_settings.py --integration \
93              --test-params 'TUNNEL_TYPE=vxlan' overlay_p2p_tput
94
95 To run GRE encapsulation tests:
96
97   .. code-block:: console
98
99     ./vsperf --conf-file user_settings.py --integration \
100              --test-params 'TUNNEL_TYPE=gre' overlay_p2p_tput
101
102 To run GENEVE encapsulation tests:
103
104   .. code-block:: console
105
106     ./vsperf --conf-file user_settings.py --integration \
107              --test-params 'TUNNEL_TYPE=geneve' overlay_p2p_tput
108
109 To run OVS NATIVE tunnel tests (VXLAN/GRE/GENEVE):
110
111 1. Install the OVS kernel modules
112
113   .. code:: console
114
115     cd src/ovs/ovs
116     sudo -E make modules_install
117
118 2. Set the following variables:
119
120   .. code-block:: python
121
122     VSWITCH = 'OvsVanilla'
123     # Specify vport_* kernel module to test.
124     PATHS['vswitch']['OvsVanilla']['src']['modules'] = [
125         'vport_vxlan',
126         'vport_gre',
127         'vport_geneve',
128         'datapath/linux/openvswitch.ko',
129     ]
130
131   **NOTE:** In case, that Vanilla OVS is installed from binary package, then
132   please set ``PATHS['vswitch']['OvsVanilla']['bin']['modules']`` instead.
133
134 3. Run tests:
135
136   .. code-block:: console
137
138     ./vsperf --conf-file user_settings.py --integration \
139              --test-params 'TUNNEL_TYPE=vxlan' overlay_p2p_tput
140
141
142 Executing VXLAN decapsulation tests
143 ------------------------------------
144
145 To run VXLAN decapsulation tests:
146
147 1. Set the variables used in "Executing Tunnel encapsulation tests"
148
149 2. Run test:
150
151   .. code-block:: console
152
153     ./vsperf --conf-file user_settings.py --integration overlay_p2p_decap_cont
154
155 If you want to use different values for your VXLAN frame, you may set:
156
157   .. code-block:: python
158
159     VXLAN_FRAME_L3 = {'proto': 'udp',
160                       'packetsize': 64,
161                       'srcip': TRAFFICGEN_PORT1_IP,
162                       'dstip': '192.168.240.1',
163                      }
164     VXLAN_FRAME_L4 = {'srcport': 4789,
165                       'dstport': 4789,
166                       'vni': VXLAN_VNI,
167                       'inner_srcmac': '01:02:03:04:05:06',
168                       'inner_dstmac': '06:05:04:03:02:01',
169                       'inner_srcip': '192.168.0.10',
170                       'inner_dstip': '192.168.240.9',
171                       'inner_proto': 'udp',
172                       'inner_srcport': 3000,
173                       'inner_dstport': 3001,
174                      }
175
176
177 Executing GRE decapsulation tests
178 ---------------------------------
179
180 To run GRE decapsulation tests:
181
182 1. Set the variables used in "Executing Tunnel encapsulation tests"
183
184 2. Run test:
185
186   .. code-block:: console
187
188     ./vsperf --conf-file user_settings.py --test-params 'TUNNEL_TYPE=gre' \
189              --integration overlay_p2p_decap_cont
190
191
192 If you want to use different values for your GRE frame, you may set:
193
194   .. code-block:: python
195
196     GRE_FRAME_L3 = {'proto': 'gre',
197                     'packetsize': 64,
198                     'srcip': TRAFFICGEN_PORT1_IP,
199                     'dstip': '192.168.240.1',
200                    }
201
202     GRE_FRAME_L4 = {'srcport': 0,
203                     'dstport': 0
204                     'inner_srcmac': '01:02:03:04:05:06',
205                     'inner_dstmac': '06:05:04:03:02:01',
206                     'inner_srcip': '192.168.0.10',
207                     'inner_dstip': '192.168.240.9',
208                     'inner_proto': 'udp',
209                     'inner_srcport': 3000,
210                     'inner_dstport': 3001,
211                    }
212
213
214 Executing GENEVE decapsulation tests
215 ------------------------------------
216
217 IxNet 7.3X does not have native support of GENEVE protocol. The
218 template, GeneveIxNetTemplate.xml_ClearText.xml, should be imported
219 into IxNET for this testcase to work.
220
221 To import the template do:
222
223 1. Run the IxNetwork TCL Server
224 2. Click on the Traffic menu
225 3. Click on the Traffic actions and click Edit Packet Templates
226 4. On the Template editor window, click Import. Select the template
227    located at ``3rd_party/ixia/GeneveIxNetTemplate.xml_ClearText.xml``
228    and click import.
229 5. Restart the TCL Server.
230
231 To run GENEVE decapsulation tests:
232
233 1. Set the variables used in "Executing Tunnel encapsulation tests"
234
235 2. Run test:
236
237   .. code-block:: console
238
239     ./vsperf --conf-file user_settings.py --test-params 'tunnel_type=geneve' \
240              --integration overlay_p2p_decap_cont
241
242
243 If you want to use different values for your GENEVE frame, you may set:
244
245   .. code-block:: python
246
247     GENEVE_FRAME_L3 = {'proto': 'udp',
248                        'packetsize': 64,
249                        'srcip': TRAFFICGEN_PORT1_IP,
250                        'dstip': '192.168.240.1',
251                       }
252
253     GENEVE_FRAME_L4 = {'srcport': 6081,
254                        'dstport': 6081,
255                        'geneve_vni': 0,
256                        'inner_srcmac': '01:02:03:04:05:06',
257                        'inner_dstmac': '06:05:04:03:02:01',
258                        'inner_srcip': '192.168.0.10',
259                        'inner_dstip': '192.168.240.9',
260                        'inner_proto': 'udp',
261                        'inner_srcport': 3000,
262                        'inner_dstport': 3001,
263                       }
264
265
266 Executing Native/Vanilla OVS VXLAN decapsulation tests
267 ------------------------------------------------------
268
269 To run VXLAN decapsulation tests:
270
271 1. Set the following variables in your user_settings.py file:
272
273   .. code-block:: python
274
275     PATHS['vswitch']['OvsVanilla']['src']['modules'] = [
276         'vport_vxlan',
277         'datapath/linux/openvswitch.ko',
278     ]
279
280     TRAFFICGEN_PORT1_IP = '172.16.1.2'
281     TRAFFICGEN_PORT2_IP = '192.168.1.11'
282
283     VTEP_IP1 = '172.16.1.2/24'
284     VTEP_IP2 = '192.168.1.1'
285     VTEP_IP2_SUBNET = '192.168.1.0/24'
286     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
287     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
288
289     VXLAN_FRAME_L2 = {'srcmac':
290                       '01:02:03:04:05:06',
291                       'dstmac':
292                       '06:05:04:03:02:01',
293                      }
294
295     VXLAN_FRAME_L3 = {'proto': 'udp',
296                       'packetsize': 64,
297                       'srcip': TRAFFICGEN_PORT1_IP,
298                       'dstip': '172.16.1.1',
299                      }
300
301     VXLAN_FRAME_L4 = {
302                       'srcport': 4789,
303                       'dstport': 4789,
304                       'protocolpad': 'true',
305                       'vni': 99,
306                       'inner_srcmac': '01:02:03:04:05:06',
307                       'inner_dstmac': '06:05:04:03:02:01',
308                       'inner_srcip': '192.168.1.2',
309                       'inner_dstip': TRAFFICGEN_PORT2_IP,
310                       'inner_proto': 'udp',
311                       'inner_srcport': 3000,
312                       'inner_dstport': 3001,
313                      }
314
315   **NOTE:** In case, that Vanilla OVS is installed from binary package, then
316   please set ``PATHS['vswitch']['OvsVanilla']['bin']['modules']`` instead.
317
318 2. Run test:
319
320   .. code-block:: console
321
322     ./vsperf --conf-file user_settings.py --integration \
323              --test-params 'tunnel_type=vxlan' overlay_p2p_decap_cont
324
325 Executing Native/Vanilla OVS GRE decapsulation tests
326 ----------------------------------------------------
327
328 To run GRE decapsulation tests:
329
330 1. Set the following variables in your user_settings.py file:
331
332   .. code-block:: python
333
334     PATHS['vswitch']['OvsVanilla']['src']['modules'] = [
335         'vport_gre',
336         'datapath/linux/openvswitch.ko',
337     ]
338
339     TRAFFICGEN_PORT1_IP = '172.16.1.2'
340     TRAFFICGEN_PORT2_IP = '192.168.1.11'
341
342     VTEP_IP1 = '172.16.1.2/24'
343     VTEP_IP2 = '192.168.1.1'
344     VTEP_IP2_SUBNET = '192.168.1.0/24'
345     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
346     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
347
348     GRE_FRAME_L2 = {'srcmac':
349                     '01:02:03:04:05:06',
350                     'dstmac':
351                     '06:05:04:03:02:01',
352                    }
353
354     GRE_FRAME_L3 = {'proto': 'udp',
355                     'packetsize': 64,
356                     'srcip': TRAFFICGEN_PORT1_IP,
357                     'dstip': '172.16.1.1',
358                    }
359
360     GRE_FRAME_L4 = {
361                     'srcport': 4789,
362                     'dstport': 4789,
363                     'protocolpad': 'true',
364                     'inner_srcmac': '01:02:03:04:05:06',
365                     'inner_dstmac': '06:05:04:03:02:01',
366                     'inner_srcip': '192.168.1.2',
367                     'inner_dstip': TRAFFICGEN_PORT2_IP,
368                     'inner_proto': 'udp',
369                     'inner_srcport': 3000,
370                     'inner_dstport': 3001,
371                    }
372
373   **NOTE:** In case, that Vanilla OVS is installed from binary package, then
374   please set ``PATHS['vswitch']['OvsVanilla']['bin']['modules']`` instead.
375
376 2. Run test:
377
378   .. code-block:: console
379
380     ./vsperf --conf-file user_settings.py --integration \
381              --test-params 'tunnel_type=gre' overlay_p2p_decap_cont
382
383 Executing Native/Vanilla OVS GENEVE decapsulation tests
384 -------------------------------------------------------
385
386 To run GENEVE decapsulation tests:
387
388 1. Set the following variables in your user_settings.py file:
389
390   .. code-block:: python
391
392     PATHS['vswitch']['OvsVanilla']['src']['modules'] = [
393         'vport_geneve',
394         'datapath/linux/openvswitch.ko',
395     ]
396
397     TRAFFICGEN_PORT1_IP = '172.16.1.2'
398     TRAFFICGEN_PORT2_IP = '192.168.1.11'
399
400     VTEP_IP1 = '172.16.1.2/24'
401     VTEP_IP2 = '192.168.1.1'
402     VTEP_IP2_SUBNET = '192.168.1.0/24'
403     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
404     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
405
406     GENEVE_FRAME_L2 = {'srcmac':
407                        '01:02:03:04:05:06',
408                        'dstmac':
409                        '06:05:04:03:02:01',
410                       }
411
412     GENEVE_FRAME_L3 = {'proto': 'udp',
413                        'packetsize': 64,
414                        'srcip': TRAFFICGEN_PORT1_IP,
415                        'dstip': '172.16.1.1',
416                       }
417
418     GENEVE_FRAME_L4 = {'srcport': 6081,
419                        'dstport': 6081,
420                        'protocolpad': 'true',
421                        'geneve_vni': 0,
422                        'inner_srcmac': '01:02:03:04:05:06',
423                        'inner_dstmac': '06:05:04:03:02:01',
424                        'inner_srcip': '192.168.1.2',
425                        'inner_dstip': TRAFFICGEN_PORT2_IP,
426                        'inner_proto': 'udp',
427                        'inner_srcport': 3000,
428                        'inner_dstport': 3001,
429                       }
430
431   **NOTE:** In case, that Vanilla OVS is installed from binary package, then
432   please set ``PATHS['vswitch']['OvsVanilla']['bin']['modules']`` instead.
433
434 2. Run test:
435
436   .. code-block:: console
437
438     ./vsperf --conf-file user_settings.py --integration \
439              --test-params 'tunnel_type=geneve' overlay_p2p_decap_cont
440
441
442 Executing Tunnel encapsulation+decapsulation tests
443 --------------------------------------------------
444
445 The OVS DPDK encapsulation/decapsulation tests requires IPs, MAC addresses,
446 bridge names and WHITELIST_NICS for DPDK.
447
448 The test cases can test the tunneling encap and decap without using any ingress
449 overlay traffic as compared to above test cases. To achieve this the OVS is
450 configured to perform encap and decap in a series on the same traffic stream as
451 given below.
452
453 TRAFFIC-IN --> [ENCAP] --> [MOD-PKT] --> [DECAP] --> TRAFFIC-OUT
454
455
456 Default values are already provided. To customize for your environment, override
457 the following variables in you user_settings.py file:
458
459   .. code-block:: python
460
461     # Variables defined in conf/integration/02_vswitch.conf
462
463     # Bridge names
464     TUNNEL_EXTERNAL_BRIDGE1 = 'br-phy1'
465     TUNNEL_EXTERNAL_BRIDGE2 = 'br-phy2'
466     TUNNEL_MODIFY_BRIDGE1 = 'br-mod1'
467     TUNNEL_MODIFY_BRIDGE2 = 'br-mod2'
468
469     # IP of br-mod1
470     TUNNEL_MODIFY_BRIDGE_IP1 = '10.0.0.1/24'
471
472     # Mac of br-mod1
473     TUNNEL_MODIFY_BRIDGE_MAC1 = '00:00:10:00:00:01'
474
475     # IP of br-mod2
476     TUNNEL_MODIFY_BRIDGE_IP2 = '20.0.0.1/24'
477
478     #Mac of br-mod2
479     TUNNEL_MODIFY_BRIDGE_MAC2 = '00:00:20:00:00:01'
480
481     # vxlan|gre|geneve, Only VXLAN is supported for now.
482     TUNNEL_TYPE = 'vxlan'
483
484 To run VXLAN encapsulation+decapsulation tests:
485
486   .. code-block:: console
487
488     ./vsperf --conf-file user_settings.py --integration \
489              overlay_p2p_mod_tput