diff options
author | juraj.linkes <juraj.linkes@pantheon.tech> | 2019-07-10 11:32:47 +0200 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2019-07-17 07:47:32 +0000 |
commit | 248d1a52e06622dc9eb1dfdd6ca9f6670b4c0bc3 (patch) | |
tree | 75693f1fe6a233a542d78ba64e80c4c5621ed3ac | |
parent | 5287b5307b3e39c4e13545b0c6ea651ac4014a84 (diff) |
Refactor VPP Device VM vhost tests
* replace the current VM image with kernel img
* rework keyword usage to make it consistent with performance tests
* remove resources/libraries/robot/shared/qemu.robot as it's not used
anywhere anymore
Change-Id: Ia5bc19e9e6ed9af031e4d9b5c0c89431fb49fd33
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
24 files changed, 592 insertions, 639 deletions
diff --git a/resources/libraries/bash/function/device.sh b/resources/libraries/bash/function/device.sh index 5d33af342e..e31ead734a 100644 --- a/resources/libraries/bash/function/device.sh +++ b/resources/libraries/bash/function/device.sh @@ -581,6 +581,10 @@ function start_topology_containers () { dcr_stc_params+="--volume /var/lib/vm/vhost-nested.img:/var/lib/vm/vhost-nested.img " # Mount docker.sock to be able to use docker deamon of the host. dcr_stc_params+="--volume /var/run/docker.sock:/var/run/docker.sock " + # Mount /opt/boot/ where VM kernel and initrd are located. + dcr_stc_params+="--volume /opt/boot/:/opt/boot/ " + # Mount host hugepages for VMs. + dcr_stc_params+="--volume /dev/hugepages/:/dev/hugepages/ " # Docker Container UUIDs. declare -gA DCR_UUIDS diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py index 877fc25012..ddff2b161c 100644 --- a/resources/libraries/python/Constants.py +++ b/resources/libraries/python/Constants.py @@ -61,6 +61,9 @@ class Constants(object): # QEMU VM kernel image path QEMU_VM_KERNEL = '/opt/boot/vmlinuz' + # QEMU VM kernel initrd path + QEMU_VM_KERNEL_INITRD = '/opt/boot/initrd.img' + # QEMU VM nested image path QEMU_VM_IMAGE = '/var/lib/vm/vhost-nested.img' diff --git a/resources/libraries/python/CpuUtils.py b/resources/libraries/python/CpuUtils.py index 67bf312f5d..07c5032aa8 100644 --- a/resources/libraries/python/CpuUtils.py +++ b/resources/libraries/python/CpuUtils.py @@ -62,15 +62,20 @@ class CpuUtils(object): return bool(count == cpu_mems_len) @staticmethod - def get_cpu_layout_from_all_nodes(nodes): - """Retrieve cpu layout from all nodes, assuming all nodes - are Linux nodes. + def get_cpu_info_from_all_nodes(nodes): + """Assuming all nodes are Linux nodes, retrieve the following + cpu information from all nodes: + - cpu architecture + - cpu layout :param nodes: DICT__nodes from Topology.DICT__nodes. :type nodes: dict - :raises RuntimeError: If the ssh command "lscpu -p" fails. + :raises RuntimeError: If an ssh command retrieving cpu information + fails. """ for node in nodes.values(): + stdout, _ = exec_cmd_no_error(node, 'uname -m') + node['arch'] = stdout.strip() stdout, _ = exec_cmd_no_error(node, 'lscpu -p') node['cpuinfo'] = list() for line in stdout.split("\n"): diff --git a/resources/libraries/python/QemuUtils.py b/resources/libraries/python/QemuUtils.py index 9c021763bd..6a63798b1e 100644 --- a/resources/libraries/python/QemuUtils.py +++ b/resources/libraries/python/QemuUtils.py @@ -13,13 +13,13 @@ """QEMU utilities library.""" -from time import sleep -from string import Template -import json -from re import match # Disable due to pylint bug # pylint: disable=no-name-in-module,import-error from distutils.version import StrictVersion +import json +from re import match +from string import Template +from time import sleep from robot.api import logger from resources.libraries.python.Constants import Constants @@ -59,6 +59,11 @@ class QemuUtils(object): """ self._vhost_id = 0 self._node = node + self._arch = Topology.get_node_arch(self._node) + dpdk_target = 'arm64-armv8a' if self._arch == 'aarch64' \ + else 'x86_64-native' + self._testpmd_path = '{path}/{dpdk_target}-linuxapp-gcc/app'\ + .format(path=Constants.QEMU_VM_DPDK, dpdk_target=dpdk_target) self._vm_info = { 'host': node['host'], 'type': NodeType.VM, @@ -82,16 +87,25 @@ class QemuUtils(object): # Temporary files. self._temp = dict() self._temp['pidfile'] = '/var/run/qemu_{id}.pid'.format(id=qemu_id) - if '/var/lib/vm/' in img: + if img == Constants.QEMU_VM_IMAGE: self._opt['vm_type'] = 'nestedvm' self._temp['qmp'] = '/var/run/qmp_{id}.sock'.format(id=qemu_id) self._temp['qga'] = '/var/run/qga_{id}.sock'.format(id=qemu_id) - elif '/opt/boot/vmlinuz' in img: + elif img == Constants.QEMU_VM_KERNEL: + self._opt['img'], _ = exec_cmd_no_error( + node, + 'ls -1 {img}* | tail -1'.format(img=Constants.QEMU_VM_KERNEL), + message='Qemu Kernel VM image not found!') self._opt['vm_type'] = 'kernelvm' self._temp['log'] = '/tmp/serial_{id}.log'.format(id=qemu_id) self._temp['ini'] = '/etc/vm_init_{id}.conf'.format(id=qemu_id) + self._opt['initrd'], _ = exec_cmd_no_error( + node, + 'ls -1 {initrd}* | tail -1'.format( + initrd=Constants.QEMU_VM_KERNEL_INITRD), + message='Qemu Kernel initrd image not found!') else: - raise RuntimeError('QEMU: Unknown VM image option!') + raise RuntimeError('QEMU: Unknown VM image option: {}'.format(img)) # Computed parameters for QEMU command line. self._params = OptionString(prefix='-') self.add_params() @@ -119,8 +133,13 @@ class QemuUtils(object): self._params.add('enable-kvm') self._params.add_with_value('pidfile', self._temp.get('pidfile')) self._params.add_with_value('cpu', 'host') + + if self._arch == 'aarch64': + machine_args = 'virt,accel=kvm,usb=off,mem-merge=off,gic-version=3' + else: + machine_args = 'pc,accel=kvm,usb=off,mem-merge=off' self._params.add_with_value( - 'machine', 'pc,accel=kvm,usb=off,mem-merge=off') + 'machine', machine_args) self._params.add_with_value( 'smp', '{smp},sockets=1,cores={smp},threads=1'.format( smp=self._opt.get('smp'))) @@ -163,21 +182,22 @@ class QemuUtils(object): def add_kernelvm_params(self): """Set KernelVM QEMU parameters.""" - self._params.add_with_value( - 'chardev', 'file,id=char0,path={log}'.format( - log=self._temp.get('log'))) - self._params.add_with_value('device', 'isa-serial,chardev=char0') + console = 'ttyAMA0' if self._arch == 'aarch64' else 'ttyS0' + self._params.add_with_value('serial', 'file:{log}'.format( + log=self._temp.get('log'))) self._params.add_with_value( 'fsdev', 'local,id=root9p,path=/,security_model=none') self._params.add_with_value( - 'device', 'virtio-9p-pci,fsdev=root9p,mount_tag=/dev/root') + 'device', 'virtio-9p-pci,fsdev=root9p,mount_tag=virtioroot') + self._params.add_with_value( + 'kernel', '{img}'.format(img=self._opt.get('img'))) self._params.add_with_value( - 'kernel', '$(readlink -m {img}* | tail -1)'.format( - img=self._opt.get('img'))) + 'initrd', '{initrd}'.format(initrd=self._opt.get('initrd'))) self._params.add_with_value( - 'append', '"ro rootfstype=9p rootflags=trans=virtio console=ttyS0' - ' tsc=reliable hugepages=256 init={init}"'.format( - init=self._temp.get('ini'))) + 'append', '"ro rootfstype=9p rootflags=trans=virtio ' + 'root=virtioroot console={console} tsc=reliable ' + 'hugepages=256 init={init}"'.format( + console=console, init=self._temp.get('ini'))) def create_kernelvm_config_vpp(self, **kwargs): """Create QEMU VPP config files. @@ -203,8 +223,9 @@ class QemuUtils(object): vpp_config.add_unix_cli_listen() vpp_config.add_unix_exec(running) vpp_config.add_cpu_main_core('0') - vpp_config.add_cpu_corelist_workers('1-{smp}'. - format(smp=self._opt.get('smp')-1)) + if self._opt.get('smp') > 1: + vpp_config.add_cpu_corelist_workers('1-{smp}'.format( + smp=self._opt.get('smp')-1)) vpp_config.add_dpdk_dev('0000:00:06.0', '0000:00:07.0') vpp_config.add_dpdk_dev_default_rxq(kwargs['queues']) vpp_config.add_dpdk_log_level('debug') @@ -233,9 +254,6 @@ class QemuUtils(object): :param kwargs: Key-value pairs to construct command line parameters. :type kwargs: dict """ - testpmd_path = ('{path}/{arch}-native-linuxapp-gcc/app'. - format(path=Constants.QEMU_VM_DPDK, - arch=Topology.get_node_arch(self._node))) testpmd_cmd = DpdkUtil.get_testpmd_cmdline( eal_corelist='0-{smp}'.format(smp=self._opt.get('smp') - 1), eal_driver=False, @@ -249,7 +267,7 @@ class QemuUtils(object): pmd_nb_cores=str(self._opt.get('smp') - 1)) self._opt['vnf_bin'] = ('{testpmd_path}/{testpmd_cmd}'. - format(testpmd_path=testpmd_path, + format(testpmd_path=self._testpmd_path, testpmd_cmd=testpmd_cmd)) def create_kernelvm_config_testpmd_mac(self, **kwargs): @@ -258,9 +276,6 @@ class QemuUtils(object): :param kwargs: Key-value pairs to construct command line parameters. :type kwargs: dict """ - testpmd_path = ('{path}/{arch}-native-linuxapp-gcc/app'. - format(path=Constants.QEMU_VM_DPDK, - arch=Topology.get_node_arch(self._node))) testpmd_cmd = DpdkUtil.get_testpmd_cmdline( eal_corelist='0-{smp}'.format(smp=self._opt.get('smp') - 1), eal_driver=False, @@ -277,7 +292,7 @@ class QemuUtils(object): pmd_nb_cores=str(self._opt.get('smp') - 1)) self._opt['vnf_bin'] = ('{testpmd_path}/{testpmd_cmd}'. - format(testpmd_path=testpmd_path, + format(testpmd_path=self._testpmd_path, testpmd_cmd=testpmd_cmd)) def create_kernelvm_init(self, **kwargs): @@ -407,7 +422,7 @@ class QemuUtils(object): format(queue_size=queue_size)) if queue_size else '' mbuf = 'on,host_mtu=9200' self._params.add_with_value( - 'device', 'virtio-net-pci,netdev=vhost{vhost},mac={mac},bus=pci.0,' + 'device', 'virtio-net-pci,netdev=vhost{vhost},mac={mac},' 'addr={addr}.0,mq=on,vectors={vectors},csum=off,gso=off,' 'guest_tso4=off,guest_tso6=off,guest_ecn=off,mrg_rxbuf={mbuf},' '{queue_size}'.format( @@ -597,8 +612,7 @@ class QemuUtils(object): """ cmd_opts = OptionString() cmd_opts.add('{bin_path}/qemu-system-{arch}'.format( - bin_path=Constants.QEMU_BIN_PATH, - arch=Topology.get_node_arch(self._node))) + bin_path=Constants.QEMU_BIN_PATH, arch=self._arch)) cmd_opts.extend(self._params) message = ('QEMU: Start failed on {host}!'. format(host=self._node['host'])) @@ -643,7 +657,7 @@ class QemuUtils(object): """ command = ('{bin_path}/qemu-system-{arch} --version'.format( bin_path=Constants.QEMU_BIN_PATH, - arch=Topology.get_node_arch(self._node))) + arch=self._arch)) try: stdout, _ = exec_cmd_no_error(self._node, command, sudo=True) ver = match(r'QEMU emulator version ([\d.]*)', stdout).group(1) diff --git a/resources/libraries/robot/performance/performance_configuration.robot b/resources/libraries/robot/performance/performance_configuration.robot index 25a76fed37..a6f1acecd0 100644 --- a/resources/libraries/robot/performance/performance_configuration.robot +++ b/resources/libraries/robot/performance/performance_configuration.robot @@ -339,10 +339,8 @@ | | ... | ${dut1} | ${dut1_if1} | 100.0.0.1 | 30 | | Configure IP addresses on interfaces | | ... | ${dut1} | ${dut1_if2} | 200.0.0.1 | 30 -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 100.0.0.2 | ${tg1_if1_mac} -| | VPP Add IP Neighbor | ${dut1} | ${dut1_if2} | 200.0.0.2 | ${tg1_if2_mac} +| | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 100.0.0.2 | ${tg_if1_mac} +| | VPP Add IP Neighbor | ${dut1} | ${dut1_if2} | 200.0.0.2 | ${tg_if2_mac} | | Vpp Route Add | ${dut1} | 10.0.0.0 | 8 | gateway=100.0.0.2 | | ... | interface=${dut1_if1} | vrf=${fib_table_1} | | Vpp Route Add | ${dut1} | 20.0.0.0 | 8 | gateway=200.0.0.2 @@ -689,6 +687,75 @@ | | Vpp Route Add | ${dut} | 2001:2::0 | ${host_prefix} | gateway=2001:5::2 | | ... | interface=${dut_if2} | count=${count} +| Initialize IPv6 forwarding with vhost in 2-node circular topology +| | [Documentation] +| | ... | Create pairs of Vhost-User interfaces for defined number of VMs on \ +| | ... | VPP node. Set UP state of all VPP interfaces in path. Create \ +| | ... | nf_nodes+1 FIB tables on DUT with multipath routing. Assign each \ +| | ... | Virtual interface to FIB table with Physical interface or Virtual \ +| | ... | interface on both nodes. Setup IPv6 addresses with /64 prefix on \ +| | ... | DUT-TG links. Set routing on DUT nodes in all FIB tables with \ +| | ... | prefix /64 and next hop of neighbour IPv6 address. Setup neighbours \ +| | ... | on all VPP interfaces. +| | ... +| | ... | *Arguments:* +| | ... | - nf_nodes - Number of guest VMs. Type: integer +| | ... +| | ... | *Note:* +| | ... | Socket paths for VM are defined in following format: +| | ... | - /var/run/vpp/sock-${VM_ID}-1 +| | ... | - /var/run/vpp/sock-${VM_ID}-2 +| | ... +| | ... | *Example:* +| | ... +| | ... | \| IPv6 forwarding with Vhost-User initialized in a 2-node circular\ +| | ... | topology \| 1 \| +| | ... +| | [Arguments] | ${nf_nodes}=${1} +| | ... +| | Suppress ICMPv6 router advertisement message | ${nodes} +| | Set interfaces in path up +| | ${prefix}= | Set Variable | 64 +| | ${fib_table_1}= | Set Variable | ${101} +| | ${fib_table_2}= | Evaluate | ${fib_table_1}+${nf_nodes} +| | Add Fib Table | ${dut1} | ${fib_table_1} | ipv6=${True} +| | Add Fib Table | ${dut1} | ${fib_table_2} | ipv6=${True} +| | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1} +| | ... | ipv6=${True} +| | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2} +| | ... | ipv6=${True} +| | VPP Interface Set IP Address | ${dut1} | ${dut1_if1} | 2001:100::1 +| | ... | ${prefix} +| | VPP Interface Set IP Address | ${dut1} | ${dut1_if2} | 2001:200::1 +| | ... | ${prefix} +| | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 2001:100::2 | ${tg_if1_mac} +| | VPP Add IP Neighbor | ${dut1} | ${dut1_if2} | 2001:200::2 | ${tg_if2_mac} +| | Vpp Route Add | ${dut1} | 2001:1::0 | 64 | gateway=2001:100::2 +| | ... | interface=${dut1_if1} | vrf=${fib_table_1} +| | Vpp Route Add | ${dut1} | 2001:2::0 | 64 | gateway=2001:200::2 +| | ... | interface=${dut1_if2} | vrf=${fib_table_2} +| | :FOR | ${number} | IN RANGE | 1 | ${nf_nodes}+1 +| | | ${fib_table_1}= | Evaluate | ${100}+${number} +| | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${1} +| | | Configure vhost interfaces for L2BD forwarding | ${dut1} +| | | ... | /var/run/vpp/sock-${number}-1 | /var/run/vpp/sock-${number}-2 +| | | ... | dut1-vhost-${number}-if1 | dut1-vhost-${number}-if2 +| | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if1} | up +| | | Set Interface State | ${dut1} | ${dut1-vhost-${number}-if2} | up +| | | Add Fib Table | ${dut1} | ${fib_table_1} | ipv6=${True} +| | | Add Fib Table | ${dut1} | ${fib_table_2} | ipv6=${True} +| | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if1} +| | | ... | ${fib_table_1} | ipv6=${True} +| | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if2} +| | | ... | ${fib_table_2} | ipv6=${True} +| | | Configure IP addresses on interfaces +| | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | 1:1::2 | 64 +| | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | 1:2::2 | 64 +| | | Vpp Route Add | ${dut1} | 2001:2::0 | 64 | gateway=1:1::1 +| | | ... | interface=${dut1-vhost-${number}-if1} | vrf=${fib_table_1} +| | | Vpp Route Add | ${dut1} | 2001:1::0 | 64 | gateway=1:2::1 +| | | ... | interface=${dut1-vhost-${number}-if2} | vrf=${fib_table_2} + | Initialize IPv6 forwarding with VLAN dot1q sub-interfaces in circular topology | | [Documentation] | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node @@ -2114,87 +2181,6 @@ | | Add Eth Interface | ${dut1} | ${dut1_eth_bond_if1_name} | ifc_pfx=eth_bond | | Add Eth Interface | ${dut2} | ${dut2_eth_bond_if1_name} | ifc_pfx=eth_bond -| Configure chains of NFs connected via vhost-user -| | [Documentation] -| | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\ -| | ... | interfaces and interconnecting NF. -| | ... -| | ... | *Arguments:* -| | ... | - nf_chains - Number of chains of NFs. Type: integer -| | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer -| | ... | - jumbo - Jumbo frames are used (True) or are not used (False) -| | ... | in the test. Type: boolean -| | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer -| | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP. -| | ... | Type: boolean -| | ... | - auto_scale - Whether to use same amount of RXQs for memif interface -| | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean -| | ... | - vnf - Network function as a payload. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure chains of VMs connected via vhost-user -| | ... | \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp -| | ... -| | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${jumbo}=${False} -| | ... | ${perf_qemu_qsz}=${1024} | ${use_tuned_cfs}=${False} -| | ... | ${auto_scale}=${True} | ${vnf}=vpp -| | ... -| | Import Library | resources.libraries.python.QemuManager | ${nodes} -| | ... | WITH NAME | vnf_manager -| | Run Keyword | vnf_manager.Construct VMs on all nodes -| | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo} -| | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs} -| | ... | auto_scale=${auto_scale} | vnf=${vnf} -| | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac} -| | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr} -| | ... | rxq_count_int=${rxq_count_int} -| | Run Keyword | vnf_manager.Start All VMs | pinning=${True} -| | All VPP Interfaces Ready Wait | ${nodes} | retries=${300} -| | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual - -| Configure chains of NFs connected via vhost-user on single node -| | [Documentation] -| | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\ -| | ... | interfaces and interconnecting NF on single DUT node. -| | ... -| | ... | *Arguments:* -| | ... | - node - DUT node. Type: dictionary -| | ... | - nf_chains - Number of chains of NFs. Type: integer -| | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer -| | ... | - jumbo - Jumbo frames are used (True) or are not used (False) -| | ... | in the test. Type: boolean -| | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer -| | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP. -| | ... | Type: boolean -| | ... | - auto_scale - Whether to use same amount of RXQs for memif interface -| | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean -| | ... | - vnf - Network function as a payload. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure chains of NFs connected via vhost-user on single node -| | ... | \| DUT1 \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp -| | ... -| | [Arguments] | ${node} | ${nf_chains}=${1} | ${nf_nodes}=${1} -| | ... | ${jumbo}=${False} | ${perf_qemu_qsz}=${1024} -| | ... | ${use_tuned_cfs}=${False} | ${auto_scale}=${True} | ${vnf}=vpp -| | ... -| | Import Library | resources.libraries.python.QemuManager | ${nodes} -| | ... | WITH NAME | vnf_manager -| | Run Keyword | vnf_manager.Initialize -| | Run Keyword | vnf_manager.Construct VMs on node -| | ... | node=${node} -| | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo} -| | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs} -| | ... | auto_scale=${auto_scale} | vnf=${vnf} -| | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac} -| | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr} -| | ... | rxq_count_int=${rxq_count_int} -| | Run Keyword | vnf_manager.Start All VMs | pinning=${True} -| | All VPP Interfaces Ready Wait | ${nodes} | retries=${300} -| | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual - | Initialize LISP IPv4 forwarding in 3-node circular topology | | [Documentation] | Custom setup of IPv4 addresses on all DUT nodes and TG \ | | ... | Don`t set route. diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot index a25919d9d6..89609f563b 100644 --- a/resources/libraries/robot/shared/default.robot +++ b/resources/libraries/robot/shared/default.robot @@ -42,12 +42,12 @@ | Resource | resources/libraries/robot/performance/performance_utils.robot | Resource | resources/libraries/robot/shared/container.robot | Resource | resources/libraries/robot/features/policer.robot -| Resource | resources/libraries/robot/shared/qemu.robot | Resource | resources/libraries/robot/shared/suite_teardown.robot | Resource | resources/libraries/robot/shared/suite_setup.robot | Resource | resources/libraries/robot/shared/test_teardown.robot | Resource | resources/libraries/robot/shared/test_setup.robot | Resource | resources/libraries/robot/shared/traffic.robot +| Resource | resources/libraries/robot/shared/vm.robot *** Keywords *** | Show Vpp Errors On All DUTs diff --git a/resources/libraries/robot/shared/qemu.robot b/resources/libraries/robot/shared/qemu.robot deleted file mode 100644 index 1178fa93b4..0000000000 --- a/resources/libraries/robot/shared/qemu.robot +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2019 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 *** -| Library | resources.libraries.python.L2Util -| Library | resources.libraries.python.InterfaceUtil - -*** Keywords *** -| Configure VM for vhost L2BD forwarding -| | [Documentation] | Setup QEMU and start VM with two vhost interfaces. -| | ... -| | ... | *Arguments:* -| | ... | - ${dut_node} - DUT node to start VM on. Type: dictionary -| | ... | - ${sock1} - Socket path for first Vhost-User interface. Type: string -| | ... | - ${sock2} - Socket path for second Vhost-User interface. Type: string -| | ... | - ${qemu_name} - Qemu instance name by which the object will be -| | ... | accessed (Optional). Type: string -| | ... -| | ... | _NOTE:_ This KW sets following test case variable: -| | ... | - ${${qemu_name}} - VM node info. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure VM for vhost L2BD forwarding \| ${nodes['DUT1']} \ -| | ... | \| /tmp/sock1 \| /tmp/sock2 \| -| | ... | \| Configure VM for vhost L2BD forwarding \| ${nodes['DUT2']} \ -| | ... | \| /tmp/sock1 \| /tmp/sock2 \| qemu_instance_2 \| -| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${qemu_name}=vm_node -| | Import Library | resources.libraries.python.QemuUtils | node=${dut_node} | -| | ... | WITH NAME | ${qemu_name} -| | Set Test Variable | ${${qemu_name}} | ${None} -| | Run Keyword | ${qemu_name}.Qemu Add Vhost User If | ${sock1} -| | Run Keyword | ${qemu_name}.Qemu Add Vhost User If | ${sock2} -| | ${vm}= | Run keyword | ${qemu_name}.Qemu Start -| | ${br}= | Set Variable | br0 -| | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1} -| | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2} -| | Linux Add Bridge | ${vm} | ${br} | ${vhost1} | ${vhost2} -| | Set Interface State | ${vm} | ${vhost1} | up | if_type=name -| | Set Interface State | ${vm} | ${vhost2} | up | if_type=name -| | Set Interface State | ${vm} | ${br} | up | if_type=name -| | Set Test Variable | ${${qemu_name}} | ${vm} diff --git a/resources/libraries/robot/shared/test_teardown.robot b/resources/libraries/robot/shared/test_teardown.robot index cec0655e19..cad3c620e0 100644 --- a/resources/libraries/robot/shared/test_teardown.robot +++ b/resources/libraries/robot/shared/test_teardown.robot @@ -15,7 +15,6 @@ *** Settings *** | Resource | resources/libraries/robot/shared/container.robot -| Resource | resources/libraries/robot/shared/qemu.robot | Library | resources.libraries.python.PapiHistory | Library | resources.libraries.python.topology.Topology | ... @@ -66,8 +65,7 @@ | | ... | Additional teardown for tests which uses vhost(s) and VM(s). | | ... | | Show VPP vhost on all DUTs | ${nodes} -| | Run Keyword If | "PERFTEST" in @{TEST TAGS} | vnf_manager.Kill All VMs -| | Run Keyword If | "DEVICETEST" in @{TEST TAGS} | vm_node.Qemu Kill +| | vnf_manager.Kill All VMs | Additional Test Tear Down Action For nat | | [Documentation] diff --git a/resources/libraries/robot/shared/vm.robot b/resources/libraries/robot/shared/vm.robot new file mode 100644 index 0000000000..c6e5373c8b --- /dev/null +++ b/resources/libraries/robot/shared/vm.robot @@ -0,0 +1,103 @@ +# Copyright (c) 2019 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 *** +| Documentation | Keywords related to vm lifecycle management +... +| Library | resources.libraries.python.InterfaceUtil + +*** Keywords *** +| Configure chains of NFs connected via vhost-user +| | [Documentation] +| | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\ +| | ... | interfaces and interconnecting NF. +| | ... +| | ... | *Arguments:* +| | ... | - nf_chains - Number of chains of NFs. Type: integer +| | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer +| | ... | - jumbo - Jumbo frames are used (True) or are not used (False) +| | ... | in the test. Type: boolean +| | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer +| | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP. +| | ... | Type: boolean +| | ... | - auto_scale - Whether to use same amount of RXQs for memif interface +| | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean +| | ... | - vnf - Network function as a payload. Type: string +| | ... | - pinning - Whether to pin QEMU VMs to specific cores +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure chains of VMs connected via vhost-user +| | ... | \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp \| True \| +| | ... +| | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${jumbo}=${False} +| | ... | ${perf_qemu_qsz}=${1024} | ${use_tuned_cfs}=${False} +| | ... | ${auto_scale}=${True} | ${vnf}=vpp | ${pinning}=${True} +| | ... +| | Import Library | resources.libraries.python.QemuManager | ${nodes} +| | ... | WITH NAME | vnf_manager +| | Run Keyword | vnf_manager.Construct VMs on all nodes +| | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo} +| | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs} +| | ... | auto_scale=${auto_scale} | vnf=${vnf} +| | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac} +| | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr} +| | ... | rxq_count_int=${rxq_count_int} +| | Run Keyword | vnf_manager.Start All VMs | pinning=${pinning} +| | All VPP Interfaces Ready Wait | ${nodes} | retries=${300} +| | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual + +| Configure chains of NFs connected via vhost-user on single node +| | [Documentation] +| | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\ +| | ... | interfaces and interconnecting NF on single DUT node. +| | ... +| | ... | *Arguments:* +| | ... | - node - DUT node. Type: dictionary +| | ... | - nf_chains - Number of chains of NFs. Type: integer +| | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer +| | ... | - jumbo - Jumbo frames are used (True) or are not used (False) +| | ... | in the test. Type: boolean +| | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer +| | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP. +| | ... | Type: boolean +| | ... | - auto_scale - Whether to use same amount of RXQs for memif interface +| | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean +| | ... | - vnf - Network function as a payload. Type: string +| | ... | - pinning - Whether to pin QEMU VMs to specific cores +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure chains of NFs connected via vhost-user on single node +| | ... | \| DUT1 \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp \| +| | ... | True \| +| | ... +| | [Arguments] | ${node} | ${nf_chains}=${1} | ${nf_nodes}=${1} +| | ... | ${jumbo}=${False} | ${perf_qemu_qsz}=${1024} +| | ... | ${use_tuned_cfs}=${False} | ${auto_scale}=${True} | ${vnf}=vpp +| | ... | ${pinning}=${True} +| | ... +| | Import Library | resources.libraries.python.QemuManager | ${nodes} +| | ... | WITH NAME | vnf_manager +| | Run Keyword | vnf_manager.Initialize +| | Run Keyword | vnf_manager.Construct VMs on node +| | ... | node=${node} +| | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo} +| | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs} +| | ... | auto_scale=${auto_scale} | vnf=${vnf} +| | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac} +| | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr} +| | ... | rxq_count_int=${rxq_count_int} +| | Run Keyword | vnf_manager.Start All VMs | pinning=${pinning} +| | All VPP Interfaces Ready Wait | ${nodes} | retries=${300} +| | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual diff --git a/resources/templates/vm/init.sh b/resources/templates/vm/init.sh index 53711fd580..c970252d61 100644 --- a/resources/templates/vm/init.sh +++ b/resources/templates/vm/init.sh @@ -7,11 +7,5 @@ mount -t devpts -o "rw,noexec,nosuid,gid=5,mode=0620" devpts /dev/pts || true mount -t tmpfs -o "rw,noexec,nosuid,size=10%,mode=0755" tmpfs /run mount -t tmpfs -o "rw,noexec,nosuid,size=10%,mode=0755" tmpfs /tmp mount -t hugetlbfs -o "rw,relatime,pagesize=2M" hugetlbfs /dev/hugepages -echo 0000:00:06.0 > /sys/bus/pci/devices/0000:00:06.0/driver/unbind -echo 0000:00:07.0 > /sys/bus/pci/devices/0000:00:07.0/driver/unbind -echo uio_pci_generic > /sys/bus/pci/devices/0000:00:06.0/driver_override -echo uio_pci_generic > /sys/bus/pci/devices/0000:00:07.0/driver_override -echo 0000:00:06.0 > /sys/bus/pci/drivers/uio_pci_generic/bind -echo 0000:00:07.0 > /sys/bus/pci/drivers/uio_pci_generic/bind $vnf_bin poweroff -f diff --git a/resources/templates/vm/vpp_chain_ip6.exec b/resources/templates/vm/vpp_chain_ip6.exec new file mode 100644 index 0000000000..d2ac499d09 --- /dev/null +++ b/resources/templates/vm/vpp_chain_ip6.exec @@ -0,0 +1,10 @@ +set interface ip address GigabitEthernet0/6/0 1:1::1/64 +set interface state GigabitEthernet0/6/0 up + +set interface ip address GigabitEthernet0/7/0 1:2::1/64 +set interface state GigabitEthernet0/7/0 up + +ip route add 2001:1::/64 via 1:1::2 GigabitEthernet0/6/0 +ip route add 2001:2::/64 via 1:2::2 GigabitEthernet0/7/0 + +show version diff --git a/tests/dpdk/perf/__init__.robot b/tests/dpdk/perf/__init__.robot index d48d5f436d..8010a74503 100644 --- a/tests/dpdk/perf/__init__.robot +++ b/tests/dpdk/perf/__init__.robot @@ -20,7 +20,7 @@ | Suite Setup | Run Keywords | Setup performance global Variables | ... | AND | Setup Framework | ${nodes} | ... | AND | Install DPDK test on all DUTs | ${nodes} -| ... | AND | Get CPU Layout from all nodes | ${nodes} +| ... | AND | Get CPU Info from All Nodes | ${nodes} | ... | AND | Update All Numa Nodes | ... | ${nodes} | skip_tg=${True} | Suite Teardown | Cleanup Framework | ${nodes} diff --git a/tests/honeycomb/perf/__init__.robot b/tests/honeycomb/perf/__init__.robot index dba1392ce6..ce2af61124 100644 --- a/tests/honeycomb/perf/__init__.robot +++ b/tests/honeycomb/perf/__init__.robot @@ -37,7 +37,7 @@ | | ... | for performance testing. | | ... | | Set Global Variable | ${node} -| | Get CPU Layout from all nodes | ${nodes} +| | Get CPU Info from All Nodes | ${nodes} | | ${cores}= | Get Length | ${node['cpuinfo']} | | Set Global Variable | ${cores} | | Stop VPP Service on DUT | ${node} diff --git a/tests/kubernetes/perf/__init__.robot b/tests/kubernetes/perf/__init__.robot index c433cc7b87..790a85be0f 100644 --- a/tests/kubernetes/perf/__init__.robot +++ b/tests/kubernetes/perf/__init__.robot @@ -28,7 +28,7 @@ | ... | AND | Load Docker image on all duts | ${nodes} | ... | ${dcr_image} | ... | AND | Setup Kubernetes on all duts | ${nodes} -| ... | AND | Get CPU Layout from all nodes | ${nodes} +| ... | AND | Get CPU Info from All Nodes | ${nodes} | ... | AND | Update all numa nodes | ${nodes} | ... | skip_tg=${True} | ... | AND | Update NIC interface names on all duts | ${nodes} diff --git a/tests/vpp/device/__init__.robot b/tests/vpp/device/__init__.robot index 69883ea469..c5deb752bb 100644 --- a/tests/vpp/device/__init__.robot +++ b/tests/vpp/device/__init__.robot @@ -21,10 +21,10 @@ | Suite Setup | Run Keywords | Setup Global Variables | ... | AND | Setup Framework | ${nodes} | ... | AND | Setup Corekeeper on All Nodes | ${nodes} -| ... | AND | Install Vpp On All Duts | ${nodes} | ${packages_dir} -| ... | AND | Verify Vpp On All Duts | ${nodes} -| ... | AND | Get CPU Layout from all nodes | ${nodes} -| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| ... | AND | Install Vpp on All Duts | ${nodes} | ${packages_dir} +| ... | AND | Verify Vpp on All Duts | ${nodes} +| ... | AND | Get CPU Info from All Nodes | ${nodes} +| ... | AND | Update All Interface Data on All Nodes | ${nodes} | ... | skip_tg_udev=${True} | numa_node=${True} | ... | Suite Teardown | Cleanup Framework | ${nodes} @@ -36,9 +36,7 @@ | | ... | | ... | _NOTE:_ This KW sets following suite variables: | | ... | - dut_stats - Switch to enable DUT statistics -| | ... | - vm_image - Guest VM disk image. | | ... | - packages_dir - Path to directory where VPP packages are stored. | | ... | | Set Global Variable | ${dut_stats} | ${True} -| | Set Global Variable | ${vm_image} | /var/lib/vm/csit-nested-1.7.img | | Set Global Variable | ${packages_dir} | /tmp/openvpp-testing/download_dir/ diff --git a/tests/vpp/device/vm_vhost/ip4/eth2p-ethicmpv4-ip4base-eth-2vhost-1vm-dev.robot b/tests/vpp/device/vm_vhost/ip4/eth2p-ethicmpv4-ip4base-eth-2vhost-1vm-dev.robot new file mode 100644 index 0000000000..59da994310 --- /dev/null +++ b/tests/vpp/device/vm_vhost/ip4/eth2p-ethicmpv4-ip4base-eth-2vhost-1vm-dev.robot @@ -0,0 +1,84 @@ +# Copyright (c) 2019 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 +| ... +| Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV | SCAPY +| ... | NIC_Virtual | ETH | IP4FWD | BASE | VHOST | 1VM +| ... +| Suite Setup | Setup suite single link | scapy +| Test Setup | Setup test +| Test Teardown | Tear down test | packet_trace | vhost +| ... +| Test Template | Local Template +| ... +| Documentation | *IPv4 routing test cases with vhost user interface* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology with \ +| ... | VM and single links between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for IPv4 routing on \ +| ... | both links. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with IPv4 routing and \ +| ... | two static IPv4 /24 route entries. Qemu Guest is connected to VPP via \ +| ... | vhost-user interfaces. Guest is running VPP ip4 interconnecting \ +| ... | vhost-user interfaces. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent in \ +| ... | one direction by TG on links to DUT1; on receive TG verifies packets \ +| ... | for correctness and their IPv4 src-addr, dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC791, RFC826, RFC792 + +*** Variables *** +| @{plugins_to_enable}= | dpdk_plugin.so +| ${nic_name}= | virtual +| ${nf_chains}= | ${1} +| ${nf_nodes}= | ${1} +| ${nf_dtc} | ${1} +| ${nf_dtcr} | ${1} +| ${tg_if1_ip}= | 10.10.10.2 +| ${tg_if2_ip}= | 20.20.20.2 + +*** Keywords *** +| Local Template +| | [Documentation] +| | ... | Test uses two VRFs to route IPv4 traffic through two vhost-user \ +| | ... | nterfaces. Both interfaces are configured with IP addresses from \ +| | ... | the same network. The VM is running VPP IPv4 forwarding to pass \ +| | ... | packet from one vhost-user interface to the other one. +| | ... +| | ... | *Arguments:* +| | ... | - frame_size - Framesize in Bytes in integer. Type: integer +| | ... | - phy_cores - Number of physical cores. Type: integer +| | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer +| | ... +| | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None} +| | ... +| | Set Test Variable | \${frame_size} +| | ... +| | Given Add worker threads and rxqueues to all DUTs | ${phy_cores} | ${rxq} +| | And Add PCI devices to all DUTs +| | And Apply startup configuration on all VPP DUTs | with_trace=${True} +| | When Initialize IPv4 forwarding with vhost in 2-node circular topology +| | ... | nf_nodes=${nf_nodes} +| | And Configure chains of NFs connected via vhost-user +| | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} +| | ... | vnf=vpp_chain_ip4_noarp | pinning=${False} +| | Then Send packet and verify headers +| | ... | ${tg} | ${tg_if1_ip} | ${tg_if2_ip} +| | ... | ${tg_if1} | ${tg_if1_mac} | ${dut1_if1_mac} +| | ... | ${tg_if2} | ${dut1_if2_mac} | ${tg_if2_mac} + +*** Test Cases *** +| tc01-eth2p-ethicmp4-ip4base-eth-2vhost-1vm-dev +| | [Tags] | 64B +| | frame_size=${64} | phy_cores=${0} diff --git a/tests/vpp/device/vm_vhost/ip4/eth2p-ethip4-ip4base-eth-2vhost-1vm-dev.robot b/tests/vpp/device/vm_vhost/ip4/eth2p-ethip4-ip4base-eth-2vhost-1vm-dev.robot deleted file mode 100644 index a1a19473b4..0000000000 --- a/tests/vpp/device/vm_vhost/ip4/eth2p-ethip4-ip4base-eth-2vhost-1vm-dev.robot +++ /dev/null @@ -1,111 +0,0 @@ -# Copyright (c) 2019 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 *** -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.IPUtil -| Library | resources.libraries.python.NodePath -| Library | resources.libraries.python.topology.Topology -| Library | resources.libraries.python.Trace -| Library | resources.libraries.python.VhostUser -| Library | resources.libraries.python.VPPUtil -| ... -| Resource | resources/libraries/robot/shared/default.robot -| Resource | resources/libraries/robot/ip/ip4.robot -| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot -| Resource | resources/libraries/robot/shared/interfaces.robot -| Resource | resources/libraries/robot/shared/testing_path.robot -| Resource | resources/libraries/robot/shared/traffic.robot -| ... -| Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV -| ... | FUNCTEST | IP4FWD | BASE | ETH | VHOST | 1VM -| ... -| Suite Setup | Setup suite single link -| Test Setup | Setup test -| Test Teardown | Tear down test | packet_trace | vhost -| ... -| Documentation | *IPv4 routing test cases with vhost user interface* -| ... -| ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology with \ -| ... | VM and single links between nodes. -| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for IPv4 routing on \ -| ... | both links. -| ... | *[Cfg] DUT configuration:* DUT1 is configured with IPv4 routing and \ -| ... | two static IPv4 /24 route entries. Qemu Guest is connected to VPP via \ -| ... | vhost-user interfaces. Guest is configured with linux bridge \ -| ... | interconnecting vhost-user interfaces. -| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent in \ -| ... | one direction by TG on links to DUT1; on receive TG verifies packets \ -| ... | for correctness and their IPv4 src-addr, dst-addr and MAC addresses. -| ... | *[Ref] Applicable standard specifications:* RFC791, RFC826, RFC792 - -*** Variables *** -| @{plugins_to_enable}= | dpdk_plugin.so -| ${nic_name}= | virtual -| ${net1}= | 10.0.1.0 -| ${net3}= | 10.0.3.0 -| ${net1_ip1}= | 10.0.1.1 -| ${net1_ip2}= | 10.0.1.2 -| ${net2_ip1}= | 10.0.2.1 -| ${net2_ip2}= | 10.0.2.2 -| ${net3_ip1}= | 10.0.3.1 -| ${net3_ip2}= | 10.0.3.2 -| ${prefix_length}= | 24 -| ${fib_table_2}= | 20 -| ${sock1}= | /tmp/sock1 -| ${sock2}= | /tmp/sock2 - -*** Test Cases *** -| tc01-eth2p-ethip4-ip4base-eth-2vhost-1vm-device -| | [Documentation] -| | ... | Test uses two VRFs to route IPv4 traffic through two vhost-user \ -| | ... | interfaces. Both interfaces are configured with IP addresses from \ -| | ... | the same network. There is created linux bridge on VM to pass packet \ -| | ... | from one vhost-user interface to another one. -| | ... -| | Given Add PCI devices to all DUTs -| | And Apply startup configuration on all VPP DUTs -| | And VPP Enable Traces On All Duts | ${nodes} -| | When Configure path in 2-node circular topology -| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} -| | And Configure interfaces in path up -| | ${vhost1}= | And Vpp Create Vhost User Interface | ${dut_node} | ${sock1} -| | ${vhost2}= | And Vpp Create Vhost User Interface | ${dut_node} | ${sock2} -| | And Set Interface State | ${dut_node} | ${vhost1} | up -| | And Set Interface State | ${dut_node} | ${vhost2} | up -| | And Add Fib Table | ${dut_node} | ${fib_table_2} -| | And Assign Interface To Fib Table | ${dut_node} -| | ... | ${vhost2} | ${fib_table_2} -| | And Assign Interface To Fib Table | ${dut_node} -| | ... | ${dut_to_tg_if2} | ${fib_table_2} -| | And Configure IP addresses on interfaces -| | ... | ${dut_node} | ${dut_to_tg_if1} | ${net1_ip1} | ${prefix_length} -| | ... | ${dut_node} | ${vhost1} | ${net2_ip1} | ${prefix_length} -| | ... | ${dut_node} | ${vhost2} | ${net2_ip2} | ${prefix_length} -| | ... | ${dut_node} | ${dut_to_tg_if2} | ${net3_ip1} | ${prefix_length} -| | ${vhost2_mac}= | And Get Vhost User Mac By SW Index -| | ... | ${dut_node} | ${vhost2} -| | And Vpp Route Add | ${dut_node} | ${net3} | ${prefix_length} -| | ... | gateway=${net2_ip2} | interface=${vhost1} -| | And Vpp Route Add | ${dut_node} | ${net1} | ${prefix_length} -| | ... | gateway=${net2_ip1} | interface=${vhost2} -| | ... | vrf=${fib_table_2} -| | VPP Add IP Neighbor | ${dut_node} | ${vhost1} | ${net2_ip2} | ${vhost2_mac} -| | VPP Add IP Neighbor -| | ... | ${dut_node} | ${dut_to_tg_if2} | ${net3_ip2} | ${tg_to_dut_if2_mac} -| | And Configure VM for vhost L2BD forwarding -| | ... | ${dut_node} | ${sock1} | ${sock2} -| | Then Send packet and verify headers -| | ... | ${tg_node} | ${net1_ip2} | ${net3_ip2} -| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac} -| | ... | ${tg_to_dut_if2} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac} diff --git a/tests/vpp/device/vm_vhost/ip6/eth2p-ethicmpv6-ip6base-eth-2vhost-1vm-dev.robot b/tests/vpp/device/vm_vhost/ip6/eth2p-ethicmpv6-ip6base-eth-2vhost-1vm-dev.robot new file mode 100644 index 0000000000..3e1c103ab0 --- /dev/null +++ b/tests/vpp/device/vm_vhost/ip6/eth2p-ethicmpv6-ip6base-eth-2vhost-1vm-dev.robot @@ -0,0 +1,85 @@ +# Copyright (c) 2019 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 +| ... +| Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV | SCAPY +| ... | NIC_Virtual | ETH | IP6FWD | BASE | VHOST | 1VM +| ... +| Suite Setup | Setup suite single link | scapy +| Test Setup | Setup test +| Test Teardown | Tear down test | packet_trace | vhost +| ... +| Test Template | Local Template +| ... +| Documentation | *IPv4 routing test cases with vhost user interface* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology with \ +| ... | VM and single links between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv6-ICMPv6 for IPv6 routing on \ +| ... | both links. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with IPv6 routing and \ +| ... | two static IPv6 /64 route entries. Qemu Guest is connected to VPP via \ +| ... | vhost-user interfaces. Guest is running VPP ip6 interconnecting \ +| ... | vhost-user interfaces. +| ... | *[Ver] TG verification:* Test ICMPv6 Echo Request packets are sent in \ +| ... | one direction by TG on links to DUT1; on receive TG verifies packets \ +| ... | for correctness and their IPv6 src-addr, dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC2460, RFC4443, RFC4861 + +*** Variables *** +| @{plugins_to_enable}= | dpdk_plugin.so +| ${nic_name}= | virtual +| ${nf_chains}= | ${1} +| ${nf_nodes}= | ${1} +| ${nf_dtc} | ${1} +| ${nf_dtcr} | ${1} +| ${tg_if1_ip}= | 2001:1::2 +| ${tg_if2_ip}= | 2001:2::2 + +*** Keywords *** +| Local Template +| | [Documentation] +| | ... | Test uses two VRFs to route IPv6 traffic through two vhost-user \ +| | ... | interfaces. Both interfaces are configured with IP addresses from \ +| | ... | the same network. The VM is running VPP IPv6 forwarding to pass \ +| | ... | packet from one vhost-user interface to the other one. +| | ... +| | ... | *Arguments:* +| | ... | - frame_size - Framesize in Bytes in integer. Type: integer +| | ... | - phy_cores - Number of physical cores. Type: integer +| | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer +| | ... +| | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None} +| | ... +| | Set Test Variable | \${frame_size} +| | ... +| | Given Add worker threads and rxqueues to all DUTs | ${phy_cores} | ${rxq} +| | And Add PCI devices to all DUTs +| | And Apply startup configuration on all VPP DUTs | with_trace=${True} +| | When Initialize IPv6 forwarding with vhost in 2-node circular topology +| | ... | nf_nodes=${nf_nodes} +| | And Configure chains of NFs connected via vhost-user +| | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | vnf=vpp_chain_ip6 +| | ... | pinning=${False} +| | Then Send packet and verify headers +| | ... | ${tg} | ${tg_if1_ip} | ${tg_if2_ip} +| | ... | ${tg_if1} | ${tg_if1_mac} | ${dut1_if1_mac} +| | ... | ${tg_if2} | ${dut1_if2_mac} | ${tg_if2_mac} + + +*** Test Cases *** +| tc01-eth2p-ethicmpv6-ip6base-eth-2vhost-1vm-dev +| | [Tags] | 64B +| | frame_size=${64} | phy_cores=${0} diff --git a/tests/vpp/device/vm_vhost/ip6/eth2p-ethip6-ip6base-eth-2vhost-1vm-dev.robot b/tests/vpp/device/vm_vhost/ip6/eth2p-ethip6-ip6base-eth-2vhost-1vm-dev.robot deleted file mode 100644 index f125bba035..0000000000 --- a/tests/vpp/device/vm_vhost/ip6/eth2p-ethip6-ip6base-eth-2vhost-1vm-dev.robot +++ /dev/null @@ -1,117 +0,0 @@ -# Copyright (c) 2019 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 *** -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.IPUtil -| Library | resources.libraries.python.NodePath -| Library | resources.libraries.python.topology.Topology -| Library | resources.libraries.python.Trace -| Library | resources.libraries.python.VhostUser -| Library | resources.libraries.python.VPPUtil -| ... -| Resource | resources/libraries/robot/shared/default.robot -| Resource | resources/libraries/robot/ip/ip6.robot -| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot -| Resource | resources/libraries/robot/shared/interfaces.robot -| Resource | resources/libraries/robot/shared/testing_path.robot -| Resource | resources/libraries/robot/shared/traffic.robot -| ... -| Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV -| ... | FUNCTEST | IP6FWD | BASE | ETH | VHOST | 1VM -| ... -| Suite Setup | Setup suite single link -| Test Setup | Setup test -| Test Teardown | Tear down test | packet_trace | vhost -| ... -| Documentation | *IPv4 routing test cases with vhost user interface* -| ... -| ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology with \ -| ... | VM and single links between nodes. -| ... | *[Enc] Packet Encapsulations:* Eth-IPv6-ICMPv6 for IPv6 routing on \ -| ... | both links. -| ... | *[Cfg] DUT configuration:* DUT1 is configured with IPv6 routing and \ -| ... | two static IPv6 /64 route entries. Qemu Guest is connected to VPP via \ -| ... | vhost-user interfaces. Guest is configured with linux bridge \ -| ... | interconnecting vhost-user interfaces. -| ... | *[Ver] TG verification:* Test ICMPv6 Echo Request packets are sent in \ -| ... | one direction by TG on links to DUT1; on receive TG verifies packets \ -| ... | for correctness and their IPv6 src-addr, dst-addr and MAC addresses. -| ... | *[Ref] Applicable standard specifications:* RFC2460, RFC4443, RFC4861 - -*** Variables *** -| @{plugins_to_enable}= | dpdk_plugin.so -| ${nic_name}= | virtual -| ${net1}= | 2001:1::0 -| ${net3}= | 2001:3::0 -| ${net1_ip1}= | 2001:1::1 -| ${net1_ip2}= | 2001:1::2 -| ${net2_ip1}= | 2001:2::1 -| ${net2_ip2}= | 2001:2::2 -| ${net3_ip1}= | 2001:3::1 -| ${net3_ip2}= | 2001:3::2 -| ${prefix_length}= | 64 -| ${fib_table_2}= | 20 -| ${sock1}= | /tmp/sock1 -| ${sock2}= | /tmp/sock2 - -*** Test Cases *** -| tc01-eth2p-ethip6-ip6base-eth-2vhost-1vm-device -| | [Documentation] -| | ... | Test uses two VRFs to route IPv6 traffic through two vhost-user \ -| | ... | interfaces. Both interfaces are configured with IP addresses from \ -| | ... | the same network. There is created linux bridge on VM to pass packet \ -| | ... | from one vhost-user interface to another one. -| | ... -| | Given Add PCI devices to all DUTs -| | And Apply startup configuration on all VPP DUTs -| | And VPP Enable Traces On All Duts | ${nodes} -| | When Configure path in 2-node circular topology -| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} -| | And Configure interfaces in path up -| | ${vhost1}= | And Vpp Create Vhost User Interface | ${dut_node} | ${sock1} -| | ${vhost2}= | And Vpp Create Vhost User Interface | ${dut_node} | ${sock2} -| | And Set Interface State | ${dut_node} | ${vhost1} | up -| | And Set Interface State | ${dut_node} | ${vhost2} | up -| | And Add Fib Table | ${dut_node} | ${fib_table_2} | ipv6=${True} -| | And Assign Interface To Fib Table -| | ... | ${dut_node} | ${vhost2} | ${fib_table_2} | ipv6=${True} -| | And Assign Interface To Fib Table -| | ... | ${dut_node} | ${dut_to_tg_if2} | ${fib_table_2} | ipv6=${True} -| | And VPP Interface Set IP Address -| | ... | ${dut_node} | ${dut_to_tg_if1} | ${net1_ip1} | ${prefix_length} -| | And VPP Interface Set IP Address -| | ... | ${dut_node} | ${vhost1} | ${net2_ip1} | ${prefix_length} -| | And VPP Interface Set IP Address -| | ... | ${dut_node} | ${vhost2} | ${net2_ip2} | ${prefix_length} -| | And VPP Interface Set IP Address -| | ... | ${dut_node} | ${dut_to_tg_if2} | ${net3_ip1} | ${prefix_length} -| | And Suppress ICMPv6 router advertisement message | ${nodes} -| | ${vhost2_mac}= | And Get Vhost User Mac By SW Index -| | ... | ${dut_node} | ${vhost2} -| | And Vpp Route Add -| | ... | ${dut_node} | ${net3} | ${prefix_length} -| | ... | gateway=${net2_ip2} | interface=${vhost1} -| | And Vpp Route Add -| | ... | ${dut_node} | ${net1} | ${prefix_length} -| | ... | gateway=${net2_ip1} | interface=${vhost2} | vrf=${fib_table_2} -| | VPP Add IP Neighbor -| | ... | ${dut_node} | ${vhost1} | ${net2_ip2} | ${vhost2_mac} -| | VPP Add IP Neighbor -| | ... | ${dut_node} | ${dut_to_tg_if2} | ${net3_ip2} | ${tg_to_dut_if2_mac} -| | And Configure VM for vhost L2BD forwarding -| | ... | ${dut_node} | ${sock1} | ${sock2} -| | Then Send packet and verify headers -| | ... | ${tg_node} | ${net1_ip2} | ${net3_ip2} -| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac} -| | ... | ${tg_to_dut_if2} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac} diff --git a/tests/vpp/device/vm_vhost/l2bd/eth2p-eth-l2bdbasemaclrn-eth-2vhost-1vm-dev.robot b/tests/vpp/device/vm_vhost/l2bd/eth2p-eth-l2bdbasemaclrn-eth-2vhost-1vm-dev.robot deleted file mode 100644 index 2a821a72c7..0000000000 --- a/tests/vpp/device/vm_vhost/l2bd/eth2p-eth-l2bdbasemaclrn-eth-2vhost-1vm-dev.robot +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (c) 2019 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 *** -| Library | resources.libraries.python.Trace -| Resource | resources/libraries/robot/shared/default.robot -| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot -| Resource | resources/libraries/robot/shared/testing_path.robot -| ... -| Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV -| ... | FUNCTEST | L2BDMACLRN | BASE | ETH | VHOST | 1VM -| ... -| Suite Setup | Setup suite single link -| Test Setup | Setup test -| Test Teardown | Tear down test | packet_trace | vhost -| ... -| Documentation | *L2 bridge-domain test cases with vhost user interface* -| ... -| ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology with \ -| ... | VM and single links between nodes. -| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of \ -| ... | IPv4; Eth-IPv6-ICMPv6 for L2 switching of IPv6. -| ... | *[Cfg] DUT configuration:* DUT1 is configured with two L2 \ -| ... | bridge-domains (L2BD) switching combined with MAC learning enabled. \ -| ... | Qemu Guest is connected to VPP via vhost-user interfaces. Guest is \ -| ... | configured with linux bridge interconnecting vhost-user interfaces. -| ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets \ -| ... | are sent in both directions by TG on links to DUT1 via VM; on \ -| ... | receive TG verifies packets for correctness and their IPv4 (IPv6) \ -| ... | src-addr, dst-addr and MAC addresses. -| ... | *[Ref] Applicable standard specifications:* RFC792 - -*** Variables *** -| @{plugins_to_enable}= | dpdk_plugin.so -| ${nic_name}= | virtual -| ${bd_id1}= | 1 -| ${bd_id2}= | 2 -| ${sock1}= | /tmp/sock1 -| ${sock2}= | /tmp/sock2 - -*** Test Cases *** -| tc01-eth2p-ethip4-l2bdbasemaclrn-eth-2vhost-1vm-device -| | [Documentation] -| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 configure \ -| | ... | two L2BDs with MAC learning, each with vhost-user i/f to local \ -| | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two \ -| | ... | virtio i/fs. [Ver] Make TG verify ICMPv4 Echo Req pkts are \ -| | ... | switched thru DUT1 and VM in both directions and are correct on \ -| | ... | receive. [Ref] -| | ... -| | Given Add PCI devices to all DUTs -| | And Apply startup configuration on all VPP DUTs -| | And VPP Enable Traces On All Duts | ${nodes} -| | When Configure path in 2-node circular topology -| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} -| | And Configure interfaces in path up -| | And Configure vhost interfaces for L2BD forwarding | ${dut_node} -| | ... | ${sock1} -| | ... | ${sock2} -| | And Create bridge domain | ${dut_node} | ${bd_id1} -| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1} -| | ... | ${bd_id1} -| | And Add interface to bridge domain | ${dut_node} | ${vhost_if1} -| | ... | ${bd_id1} -| | And Create bridge domain | ${dut_node} | ${bd_id2} -| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if2} -| | ... | ${bd_id2} -| | And Add interface to bridge domain | ${dut_node} | ${vhost_if2} -| | ... | ${bd_id2} -| | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1} -| | ... | ${sock2} -| | Then Send ICMPv4 bidirectionally and verify received packets | ${tg_node} -| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2} - -| tc02-eth2p-ethip6-l2bdbasemaclrn-eth-2vhost-1vm-device -| | [Documentation] -| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT1 configure \ -| | ... | two L2BDs with MAC learning, each with vhost-user i/f to local \ -| | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two \ -| | ... | virtio i/fs. [Ver] Make TG verify ICMPv6 Echo Req pkts are \ -| | ... | switched thru DUT1 and VM in both directions and are correct on \ -| | ... | receive. [Ref] -| | ... -| | Given Add PCI devices to all DUTs -| | And Apply startup configuration on all VPP DUTs -| | And VPP Enable Traces On All Duts | ${nodes} -| | When Configure path in 2-node circular topology -| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} -| | And Configure interfaces in path up -| | And Configure vhost interfaces for L2BD forwarding | ${dut_node} -| | ... | ${sock1} -| | ... | ${sock2} -| | And Create bridge domain | ${dut_node} | ${bd_id1} -| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1} -| | ... | ${bd_id1} -| | And Add interface to bridge domain | ${dut_node} | ${vhost_if1} -| | ... | ${bd_id1} -| | And Create bridge domain | ${dut_node} | ${bd_id2} -| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if2} -| | ... | ${bd_id2} -| | And Add interface to bridge domain | ${dut_node} | ${vhost_if2} -| | ... | ${bd_id2} -| | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1} -| | ... | ${sock2} -| | Then Send ICMPv6 bidirectionally and verify received packets | ${tg_node} -| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2} diff --git a/tests/vpp/device/vm_vhost/l2bd/eth2p-ethicmpv4-l2bdbasemaclrn-eth-2vhost-1vm-dev.robot b/tests/vpp/device/vm_vhost/l2bd/eth2p-ethicmpv4-l2bdbasemaclrn-eth-2vhost-1vm-dev.robot new file mode 100644 index 0000000000..8170466742 --- /dev/null +++ b/tests/vpp/device/vm_vhost/l2bd/eth2p-ethicmpv4-l2bdbasemaclrn-eth-2vhost-1vm-dev.robot @@ -0,0 +1,83 @@ +# Copyright (c) 2019 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 +| ... +| Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV | SCAPY +| ... | NIC_Virtual | ETH | L2BDMACLRN | BASE | ICMP | VHOST | 1VM +| ... +| Suite Setup | Setup suite single link | scapy +| Test Setup | Setup test +| Test Teardown | Tear down test | packet_trace | vhost +| ... +| Test Template | Local Template +| ... +| Documentation | *L2 bridge-domain test cases with vhost user interface* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology with \ +| ... | VM and single links between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of \ +| ... | IPv4. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with two L2 \ +| ... | bridge-domains (L2BD) switching combined with MAC learning enabled. \ +| ... | Qemu Guest is connected to VPP via vhost-user interfaces. Guest is \ +| ... | configured with VPP l2 cross-connect interconnecting vhost-user \ +| ... | interfaces. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent in \ +| ... | both directions by TG on links to DUT1 via VM; on receive TG verifies \ +| ... | packets for correctness and their IPv4 src-addr, dst-addr and MAC \ +| ... | addresses. +| ... | *[Ref] Applicable standard specifications:* RFC792 + +*** Variables *** +| @{plugins_to_enable}= | dpdk_plugin.so +| ${nic_name}= | virtual +| ${nf_chains}= | ${1} +| ${nf_nodes}= | ${1} +| ${nf_dtc} | ${1} +| ${nf_dtcr} | ${1} + +*** Keywords *** +| Local Template +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 configure \ +| | ... | two L2BDs with MAC learning, each with vhost-user i/f to local \ +| | ... | VM and i/f to TG; configure VPP in VM to loop pkts back betwen its \ +| | ... | two virtio i/fs. [Ver] Make TG verify ICMPv4 Echo Req pkts are \ +| | ... | switched thru DUT1 and VM in both directions and are correct on \ +| | ... | receive. [Ref] +| | ... +| | ... | *Arguments:* +| | ... | - frame_size - Framesize in Bytes in integer. Type: integer +| | ... | - phy_cores - Number of physical cores. Type: integer +| | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer +| | ... +| | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None} +| | ... +| | Set Test Variable | \${frame_size} +| | ... +| | Given Add worker threads and rxqueues to all DUTs | ${phy_cores} | ${rxq} +| | And Add PCI devices to all DUTs +| | And Apply startup configuration on all VPP DUTs | with_trace=${True} +| | When Initialize L2 bridge domains with Vhost-User | nf_nodes=${nf_nodes} +| | And Configure chains of NFs connected via vhost-user +| | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | vnf=vpp_chain_l2xc +| | ... | pinning=${False} +| | Then Send ICMPv4 bidirectionally and verify received packets | ${tg} +| | ... | ${tg_if1} | ${tg_if2} + +*** Test Cases *** +| tc01-eth2p-ethicmpv4-l2bdbasemaclrn-eth-2vhost-1vm-dev +| | [Tags] | 64B +| | frame_size=${64} | phy_cores=${0} diff --git a/tests/vpp/device/vm_vhost/l2xc/eth2p-eth-l2xcbase-eth-2vhost-1vm-dev.robot b/tests/vpp/device/vm_vhost/l2xc/eth2p-eth-l2xcbase-eth-2vhost-1vm-dev.robot deleted file mode 100644 index a820bd2cbb..0000000000 --- a/tests/vpp/device/vm_vhost/l2xc/eth2p-eth-l2xcbase-eth-2vhost-1vm-dev.robot +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright (c) 2019 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 *** -| Library | resources.libraries.python.Trace -| Library | resources.libraries.python.NodePath -| Resource | resources/libraries/robot/shared/default.robot -| Resource | resources/libraries/robot/l2/l2_xconnect.robot -| Resource | resources/libraries/robot/l2/l2_traffic.robot -| Resource | resources/libraries/robot/shared/testing_path.robot -| Resource | resources/libraries/robot/shared/interfaces.robot -| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot -| ... -| Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV -| ... | FUNCTEST | L2XCFWD | BASE | ETH | VHOST | 1VM -| ... -| Suite Setup | Setup suite single link -| Test Setup | Setup test -| Test Teardown | Tear down test | packet_trace | vhost -| ... -| Documentation | *L2 cross-connect test cases with vhost user interface* -| ... -| ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology with \ -| ... | VM and single links between nodes. -| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of \ -| ... | IPv4; Eth-IPv6-ICMPv6 for L2 switching of IPv6. -| ... | *[Cfg] DUT configuration:* DUT1 is configured with L2 cross-connect \ -| ... | (L2XC) switching. Qemu Guest is connected to VPP via vhost-user \ -| ... | interfaces. Guest is configured with linux bridge interconnecting \ -| ... | vhost-user interfaces. -| ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets \ -| ... | are sent in both directions by TG on links to DUT1 via VM; on receive \ -| ... | TG verifies packets for correctness and their IPv4 (IPv6) src-addr, \ -| ... | dst-addr and MAC addresses. -| ... | *[Ref] Applicable standard specifications:* RFC792 - -*** Variables *** -| @{plugins_to_enable}= | dpdk_plugin.so -| ${nic_name}= | virtual -| ${sock1}= | /tmp/sock1 -| ${sock2}= | /tmp/sock2 - -*** Test Cases *** -| tc01-eth2p-ethip4-l2xcbase-eth-2vhost-1vm-device -| | [Documentation] -| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT configure \ -| | ... | two L2 cross-connects (L2XC), each with one untagged interface \ -| | ... | to TG and untagged i/f to local VM over vhost-user. [Ver] Make \ -| | ... | TG send ICMPv4 Echo Reqs in both directions between two of its \ -| | ... | i/fs to be switched by DUT to and from VM; verify all packets \ -| | ... | are received. [Ref] -| | ... -| | Given Add PCI devices to all DUTs -| | And Apply startup configuration on all VPP DUTs -| | And VPP Enable Traces On All Duts | ${nodes} -| | When Configure path in 2-node circular topology -| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} -| | And Configure interfaces in path up -| | And Configure vhost interfaces for L2BD forwarding | ${dut_node} -| | ... | ${sock1} | ${sock2} -| | And Configure L2XC | ${dut_node} | ${dut_to_tg_if1} | ${vhost_if1} -| | And Configure L2XC | ${dut_node} | ${dut_to_tg_if2} | ${vhost_if2} -| | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1} -| | ... | ${sock2} -| | Then Send ICMPv4 bidirectionally and verify received packets | ${tg_node} -| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2} -| | And Get Vhost dump | ${dut_node} - -| tc02-eth2p-ethip6-l2xcbase-eth-2vhost-1vm-device -| | [Documentation] -| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT configure \ -| | ... | two L2 cross-connects (L2XC), each with one untagged i/f to TG \ -| | ... | and untagged i/f to local VM over vhost-user. [Ver] Make TG send \ -| | ... | ICMPv6 Echo Reqs in both directions between two of its i/fs to \ -| | ... | be switched by DUT to and from VM; verify all packets are \ -| | ... | received. [Ref] -| | ... -| | Given Add PCI devices to all DUTs -| | And Apply startup configuration on all VPP DUTs -| | And VPP Enable Traces On All Duts | ${nodes} -| | When Configure path in 2-node circular topology -| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} -| | And Configure interfaces in path up -| | And Configure vhost interfaces for L2BD forwarding | ${dut_node} -| | ... | ${sock1} | ${sock2} -| | And Configure L2XC | ${dut_node} | ${dut_to_tg_if1} | ${vhost_if1} -| | And Configure L2XC | ${dut_node} | ${dut_to_tg_if2} | ${vhost_if2} -| | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1} -| | ... | ${sock2} -| | Then Send ICMPv6 bidirectionally and verify received packets | ${tg_node} -| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2} diff --git a/tests/vpp/device/vm_vhost/l2xc/eth2p-ethicmpv4-l2xcbase-eth-2vhost-1vm-dev.robot b/tests/vpp/device/vm_vhost/l2xc/eth2p-ethicmpv4-l2xcbase-eth-2vhost-1vm-dev.robot new file mode 100644 index 0000000000..c5c6ab7ae6 --- /dev/null +++ b/tests/vpp/device/vm_vhost/l2xc/eth2p-ethicmpv4-l2xcbase-eth-2vhost-1vm-dev.robot @@ -0,0 +1,82 @@ +# Copyright (c) 2019 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 +| ... +| Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV | SCAPY +| ... | NIC_Virtual | ETH | L2XCFWD | BASE | ICMP | VHOST | 1VM +| ... +| Suite Setup | Setup suite single link | scapy +| Test Setup | Setup test +| Test Teardown | Tear down test | packet_trace | vhost +| ... +| Test Template | Local Template +| ... +| Documentation | *L2 cross-connect test cases with vhost user interface* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology with \ +| ... | VM and single links between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of \ +| ... | IPv4. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with L2 cross-connect \ +| ... | (L2XC) switching. Qemu Guest is connected to VPP via vhost-user \ +| ... | interfaces. Guest is configured with VPP l2 cross-connect \ +| ... | interconnecting vhost-user interfaces. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent in \ +| ... | both directions by TG on links to DUT1 via VM; on receive TG verifies \ +| ... | packets for correctness and their IPv4 src-addr, dst-addr and MAC \ +| ... | addresses. +| ... | *[Ref] Applicable standard specifications:* RFC792 + +*** Variables *** +| @{plugins_to_enable}= | dpdk_plugin.so +| ${nic_name}= | virtual +| ${nf_chains}= | ${1} +| ${nf_nodes}= | ${1} +| ${nf_dtc} | ${1} +| ${nf_dtcr} | ${1} + +*** Keywords *** +| Local Template +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT configure \ +| | ... | two L2 cross-connects (L2XC), each with one untagged interface \ +| | ... | to TG and untagged i/f to local VM over vhost-user. [Ver] Make \ +| | ... | TG send ICMPv4 Echo Reqs in both directions between two of its \ +| | ... | i/fs to be switched by DUT to and from VM; verify all packets \ +| | ... | are received. [Ref] +| | ... +| | ... | *Arguments:* +| | ... | - frame_size - Framesize in Bytes in integer. Type: integer +| | ... | - phy_cores - Number of physical cores. Type: integer +| | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer +| | ... +| | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None} +| | ... +| | Set Test Variable | \${frame_size} +| | ... +| | Given Add worker threads and rxqueues to all DUTs | ${phy_cores} | ${rxq} +| | And Add PCI devices to all DUTs +| | And Apply startup configuration on all VPP DUTs | with_trace=${True} +| | When Initialize L2 xconnect with Vhost-User | nf_nodes=${nf_nodes} +| | And Configure chains of NFs connected via vhost-user +| | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | vnf=vpp_chain_l2xc +| | ... | pinning=${False} +| | Then Send ICMPv4 bidirectionally and verify received packets | ${tg} +| | ... | ${tg_if1} | ${tg_if2} + +*** Test Cases *** +| tc01-eth2p-ethicmpv4-l2xcbase-eth-2vhost-1vm-dev +| | [Tags] | 64B +| | frame_size=${64} | phy_cores=${0} diff --git a/tests/vpp/perf/__init__.robot b/tests/vpp/perf/__init__.robot index d86a76db79..a54249bf1a 100644 --- a/tests/vpp/perf/__init__.robot +++ b/tests/vpp/perf/__init__.robot @@ -18,21 +18,21 @@ | Library | resources.libraries.python.SetupFramework.CleanupFramework | Library | resources.libraries.python.CpuUtils | ... -| Suite Setup | Run Keywords | Setup performance global Variables +| Suite Setup | Run Keywords | Setup Global Variables | ... | AND | Setup Framework | ${nodes} | ... | AND | Setup Corekeeper on All Nodes | ${nodes} | ... | AND | Install Vpp on All Duts | ${nodes} | ${packages_dir} | ... | AND | Verify Vpp on All Duts | ${nodes} | ... | AND | Verify UIO Driver on all DUTs | ${nodes} | ... | AND | Show Vpp Version on All Duts | ${nodes} -| ... | AND | Get CPU Layout from All nodes | ${nodes} +| ... | AND | Get CPU Info from All Nodes | ${nodes} | ... | AND | Update All Interface Data on All Nodes | ${nodes} | ... | skip_tg=${True} | numa_node=${True} | ... | Suite Teardown | Cleanup Framework | ${nodes} *** Keywords *** -| Setup performance global Variables +| Setup Global Variables | | [Documentation] | | ... | Setup suite Variables. Variables are used across performance testing. | | ... |