Merge "cli: Modify configuration via CLI"
[vswitchperf.git] / conf / integration / 01_testcases.conf
index a67702f..a584845 100644 (file)
@@ -128,6 +128,48 @@ STEP_VSWITCH_PVVP_FLOWS_FINIT = [
     ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[3][1]'}],
 ] + STEP_VSWITCH_PVVP_FINIT
 
+STEP_VSWITCH_P4VP_INIT = STEP_VSWITCH_PVVP_INIT + [
+    ['vswitch', 'add_vport', 'int_br0'],            # STEP 7    vm3 ports
+    ['vswitch', 'add_vport', 'int_br0'],            # STEP 8
+    ['vswitch', 'add_vport', 'int_br0'],            # STEP 9    vm4 ports
+    ['vswitch', 'add_vport', 'int_br0'],            # STEP 10
+]
+
+STEP_VSWITCH_P4VP_FINIT = [
+    ['vswitch', 'del_port', 'int_br0', '#STEP[7][0]'],  # vm3 ports
+    ['vswitch', 'del_port', 'int_br0', '#STEP[8][0]'],
+    ['vswitch', 'del_port', 'int_br0', '#STEP[9][0]'],  # vm4 ports
+    ['vswitch', 'del_port', 'int_br0', '#STEP[10][0]'],
+] + STEP_VSWITCH_PVVP_FINIT
+
+STEP_VSWITCH_P4VP_FLOWS_INIT = STEP_VSWITCH_P4VP_INIT + [
+            ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', \
+                'actions': ['output:#STEP[3][1]'], 'idle_timeout': '0'}],
+            ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[4][1]', \
+                'actions': ['output:#STEP[5][1]'], 'idle_timeout': '0'}],
+            ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[6][1]', \
+                'actions': ['output:#STEP[7][1]'], 'idle_timeout': '0'}],
+            ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[8][1]', \
+                'actions': ['output:#STEP[9][1]'], 'idle_timeout': '0'}],
+            ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[10][1]', \
+                'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
+            ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[2][1]', \
+                'actions': ['output:#STEP[10][1]'], 'idle_timeout': '0'}],
+            ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[9][1]', \
+                'actions': ['output:#STEP[8][1]'], 'idle_timeout': '0'}],
+            ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[7][1]', \
+                'actions': ['output:#STEP[6][1]'], 'idle_timeout': '0'}],
+            ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[5][1]', \
+                'actions': ['output:#STEP[4][1]'], 'idle_timeout': '0'}],
+            ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[3][1]', \
+                'actions': ['output:#STEP[1][1]'], 'idle_timeout': '0'}],
+]
+
+STEP_VSWITCH_P4VP_FLOWS_FINIT = [
+    ['vswitch', 'dump_flows', 'int_br0'],
+    ['vswitch', 'del_flow', 'int_br0'],
+] + STEP_VSWITCH_P4VP_FINIT
+
 STEP_VSWITCH_2PHY_2VM_INIT = STEP_VSWITCH_PVVP_INIT
 
 STEP_VSWITCH_2PHY_2VM_FINIT = STEP_VSWITCH_PVVP_FINIT
@@ -286,6 +328,7 @@ INTEGRATION_TESTS = [
                        "The encap and decap are performed inside the "
                        "virtual switch itself in each direction to avoid "
                        "the need of ingress overlay traffic."),
+        "Parameters": {'TRAFFICGEN_IXNET_TCL_SCRIPT' : 'ixnetrfc2544v2.tcl'},
     },
     {
         "Name": "overlay_p2p_tput",
@@ -295,6 +338,7 @@ INTEGRATION_TESTS = [
         "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
         "Tunnel Operation": "encapsulation",
         "Description": "Overlay Encapsulation Throughput RFC2544 Test",
+        "Parameters": {'TRAFFICGEN_IXNET_TCL_SCRIPT' : 'ixnetrfc2544v2.tcl'},
     },
     {
         "Name": "overlay_p2p_cont",
@@ -304,6 +348,7 @@ INTEGRATION_TESTS = [
         "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
         "Tunnel Operation": "encapsulation",
         "Description": "Overlay Encapsulation Continuous Stream",
+        "Parameters": {'TRAFFICGEN_IXNET_TCL_SCRIPT' : 'ixnetrfc2544v2.tcl'},
     },
     {
         "Name": "overlay_p2p_decap_tput",
@@ -313,6 +358,7 @@ INTEGRATION_TESTS = [
         "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
         "Tunnel Operation": "decapsulation",
         "Description": "Overlay Decapsulation Throughput RFC2544 Test",
+        "Parameters": {'TRAFFICGEN_IXNET_TCL_SCRIPT' : 'ixnetrfc2544v2.tcl'},
     },
     {
         "Name": "overlay_p2p_decap_cont",
@@ -322,6 +368,7 @@ INTEGRATION_TESTS = [
         "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
         "Tunnel Operation": "decapsulation",
         "Description": "Overlay Decapsulation Continuous Stream",
+        "Parameters": {'TRAFFICGEN_IXNET_TCL_SCRIPT' : 'ixnetrfc2544v2.tcl'},
     },
     {
         "Name": "vswitch_add_del_bridge",
@@ -406,6 +453,21 @@ INTEGRATION_TESTS = [
                         ['vswitch', 'del_switch', 'int_br0'],
                      ]
     },
+    {
+        "Name": "vswitch_vports_add_del_flow",
+        "Deployment": "clean",
+        "Description": "vSwitch - configure switch with vports, add and delete flow",
+        "TestSteps": [
+                        ['vswitch', 'add_switch', 'int_br0'],
+                        ['vswitch', 'add_vport', 'int_br0'],
+                        ['vswitch', 'add_vport', 'int_br0'],
+                        ['vswitch', 'add_flow', 'int_br0', {'in_port': '#STEP[1][1]', 'actions': ['output:#STEP[2][1]'], 'idle_timeout': '0'}],
+                        ['vswitch', 'del_flow', 'int_br0', {'in_port': '#STEP[1][1]'}],
+                        ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
+                        ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
+                        ['vswitch', 'del_switch', 'int_br0'],
+                     ]
+    },
     {
         "Name": "vswitch_add_del_flows",
         "Deployment": "clean",
@@ -454,6 +516,21 @@ INTEGRATION_TESTS = [
                      ] +
                      STEP_VSWITCH_PVP_FINIT
     },
+    {
+        "Name": "vswitch_vports_pvp",
+        "Deployment": "clean",
+        "Description": "vSwitch - configure switch with vports and one vnf",
+        "TestSteps": [
+                        ['vswitch', 'add_switch', 'int_br0'],
+                        ['vswitch', 'add_vport', 'int_br0'],
+                        ['vswitch', 'add_vport', 'int_br0'],
+                        ['vnf', 'start'],
+                        ['vnf', 'stop'],
+                        ['vswitch', 'del_port', 'int_br0', '#STEP[1][0]'],
+                        ['vswitch', 'del_port', 'int_br0', '#STEP[2][0]'],
+                        ['vswitch', 'del_switch', 'int_br0'],
+                     ]
+    },
     {
         "Name": "vswitch_pvp_tput",
         "Deployment": "clean",
@@ -575,10 +652,109 @@ INTEGRATION_TESTS = [
                      ] +
                      STEP_VSWITCH_PVVP_FLOWS_FINIT
     },
+    {
+        "Name": "vswitch_p4vp",
+        "Description": "Just configure 4 chained vnfs",
+        "Deployment": "clean",
+        "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
+        [
+            ['vnf1', 'start'],
+            ['vnf2', 'start'],
+            ['vnf3', 'start'],
+            ['vnf4', 'start'],
+            ['vnf1', 'stop'],
+            ['vnf2', 'stop'],
+            ['vnf3', 'stop'],
+            ['vnf4', 'stop'],
+        ] +
+        STEP_VSWITCH_P4VP_FLOWS_FINIT
+    },
+    {
+        "Name": "vswitch_p4vp_tput",
+        "Description": "4 chained vnfs, execute RFC2544 throughput test",
+        "Deployment": "clean",
+        "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
+        [
+            ['vnf1', 'start'],
+            ['vnf2', 'start'],
+            ['vnf3', 'start'],
+            ['vnf4', 'start'],
+            ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', \
+                'bidir' : 'True'}],
+            ['vnf1', 'stop'],
+            ['vnf2', 'stop'],
+            ['vnf3', 'stop'],
+            ['vnf4', 'stop'],
+        ] +
+        STEP_VSWITCH_P4VP_FLOWS_FINIT
+    },
+    {
+        "Name": "vswitch_p4vp_back2back",
+        "Description": "4 chained vnfs, execute RFC2544 back2back test",
+        "Deployment": "clean",
+        "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
+        [
+            ['vnf1', 'start'],
+            ['vnf2', 'start'],
+            ['vnf3', 'start'],
+            ['vnf4', 'start'],
+            ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', \
+                'bidir' : 'True'}],
+            ['vnf1', 'stop'],
+            ['vnf2', 'stop'],
+            ['vnf3', 'stop'],
+            ['vnf4', 'stop'],
+        ] +
+        STEP_VSWITCH_P4VP_FLOWS_FINIT
+    },
+    {
+        "Name": "vswitch_p4vp_cont",
+        "Description": "4 chained vnfs, execute continuous stream test",
+        "Deployment": "clean",
+        "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
+        [
+            ['vnf1', 'start'],
+            ['vnf2', 'start'],
+            ['vnf3', 'start'],
+            ['vnf4', 'start'],
+            ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', \
+                'bidir' : 'True'}],
+            ['vnf1', 'stop'],
+            ['vnf2', 'stop'],
+            ['vnf3', 'stop'],
+            ['vnf4', 'stop'],
+        ] +
+        STEP_VSWITCH_P4VP_FLOWS_FINIT
+    },
+    {
+        "Name": "vswitch_p4vp_all",
+        "Description": "4 chained vnfs, execute RFC2544 throughput test",
+        "Deployment": "clean",
+        "TestSteps": STEP_VSWITCH_P4VP_FLOWS_INIT +
+        [
+            ['vnf1', 'start'],
+            ['vnf2', 'start'],
+            ['vnf3', 'start'],
+            ['vnf4', 'start'],
+            ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', \
+                'bidir' : 'True'}],
+            ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', \
+                'bidir' : 'True'}],
+            ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', \
+                'bidir' : 'True'}],
+            ['vnf1', 'stop'],
+            ['vnf2', 'stop'],
+            ['vnf3', 'stop'],
+            ['vnf4', 'stop'],
+        ] +
+        STEP_VSWITCH_P4VP_FLOWS_FINIT
+    },
     {
       # Topology: 2 Parallel PVP connections
       # To run a Linux bridge as a loopback in the Guest use:
-      #     --test-params "guest_loopback=linux_bridge" --integration 2pvp_udp_dest_flows
+      #     --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 2pvp_udp_dest_flows
+      # or add "Parameters" option to the test definition:
+      #     "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
         "Name": "2pvp_udp_dest_flows",
         "Description": "Continuous TC with 2 Parallel VMs, flows on UDP Dest Port",
         "Deployment": "clean",
@@ -599,7 +775,9 @@ INTEGRATION_TESTS = [
     {
       # Topology: 4 Parallel PVP connections
       # To run a Linux bridge as a loopback in the Guest use:
-      #     --test-params "guest_loopback=linux_bridge" --integration 4pvp_udp_dest_flows
+      #     --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 4pvp_udp_dest_flows
+      # or add "Parameters" option to the test definition:
+      #     "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
         "Name": "4pvp_udp_dest_flows",
         "Description": "Continuous TC with 4 Parallel VMs, flows on UDP Dest Port",
         "Deployment": "clean",
@@ -624,7 +802,9 @@ INTEGRATION_TESTS = [
     {
       # Topology: 6 Parallel PVP connections
       # To run a Linux bridge as a loopback in the Guest use:
-      #     --test-params "guest_loopback=linux_bridge" --integration 6pvp_udp_dest_flows
+      #     --test-params "GUEST_LOOPBACK=['linux_bridge']" --integration 6pvp_udp_dest_flows
+      # or add "Parameters" option to the test definition:
+      #     "Parameters" : {'GUEST_LOOPBACK' : ['linux_bridge'],},
         "Name": "6pvp_udp_dest_flows",
         "Description": "Continuous TC with 6 Parallel VMs, flows on UDP Dest Port",
         "Deployment": "clean",
@@ -649,6 +829,79 @@ INTEGRATION_TESTS = [
         ] + STEP_VSWITCH_FLOWS_FINIT +
         STEP_VSWITCH_2PHY_6VM_FINIT
     },
+    {
+        # Testcase for verification of vHost User NUMA awareness feature
+        # introduced in DPDK v2.2. Test case will execute two VNFs, each
+        # pinned to different NUMA slot. After that it will verify that
+        # QEMU and PMD threads serving its interfaces are co-located
+        # at the same NUMA slot.
+        #
+        # Prerequisites:
+        #     * architecture with at least 2 NUMA slots
+        #     * OVS with DPDK support and DPDK v2.2 and newer
+        #     * OVS configuration utilizing both NUMA slots
+        #
+        #     Example of OVS configuration valid for DPDK v16.04 and cores
+        #     split between NUMA slots as follows:
+        #           node 0 cpus: 0 1 2 3 4 5 6 7 8 9
+        #           node 1 cpus: 10 11 12 13 14 15 16 17 18 19
+        #
+        #     VSWITCH_PMD_CPU_MASK = '1010'
+        #     VSWITCHD_DPDK_CONFIG = {
+        #         'dpdk-init' : 'true',
+        #         'dpdk-lcore-mask' : '0x4004',
+        #         'pmd-cpu-mask' : 'FF0FF',
+        #         'dpdk-socket-mem' : '1024,1024',
+        #     }
+        #
+        "Name": "vhost_numa_awareness",
+        "Deployment": "clean",
+        "Description": "vSwitch DPDK - verify that PMD threads are served "
+                       "by the same NUMA slot as QEMU instances",
+        "vSwitch" : "OvsDpdkVhost",
+        "TestSteps": STEP_VSWITCH_PVVP_INIT +                                       # STEP 0-6
+            [
+                # check that at least 2 numa slots are available
+                ['tools', 'exec', 'numactl -H', 'available: ([0-9]+)'],             # STEP 7
+                ['tools', 'assert', '#STEP[-1][0]>1'],                              # STEP 8
+                # store last 2 cores from numa slot 0
+                ['tools', 'exec', 'numactl -H', 'node 0 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 9
+                # store last 2 cores from numa slot 1
+                ['tools', 'exec', 'numactl -H', 'node 1 cpus:.*\s+(\\d+) (\\d+)$'], # STEP 10
+                # pin VNF1 to 1st NUMA slot and VNF2 to 2nd NUMA slot
+                ['settings', 'setValue', 'GUEST_CORE_BINDING',                      # STEP 11
+                    [("#STEP[-2][0][0]", "#STEP[-2][0][1]"),
+                     ("#STEP[-1][0][0]", "#STEP[-1][0][1]")]
+                ],
+                # start 2 VNFs
+                ['vnf1', 'start'],                                                  # STEP 12
+                ['vnf2', 'start'],                                                  # STEP 13
+                # read paths to ovs utilities
+                ['settings', 'getValue', 'TOOLS'],                                  # STEP 14
+                # check that PMD thread serving VNF1 runs at NUMA slot 0
+                ## i.e. get numa slot ID serving dpdhvhostuser0...
+                ['tools', 'exec', "sudo #STEP[-1]['ovs-appctl'] "                   # STEP 15
+                    "dpif-netdev/pmd-rxq-show | "
+                    "sed -e '/dpdkvhostuser0/,$d' | tac",
+                    'pmd thread numa_id ([0-9])+'
+                ],
+                ## ...and check that it is NUMA slot 0
+                ['tools', 'assert', '#STEP[-1][0]==0'],                             # STEP 16
+                # check that PMD thread serving VNF2 runs at NUMA slot 1
+                ## i.e. get numa slot ID serving dpdhvhostuser2...
+                ['tools', 'exec', "sudo #STEP[-3]['ovs-appctl'] "                   # STEP 17
+                    "dpif-netdev/pmd-rxq-show | "
+                    "sed -e '/dpdkvhostuser2/,$d' | tac",
+                    'pmd thread numa_id ([0-9])+'
+                ],
+                ## ...and check that it is NUMA slot 1
+                ['tools', 'assert', '#STEP[-1][0]==1'],                             # STEP 18
+                # clean up
+                ['vnf2', 'stop'],                                                   # STEP 19
+                ['vnf1', 'stop'],                                                   # STEP 20
+            ] +
+            STEP_VSWITCH_PVVP_FINIT                                                 # STEP 21...
+    },
 ]
 
 # Example of TC definition with exact vSwitch, VNF and TRAFFICGEN values.
@@ -659,7 +912,7 @@ INTEGRATION_TESTS = [
 #        "vSwitch" : "OvsVanilla",
 #        "VNF" : "QemuVirtioNet",
 #        "Trafficgen": "IxNet",
-#        "Parameters": {"guest_loopback" : "linux_bridge"},
+#        "Parameters": {"GUEST_LOOPBACK" : ["linux_bridge"],},
 #        "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
 #                     [
 #                        ['vnf', 'start'],