Merge "integration_doc: Update integration document"
[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 include switch functionality and Overlay
11 tests.
12
13 Tests in the conf/integration can be used to test scaling of different switch
14 configurations by adding steps into the test case.
15
16 For the overlay tests VSPERF supports VXLAN, GRE and GENEVE tunneling protocols.
17 Testing of these protocols is limited to unidirectional traffic and
18 P2P (Physical to Physical scenarios).
19
20 NOTE: The configuration for overlay tests provided in this guide is for
21 unidirectional traffic only.
22
23 Executing Integration Tests
24 ---------------------------
25
26 To execute integration tests VSPERF is run with the integration parameter. To
27 view the current test list simply execute the following command:
28
29 .. code-block:: console
30
31     ./vsperf --integration --list
32
33 The standard tests included are defined inside the
34 ``conf/integration/01_testcases.conf`` file.
35
36 Test Steps
37 ----------
38
39 Execution of integration tests are done on a step by step work flow starting
40 with step 0 as defined inside the test case. Each step of the test increments
41 the step number by one which is indicated in the log.
42
43 .. code-block:: console
44
45     (testcases.integration) - Step 1 - 'vswitch add_switch ['int_br1']' ... OK
46
47 Each step in the test case is validated. If a step does not pass validation the
48 test will fail and terminate. The test will continue until a failure is detected
49 or all steps pass. A csv report file is generated after a test completes with an
50 OK or FAIL result.
51
52 Test Macros
53 -----------
54
55 Test profiles can include macros as part of the test step. Each step in the
56 profile may return a value such as a port name. Recall macros use #STEP to
57 indicate the recalled value inside the return structure. If the method the
58 test step calls returns a value it can be later recalled, for example:
59
60 .. code-block:: python
61
62     {
63         "Name": "vswitch_add_del_vport",
64         "Deployment": "clean",
65         "Description": "vSwitch - add and delete virtual port",
66         "TestSteps": [
67                 ['vswitch', 'add_switch', 'int_br0'],               # STEP 0
68                 ['vswitch', 'add_vport', 'int_br0'],                # STEP 1
69                 ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],  # STEP 2
70                 ['vswitch', 'del_switch', 'int_br0'],               # STEP 3
71              ]
72     }
73
74 This test profile uses the the vswitch add_vport method which returns a string
75 value of the port added. This is later called by the del_port method using the
76 name from step 1.
77
78 Also commonly used steps can be created as a separate profile.
79
80 .. code-block:: python
81
82     STEP_VSWITCH_PVP_INIT = [
83         ['vswitch', 'add_switch', 'int_br0'],           # STEP 0
84         ['vswitch', 'add_phy_port', 'int_br0'],         # STEP 1
85         ['vswitch', 'add_phy_port', 'int_br0'],         # STEP 2
86         ['vswitch', 'add_vport', 'int_br0'],            # STEP 3
87         ['vswitch', 'add_vport', 'int_br0'],            # STEP 4
88     ]
89
90 This profile can then be used inside other testcases
91
92 .. code-block:: python
93
94     {
95         "Name": "vswitch_pvp",
96         "Deployment": "clean",
97         "Description": "vSwitch - configure switch and one vnf",
98         "TestSteps": STEP_VSWITCH_PVP_INIT +
99                      [
100                         ['vnf', 'start'],
101                         ['vnf', 'stop'],
102                      ] +
103                      STEP_VSWITCH_PVP_FINIT
104     }
105
106 Executing Tunnel encapsulation tests
107 ------------------------------------
108
109 The VXLAN OVS DPDK encapsulation tests requires IPs, MAC addresses,
110 bridge names and WHITELIST_NICS for DPDK.
111
112 Default values are already provided. To customize for your environment, override
113 the following variables in you user_settings.py file:
114
115   .. code-block:: python
116
117     # Variables defined in conf/integration/02_vswitch.conf
118     # Tunnel endpoint for Overlay P2P deployment scenario
119     # used for br0
120     VTEP_IP1 = '192.168.0.1/24'
121
122     # Used as remote_ip in adding OVS tunnel port and
123     # to set ARP entry in OVS (e.g. tnl/arp/set br-ext 192.168.240.10 02:00:00:00:00:02
124     VTEP_IP2 = '192.168.240.10'
125
126     # Network to use when adding a route for inner frame data
127     VTEP_IP2_SUBNET = '192.168.240.0/24'
128
129     # Bridge names
130     TUNNEL_INTEGRATION_BRIDGE = 'br0'
131     TUNNEL_EXTERNAL_BRIDGE = 'br-ext'
132
133     # IP of br-ext
134     TUNNEL_EXTERNAL_BRIDGE_IP = '192.168.240.1/24'
135
136     # vxlan|gre|geneve
137     TUNNEL_TYPE = 'vxlan'
138
139     # Variables defined conf/integration/03_traffic.conf
140     # For OP2P deployment scenario
141     TRAFFICGEN_PORT1_MAC = '02:00:00:00:00:01'
142     TRAFFICGEN_PORT2_MAC = '02:00:00:00:00:02'
143     TRAFFICGEN_PORT1_IP = '1.1.1.1'
144     TRAFFICGEN_PORT2_IP = '192.168.240.10'
145
146 To run VXLAN encapsulation tests:
147
148   .. code-block:: console
149
150     ./vsperf --conf-file user_settings.py --integration
151              --test-params 'tunnel_type=vxlan' overlay_p2p_tput
152
153 To run GRE encapsulation tests:
154
155   .. code-block:: console
156
157     ./vsperf --conf-file user_settings.py --integration
158              --test-params 'tunnel_type=gre' overlay_p2p_tput
159
160 To run GENEVE encapsulation tests:
161
162   .. code-block:: console
163
164     ./vsperf --conf-file user_settings.py --integration
165              --test-params 'tunnel_type=geneve' overlay_p2p_tput
166
167 To run OVS NATIVE tunnel tests (VXLAN/GRE/GENEVE):
168
169 1. Install the OVS kernel modules
170
171   .. code:: console
172
173     cd src/ovs/ovs
174     sudo -E make modules_install
175
176 2. Set the following variables:
177
178   .. code-block:: python
179
180     VSWITCH = 'OvsVanilla'
181     # Specify vport_* kernel module to test.
182     VSWITCH_VANILLA_KERNEL_MODULES = ['vport_vxlan',
183                                       'vport_gre',
184                                       'vport_geneve',
185                                       os.path.join(OVS_DIR_VANILLA,
186                                       'datapath/linux/openvswitch.ko')]
187
188 3. Run tests:
189
190   .. code-block:: console
191
192     ./vsperf --conf-file user_settings.py --integration
193              --test-params 'tunnel_type=vxlan' overlay_p2p_tput
194
195
196 Executing VXLAN decapsulation tests
197 ------------------------------------
198
199 To run VXLAN decapsulation tests:
200
201 1. Set the variables used in "Executing Tunnel encapsulation tests"
202
203 2. Set dstmac of DUT_NIC2_MAC to the MAC adddress of the 2nd NIC of your DUT
204
205   .. code-block:: python
206
207     DUT_NIC2_MAC = '<DUT NIC2 MAC>'
208
209 3. Run test:
210
211   .. code-block:: console
212
213     ./vsperf --conf-file user_settings.py --integration overlay_p2p_decap_cont
214
215 If you want to use different values for your VXLAN frame, you may set:
216
217   .. code-block:: python
218
219     VXLAN_FRAME_L3 = {'proto': 'udp',
220                       'packetsize': 64,
221                       'srcip': TRAFFICGEN_PORT1_IP,
222                       'dstip': '192.168.240.1',
223                      }
224     VXLAN_FRAME_L4 = {'srcport': 4789,
225                       'dstport': 4789,
226                       'vni': VXLAN_VNI,
227                       'inner_srcmac': '01:02:03:04:05:06',
228                       'inner_dstmac': '06:05:04:03:02:01',
229                       'inner_srcip': '192.168.0.10',
230                       'inner_dstip': '192.168.240.9',
231                       'inner_proto': 'udp',
232                       'inner_srcport': 3000,
233                       'inner_dstport': 3001,
234                      }
235
236
237 Executing GRE decapsulation tests
238 ---------------------------------
239
240 To run GRE decapsulation tests:
241
242 1. Set the variables used in "Executing Tunnel encapsulation tests"
243
244 2. Set dstmac of DUT_NIC2_MAC to the MAC adddress of the 2nd NIC of your DUT
245
246   .. code-block:: python
247
248     DUT_NIC2_MAC = '<DUT NIC2 MAC>'
249
250 3. Run test:
251
252   .. code-block:: console
253
254     ./vsperf --conf-file user_settings.py --test-params 'tunnel_type=gre'
255              --integration overlay_p2p_decap_cont
256
257
258 If you want to use different values for your GRE frame, you may set:
259
260   .. code-block:: python
261
262     GRE_FRAME_L3 = {'proto': 'gre',
263                     'packetsize': 64,
264                     'srcip': TRAFFICGEN_PORT1_IP,
265                     'dstip': '192.168.240.1',
266                    }
267
268     GRE_FRAME_L4 = {'srcport': 0,
269                     'dstport': 0
270                     'inner_srcmac': '01:02:03:04:05:06',
271                     'inner_dstmac': '06:05:04:03:02:01',
272                     'inner_srcip': '192.168.0.10',
273                     'inner_dstip': '192.168.240.9',
274                     'inner_proto': 'udp',
275                     'inner_srcport': 3000,
276                     'inner_dstport': 3001,
277                    }
278
279
280 Executing GENEVE decapsulation tests
281 ------------------------------------
282
283 IxNet 7.3X does not have native support of GENEVE protocol. The
284 template, GeneveIxNetTemplate.xml_ClearText.xml, should be imported
285 into IxNET for this testcase to work.
286
287 To import the template do:
288
289 1. Run the IxNetwork TCL Server
290 2. Click on the Traffic menu
291 3. Click on the Traffic actions and click Edit Packet Templates
292 4. On the Template editor window, click Import. Select the template
293    tools/pkt_gen/ixnet/GeneveIxNetTemplate.xml_ClearText.xml
294    and click import.
295 5. Restart the TCL Server.
296
297 To run GENEVE decapsulation tests:
298
299 1. Set the variables used in "Executing Tunnel encapsulation tests"
300
301 2. Set dstmac of DUT_NIC2_MAC to the MAC adddress of the 2nd NIC of your DUT
302
303   .. code-block:: python
304
305     DUT_NIC2_MAC = '<DUT NIC2 MAC>'
306
307 3. Run test:
308
309   .. code-block:: console
310
311     ./vsperf --conf-file user_settings.py --test-params 'tunnel_type=geneve'
312              --integration overlay_p2p_decap_cont
313
314
315 If you want to use different values for your GENEVE frame, you may set:
316
317   .. code-block:: python
318
319     GENEVE_FRAME_L3 = {'proto': 'udp',
320                        'packetsize': 64,
321                        'srcip': TRAFFICGEN_PORT1_IP,
322                        'dstip': '192.168.240.1',
323                       }
324
325     GENEVE_FRAME_L4 = {'srcport': 6081,
326                        'dstport': 6081,
327                        'geneve_vni': 0,
328                        'inner_srcmac': '01:02:03:04:05:06',
329                        'inner_dstmac': '06:05:04:03:02:01',
330                        'inner_srcip': '192.168.0.10',
331                        'inner_dstip': '192.168.240.9',
332                        'inner_proto': 'udp',
333                        'inner_srcport': 3000,
334                        'inner_dstport': 3001,
335                       }
336
337
338 Executing Native/Vanilla OVS VXLAN decapsulation tests
339 ------------------------------------------------------
340
341 To run VXLAN decapsulation tests:
342
343 1. Set the following variables in your user_settings.py file:
344
345   .. code-block:: python
346
347     VSWITCH_VANILLA_KERNEL_MODULES = ['vport_vxlan',
348                                       os.path.join(OVS_DIR_VANILLA,
349                                       'datapath/linux/openvswitch.ko')]
350
351     DUT_NIC1_MAC = '<DUT NIC1 MAC ADDRESS>'
352
353     TRAFFICGEN_PORT1_IP = '172.16.1.2'
354     TRAFFICGEN_PORT2_IP = '192.168.1.11'
355
356     VTEP_IP1 = '172.16.1.2/24'
357     VTEP_IP2 = '192.168.1.1'
358     VTEP_IP2_SUBNET = '192.168.1.0/24'
359     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
360     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
361
362     VXLAN_FRAME_L2 = {'srcmac':
363                       '01:02:03:04:05:06',
364                       'dstmac': DUT_NIC1_MAC
365                      }
366
367     VXLAN_FRAME_L3 = {'proto': 'udp',
368                       'packetsize': 64,
369                       'srcip': TRAFFICGEN_PORT1_IP,
370                       'dstip': '172.16.1.1',
371                      }
372
373     VXLAN_FRAME_L4 = {
374                       'srcport': 4789,
375                       'dstport': 4789,
376                       'protocolpad': 'true',
377                       'vni': 99,
378                       'inner_srcmac': '01:02:03:04:05:06',
379                       'inner_dstmac': '06:05:04:03:02:01',
380                       'inner_srcip': '192.168.1.2',
381                       'inner_dstip': TRAFFICGEN_PORT2_IP,
382                       'inner_proto': 'udp',
383                       'inner_srcport': 3000,
384                       'inner_dstport': 3001,
385                      }
386
387 2. Run test:
388
389   .. code-block:: console
390
391     ./vsperf --conf-file user_settings.py --integration
392              --test-params 'tunnel_type=vxlan' overlay_p2p_decap_cont
393
394 Executing Native/Vanilla OVS GRE decapsulation tests
395 ----------------------------------------------------
396
397 To run GRE decapsulation tests:
398
399 1. Set the following variables in your user_settings.py file:
400
401   .. code-block:: python
402
403     VSWITCH_VANILLA_KERNEL_MODULES = ['vport_gre',
404                                       os.path.join(OVS_DIR_VANILLA,
405                                       'datapath/linux/openvswitch.ko')]
406
407     DUT_NIC1_MAC = '<DUT NIC1 MAC ADDRESS>'
408
409     TRAFFICGEN_PORT1_IP = '172.16.1.2'
410     TRAFFICGEN_PORT2_IP = '192.168.1.11'
411
412     VTEP_IP1 = '172.16.1.2/24'
413     VTEP_IP2 = '192.168.1.1'
414     VTEP_IP2_SUBNET = '192.168.1.0/24'
415     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
416     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
417
418     GRE_FRAME_L2 = {'srcmac':
419                     '01:02:03:04:05:06',
420                     'dstmac': DUT_NIC1_MAC
421                    }
422
423     GRE_FRAME_L3 = {'proto': 'udp',
424                     'packetsize': 64,
425                     'srcip': TRAFFICGEN_PORT1_IP,
426                     'dstip': '172.16.1.1',
427                    }
428
429     GRE_FRAME_L4 = {
430                     'srcport': 4789,
431                     'dstport': 4789,
432                     'protocolpad': 'true',
433                     'inner_srcmac': '01:02:03:04:05:06',
434                     'inner_dstmac': '06:05:04:03:02:01',
435                     'inner_srcip': '192.168.1.2',
436                     'inner_dstip': TRAFFICGEN_PORT2_IP,
437                     'inner_proto': 'udp',
438                     'inner_srcport': 3000,
439                     'inner_dstport': 3001,
440                    }
441
442 2. Run test:
443
444   .. code-block:: console
445
446     ./vsperf --conf-file user_settings.py --integration
447              --test-params 'tunnel_type=gre' overlay_p2p_decap_cont
448
449 Executing Native/Vanilla OVS GENEVE decapsulation tests
450 -------------------------------------------------------
451
452 To run GENEVE decapsulation tests:
453
454 1. Set the following variables in your user_settings.py file:
455
456   .. code-block:: python
457
458     VSWITCH_VANILLA_KERNEL_MODULES = ['vport_geneve',
459                                       os.path.join(OVS_DIR_VANILLA,
460                                       'datapath/linux/openvswitch.ko')]
461
462     DUT_NIC1_MAC = '<DUT NIC1 MAC ADDRESS>'
463
464     TRAFFICGEN_PORT1_IP = '172.16.1.2'
465     TRAFFICGEN_PORT2_IP = '192.168.1.11'
466
467     VTEP_IP1 = '172.16.1.2/24'
468     VTEP_IP2 = '192.168.1.1'
469     VTEP_IP2_SUBNET = '192.168.1.0/24'
470     TUNNEL_EXTERNAL_BRIDGE_IP = '172.16.1.1/24'
471     TUNNEL_INT_BRIDGE_IP = '192.168.1.1'
472
473     GENEVE_FRAME_L2 = {'srcmac':
474                        '01:02:03:04:05:06',
475                        'dstmac': DUT_NIC1_MAC
476                       }
477
478     GENEVE_FRAME_L3 = {'proto': 'udp',
479                        'packetsize': 64,
480                        'srcip': TRAFFICGEN_PORT1_IP,
481                        'dstip': '172.16.1.1',
482                       }
483
484     GENEVE_FRAME_L4 = {'srcport': 6081,
485                        'dstport': 6081,
486                        'protocolpad': 'true',
487                        'geneve_vni': 0,
488                        'inner_srcmac': '01:02:03:04:05:06',
489                        'inner_dstmac': '06:05:04:03:02:01',
490                        'inner_srcip': '192.168.1.2',
491                        'inner_dstip': TRAFFICGEN_PORT2_IP,
492                        'inner_proto': 'udp',
493                        'inner_srcport': 3000,
494                        'inner_dstport': 3001,
495                       }
496
497 2. Run test:
498
499   .. code-block:: console
500
501     ./vsperf --conf-file user_settings.py --integration
502              --test-params 'tunnel_type=geneve' overlay_p2p_decap_cont
503