From 6721e7f09aa95bff6622068332a3f56afad9c87b Mon Sep 17 00:00:00 2001 From: Tibor Frank Date: Tue, 20 Jun 2017 13:57:08 +0200 Subject: CSIT-687: Directory structure reorganization Change-Id: I772c9e214be2461adf58124998d272e7d795220f Signed-off-by: Tibor Frank Signed-off-by: Maciek Konstantynowicz --- resources/libraries/python/TLDK/UdpTest.py | 252 +-- resources/libraries/python/TrafficGenerator.py | 16 +- resources/libraries/robot/DPDK/default.robot | 110 -- resources/libraries/robot/TLDK/TLDKUtils.robot | 80 - resources/libraries/robot/bridge_domain.robot | 279 ---- resources/libraries/robot/counters.robot | 91 -- resources/libraries/robot/crypto/ipsec.robot | 280 ++++ resources/libraries/robot/default.robot | 357 ----- resources/libraries/robot/dhcp_client.robot | 141 -- resources/libraries/robot/dhcp_proxy.robot | 159 -- resources/libraries/robot/double_qemu_setup.robot | 95 -- resources/libraries/robot/dpdk/default.robot | 110 ++ resources/libraries/robot/fds/default.robot | 4 +- .../libraries/robot/features/dhcp_client.robot | 141 ++ .../libraries/robot/features/dhcp_proxy.robot | 159 ++ resources/libraries/robot/features/policer.robot | 99 ++ resources/libraries/robot/gre.robot | 182 --- resources/libraries/robot/honeycomb/policer.robot | 2 +- resources/libraries/robot/interfaces.robot | 35 - resources/libraries/robot/ip/ip4.robot | 160 ++ resources/libraries/robot/ip/ip6.robot | 195 +++ resources/libraries/robot/ip/map.robot | 312 ++++ resources/libraries/robot/ip/snat.robot | 150 ++ resources/libraries/robot/ipsec.robot | 280 ---- resources/libraries/robot/ipv4.robot | 160 -- resources/libraries/robot/ipv6.robot | 195 --- .../libraries/robot/l2/l2_bridge_domain.robot | 279 ++++ resources/libraries/robot/l2/l2_traffic.robot | 183 +++ resources/libraries/robot/l2/l2_xconnect.robot | 24 + resources/libraries/robot/l2/tagging.robot | 219 +++ resources/libraries/robot/l2_traffic.robot | 183 --- resources/libraries/robot/l2_xconnect.robot | 24 - resources/libraries/robot/lisp/l2lisp.robot | 77 - resources/libraries/robot/lisp/lisp_api.robot | 399 ----- .../robot/lisp/lisp_static_adjacency.robot | 168 -- resources/libraries/robot/lisp/lispgpe.robot | 126 -- resources/libraries/robot/lxc.robot | 257 ---- resources/libraries/robot/map.robot | 312 ---- resources/libraries/robot/overlay/gre.robot | 182 +++ resources/libraries/robot/overlay/l2lisp.robot | 77 + resources/libraries/robot/overlay/lisp_api.robot | 399 +++++ .../robot/overlay/lisp_static_adjacency.robot | 168 ++ resources/libraries/robot/overlay/lispgpe.robot | 126 ++ resources/libraries/robot/overlay/vxlan.robot | 135 ++ .../performance/performance_configuration.robot | 1597 ++++++++++++++++++++ .../robot/performance/performance_setup.robot | 532 +++++++ .../robot/performance/performance_utils.robot | 545 +++++++ .../robot/performance_configuration.robot | 1597 -------------------- resources/libraries/robot/performance_setup.robot | 532 ------- resources/libraries/robot/performance_utils.robot | 545 ------- resources/libraries/robot/policer.robot | 99 -- resources/libraries/robot/qemu.robot | 99 -- resources/libraries/robot/shared/counters.robot | 91 ++ resources/libraries/robot/shared/default.robot | 357 +++++ resources/libraries/robot/shared/interfaces.robot | 35 + resources/libraries/robot/shared/lxc.robot | 257 ++++ .../libraries/robot/shared/testing_path.robot | 353 +++++ resources/libraries/robot/shared/traffic.robot | 459 ++++++ resources/libraries/robot/snat.robot | 150 -- resources/libraries/robot/tagging.robot | 219 --- resources/libraries/robot/telemetry/ipfix.robot | 2 +- resources/libraries/robot/testing_path.robot | 353 ----- resources/libraries/robot/tldk/tldk_utils.robot | 80 + resources/libraries/robot/traffic.robot | 459 ------ .../libraries/robot/vm/double_qemu_setup.robot | 95 ++ resources/libraries/robot/vm/qemu.robot | 99 ++ resources/libraries/robot/vxlan.robot | 135 -- 67 files changed, 8036 insertions(+), 8036 deletions(-) delete mode 100644 resources/libraries/robot/DPDK/default.robot delete mode 100644 resources/libraries/robot/TLDK/TLDKUtils.robot delete mode 100644 resources/libraries/robot/bridge_domain.robot delete mode 100644 resources/libraries/robot/counters.robot create mode 100644 resources/libraries/robot/crypto/ipsec.robot delete mode 100644 resources/libraries/robot/default.robot delete mode 100644 resources/libraries/robot/dhcp_client.robot delete mode 100644 resources/libraries/robot/dhcp_proxy.robot delete mode 100644 resources/libraries/robot/double_qemu_setup.robot create mode 100644 resources/libraries/robot/dpdk/default.robot create mode 100644 resources/libraries/robot/features/dhcp_client.robot create mode 100644 resources/libraries/robot/features/dhcp_proxy.robot create mode 100644 resources/libraries/robot/features/policer.robot delete mode 100644 resources/libraries/robot/gre.robot delete mode 100644 resources/libraries/robot/interfaces.robot create mode 100644 resources/libraries/robot/ip/ip4.robot create mode 100644 resources/libraries/robot/ip/ip6.robot create mode 100644 resources/libraries/robot/ip/map.robot create mode 100644 resources/libraries/robot/ip/snat.robot delete mode 100644 resources/libraries/robot/ipsec.robot delete mode 100644 resources/libraries/robot/ipv4.robot delete mode 100644 resources/libraries/robot/ipv6.robot create mode 100644 resources/libraries/robot/l2/l2_bridge_domain.robot create mode 100644 resources/libraries/robot/l2/l2_traffic.robot create mode 100644 resources/libraries/robot/l2/l2_xconnect.robot create mode 100644 resources/libraries/robot/l2/tagging.robot delete mode 100644 resources/libraries/robot/l2_traffic.robot delete mode 100644 resources/libraries/robot/l2_xconnect.robot delete mode 100644 resources/libraries/robot/lisp/l2lisp.robot delete mode 100644 resources/libraries/robot/lisp/lisp_api.robot delete mode 100644 resources/libraries/robot/lisp/lisp_static_adjacency.robot delete mode 100644 resources/libraries/robot/lisp/lispgpe.robot delete mode 100644 resources/libraries/robot/lxc.robot delete mode 100644 resources/libraries/robot/map.robot create mode 100644 resources/libraries/robot/overlay/gre.robot create mode 100644 resources/libraries/robot/overlay/l2lisp.robot create mode 100644 resources/libraries/robot/overlay/lisp_api.robot create mode 100644 resources/libraries/robot/overlay/lisp_static_adjacency.robot create mode 100644 resources/libraries/robot/overlay/lispgpe.robot create mode 100644 resources/libraries/robot/overlay/vxlan.robot create mode 100644 resources/libraries/robot/performance/performance_configuration.robot create mode 100644 resources/libraries/robot/performance/performance_setup.robot create mode 100644 resources/libraries/robot/performance/performance_utils.robot delete mode 100644 resources/libraries/robot/performance_configuration.robot delete mode 100644 resources/libraries/robot/performance_setup.robot delete mode 100644 resources/libraries/robot/performance_utils.robot delete mode 100644 resources/libraries/robot/policer.robot delete mode 100644 resources/libraries/robot/qemu.robot create mode 100644 resources/libraries/robot/shared/counters.robot create mode 100644 resources/libraries/robot/shared/default.robot create mode 100644 resources/libraries/robot/shared/interfaces.robot create mode 100644 resources/libraries/robot/shared/lxc.robot create mode 100644 resources/libraries/robot/shared/testing_path.robot create mode 100644 resources/libraries/robot/shared/traffic.robot delete mode 100644 resources/libraries/robot/snat.robot delete mode 100644 resources/libraries/robot/tagging.robot delete mode 100644 resources/libraries/robot/testing_path.robot create mode 100644 resources/libraries/robot/tldk/tldk_utils.robot delete mode 100644 resources/libraries/robot/traffic.robot create mode 100644 resources/libraries/robot/vm/double_qemu_setup.robot create mode 100644 resources/libraries/robot/vm/qemu.robot delete mode 100644 resources/libraries/robot/vxlan.robot (limited to 'resources/libraries') diff --git a/resources/libraries/python/TLDK/UdpTest.py b/resources/libraries/python/TLDK/UdpTest.py index adf0888724..adc8aa0ed0 100644 --- a/resources/libraries/python/TLDK/UdpTest.py +++ b/resources/libraries/python/TLDK/UdpTest.py @@ -1,126 +1,126 @@ -# Copyright (c) 2017 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. - - -""" -This module exists to provide the UDP test for TLDK on topology nodes. -""" - -from scapy.utils import rdpcap -from scapy.layers.inet import IP -from scapy.layers.inet6 import IPv6 - -from robot.libraries.BuiltIn import BuiltIn - -from resources.libraries.python.ssh import SSH -from resources.libraries.python.TLDK.TLDKConstants import TLDKConstants as con -from resources.libraries.python.topology import Topology - -class UdpTest(object): - """Test the TLDK UDP function.""" - - @staticmethod - def get_pcap_info(file_prefix): - """Get the Dest IP from the RX pcap file - - :param file_prefix: the test case pcap file prefix - :type file_prefix: str - :returns: packet counts, dest ip, is or not ipv4 - :rtype: tuple(int, str, bool). - """ - exec_dir = BuiltIn().get_variable_value("${EXECDIR}") - - rx_pcapfile = '{0}/{1}/{2}_rx.pcap' \ - .format(exec_dir, con.TLDK_TESTCONFIG, file_prefix) - packets = rdpcap(rx_pcapfile) - count = len(packets) - - ### the first packet - pkt = packets[0] - if pkt.type == 0x0800: - ### this is a IPv4 packet - dest_ip = pkt[IP].dst - is_ipv4 = True - elif pkt.type == 0x86dd: - ### this is a IPv6 packet - dest_ip = pkt[IPv6].dst - is_ipv4 = False - - return count, dest_ip, is_ipv4 - - @staticmethod - def exec_the_udpfwd_test(dut_node, dut_if, file_prefix, \ - dest_ip, is_ipv4=True): - """Execute the udpfwd on the dut_node. - - :param dut_node: Will execute the udpfwd on this node. - :param dut_if: DUT interface name. - :param file_prefix: The test case config file prefix. - :param dest_ip: The UDP packet dest IP. - :param is_ipv4: Execute the IPv4 or IPv6 test. - :type dut_node: dict - :type dut_if: str - :type file_prefix: str - :type dest_ip: str - :type is_ipv4: bool - :returns: none. - :raises RuntimeError: If failed to execute udpfwd test on the dut node. - """ - pci_address = Topology.get_interface_pci_addr(dut_node, dut_if) - ssh = SSH() - ssh.connect(dut_node) - if is_ipv4: - cmd = 'cd {0}/{4} && ./run_tldk.sh {0}/{5}/{2}_rx.pcap ' \ - '{0}/{5}/{2}_tx.pcap {1} {0}/{5}/{2}_fe.cfg ' \ - '{0}/{5}/{2}_be.cfg {3} NONE' \ - .format(con.REMOTE_FW_DIR, pci_address, file_prefix, \ - dest_ip, con.TLDK_SCRIPTS, con.TLDK_TESTCONFIG) - else: - cmd = 'cd {0}/{4} && ./run_tldk.sh {0}/{5}/{2}_rx.pcap ' \ - '{0}/{5}/{2}_tx.pcap {1} {0}/{5}/{2}_fe.cfg ' \ - '{0}/{5}/{2}_be.cfg NONE {3}' \ - .format(con.REMOTE_FW_DIR, pci_address, file_prefix, \ - dest_ip, con.TLDK_SCRIPTS, con.TLDK_TESTCONFIG) - - (ret_code, _, _) = ssh.exec_command(cmd, timeout=600) - if ret_code != 0: - raise RuntimeError('Failed to execute udpfwd test at node {0}' - .format(dut_node['host'])) - - @staticmethod - def get_the_test_result(dut_node, file_prefix): - """ - After execute the udpfwd cmd, use this to get the test result. - - :param dut_node: will get the test result in this dut node - :param dut_if: the dut interface name - :param file_prefix: the test case output file prefix - :type dut_node: dice - :type dut_if: str - :type file_prefix: str - :returns: str. - :rtype: str - :raises RuntimeError: If failed to get the test result. - """ - ssh = SSH() - ssh.connect(dut_node) - cmd = 'cd {0}; tcpdump -nnnn -vvv -r ./{2}/{1}_tx.pcap | ' \ - 'grep \'udp sum ok\' | wc -l' \ - .format(con.REMOTE_FW_DIR, file_prefix, con.TLDK_TESTCONFIG) - - (ret_code, stdout, _) = ssh.exec_command(cmd, timeout=100) - if ret_code != 0: - raise RuntimeError('Failed to get test result at node {0}' - .format(dut_node['host'])) - - return stdout +# Copyright (c) 2017 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. + + +""" +This module exists to provide the UDP test for TLDK on topology nodes. +""" + +from scapy.utils import rdpcap +from scapy.layers.inet import IP +from scapy.layers.inet6 import IPv6 + +from robot.libraries.BuiltIn import BuiltIn + +from resources.libraries.python.ssh import SSH +from resources.libraries.python.TLDK.TLDKConstants import TLDKConstants as con +from resources.libraries.python.topology import Topology + +class UdpTest(object): + """Test the TLDK UDP function.""" + + @staticmethod + def get_pcap_info(file_prefix): + """Get the Dest IP from the RX pcap file + + :param file_prefix: the test case pcap file prefix + :type file_prefix: str + :returns: packet counts, dest ip, is or not ipv4 + :rtype: tuple(int, str, bool). + """ + exec_dir = BuiltIn().get_variable_value("${EXECDIR}") + + rx_pcapfile = '{0}/{1}/{2}_rx.pcap' \ + .format(exec_dir, con.TLDK_TESTCONFIG, file_prefix) + packets = rdpcap(rx_pcapfile) + count = len(packets) + + ### the first packet + pkt = packets[0] + if pkt.type == 0x0800: + ### this is a IPv4 packet + dest_ip = pkt[IP].dst + is_ipv4 = True + elif pkt.type == 0x86dd: + ### this is a IPv6 packet + dest_ip = pkt[IPv6].dst + is_ipv4 = False + + return count, dest_ip, is_ipv4 + + @staticmethod + def exec_the_udpfwd_test(dut_node, dut_if, file_prefix, \ + dest_ip, is_ipv4=True): + """Execute the udpfwd on the dut_node. + + :param dut_node: Will execute the udpfwd on this node. + :param dut_if: DUT interface name. + :param file_prefix: The test case config file prefix. + :param dest_ip: The UDP packet dest IP. + :param is_ipv4: Execute the IPv4 or IPv6 test. + :type dut_node: dict + :type dut_if: str + :type file_prefix: str + :type dest_ip: str + :type is_ipv4: bool + :returns: none. + :raises RuntimeError: If failed to execute udpfwd test on the dut node. + """ + pci_address = Topology.get_interface_pci_addr(dut_node, dut_if) + ssh = SSH() + ssh.connect(dut_node) + if is_ipv4: + cmd = 'cd {0}/{4} && ./run_tldk.sh {0}/{5}/{2}_rx.pcap ' \ + '{0}/{5}/{2}_tx.pcap {1} {0}/{5}/{2}_fe.cfg ' \ + '{0}/{5}/{2}_be.cfg {3} NONE' \ + .format(con.REMOTE_FW_DIR, pci_address, file_prefix, \ + dest_ip, con.TLDK_SCRIPTS, con.TLDK_TESTCONFIG) + else: + cmd = 'cd {0}/{4} && ./run_tldk.sh {0}/{5}/{2}_rx.pcap ' \ + '{0}/{5}/{2}_tx.pcap {1} {0}/{5}/{2}_fe.cfg ' \ + '{0}/{5}/{2}_be.cfg NONE {3}' \ + .format(con.REMOTE_FW_DIR, pci_address, file_prefix, \ + dest_ip, con.TLDK_SCRIPTS, con.TLDK_TESTCONFIG) + + (ret_code, _, _) = ssh.exec_command(cmd, timeout=600) + if ret_code != 0: + raise RuntimeError('Failed to execute udpfwd test at node {0}' + .format(dut_node['host'])) + + @staticmethod + def get_the_test_result(dut_node, file_prefix): + """ + After execute the udpfwd cmd, use this to get the test result. + + :param dut_node: will get the test result in this dut node + :param dut_if: the dut interface name + :param file_prefix: the test case output file prefix + :type dut_node: dice + :type dut_if: str + :type file_prefix: str + :returns: str. + :rtype: str + :raises RuntimeError: If failed to get the test result. + """ + ssh = SSH() + ssh.connect(dut_node) + cmd = 'cd {0}; tcpdump -nnnn -vvv -r ./{2}/{1}_tx.pcap | ' \ + 'grep \'udp sum ok\' | wc -l' \ + .format(con.REMOTE_FW_DIR, file_prefix, con.TLDK_TESTCONFIG) + + (ret_code, stdout, _) = ssh.exec_command(cmd, timeout=100) + if ret_code != 0: + raise RuntimeError('Failed to get test result at node {0}' + .format(dut_node['host'])) + + return stdout diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py index 0f25ebe42e..ca63efef56 100644 --- a/resources/libraries/python/TrafficGenerator.py +++ b/resources/libraries/python/TrafficGenerator.py @@ -190,11 +190,11 @@ class TrafficGenerator(object): ssh.connect(tg_node) (ret, stdout, stderr) = ssh.exec_command( - "sudo -E sh -c '{}/resources/tools/t-rex/" - "t-rex-installer.sh'".format(Constants.REMOTE_FW_DIR), + "sudo -E sh -c '{}/resources/tools/trex/" + "trex_installer.sh'".format(Constants.REMOTE_FW_DIR), timeout=1800) if int(ret) != 0: - logger.error('trex installation failed: {0}'.format( + logger.error('TRex installation failed: {0}'.format( stdout + stderr)) raise RuntimeError('Installation of TG failed') @@ -274,7 +274,7 @@ class TrafficGenerator(object): # get T-rex server info (ret, _, _) = ssh.exec_command( "sh -c 'sleep 3; " - "{0}/resources/tools/t-rex/t-rex-server-info.py'"\ + "{0}/resources/tools/trex/trex_server_info.py'"\ .format(Constants.REMOTE_FW_DIR), timeout=120) if int(ret) == 0: @@ -320,8 +320,8 @@ class TrafficGenerator(object): ssh.connect(node) (ret, _, _) = ssh.exec_command( - "sh -c '{}/resources/tools/t-rex/" - "t-rex-stateless-stop.py'".format(Constants.REMOTE_FW_DIR)) + "sh -c '{}/resources/tools/trex/" + "trex_stateless_stop.py'".format(Constants.REMOTE_FW_DIR)) if int(ret) != 0: raise RuntimeError('T-rex stateless runtime error') @@ -355,12 +355,12 @@ class TrafficGenerator(object): _latency = "--latency" if latency else "" _p0, _p1 = (2, 1) if self._ifaces_reordered else (1, 2) - profile_path = ("{0}/resources/tools/t-rex/stream_profiles/" + profile_path = ("{0}/resources/traffic_profiles/trex/" "{1}.py".format(Constants.REMOTE_FW_DIR, traffic_type)) (ret, stdout, _) = ssh.exec_command( "sh -c " - "'{0}/resources/tools/t-rex/t-rex-stateless-profile.py " + "'{0}/resources/tools/trex/trex_stateless_profile.py " "--profile {1} " "--duration {2} " "--frame_size {3} " diff --git a/resources/libraries/robot/DPDK/default.robot b/resources/libraries/robot/DPDK/default.robot deleted file mode 100644 index e6921c9b27..0000000000 --- a/resources/libraries/robot/DPDK/default.robot +++ /dev/null @@ -1,110 +0,0 @@ -# Copyright (c) 2016 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 *** -| Variables | resources/libraries/python/topology.py -| Library | resources.libraries.python.topology.Topology -| Library | resources.libraries.python.CpuUtils -| Library | resources.libraries.python.DUTSetup -| Library | resources.libraries.python.TGSetup -| Library | resources.libraries.python.DPDK.L2fwdTest -| Library | resources.libraries.python.DPDK.L3fwdTest -| Library | Collections - -*** Keywords *** -| Start L2FWD '${m}' worker threads and '${n}' rxqueues with jumbo frames '${b}' -| | [Documentation] | Start the l2fwd with M worker threads without SMT -| | ... | and rxqueues N and B (yes or no) jumbo frames in all DUTs. -| | ... -| | ${m_int}= | Convert To Integer | ${m} -| | ${cpu_cnt}= | Evaluate | ${m_int}+1 -| | ${nb_cores}= | Convert to String | ${m} -| | ${rxqueues}= | Convert to String | ${n} -| | ${jumbo_frames}= | Convert to String | ${b} -| | ${dut1_numa}= | Get interfaces numa node | ${dut1} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${dut2_numa}= | Get interfaces numa node | ${dut2} -| | ... | ${dut2_if1} | ${dut2_if2} -| | ${dut1_cpus}= | Cpu Range Per Node Str | ${dut1} | ${dut1_numa} -| | ... | skip_cnt=${1} | cpu_cnt=${cpu_cnt} -| | ${dut2_cpus}= | Cpu Range Per Node Str | ${dut2} | ${dut2_numa} -| | ... | skip_cnt=${1} | cpu_cnt=${cpu_cnt} -| | Start the l2fwd test | ${dut1} | ${dut1_cpus} | ${nb_cores} | ${rxqueues} -| | ... | ${jumbo_frames} -| | Start the l2fwd test | ${dut2} | ${dut2_cpus} | ${nb_cores} | ${rxqueues} -| | ... | ${jumbo_frames} - -| Start L2FWD '${m}' worker threads using SMT and '${n}' rxqueues with jumbo frames '${b}' -| | [Documentation] | Start the l2fwd with M worker threads with SMT -| | ... | and rxqueues N and B (yes or no) jumbo frames in all DUTs. -| | ... -| | ${m_int}= | Convert To Integer | ${m} -| | ${cpu_cnt}= | Evaluate | ${m_int}+1 -| | ${nb_cores_int}= | Evaluate | ${m_int}*2 -| | ${nb_cores}= | Convert to String | ${nb_cores_int} -| | ${rxqueues}= | Convert to String | ${n} -| | ${jumbo_frames}= | Convert to String | ${b} -| | ${dut1_numa}= | Get interfaces numa node | ${dut1} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${dut2_numa}= | Get interfaces numa node | ${dut2} -| | ... | ${dut2_if1} | ${dut2_if2} -| | ${dut1_cpus}= | Cpu Range Per Node Str | ${dut1} | ${dut1_numa} -| | ... | skip_cnt=${1} | cpu_cnt=${cpu_cnt} | smt_used=${True} -| | ${dut2_cpus}= | Cpu Range Per Node Str | ${dut2} | ${dut2_numa} -| | ... | skip_cnt=${1} | cpu_cnt=${cpu_cnt} | smt_used=${True} -| | Start the l2fwd test | ${dut1} | ${dut1_cpus} | ${nb_cores} | ${rxqueues} -| | ... | ${jumbo_frames} -| | Start the l2fwd test | ${dut2} | ${dut2_cpus} | ${nb_cores} | ${rxqueues} -| | ... | ${jumbo_frames} - -| Start L3FWD '${m}' worker threads and '${n}' rxqueues with jumbo frames '${b}' -| | [Documentation] | Start the l3fwd with M worker threads without SMT -| | ... | and rxqueues N and B(yes or no) jumbo frames in all DUTs. -| | ${cpu_cnt}= | Convert To Integer | ${m} -| | ${nb_cores}= | Convert to String | ${m} -| | ${rxqueues}= | Convert to String | ${n} -| | ${jumbo_frames}= | Convert to String | ${b} -| | ${dut1_numa}= | Get interfaces numa node | ${dut1} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${dut2_numa}= | Get interfaces numa node | ${dut2} -| | ... | ${dut2_if1} | ${dut2_if2} -| | ${dut1_cpus}= | Cpu List Per Node Str | ${dut1} | ${dut1_numa} -| | ... | cpu_cnt=${cpu_cnt} -| | ${dut2_cpus}= | Cpu List Per Node Str | ${dut2} | ${dut2_numa} -| | ... | cpu_cnt=${cpu_cnt} -| | Start the l3fwd test | ${nodes} | ${dut1} | ${dut1_if1} | ${dut1_if2} -| | ... | ${nb_cores} | ${dut1_cpus} | ${rxqueues} | ${jumbo_frames} -| | Start the l3fwd test | ${nodes} | ${dut2} | ${dut2_if1} | ${dut2_if2} -| | ... | ${nb_cores} | ${dut2_cpus} | ${rxqueues} | ${jumbo_frames} - -| Start L3FWD '${m}' worker threads using SMT and '${n}' rxqueues with jumbo frames '${b}' -| | [Documentation] | Start the l3fwd with M worker threads with SMT -| | ... | and rxqueues N and B(yes or no) jumbo frames in all DUTs. -| | ${cpu_cnt}= | Convert To Integer | ${m} -| | ${nb_cores_int}= | Evaluate | ${cpu_cnt}*2 -| | ${nb_cores}= | Convert to String | ${nb_cores_int} -| | ${rxqueues}= | Convert to String | ${n} -| | ${jumbo_frames}= | Convert to String | ${b} -| | ${dut1_numa}= | Get interfaces numa node | ${dut1} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${dut2_numa}= | Get interfaces numa node | ${dut2} -| | ... | ${dut2_if1} | ${dut2_if2} -| | ${dut1_cpus}= | Cpu List Per Node Str | ${dut1} | ${dut1_numa} -| | ... | cpu_cnt=${cpu_cnt} | smt_used=${True} -| | ${dut2_cpus}= | Cpu List Per Node Str | ${dut2} | ${dut2_numa} -| | ... | cpu_cnt=${cpu_cnt} | smt_used=${True} -| | Start the l3fwd test | ${nodes} | ${dut1} | ${dut1_if1} | ${dut1_if2} -| | ... | ${nb_cores} | ${dut1_cpus} | ${rxqueues} | ${jumbo_frames} -| | Start the l3fwd test | ${nodes} | ${dut2} | ${dut2_if1} | ${dut2_if2} -| | ... | ${nb_cores} | ${dut2_cpus} | ${rxqueues} | ${jumbo_frames} - diff --git a/resources/libraries/robot/TLDK/TLDKUtils.robot b/resources/libraries/robot/TLDK/TLDKUtils.robot deleted file mode 100644 index 75e982252c..0000000000 --- a/resources/libraries/robot/TLDK/TLDKUtils.robot +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (c) 2017 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.NodePath -| Documentation | *Utilities for the path computing, pcap reading* -| ... -| ... | Utilities for the path computing, pcap file reading and also the port -| ... | selection. - -*** Keywords *** -| Path for 2-node testing is set -| | [Documentation] | Compute the path for the 2 node testing. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - dut_node - DUT node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Path for 2-node testing is set \| ${nodes['TG']} \ -| | ... | \| ${nodes['DUT1'] \| -| | ... -| | [Arguments] | ${tg_node} | ${dut_node} -| | Append Nodes | ${tg_node} | ${dut_node} -| | Compute Path - -| Pick out the port used to execute test -| | [Documentation] | Pick out the port used to execute the test. -| | ... -| | ... | *Arguments:* -| | ... | - No arguments. -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Pick out the port used to execute test \| -| | ... -| | ${tg_port} | ${tg_node}= | First Interface -| | ${dut_port} | ${dut_node}= | Last Interface -| | set suite variable | ${tg_node} -| | set suite variable | ${dut_node} -| | set suite variable | ${tg_port} -| | set suite variable | ${dut_port} - -| Get the pcap data -| | [Documentation] | Get the pcap file detailed data. -| | ... -| | ... | *Arguments:* -| | ... | - file_prefix - file prefix. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - packet_num, dest_ip, is_ipv4 - a tuple of packet_num -| | ... | dest_ip, is_ipv4. Type: tuple(int, str, bool) -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Get the pcap data \| ${tc01_file_prefix} \| -| | ... -| | [Arguments] | ${file_prefix} -| | ${packet_num} | ${dest_ip} | ${is_ipv4}= | Get Pcap Info -| | ... | ${file_prefix} -| | set suite variable | ${packet_num} -| | set suite variable | ${dest_ip} -| | set suite variable | ${is_ipv4} diff --git a/resources/libraries/robot/bridge_domain.robot b/resources/libraries/robot/bridge_domain.robot deleted file mode 100644 index 22e46a02cb..0000000000 --- a/resources/libraries/robot/bridge_domain.robot +++ /dev/null @@ -1,279 +0,0 @@ -# Copyright (c) 2016 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 -| Library | resources.libraries.python.NodePath -| Library | resources.libraries.python.VhostUser -| Resource | resources/libraries/robot/interfaces.robot -| Resource | resources/libraries/robot/l2_traffic.robot - -*** Keywords *** -| Configure L2BD forwarding -| | [Documentation] | Setup BD between 2 interfaces on VPP node and if learning -| | ... | is off set static L2FIB entry on second interface -| | [Arguments] | ${node} | ${if1} | ${if2} | ${learn}=${TRUE} | ${mac}=${EMPTY} -| | Set Interface State | ${node} | ${if1} | up -| | Set Interface State | ${node} | ${if2} | up -| | Vpp Add L2 Bridge Domain | ${node} | ${1} | ${if1} | ${if2} | ${learn} -| | Run Keyword If | ${learn} == ${FALSE} -| | ... | Vpp Add L2fib Entry | ${node} | ${mac} | ${if2} | ${1} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Configure path for 3-node BD-SHG test -| | [Documentation] | Compute path for bridge domain split-horizon group testing -| | ... | on three given nodes with following interconnections -| | ... | TG - (2 links) - DUT1 - (1 link) - DUT2 - (2 links) - TG -| | ... | and set corresponding test case variables. -| | ... -| | ... | *Arguments:* -| | ... | - ${tg_node} - TG node. Type: dictionary -| | ... | - ${dut1_node} - DUT1 node. Type: dictionary -| | ... | - ${dut2_node} - DUT2 node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | _NOTE:_ This KW sets following test case variables: -| | ... | - ${tg_node} - TG node. -| | ... | - ${tg_to_dut1_if1} - TG interface 1 towards DUT1. -| | ... | - ${tg_to_dut1_if2} - TG interface 2 towards DUT1. -| | ... | - ${tg_to_dut2_if1} - TG interface 1 towards DUT2. -| | ... | - ${tg_to_dut2_if2} - TG interface 2 towards DUT2. -| | ... | - ${dut1_node} - DUT1 node. -| | ... | - ${dut1_to_tg_if1} - DUT1 interface 1 towards TG. -| | ... | - ${dut1_to_tg_if2} - DUT1 interface 2 towards TG. -| | ... | - ${dut1_to_dut2} - DUT1 interface towards DUT2. -| | ... | - ${dut2_node} - DUT2 node. -| | ... | - ${dut2_to_tg_if1} - DUT2 interface 1 towards TG. -| | ... | - ${dut2_to_tg_if2} - DUT2 interface 2 towards TG. -| | ... | - ${dut2_to_dut1} - DUT2 interface towards DUT1. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Given Configure path for 3-node BD-SHG test \| ${nodes['TG']} \ -| | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \| -| | [Arguments] | ${tg_node} | ${dut1_node} | ${dut2_node} -| | # Compute path TG - DUT1 with two links in between -| | Append Nodes | ${tg_node} | ${dut1_node} | ${tg_node} -| | Compute Path | always_same_link=${FALSE} -| | ${tg_to_dut1_if1} | ${tmp}= | First Interface -| | ${tg_to_dut1_if2} | ${tmp}= | Last Interface -| | ${dut1_to_tg_if1} | ${tmp}= | First Ingress Interface -| | ${dut1_to_tg_if2} | ${tmp}= | Last Egress Interface -| | # Compute path TG - DUT2 with two links in between -| | Clear Path -| | Append Nodes | ${tg_node} | ${dut2_node} | ${tg_node} -| | Compute Path | always_same_link=${FALSE} -| | ${tg_to_dut2_if1} | ${tmp}= | First Interface -| | ${tg_to_dut2_if2} | ${tmp}= | Last Interface -| | ${dut2_to_tg_if1} | ${tmp}= | First Ingress Interface -| | ${dut2_to_tg_if2} | ${tmp}= | Last Egress Interface -| | # Compute path DUT1 - DUT2 with one link in between -| | Clear Path -| | Append Nodes | ${dut1_node} | ${dut2_node} -| | Compute Path -| | ${dut1_to_dut2} | ${tmp}= | Next Interface -| | ${dut2_to_dut1} | ${tmp}= | Next Interface -| | # Set test variables -| | Set Test Variable | ${tg_to_dut1_if1} -| | Set Test Variable | ${tg_to_dut1_if2} -| | Set Test Variable | ${tg_to_dut2_if1} -| | Set Test Variable | ${tg_to_dut2_if2} -| | Set Test Variable | ${dut1_to_tg_if1} -| | Set Test Variable | ${dut1_to_tg_if2} -| | Set Test Variable | ${dut2_to_tg_if1} -| | Set Test Variable | ${dut2_to_tg_if2} -| | Set Test Variable | ${dut1_to_dut2} -| | Set Test Variable | ${dut2_to_dut1} -| | Set Test Variable | ${tg_node} -| | Set Test Variable | ${dut1_node} -| | Set Test Variable | ${dut2_node} - -| Set interfaces in 3-node BD-SHG test up -| | [Documentation] | Set UP state on interfaces in 3-node path on nodes and -| | ... | wait for all interfaces are ready. -| | ... -| | ... | *Arguments:* -| | ... | - No arguments. -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | _NOTE:_ This KW uses test variables sets in -| | ... | "Configure path for 3-node BD-SHG test" KW. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure path for 3-node BD-SHG test \| ${nodes['TG']} \ -| | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \| -| | ... | \| Set interfaces in 3-node BD-SHG test up \| -| | ... -| | Set Interface State | ${tg_node} | ${tg_to_dut1_if1} | up -| | Set Interface State | ${tg_node} | ${tg_to_dut1_if2} | up -| | Set Interface State | ${tg_node} | ${tg_to_dut2_if1} | up -| | Set Interface State | ${tg_node} | ${tg_to_dut2_if2} | up -| | Set Interface State | ${dut1_node} | ${dut1_to_tg_if1} | up -| | Set Interface State | ${dut1_node} | ${dut1_to_tg_if2} | up -| | Set Interface State | ${dut2_node} | ${dut2_to_tg_if1} | up -| | Set Interface State | ${dut2_node} | ${dut2_to_tg_if2} | up -| | Set Interface State | ${dut1_node} | ${dut1_to_dut2} | up -| | Set Interface State | ${dut2_node} | ${dut2_to_dut1} | up -| | Vpp Node Interfaces Ready Wait | ${dut1_node} -| | Vpp Node Interfaces Ready Wait | ${dut2_node} - -| Create bridge domain -| | [Documentation] | Create bridge domain on given VPP node with defined -| | ... | learning status. -| | ... -| | ... | *Arguments:* -| | ... | - ${dut_node} - DUT node. Type: dictionary -| | ... | - ${bd_id} - Bridge domain ID. Type: integer -| | ... | - ${learn} - Enable/disable MAC learn. Type: boolean, \ -| | ... | default value: ${TRUE} -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create bridge domain \| ${nodes['DUT1']} \| 2 \| -| | ... | \| Create bridge domain \| ${nodes['DUT1']} \| 5 \ -| | ... | \| learn=${FALSE} \| -| | [Arguments] | ${dut_node} | ${bd_id} | ${learn}=${TRUE} -| | ${learn} = | Set Variable If | ${learn} == ${TRUE} | ${1} | ${0} -| | Create L2 BD | ${dut_node} | ${bd_id} | learn=${learn} - -| Add interface to bridge domain -| | [Documentation] | Set given interface admin state to up and add this -| | ... | interface to required L2 bridge domain on defined -| | ... | VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - ${dut_node} - DUT node. Type: dictionary -| | ... | - ${dut_if} - DUT node interface name. Type: string -| | ... | - ${bd_id} - Bridge domain ID. Type: integer -| | ... | - ${shg} - Split-horizon group ID. Type: integer, default value: 0 -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Add interface to bridge domain \| ${nodes['DUT2']} \ -| | ... | \| GigabitEthernet0/8/0 \| 3 \| -| | [Arguments] | ${dut_node} | ${dut_if} | ${bd_id} | ${shg}=0 -| | Set Interface State | ${dut_node} | ${dut_if} | up -| | Add Interface To L2 BD | ${dut_node} | ${dut_if} | ${bd_id} | ${shg} - -| Add destination port to L2FIB -| | [Documentation] | Create a static L2FIB entry for required destination port -| | ... | on defined interface and bridge domain ID -| | ... | of the given VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - ${dest_node} - Destination node. Type: dictionary -| | ... | - ${dest_node_if} - Destination node interface name. Type: string -| | ... | - ${vpp_node} - DUT node to add L2FIB entry on. Type: dictionary -| | ... | - ${vpp_node_if} - DUT node interface name. Type: string -| | ... | - ${bd_id} - Bridge domain ID. Type: integer -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Add destination port to L2FIB \| ${nodes['TG']} \ -| | ... | \| eth1 \| ${nodes['DUT2']} \| GigabitEthernet0/8/0 \| 3 \| -| | [Arguments] | ${dest_node} | ${dest_node_if} | ${vpp_node} -| | ... | ${vpp_node_if} | ${bd_id} -| | ${mac}= | Get Interface Mac | ${dest_node} | ${dest_node_if} -| | Vpp Add L2fib Entry | ${vpp_node} | ${mac} | ${vpp_node_if} | ${bd_id} - -| 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 -| | Run Keyword Unless | "${qemu_name}" == "vm_node" | Import Library -| | ... | resources.libraries.python.QemuUtils | WITH NAME | ${qemu_name} -| | Set Test Variable | ${${qemu_name}} | ${None} -| | ${qemu_set_node}= | Run Keyword If | "${qemu_name}" == "vm_node" -| | | ... | Set Variable | Qemu Set Node -| | ... | ELSE | Replace Variables | ${qemu_name}.Qemu Set Node -| | Run keyword | ${qemu_set_node} | ${dut_node} -| | ${qemu_add_vhost}= | Run Keyword If | "${qemu_name}" == "vm_node" -| | | ... | Set Variable | Qemu Add Vhost User If -| | ... | ELSE | Replace Variables | ${qemu_name}.Qemu Add Vhost User If -| | Run keyword | ${qemu_add_vhost} | ${sock1} -| | Run keyword | ${qemu_add_vhost} | ${sock2} -| | ${qemu_start}= | Run Keyword If | "${qemu_name}" == "vm_node" -| | | ... | Set Variable | Qemu Start -| | ... | ELSE | Replace Variables | ${qemu_name}.Qemu Start -| | ${vm}= | Run keyword | ${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} - -| Configure vhost interfaces for L2BD forwarding -| | [Documentation] | Create two Vhost-User interfaces on defined VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - ${dut_node} - DUT node. Type: dictionary -| | ... | - ${sock1} - Socket path for first Vhost-User interface. Type: string -| | ... | - ${sock2} - Socket path for second Vhost-User interface. Type: string -| | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional). -| | ... | Type: string -| | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional). -| | ... | Type: string -| | ... -| | ... | _NOTE:_ This KW sets following test case variable: -| | ... | - ${${vhost_if1}} - First Vhost-User interface. -| | ... | - ${${vhost_if2}} - Second Vhost-User interface. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure vhost interfaces for L2BD forwarding \ -| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| -| | ... | \| Configure vhost interfaces for L2BD forwarding \ -| | ... | \| ${nodes['DUT2']} \| /tmp/sock1 \| /tmp/sock2 \| dut2_vhost_if1 \ -| | ... | \| dut2_vhost_if2 \| -| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1 -| | ... | ${vhost_if2}=vhost_if2 -| | ${vhost_1}= | Vpp Create Vhost User Interface | ${dut_node} | ${sock1} -| | ${vhost_2}= | Vpp Create Vhost User Interface | ${dut_node} | ${sock2} -| | Set Interface State | ${dut_node} | ${vhost_1} | up -| | Set Interface State | ${dut_node} | ${vhost_2} | up -| | Set Test Variable | ${${vhost_if1}} | ${vhost_1} -| | Set Test Variable | ${${vhost_if2}} | ${vhost_2} diff --git a/resources/libraries/robot/counters.robot b/resources/libraries/robot/counters.robot deleted file mode 100644 index 3591dd5fe7..0000000000 --- a/resources/libraries/robot/counters.robot +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (c) 2016 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 | VPP counters keywords -| Library | resources/libraries/python/VppCounters.py - -*** Keywords *** -| Clear interface counters on all vpp nodes in topology -| | [Documentation] | Clear interface counters on all VPP nodes in topology -| | [Arguments] | ${nodes} -| | Vpp Nodes Clear Interface Counters | ${nodes} - -| Get interface statistics -| | [Documentation] | Dump stats table on VPP node -| | [Arguments] | ${node} -| | Vpp Dump Stats Table | ${node} - -| Get interface ipv6 counter -| | [Documentation] | Return IPv6 statistics for node interface -| | [Arguments] | ${node} | ${interface} -| | ${ipv6_counter}= | Vpp Get Ipv6 Interface Counter | ${node} | ${interface} -| | [Return] | ${ipv6_counter} - -| Check ipv4 interface counter -| | [Documentation] | Check that ipv4 interface counter has right value -| | [Arguments] | ${node} | ${interface} | ${value} -| | ${ipv4_counter}= | Vpp get ipv4 interface counter | ${node} | ${interface} -| | Should Be Equal | ${ipv4_counter} | ${value} - -| Show statistics on all DUTs -| | [Documentation] | Show VPP statistics on all DUTs -| | Sleep | 10 | Waiting for statistics to be collected -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Show vpp statistics | ${nodes['${dut}']} - -| Show vpp statistics -| | [Documentation] | Show [error, hardware, interface] stats -| | [Arguments] | ${node} -| | Vpp Show Errors | ${node} -| | Vpp Show Hardware Detail | ${node} -| | Vpp Show Runtime | ${node} - -| Clear all counters on all DUTs -| | [Documentation] | Clear runtime, interface, hardware and error counters -| | ... | on all DUTs with VPP instance -| | Clear runtime counters on all DUTs -| | Clear interface counters on all DUTs -| | Clear hardware counters on all DUTs -| | Clear error counters on all DUTs - -| Clear runtime counters on all DUTs -| | [Documentation] | Clear VPP runtime counters on all DUTs -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Vpp clear runtime | ${nodes['${dut}']} - -| Clear interface counters on all DUTs -| | [Documentation] | Clear VPP interface counters on all DUTs -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Vpp clear interface counters | ${nodes['${dut}']} - -| Clear hardware counters on all DUTs -| | [Documentation] | Clear VPP hardware counters on all DUTs -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Vpp clear hardware counters | ${nodes['${dut}']} - -| Clear error counters on all DUTs -| | [Documentation] | Clear VPP errors counters on all DUTs -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Vpp clear errors counters | ${nodes['${dut}']} - -| Show runtime counters on all DUTs -| | [Documentation] | Show VPP runtime counters on all DUTs -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Vpp show runtime | ${nodes['${dut}']} diff --git a/resources/libraries/robot/crypto/ipsec.robot b/resources/libraries/robot/crypto/ipsec.robot new file mode 100644 index 0000000000..74a1a53f25 --- /dev/null +++ b/resources/libraries/robot/crypto/ipsec.robot @@ -0,0 +1,280 @@ +# Copyright (c) 2016 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 +| Library | resources.libraries.python.IPsecUtil +| Library | resources.libraries.python.NodePath +| Library | resources.libraries.python.TrafficScriptExecutor +| Library | resources.libraries.python.IPv4Util.IPv4Util +| Library | resources.libraries.python.InterfaceUtil +| Library | resources.libraries.python.Routing +| Library | String +| Library | resources.libraries.python.IPv6Util +| Library | resources.libraries.python.IPv6Setup +| Library | resources.libraries.python.IPv4Setup.Dut | ${nodes['DUT1']} +| ... | WITH NAME | dut1_v4 +| Documentation | *IPsec keywords.* + +*** Keywords *** +| Generate keys for IPSec +| | [Documentation] | Generate keys for IPsec. +| | ... +| | ... | *Arguments:* +| | ... | - crypto_alg - Encryption algorithm. Type: enum +| | ... | - integ_alg - Integrity algorithm. Type: enum +| | ... +| | ... | _NOTE:_ This KW sets following test case variable: +| | ... | - encr_key - Encryption key. Type: string +| | ... | - auth_key - Integrity key. Type: string +| | ... +| | ... | *Example:* +| | ... | \| ${encr_alg}= \| Crypto Alg AES CBC 128 \| +| | ... | \| ${auth_alg}= \| Integ Alg SHA1 96 \| +| | ... | \| Generate keys for IPSec \| ${encr_alg} \| ${auth_alg} \| +| | [Arguments] | ${crypto_alg} | ${integ_alg} +| | ${encr_key_len}= | Get Crypto Alg Key Len | ${crypto_alg} +| | ${encr_key}= | Generate Random String | ${encr_key_len} +| | ${auth_key_len}= | Get Integ Alg Key Len | ${integ_alg} +| | ${auth_key}= | Generate Random String | ${auth_key_len} +| | Set Test Variable | ${encr_key} +| | Set Test Variable | ${auth_key} + +| Configure path for IPSec test +| | [Documentation] | Setup path for IPsec testing TG<-->DUT1. +| | ... +| | ... | _NOTE:_ This KW sets following test case variable: +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - tg_if - TG interface connected to DUT. Type: string +| | ... | - tg_if_mac - TG interface MAC. Type: string +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - dut_if - DUT interface connected to TG. Type: string +| | ... | - dut_if_mac - DUT interface MAC. Type: string +| | ... | - dut_lo - DUT loopback interface. Type: string +| | ... +| | ... | *Example:* +| | ... | \| Configure path for IPSec test \| +| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} +| | Compute Path +| | ${tg_if} | ${tg_node}= | Next Interface +| | ${dut_if} | ${dut_node}= | Next Interface +| | ${dut_if_mac}= | Get Interface Mac | ${dut_node} | ${dut_if} +| | ${tg_if_mac}= | Get Interface Mac | ${tg_node} | ${tg_if} +| | ${dut_lo}= | Vpp Create Loopback | ${dut_node} +| | Set Interface State | ${dut_node} | ${dut_if} | up +| | Set Interface State | ${dut_node} | ${dut_lo} | up +| | Vpp Node Interfaces Ready Wait | ${dut_node} +| | Set Test Variable | ${tg_node} +| | Set Test Variable | ${tg_if} +| | Set Test Variable | ${tg_if_mac} +| | Set Test Variable | ${dut_node} +| | Set Test Variable | ${dut_if} +| | Set Test Variable | ${dut_if_mac} +| | Set Test Variable | ${dut_lo} + +| Configure topology for IPv4 IPsec testing +| | [Documentation] | Setup topology for IPv4 IPsec testing. +| | ... +| | ... | _NOTE:_ This KW sets following test case variable: +| | ... | - dut_tun_ip - DUT tunnel IP address. Type: string +| | ... | - dut_src_ip - DUT source IP address. Type: string +| | ... | - tg_tun_ip - TG tunnel IP address. Type: string +| | ... | - tg_src_ip - TG source IP address. Type: string +| | ... +| | ... | *Example:* +| | ... | \| Configure topology for IPv4 IPsec testing \| +| | Configure path for IPSec test +| | Set Interface Address | ${dut_node} | ${dut_if} | ${dut_if_ip4} +| | ... | ${ip4_plen} +| | Set Interface Address | ${dut_node} | ${dut_lo} | ${dut_lo_ip4} +| | ... | ${ip4_plen} +| | dut1_v4.Set Arp | ${dut_if} | ${tg_if_ip4} | ${tg_if_mac} +| | Vpp Route Add | ${dut_node} | ${tg_lo_ip4} | ${ip4_plen} | ${tg_if_ip4} +| | ... | ${dut_if} +| | Set Test Variable | ${dut_tun_ip} | ${dut_if_ip4} +| | Set Test Variable | ${dut_src_ip} | ${dut_lo_ip4} +| | Set Test Variable | ${tg_tun_ip} | ${tg_if_ip4} +| | Set Test Variable | ${tg_src_ip} | ${tg_lo_ip4} + +| Configure topology for IPv6 IPsec testing +| | [Documentation] | Setup topology fo IPv6 IPsec testing. +| | ... +| | ... | _NOTE:_ This KW sets following test case variable: +| | ... | - dut_tun_ip - DUT tunnel IP address. Type: string +| | ... | - dut_src_ip - DUT source IP address. Type: string +| | ... | - tg_tun_ip - TG tunnel IP address. Type: string +| | ... | - tg_src_ip - TG source IP address. Type: string +| | ... +| | ... | *Example:* +| | ... | \| Configure topology for IPv6 IPsec testing \| +| | Configure path for IPSec test +| | VPP Set If IPv6 Addr | ${dut_node} | ${dut_if} | ${dut_if_ip6} | ${ip6_plen} +| | VPP Set If IPv6 Addr | ${dut_node} | ${dut_lo} | ${dut_lo_ip6} | ${ip6_plen} +| | Add IP Neighbor | ${dut_node} | ${dut_if} | ${tg_if_ip6} | ${tg_if_mac} +| | Vpp All RA Suppress Link Layer | ${nodes} +| | Vpp Route Add | ${dut_node} | ${tg_lo_ip6} | ${ip6_plen_rt} | ${tg_if_ip6} +| | ... | ${dut_if} +| | Set Test Variable | ${dut_tun_ip} | ${dut_if_ip6} +| | Set Test Variable | ${dut_src_ip} | ${dut_lo_ip6} +| | Set Test Variable | ${tg_tun_ip} | ${tg_if_ip6} +| | Set Test Variable | ${tg_src_ip} | ${tg_lo_ip6} + +| Configure manual keyed connection for IPSec +| | [Documentation] | Setup IPsec manual keyed connection on VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - node - VPP node to setup IPsec on. Type: dictionary +| | ... | - interface - Interface to enable IPsec on. Type: string +| | ... | - crypto_alg - Encrytion algorithm. Type: enum +| | ... | - crypto_key - Encryption key. Type: string +| | ... | - integ_alg - Integrity algorithm. Type: enum +| | ... | - integ_key - Integrity key. Type: string +| | ... | - l_spi - Local SPI. Type: integer +| | ... | - r_spi - Remote SPI. Type: integer +| | ... | - l_ip - Local IP address. Type: string +| | ... | - r_ip - Remote IP address. Type: string +| | ... | - l_tunnel - Local tunnel IP address (optional). Type: string +| | ... | - r_tunnel - Remote tunnel IP address (optional). Type: string +| | ... +| | ... | _NOTE:_ This KW sets following test case variables: +| | ... | - l_sa_id +| | ... | - r_sa_id +| | ... +| | ... | *Example:* +| | ... | \| ${encr_alg}= \| Crypto Alg AES CBC 128 \| +| | ... | \| ${auth_alg}= \| Integ Alg SHA1 96 \| +| | ... | \| Configure manual keyed connection for IPSec \| ${nodes['DUT1']} \ +| | ... | \| GigabitEthernet0/8/0 \| ${encr_alg} \| sixteenbytes_key \ +| | ... | \| ${auth_alg} \| twentybytessecretkey \| ${1000} \| ${1001} \ +| | ... | \| 192.168.4.4 \| 192.168.3.3 \| 192.168.100.3 \| 192.168.100.2 \| +| | [Arguments] | ${node} | ${interface} | ${crypto_alg} | ${crypto_key} +| | ... | ${integ_alg} | ${integ_key} | ${l_spi} | ${r_spi} | ${l_ip} +| | ... | ${r_ip} | ${l_tunnel}=${None} | ${r_tunnel}=${None} +| | Set Test Variable | ${l_sa_id} | ${10} +| | Set Test Variable | ${r_sa_id} | ${20} +| | ${spd_id}= | Set Variable | ${1} +| | ${p_hi}= | Set Variable | ${100} +| | ${p_lo}= | Set Variable | ${10} +| | VPP IPsec Add SAD Entry | ${node} | ${l_sa_id} | ${l_spi} | ${crypto_alg} +| | ... | ${crypto_key} | ${integ_alg} | ${integ_key} +| | ... | ${l_tunnel} | ${r_tunnel} +| | VPP IPsec Add SAD Entry | ${node} | ${r_sa_id} | ${r_spi} | ${crypto_alg} +| | ... | ${crypto_key} | ${integ_alg} | ${integ_key} +| | ... | ${r_tunnel} | ${l_tunnel} +| | VPP IPsec Add SPD | ${node} | ${spd_id} +| | VPP IPsec SPD Add If | ${node} | ${spd_id} | ${interface} +| | ${action}= | Policy Action Bypass +| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_hi} | ${action} +| | ... | inbound=${TRUE} | proto=${ESP_PROTO} +| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_hi} | ${action} +| | ... | inbound=${FALSE} | proto=${ESP_PROTO} +| | ${action}= | Policy Action Protect +| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_lo} | ${action} +| | ... | sa_id=${r_sa_id} | laddr_range=${l_ip} +| | ... | raddr_range=${r_ip} | inbound=${TRUE} +| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_lo} | ${action} +| | ... | sa_id=${l_sa_id} | laddr_range=${l_ip} +| | ... | raddr_range=${r_ip} | inbound=${FALSE} + +| Update IPSec SA keys +| | [Documentation] | Update IPsec SA keys on VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - node - VPP node to update SA keys. Type: dictionary +| | ... | - l_sa_id - Local SA ID. Type: string +| | ... | - r_sa_id - Remote SA ID. Type: string +| | ... | - crypto_key - Encryption key. Type: string +| | ... | - integ_key - Integrity key. Type: string +| | ... +| | ... | *Example:* +| | ... | \| Update IPSec SA keys \| ${nodes['DUT1']} \ +| | ... | \| 10 \| 20 \| sixteenbytes_key \| twentybytessecretkey \| +| | [Arguments] | ${node} | ${l_sa_id} | ${r_sa_id} | ${crypto_key} +| | ... | ${integ_key} +| | VPP IPsec SA Set Key | ${dut_node} | ${l_sa_id} | ${crypto_key} +| | ... | ${integ_key} +| | VPP IPsec SA Set Key | ${dut_node} | ${r_sa_id} | ${crypto_key} +| | ... | ${integ_key} + +| Send IPsec Packet and verify ESP encapsulation in received packet +| | [Documentation] | Send IPsec packet from TG to DUT. Receive IPsec packet\ +| | ... | from DUT on TG and verify ESP encapsulation. +| | ... +| | ... | *Arguments:* +| | ... | - node - TG node. Type: dictionary +| | ... | - interface - TG Interface. Type: string +| | ... | - dst_mac - Destination MAC. Type: string +| | ... | - crypto_alg - Encrytion algorithm. Type: enum +| | ... | - crypto_key - Encryption key. Type: string +| | ... | - integ_alg - Integrity algorithm. Type: enum +| | ... | - integ_key - Integrity key. Type: string +| | ... | - l_spi - Local SPI. Type: integer +| | ... | - r_spi - Remote SPI. Type: integer +| | ... | - l_ip - Local IP address. Type: string +| | ... | - r_ip - Remote IP address. Type: string +| | ... | - l_tunnel - Local tunnel IP address (optional). Type: string +| | ... | - r_tunnel - Remote tunnel IP address (optional). Type: string +| | ... +| | ... | *Example:* +| | ... | \| ${encr_alg}= \| Crypto Alg AES CBC 128 \| +| | ... | \| ${auth_alg}= \| Integ Alg SHA1 96 \| +| | ... | \| Send IPsec Packet and verify ESP encapsulation in received packet\ +| | ... | \| ${nodes['TG']} \| eth1 \ +| | ... | \| 52:54:00:d4:d8:22 \| ${encr_alg} \| sixteenbytes_key \ +| | ... | \| ${auth_alg} \| twentybytessecretkey \| ${1001} \| ${1000} \ +| | ... | \| 192.168.3.3 \| 192.168.4.4 \| 192.168.100.2 \| 192.168.100.3 \| +| | [Arguments] | ${node} | ${interface} | ${dst_mac} | ${crypto_alg} +| | ... | ${crypto_key} | ${integ_alg} | ${integ_key} | ${l_spi} +| | ... | ${r_spi} | ${l_ip} | ${r_ip} | ${l_tunnel}=${None} +| | ... | ${r_tunnel}=${None} +| | ${src_mac}= | Get Interface Mac | ${node} | ${interface} +| | ${if_name}= | Get Interface Name | ${node} | ${interface} +| | ${args}= | Traffic Script Gen Arg | ${if_name} | ${if_name} | ${src_mac} +| | ... | ${dst_mac} | ${l_ip} | ${r_ip} +| | ${crypto_alg_str}= | Get Crypto Alg Scapy Name | ${crypto_alg} +| | ${integ_alg_str}= | Get Integ Alg Scapy Name | ${integ_alg} +| | ${args}= | Catenate | ${args} | --crypto_alg ${crypto_alg_str} +| | ... | --crypto_key ${crypto_key} | --integ_alg ${integ_alg_str} +| | ... | --integ_key ${integ_key} | --l_spi ${l_spi} | --r_spi ${r_spi} +| | ${args}= | Set Variable If | "${l_tunnel}" == "${None}" | ${args} +| | ... | ${args} --src_tun ${l_tunnel} +| | ${args}= | Set Variable If | "${r_tunnel}" == "${None}" | ${args} +| | ... | ${args} --dst_tun ${r_tunnel} +| | Run Traffic Script On Node | ipsec.py | ${node} | ${args} + +| Set up IPv4 IPSec functional test +| | [Documentation] +| | ... | Set up IPv4 IPSec functional test +| | ... +| | Set up functional test +| | Configure topology for IPv4 IPsec testing + +| Set up IPv6 IPSec functional test +| | [Documentation] +| | ... | Set up IPv6 IPSec functional test +| | ... +| | Set up functional test +| | Configure topology for IPv6 IPsec testing + +| Tear down IPSec functional test +| | [Documentation] +| | ... | Tear down IPSec functional test +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Tear down IPSec functional test \| ${dut_node} \| +| | ... +| | [Arguments] | ${dut_node} +| | ... +| | VPP IPsec Show | ${dut_node} +| | Tear down functional test diff --git a/resources/libraries/robot/default.robot b/resources/libraries/robot/default.robot deleted file mode 100644 index 68d399702a..0000000000 --- a/resources/libraries/robot/default.robot +++ /dev/null @@ -1,357 +0,0 @@ -# Copyright (c) 2016 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/qemu.robot -| Variables | resources/libraries/python/topology.py -| Variables | resources/libraries/python/VatHistory.py -| Library | resources.libraries.python.topology.Topology -| Library | resources.libraries.python.VatHistory -| Library | resources.libraries.python.CpuUtils -| Library | resources.libraries.python.DUTSetup -| Library | resources.libraries.python.SchedUtils -| Library | resources.libraries.python.TGSetup -| Library | resources.libraries.python.L2Util -| Library | resources.libraries.python.Tap -| Library | resources/libraries/python/VppConfigGenerator.py -| Library | resources/libraries/python/VppCounters.py -| Library | Collections - -*** Keywords *** -| Configure all DUTs before test -| | [Documentation] | Setup all DUTs in topology before test execution. -| | ... -| | Setup All DUTs | ${nodes} - -| Configure all TGs for traffic script -| | [Documentation] | Prepare all TGs before traffic scripts execution. -| | ... -| | All TGs Set Interface Default Driver | ${nodes} - -| Show VPP version on all DUTs -| | [Documentation] | Show VPP version verbose on all DUTs. -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Vpp show version verbose | ${nodes['${dut}']} - -| Show Vpp Errors On All DUTs -| | [Documentation] | Show VPP errors verbose on all DUTs. -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Vpp Show Errors | ${nodes['${dut}']} - -| Show VPP trace dump on all DUTs -| | [Documentation] | Save API trace and dump output on all DUTs. -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Vpp api trace save | ${nodes['${dut}']} -| | | Vpp api trace dump | ${nodes['${dut}']} - -| Show VPP vhost on all DUTs -| | [Documentation] | Show Vhost User on all DUTs. -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Vpp Show Vhost | ${nodes['${dut}']} - -| Show Bridge Domain Data On All DUTs -| | [Documentation] | Show Bridge Domain data on all DUTs. -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Vpp Get Bridge Domain Data | ${nodes['${dut}']} - -| Setup Scheduler Policy for Vpp On All DUTs -| | [Documentation] | Set realtime scheduling policy (SCHED_RR) with priority 1 -| | ... | on all VPP worker threads on all DUTs. -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Set VPP Scheduling rr | ${nodes['${dut}']} - -| Configure crypto device on all DUTs -| | [Documentation] | Verify if Crypto QAT device virtual functions are -| | ... | initialized on all DUTs. If parameter force_init is set to True, then -| | ... | try to initialize. -| | ... -| | ... | *Arguments:* -| | ... | - ${force_init} - Try to initialize. Type: boolean -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure crypto device on all DUTs \| ${True} \| -| | ... -| | [Arguments] | ${force_init}=${False} -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Crypto Device Verify | ${nodes['${dut}']} | force_init=${force_init} - -| Configure kernel module on all DUTs -| | [Documentation] | Verify if specific kernel module is loaded on all DUTs. -| | ... | If parameter force_load is set to True, then try to initialize. -| | ... -| | ... | *Arguments:* -| | ... | - ${module} - Module to verify. Type: string -| | ... | - ${force_load} - Try to load module. Type: boolean -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure kernel module on all DUTs \| ${True} \| -| | ... -| | [Arguments] | ${module} | ${force_load}=${False} -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Kernel Module Verify | ${nodes['${dut}']} | ${module} -| | | ... | force_load=${force_load} - -| Create base startup configuration of VPP on all DUTs -| | [Documentation] | Create base startup configuration of VPP to all DUTs. -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Import Library | resources.libraries.python.VppConfigGenerator -| | | ... | WITH NAME | ${dut} -| | | Run keyword | ${dut}.Set Node | ${nodes['${dut}']} -| | | Run keyword | ${dut}.Add Unix Log -| | | Run keyword | ${dut}.Add Unix CLI Listen -| | | Run keyword | ${dut}.Add Unix Nodaemon -| | | Run keyword | ${dut}.Add DPDK Socketmem | "1024,1024" -| | | Run keyword | ${dut}.Add Heapsize | "3G" -| | | Run keyword | ${dut}.Add IP6 Hash Buckets | "2000000" -| | | Run keyword | ${dut}.Add IP6 Heap Size | "3G" - -| Add '${m}' worker threads and '${n}' rxqueues in 3-node single-link circular topology -| | [Documentation] | Setup M worker threads and N rxqueues in vpp startup\ -| | ... | configuration on all DUTs in 3-node single-link topology. -| | ... -| | ${m_int}= | Convert To Integer | ${m} -| | ${dut1_numa}= | Get interfaces numa node | ${dut1} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${dut2_numa}= | Get interfaces numa node | ${dut2} -| | ... | ${dut2_if1} | ${dut2_if2} -| | ${dut1_cpu_main}= | Cpu list per node str | ${dut1} | ${dut1_numa} -| | ... | skip_cnt=${1} | cpu_cnt=${1} -| | ${dut1_cpu_w}= | Cpu list per node str | ${dut1} | ${dut1_numa} -| | ... | skip_cnt=${2} | cpu_cnt=${m_int} -| | ${dut2_cpu_main}= | Cpu list per node str | ${dut2} | ${dut2_numa} -| | ... | skip_cnt=${1} | cpu_cnt=${1} -| | ${dut2_cpu_w}= | Cpu list per node str | ${dut2} | ${dut2_numa} -| | ... | skip_cnt=${2} | cpu_cnt=${m_int} -| | Run keyword | DUT1.Add CPU Main Core | ${dut1_cpu_main} -| | Run keyword | DUT2.Add CPU Main Core | ${dut2_cpu_main} -| | Run keyword | DUT1.Add CPU Corelist Workers | ${dut1_cpu_w} -| | Run keyword | DUT2.Add CPU Corelist Workers | ${dut2_cpu_w} -| | Run keyword | DUT1.Add DPDK Dev Default RXQ | ${n} -| | Run keyword | DUT2.Add DPDK Dev Default RXQ | ${n} - -| Add '${m}' worker threads and '${n}' rxqueues in 2-node single-link circular topology -| | [Documentation] | Setup M worker threads and N rxqueues in vpp startup\ -| | ... | configuration on all DUTs in 2-node single-link topology. -| | ... -| | ${m_int}= | Convert To Integer | ${m} -| | ${dut1_numa}= | Get interfaces numa node | ${dut1} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${dut1_cpu_main}= | Cpu list per node str | ${dut1} | ${dut1_numa} -| | ... | skip_cnt=${1} | cpu_cnt=${1} -| | ${dut1_cpu_w}= | Cpu list per node str | ${dut1} | ${dut1_numa} -| | ... | skip_cnt=${2} | cpu_cnt=${m_int} -| | Run keyword | DUT1.Add CPU Main Core | ${dut1_cpu_main} -| | Run keyword | DUT1.Add CPU Corelist Workers | ${dut1_cpu_w} -| | Run keyword | DUT1.Add DPDK Dev Default RXQ | ${n} - -| Add '${m}' worker threads using SMT and '${n}' rxqueues in 3-node single-link circular topology -| | [Documentation] | Setup M worker threads using SMT and N rxqueues in vpp\ -| | ... | startup configuration on all DUTs in 3-node single-link topology. -| | ... -| | ${m_int}= | Convert To Integer | ${m} -| | ${dut1_numa}= | Get interfaces numa node | ${dut1} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${dut2_numa}= | Get interfaces numa node | ${dut2} -| | ... | ${dut2_if1} | ${dut2_if2} -| | ${dut1_cpu_main}= | Cpu list per node str | ${dut1} | ${dut1_numa} -| | ... | skip_cnt=${1} | cpu_cnt=${1} | smt_used=${True} -| | ${dut1_cpu_w}= | Cpu list per node str | ${dut1} | ${dut1_numa} -| | ... | skip_cnt=${2} | cpu_cnt=${m_int} | smt_used=${True} -| | ${dut2_cpu_main}= | Cpu list per node str | ${dut2} | ${dut2_numa} -| | ... | skip_cnt=${1} | cpu_cnt=${1} | smt_used=${True} -| | ${dut2_cpu_w}= | Cpu list per node str | ${dut2} | ${dut2_numa} -| | ... | skip_cnt=${2} | cpu_cnt=${m_int} | smt_used=${True} -| | Run keyword | DUT1.Add CPU Main Core | ${dut1_cpu_main} -| | Run keyword | DUT2.Add CPU Main Core | ${dut2_cpu_main} -| | Run keyword | DUT1.Add CPU Corelist Workers | ${dut1_cpu_w} -| | Run keyword | DUT2.Add CPU Corelist Workers | ${dut2_cpu_w} -| | Run keyword | DUT1.Add DPDK Dev Default RXQ | ${n} -| | Run keyword | DUT2.Add DPDK Dev Default RXQ | ${n} - -| Add '${m}' worker threads using SMT and '${n}' rxqueues in 2-node single-link circular topology -| | [Documentation] | Setup M worker threads and N rxqueues in vpp startup\ -| | ... | configuration on all DUTs in 2-node single-link topology. -| | ... -| | ${m_int}= | Convert To Integer | ${m} -| | ${dut1_numa}= | Get interfaces numa node | ${dut1} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${dut1_cpu_main}= | Cpu list per node str | ${dut1} | ${dut1_numa} -| | ... | skip_cnt=${1} | cpu_cnt=${1} | smt_used=${True} -| | ${dut1_cpu_w}= | Cpu list per node str | ${dut1} | ${dut1_numa} -| | ... | skip_cnt=${2} | cpu_cnt=${m_int} | smt_used=${True} -| | Run keyword | DUT1.Add CPU Main Core | ${dut1_cpu_main} -| | Run keyword | DUT1.Add CPU Corelist Workers | ${dut1_cpu_w} -| | Run keyword | DUT1.Add DPDK Dev Default RXQ | ${n} - -| Add no multi seg to all DUTs -| | [Documentation] | Add No Multi Seg to VPP startup configuration to all DUTs. -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Run keyword | ${dut}.Add DPDK No Multi Seg - -| Add SNAT to all DUTs -| | [Documentation] | Add SNAT configuration to all DUTs. -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Run keyword | ${dut}.Add SNAT - -| Add cryptodev to all DUTs -| | [Documentation] | Add Cryptodev to VPP startup configuration to all DUTs. -| | ... -| | ... | *Arguments:* -| | ... | - ${count} - Number of QAT devices. Type: integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Add cryptodev to all DUTs \| ${4} \| -| | ... -| | [Arguments] | ${count} -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Run keyword | ${dut}.Add DPDK Cryptodev | ${count} - -| Apply startup configuration on all VPP DUTs -| | [Documentation] | Write startup configuration and restart VPP on all DUTs. -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Run keyword | ${dut}.Apply Config -| | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${TRUE} - -| Save VPP PIDs -| | [Documentation] | Get PIDs of VPP processes from all DUTs in topology and\ -| | ... | set it as a test variable. The PIDs are stored as dictionary items\ -| | ... | where the key is the host and the value is the PID. -| | ... -| | ${setup_vpp_pids}= | Get VPP PIDs | ${nodes} -| | ${keys}= | Get Dictionary Keys | ${setup_vpp_pids} -| | :FOR | ${key} | IN | @{keys} -| | | ${pid}= | Get From Dictionary | ${setup_vpp_pids} | ${key} -| | | Run Keyword If | $pid is None | FAIL | No VPP PID found on node ${key} -| | | Run Keyword If | ',' in '${pid}' -| | | ... | FAIL | More then one VPP PID found on node ${key}: ${pid} -| | Set Test Variable | ${setup_vpp_pids} - -| Verify VPP PID in Teardown -| | [Documentation] | Check if the VPP PIDs on all DUTs are the same at the end\ -| | ... | of test as they were at the begining. If they are not, only a message\ -| | ... | is printed on console and to log. The test will not fail. -| | ... -| | ${teardown_vpp_pids}= | Get VPP PIDs | ${nodes} -| | ${err_msg}= | Catenate | ${SUITE NAME} - ${TEST NAME} -| | ... | \nThe VPP PIDs are not equal!\nTest Setup VPP PIDs: -| | ... | ${setup_vpp_pids}\nTest Teardown VPP PIDs: ${teardown_vpp_pids} -| | ${rc} | ${msg}= | Run keyword and ignore error -| | ... | Dictionaries Should Be Equal -| | ... | ${setup_vpp_pids} | ${teardown_vpp_pids} -| | Run Keyword And Return If | '${rc}'=='FAIL' | Log | ${err_msg} -| | ... | console=yes | level=WARN - -| Set up functional test -| | [Documentation] | Common test setup for functional tests. -| | ... -| | Configure all DUTs before test -| | Save VPP PIDs -| | Configure all TGs for traffic script -| | Update All Interface Data On All Nodes | ${nodes} -| | Reset VAT History On All DUTs | ${nodes} - -| Tear down functional test -| | [Documentation] | Common test teardown for functional tests. -| | ... -| | Show Packet Trace on All DUTs | ${nodes} -| | Show VAT History On All DUTs | ${nodes} -| | Vpp Show Errors On All DUTs | ${nodes} -| | Verify VPP PID in Teardown - -| Tear down LISP functional test -| | [Documentation] | Common test teardown for functional tests with LISP. -| | ... -| | Show Packet Trace on All DUTs | ${nodes} -| | Show VAT History On All DUTs | ${nodes} -| | Show Vpp Settings | ${nodes['DUT1']} -| | Show Vpp Settings | ${nodes['DUT2']} -| | Vpp Show Errors On All DUTs | ${nodes} -| | Verify VPP PID in Teardown - -| Tear down LISP functional test with QEMU -| | [Documentation] | Common test teardown for functional tests with LISP and\ -| | ... | QEMU. -| | ... -| | ... | *Arguments:* -| | ... | - vm_node - VM to stop. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Tear down LISP functional test with QEMU \| ${vm_node} \| -| | ... -| | [Arguments] | ${vm_node} -| | ... -| | Show Packet Trace on All DUTs | ${nodes} -| | Show VAT History On All DUTs | ${nodes} -| | Show Vpp Settings | ${nodes['DUT1']} -| | Show Vpp Settings | ${nodes['DUT2']} -| | Vpp Show Errors On All DUTs | ${nodes} -| | Stop and clear QEMU | ${nodes['DUT1']} | ${vm_node} -| | Verify VPP PID in Teardown - -| Set up TAP functional test -| | [Documentation] | Common test setup for functional tests with TAP. -| | ... -| | Set up functional test -| | Clean Up Namespaces | ${nodes['DUT1']} - -| Tear down TAP functional test -| | [Documentation] | Common test teardown for functional tests with TAP. -| | ... -| | Tear down functional test -| | Clean Up Namespaces | ${nodes['DUT1']} - -| Tear down TAP functional test with Linux bridge -| | [Documentation] | Common test teardown for functional tests with TAP and -| | ... | a Linux bridge. -| | ... -| | ... | *Arguments:* -| | ... | - bid_TAP - Bridge name. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Tear down TAP functional test with Linux bridge \| ${bid_TAP} \| -| | ... -| | [Arguments] | ${bid_TAP} -| | ... -| | Tear down functional test -| | Linux Del Bridge | ${nodes['DUT1']} | ${bid_TAP} -| | Clean Up Namespaces | ${nodes['DUT1']} diff --git a/resources/libraries/robot/dhcp_client.robot b/resources/libraries/robot/dhcp_client.robot deleted file mode 100644 index 192ab2b729..0000000000 --- a/resources/libraries/robot/dhcp_client.robot +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright (c) 2016 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 | Collections -| Resource | resources/libraries/robot/default.robot -| Library | resources.libraries.python.Dhcp.DhcpClient -| Library | resources.libraries.python.TrafficScriptExecutor -| Documentation | DHCP Client specific keywords. - -*** Keywords *** -| Verify DHCP DISCOVER header -| | [Documentation] | Check if DHCP DISCOVER message contains all required -| | ... | fields. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - interface - TG interface where listen for DHCP DISCOVER message. -| | ... | Type: string -| | ... | - src_mac - DHCP client MAC address. Type: string -| | ... | - hostname - DHCP client hostname (Optional, Default="", if not -| | ... | specified, the hostname is not checked). Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Verify DHCP DISCOVER header \| ${nodes['TG']} \ -| | ... | \| eth2 \| 08:00:27:66:b8:57 \| -| | ... | \| Verify DHCP DISCOVER header \| ${nodes['TG']} \ -| | ... | \| eth2 \| 08:00:27:66:b8:57 \| client-hostname \| -| | ... -| | [Arguments] | ${tg_node} | ${interface} | ${src_mac} | ${hostname}=${EMPTY} -| | ${interface_name}= | Get interface name | ${tg_node} | ${interface} -| | ${args}= | Catenate | --rx_if | ${interface_name} | --rx_src_mac | ${src_mac} -| | ${args}= | Run Keyword If | "${hostname}" == "" | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --hostname | ${hostname} -| | Run Traffic Script On Node | dhcp/check_dhcp_discover.py -| | ... | ${tg_node} | ${args} - - -| Verify DHCP REQUEST after OFFER -| | [Documentation] | Check if DHCP REQUEST message contains all required -| | ... | fields. DHCP REQUEST should be send by a client after DHCP OFFER -| | ... | message sent by a server. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - tg_interface - TG interface where listen for DHCP DISCOVER, -| | ... | send DHCP OFFER and listen for DHCP REQUEST messages. Type: string -| | ... | - server_mac - DHCP server MAC address. Type: string -| | ... | - server_ip - DHCP server IP address. Type: string -| | ... | - client_mac - DHCP client MAC address. Type: string -| | ... | - client_ip - IP address that should be offered to client. -| | ... | Type: string -| | ... | - client_mask - IP netmask that should be offered to client. -| | ... | Type: string -| | ... | - hostname - DHCP client hostname (Optional, Default="", if not -| | ... | specified, the hostname is not checked). Type: string -| | ... | - offer_xid - Transaction ID (Optional, Default="", if not specified -| | ... | xid field in DHCP OFFER is same as in DHCP DISCOVER message). -| | ... | Type: integer -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | *Raises:* -| | ... | - DHCP REQUEST Rx timeout - if no DHCP REQUEST is received. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Verify DHCP REQUEST after OFFER \| ${nodes['TG']} \ -| | ... | \| eth2 \| 08:00:27:66:b8:57 \| 192.168.23.1 \ -| | ... | \| 08:00:27:46:2b:4c \| 192.168.23.10 \| 255.255.255.0 \| -| | ... -| | ... | \| Run Keyword And Expect Error \| DHCP REQUEST Rx timeout \ -| | ... | \| Verify DHCP REQUEST after OFFER \ -| | ... | \| ${nodes['TG']} \| eth2 \| 08:00:27:66:b8:57 \| 192.168.23.1 \ -| | ... | \| 08:00:27:46:2b:4c \| 192.168.23.10 \| 255.255.255.0 \ -| | ... | \| offer_xid=11113333 \| -| | ... -| | [Arguments] | ${tg_node} | ${tg_interface} | ${server_mac} | ${server_ip} -| | ... | ${client_mac} | ${client_ip} | ${client_mask} -| | ... | ${hostname}=${EMPTY} | ${offer_xid}=${EMPTY} -| | ${tg_interface_name}= | Get interface name | ${tg_node} | ${tg_interface} -| | ${args}= | Catenate | --rx_if | ${tg_interface_name} | --server_mac -| | ... | ${server_mac} | --server_ip | ${server_ip} | --client_mac -| | ... | ${client_mac} | --client_ip | ${client_ip} | --client_mask -| | ... | ${client_mask} -| | ${args}= | Run Keyword If | "${hostname}" == "" | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --hostname | ${hostname} -| | ${args}= | Run Keyword If | "${offer_xid}" == "" | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --offer_xid | ${offer_xid} -| | Run Traffic Script On Node | dhcp/check_dhcp_request.py -| | ... | ${tg_node} | ${args} - - -| Configure IP on client via DHCP -| | [Documentation] | Run script that sends IP configuration to the DHCP client. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - tg_interface - TG interface where listen for DHCP DISCOVER, -| | ... | send DHCP OFFER and DHCP ACK after DHCP REQUEST messages. -| | ... | Type: string -| | ... | - server_mac - DHCP server MAC address. Type: string -| | ... | - server_ip - DHCP server IP address. Type: string -| | ... | - client_ip - IP address that is offered to client. Type: string -| | ... | - client_mask - IP netmask that is offered to client. Type: string -| | ... | - lease_time - IP lease time in seconds. Type: integer -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure IP on client via DHCP \| ${nodes['TG']} \ -| | ... | \| eth2 \| 08:00:27:66:b8:57 \| 192.168.23.1 \ -| | ... | \| 192.168.23.10 \| 255.255.255.0 \| 86400 \| -| | ... -| | [Arguments] | ${tg_node} | ${tg_interface} -| | ... | ${server_mac} | ${server_ip} | ${client_ip} | ${client_mask} -| | ... | ${lease_time} -| | ${tg_interface_name}= | Get interface name | ${tg_node} | ${tg_interface} -| | ${args}= | Catenate | --rx_if | ${tg_interface_name} -| | ... | --server_mac | ${server_mac} | --server_ip | ${server_ip} -| | ... | --client_ip | ${client_ip} | --client_mask | ${client_mask} -| | ... | --lease_time | ${lease_time} -| | Run Traffic Script On Node | dhcp/check_dhcp_request_ack.py -| | ... | ${tg_node} | ${args} diff --git a/resources/libraries/robot/dhcp_proxy.robot b/resources/libraries/robot/dhcp_proxy.robot deleted file mode 100644 index e2b16e5149..0000000000 --- a/resources/libraries/robot/dhcp_proxy.robot +++ /dev/null @@ -1,159 +0,0 @@ -# Copyright (c) 2016 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 | Collections -| Resource | resources/libraries/robot/default.robot -| Library | resources.libraries.python.Dhcp.DhcpProxy -| Library | resources.libraries.python.TrafficScriptExecutor -| Documentation | DHCP Proxy specific keywords. - -*** Keywords *** -| Send DHCP messages and check answer -| | [Documentation] | Send and receive DHCP messages between client -| | ... | and server through DHCP proxy. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - tg_interface1 - TG interface. Type: string -| | ... | - tg_interface2 - TG interface. Type: string -| | ... | - server_ip - DHCP server IP address. Type: string -| | ... | - server_mac - DHCP server MAC address. Type: string -| | ... | - client_ip - Client IP address. Type: string -| | ... | - client_mac - Client MAC address. Type: string -| | ... | - proxy_ip - DHCP proxy IP address. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send DHCP messages and check answer \| ${nodes['TG']} \ -| | ... | \| eth3 \| eth4 \| 192.168.0.100 \| 08:00:27:cc:4f:54 \ -| | ... | \| 172.16.0.2 \| 08:00:27:64:18:d2 \| 172.16.0.1 \| -| | ... -| | [Arguments] | ${tg_node} | ${tg_interface1} | ${tg_interface2} -| | ... | ${server_ip} | ${server_mac} | ${client_ip} | ${client_mac} -| | ... | ${proxy_ip} | -| | ${tg_interface_name1}= | Get interface name | ${tg_node} | ${tg_interface1} -| | ${tg_interface_name2}= | Get interface name | ${tg_node} | ${tg_interface2} -| | ${args}= | Catenate | --tx_if | ${tg_interface_name1} -| | ... | --rx_if | ${tg_interface_name2} -| | ... | --server_ip | ${server_ip} -| | ... | --server_mac | ${server_mac} -| | ... | --client_ip | ${client_ip} -| | ... | --client_mac | ${client_mac} -| | ... | --proxy_ip | ${proxy_ip} -| | Run Traffic Script On Node | dhcp/send_and_check_proxy_messages.py -| | ... | ${tg_node} | ${args} - -| Send DHCP DISCOVER and check answer -| | [Documentation] | Send and receive DHCP DISCOVER. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - tg_interface1 - TG interface. Type: string -| | ... | - tg_interface2 - TG interface. Type: string -| | ... | - tx_src_ip - Source address of DHCP DISCOVER packet. Type: string -| | ... | - tx_dst_ip - Destination address of DHCP DISCOVER packet. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send DHCP DISCOVER and check answer \| ${nodes['TG']} \ -| | ... | \| eth3 \| eth4 \| 0.0.0.0 \| 255.255.255.255 \| -| | ... -| | [Arguments] | ${tg_node} | ${tg_interface1} | ${tg_interface2} -| | ... | ${tx_src_ip} | ${tx_dst_ip} | -| | ${tg_interface_name1}= | Get interface name | ${tg_node} | ${tg_interface1} -| | ${tg_interface_name2}= | Get interface name | ${tg_node} | ${tg_interface2} -| | ${args}= | Catenate | --tx_if | ${tg_interface_name1} -| | ... | --rx_if | ${tg_interface_name2} -| | ... | --tx_src_ip | ${tx_src_ip} -| | ... | --tx_dst_ip | ${tx_dst_ip} -| | Run Traffic Script On Node | dhcp/send_and_check_proxy_discover.py -| | ... | ${tg_node} | ${args} - -| DHCP DISCOVER should fail -| | [Documentation] | Send and receive DHCP DISCOVER should fail. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - tg_interface1 - TG interface. Type: string -| | ... | - tg_interface2 - TG interface. Type: string -| | ... | - tx_src_ip - Source address of DHCP DISCOVER packet. Type: string -| | ... | - tx_dst_ip - Destination address of DHCP DISCOVER packet. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| DHCP DISCOVER should fail \| ${nodes['TG']} \ -| | ... | \| eth3 \| eth4 \| 0.0.0.0 \| 255.255.255.1 \| -| | ... -| | [Arguments] | ${tg_node} | ${tg_interface1} | ${tg_interface2} -| | ... | ${tx_src_ip} | ${tx_dst_ip} | -| | ${tg_interface_name1}= | Get interface name | ${tg_node} | ${tg_interface1} -| | ${tg_interface_name2}= | Get interface name | ${tg_node} | ${tg_interface2} -| | ${args}= | Catenate | --tx_if | ${tg_interface_name1} -| | ... | --rx_if | ${tg_interface_name2} -| | ... | --tx_src_ip | ${tx_src_ip} -| | ... | --tx_dst_ip | ${tx_dst_ip} -| | Run Keyword And Expect Error | DHCP DISCOVER Rx timeout -| | ... | Run Traffic Script On Node | dhcp/send_and_check_proxy_discover.py -| | ... | ${tg_node} | ${args} - -| Send DHCPv6 Messages -| | [Documentation] | Send and receive DHCPv6 messages between client -| | ... | and server through DHCPv6 proxy. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - tg_interface1 - TG interface. Type: string -| | ... | - tg_interface2 - TG interface. Type: string -| | ... | - proxy_ip - DHCPv6 proxy IP address. Type: string -| | ... | - proxy_mac - Proxy MAC address. Type: string -| | ... | - server_ip - DHCPv6 server IP address. Type: string -| | ... | - server_mac - Server MAC address. Type: string -| | ... | - client_mac - Client MAC address. Type: string -| | ... | - proxy_to_server_mac - MAC address of proxy interface -| | ... | connected to server. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send DHCPv6 Messages \| ${nodes['TG']} \ -| | ... | \| eth3 \| eth4 \| 3ffe:62::1 \| 08:00:27:54:59:f9 \ -| | ... | \| 3ffe:63::2 \| 08:00:27:cc:4f:54 \| -| | ... | \| 08:00:27:64:18:d2 \| 08:00:27:c9:6a:d5 \| -| | ... -| | [Arguments] | ${tg_node} | ${tg_interface1} | ${tg_interface2} | ${proxy_ip} -| | ... | ${proxy_mac} | ${server_ip} | ${server_mac} | ${client_mac} -| | ... | ${proxy_to_server_mac} -| | ${tg_interface_name1}= | Get interface name | ${tg_node} | ${tg_interface1} -| | ${tg_interface_name2}= | Get interface name | ${tg_node} | ${tg_interface2} -| | ${args}= | Catenate | --tx_if | ${tg_interface_name1} -| | ... | --rx_if | ${tg_interface_name2} -| | ... | --proxy_ip | ${proxy_ip} -| | ... | --proxy_mac | ${proxy_mac} -| | ... | --server_ip | ${server_ip} -| | ... | --server_mac | ${server_mac} -| | ... | --client_mac | ${client_mac} -| | ... | --proxy_to_server_mac | ${proxy_to_server_mac} -| | Run Traffic Script On Node | dhcp/send_dhcp_v6_messages.py -| | ... | ${tg_node} | ${args} diff --git a/resources/libraries/robot/double_qemu_setup.robot b/resources/libraries/robot/double_qemu_setup.robot deleted file mode 100644 index 377e222804..0000000000 --- a/resources/libraries/robot/double_qemu_setup.robot +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright (c) 2016 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.IPUtil - -*** Keywords *** -| Configure QEMU vhost and run it -| | [Documentation] | Setup Qemu with 4 vhost-user interfaces and 4 namespaces. -| | ... | Each call will be different object instance. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - Node where to setup qemu. Type: dict -| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string -| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string -| | ... | - sock3 - Socket path for third Vhost-User interface. Type: string -| | ... | - sock4 - Socket path for forth Vhost-User interface. Type: string -| | ... | - ip1 - IP address for namespace 1. Type: string -| | ... | - ip2 - IP address for namespace 2. Type: string -| | ... | - ip3 - IP address for namespace 3. Type: string -| | ... | - ip4 - IP address for namespace 4. Type: string -| | ... | - prefix_length - IP prefix length. Type: int -| | ... | - qemu_name - Qemu instance name by which the object will be accessed. -| | ... | Type: string -| | ... | - mac_ID - MAC address ID used to differentiate qemu instances and -| | ... | namespaces assigned to them. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Setup QEMU Vhost And Run\| {nodes['DUT1']} \| /tmp/sock1 \ -| | ... | \| /tmp/sock2 \| /tmp/sock3 \| /tmp/sock4 \| 16.0.0.1 \| 16.0.0.2 \ -| | ... | \| 16.0.0.3 \| 16.0.0.4 \| 24 \| qemu_instance_1 \| 06 \| -| | ... -| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${sock3} | ${sock4} -| | ... | ${ip1} | ${ip2} | ${ip3} | ${ip4} | ${prefix_length} -| | ... | ${qemu_name} | ${mac_ID} -| | Import Library | resources.libraries.python.QemuUtils \ -| | ... | WITH NAME | ${qemu_name} -| | ${qemu_add_vhost}= | Replace Variables | ${qemu_name}.Qemu Add Vhost User If -| | ${qemu_set_node}= | Replace Variables | ${qemu_name}.Qemu Set Node -| | ${qemu_start}= | Replace Variables | ${qemu_name}.Qemu Start -| | Run keyword | ${qemu_add_vhost} | ${sock1} | mac=52:54:00:00:${mac_ID}:01 -| | Run keyword | ${qemu_add_vhost} | ${sock2} | mac=52:54:00:00:${mac_ID}:02 -| | Run keyword | ${qemu_add_vhost} | ${sock3} | mac=52:54:00:00:${mac_ID}:03 -| | Run keyword | ${qemu_add_vhost} | ${sock4} | mac=52:54:00:00:${mac_ID}:04 -| | Run keyword | ${qemu_set_node} | ${dut_node} -| | ${vm}= | Run keyword | ${qemu_start} -| | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1} -| | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2} -| | ${vhost3}= | Get Vhost User If Name By Sock | ${vm} | ${sock3} -| | ${vhost4}= | Get Vhost User If Name By Sock | ${vm} | ${sock4} -| | Set Interface State | ${vm} | ${vhost1} | up | if_type=name -| | Set Interface State | ${vm} | ${vhost2} | up | if_type=name -| | Set Interface State | ${vm} | ${vhost3} | up | if_type=name -| | Set Interface State | ${vm} | ${vhost4} | up | if_type=name -| | Setup Network Namespace -| | ... | ${vm} | nmspace1 | ${vhost1} | ${ip1} | ${prefix_length} -| | Setup Network Namespace -| | ... | ${vm} | nmspace2 | ${vhost2} | ${ip2} | ${prefix_length} -| | Setup Network Namespace -| | ... | ${vm} | nmspace3 | ${vhost3} | ${ip3} | ${prefix_length} -| | Setup Network Namespace -| | ... | ${vm} | nmspace4 | ${vhost4} | ${ip4} | ${prefix_length} -| | Set Test Variable | ${${qemu_name}} | ${vm} - -| Tear down QEMU -| | [Documentation] | Stop specific qemu instance -| | ... | running on ${dut_node}, ${vm} is VM node info dictionary -| | ... | returned by qemu_start or None. -| | ... | *Arguments:* -| | ... | - dut_node - Node where to clean qemu. Type: dict -| | ... | - vm - VM node info dictionary. Type: string -| | ... | - qemu_name - Qemu instance by name. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Tear down QEMU \| ${node['DUT1']} \| ${vm} \| qemu_node_1 \| -| | ... -| | [Arguments] | ${dut_node} | ${vm} | ${qemu_name} -| | ${set_node}= | Replace Variables | ${qemu_name}.Qemu Set Node -| | ${kill}= | Replace Variables | ${qemu_name}.Qemu Kill -| | ${clear_socks}= | Replace Variables | ${qemu_name}.Qemu Clear Socks -| | Run Keyword | ${set_node} | ${dut_node} -| | Run Keyword | ${kill} -| | Run Keyword | ${clear_socks} -| | Run Keyword If | ${vm} is not None | Disconnect | ${vm} diff --git a/resources/libraries/robot/dpdk/default.robot b/resources/libraries/robot/dpdk/default.robot new file mode 100644 index 0000000000..e6921c9b27 --- /dev/null +++ b/resources/libraries/robot/dpdk/default.robot @@ -0,0 +1,110 @@ +# Copyright (c) 2016 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 *** +| Variables | resources/libraries/python/topology.py +| Library | resources.libraries.python.topology.Topology +| Library | resources.libraries.python.CpuUtils +| Library | resources.libraries.python.DUTSetup +| Library | resources.libraries.python.TGSetup +| Library | resources.libraries.python.DPDK.L2fwdTest +| Library | resources.libraries.python.DPDK.L3fwdTest +| Library | Collections + +*** Keywords *** +| Start L2FWD '${m}' worker threads and '${n}' rxqueues with jumbo frames '${b}' +| | [Documentation] | Start the l2fwd with M worker threads without SMT +| | ... | and rxqueues N and B (yes or no) jumbo frames in all DUTs. +| | ... +| | ${m_int}= | Convert To Integer | ${m} +| | ${cpu_cnt}= | Evaluate | ${m_int}+1 +| | ${nb_cores}= | Convert to String | ${m} +| | ${rxqueues}= | Convert to String | ${n} +| | ${jumbo_frames}= | Convert to String | ${b} +| | ${dut1_numa}= | Get interfaces numa node | ${dut1} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${dut2_numa}= | Get interfaces numa node | ${dut2} +| | ... | ${dut2_if1} | ${dut2_if2} +| | ${dut1_cpus}= | Cpu Range Per Node Str | ${dut1} | ${dut1_numa} +| | ... | skip_cnt=${1} | cpu_cnt=${cpu_cnt} +| | ${dut2_cpus}= | Cpu Range Per Node Str | ${dut2} | ${dut2_numa} +| | ... | skip_cnt=${1} | cpu_cnt=${cpu_cnt} +| | Start the l2fwd test | ${dut1} | ${dut1_cpus} | ${nb_cores} | ${rxqueues} +| | ... | ${jumbo_frames} +| | Start the l2fwd test | ${dut2} | ${dut2_cpus} | ${nb_cores} | ${rxqueues} +| | ... | ${jumbo_frames} + +| Start L2FWD '${m}' worker threads using SMT and '${n}' rxqueues with jumbo frames '${b}' +| | [Documentation] | Start the l2fwd with M worker threads with SMT +| | ... | and rxqueues N and B (yes or no) jumbo frames in all DUTs. +| | ... +| | ${m_int}= | Convert To Integer | ${m} +| | ${cpu_cnt}= | Evaluate | ${m_int}+1 +| | ${nb_cores_int}= | Evaluate | ${m_int}*2 +| | ${nb_cores}= | Convert to String | ${nb_cores_int} +| | ${rxqueues}= | Convert to String | ${n} +| | ${jumbo_frames}= | Convert to String | ${b} +| | ${dut1_numa}= | Get interfaces numa node | ${dut1} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${dut2_numa}= | Get interfaces numa node | ${dut2} +| | ... | ${dut2_if1} | ${dut2_if2} +| | ${dut1_cpus}= | Cpu Range Per Node Str | ${dut1} | ${dut1_numa} +| | ... | skip_cnt=${1} | cpu_cnt=${cpu_cnt} | smt_used=${True} +| | ${dut2_cpus}= | Cpu Range Per Node Str | ${dut2} | ${dut2_numa} +| | ... | skip_cnt=${1} | cpu_cnt=${cpu_cnt} | smt_used=${True} +| | Start the l2fwd test | ${dut1} | ${dut1_cpus} | ${nb_cores} | ${rxqueues} +| | ... | ${jumbo_frames} +| | Start the l2fwd test | ${dut2} | ${dut2_cpus} | ${nb_cores} | ${rxqueues} +| | ... | ${jumbo_frames} + +| Start L3FWD '${m}' worker threads and '${n}' rxqueues with jumbo frames '${b}' +| | [Documentation] | Start the l3fwd with M worker threads without SMT +| | ... | and rxqueues N and B(yes or no) jumbo frames in all DUTs. +| | ${cpu_cnt}= | Convert To Integer | ${m} +| | ${nb_cores}= | Convert to String | ${m} +| | ${rxqueues}= | Convert to String | ${n} +| | ${jumbo_frames}= | Convert to String | ${b} +| | ${dut1_numa}= | Get interfaces numa node | ${dut1} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${dut2_numa}= | Get interfaces numa node | ${dut2} +| | ... | ${dut2_if1} | ${dut2_if2} +| | ${dut1_cpus}= | Cpu List Per Node Str | ${dut1} | ${dut1_numa} +| | ... | cpu_cnt=${cpu_cnt} +| | ${dut2_cpus}= | Cpu List Per Node Str | ${dut2} | ${dut2_numa} +| | ... | cpu_cnt=${cpu_cnt} +| | Start the l3fwd test | ${nodes} | ${dut1} | ${dut1_if1} | ${dut1_if2} +| | ... | ${nb_cores} | ${dut1_cpus} | ${rxqueues} | ${jumbo_frames} +| | Start the l3fwd test | ${nodes} | ${dut2} | ${dut2_if1} | ${dut2_if2} +| | ... | ${nb_cores} | ${dut2_cpus} | ${rxqueues} | ${jumbo_frames} + +| Start L3FWD '${m}' worker threads using SMT and '${n}' rxqueues with jumbo frames '${b}' +| | [Documentation] | Start the l3fwd with M worker threads with SMT +| | ... | and rxqueues N and B(yes or no) jumbo frames in all DUTs. +| | ${cpu_cnt}= | Convert To Integer | ${m} +| | ${nb_cores_int}= | Evaluate | ${cpu_cnt}*2 +| | ${nb_cores}= | Convert to String | ${nb_cores_int} +| | ${rxqueues}= | Convert to String | ${n} +| | ${jumbo_frames}= | Convert to String | ${b} +| | ${dut1_numa}= | Get interfaces numa node | ${dut1} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${dut2_numa}= | Get interfaces numa node | ${dut2} +| | ... | ${dut2_if1} | ${dut2_if2} +| | ${dut1_cpus}= | Cpu List Per Node Str | ${dut1} | ${dut1_numa} +| | ... | cpu_cnt=${cpu_cnt} | smt_used=${True} +| | ${dut2_cpus}= | Cpu List Per Node Str | ${dut2} | ${dut2_numa} +| | ... | cpu_cnt=${cpu_cnt} | smt_used=${True} +| | Start the l3fwd test | ${nodes} | ${dut1} | ${dut1_if1} | ${dut1_if2} +| | ... | ${nb_cores} | ${dut1_cpus} | ${rxqueues} | ${jumbo_frames} +| | Start the l3fwd test | ${nodes} | ${dut2} | ${dut2_if1} | ${dut2_if2} +| | ... | ${nb_cores} | ${dut2_cpus} | ${rxqueues} | ${jumbo_frames} + diff --git a/resources/libraries/robot/fds/default.robot b/resources/libraries/robot/fds/default.robot index 83657e9fb4..2808ec08db 100644 --- a/resources/libraries/robot/fds/default.robot +++ b/resources/libraries/robot/fds/default.robot @@ -12,8 +12,8 @@ # limitations under the License. *** Settings *** -| Resource | resources/libraries/robot/default.robot -| Resource | resources/libraries/robot/double_qemu_setup.robot +| Resource | resources/libraries/robot/shared/default.robot +| Resource | resources/libraries/robot/vm/double_qemu_setup.robot | Library | resources.libraries.python.VatHistory | Library | resources.libraries.python.Trace | ... diff --git a/resources/libraries/robot/features/dhcp_client.robot b/resources/libraries/robot/features/dhcp_client.robot new file mode 100644 index 0000000000..efc016741a --- /dev/null +++ b/resources/libraries/robot/features/dhcp_client.robot @@ -0,0 +1,141 @@ +# Copyright (c) 2016 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 | Collections +| Resource | resources/libraries/robot/shared/default.robot +| Library | resources.libraries.python.Dhcp.DhcpClient +| Library | resources.libraries.python.TrafficScriptExecutor +| Documentation | DHCP Client specific keywords. + +*** Keywords *** +| Verify DHCP DISCOVER header +| | [Documentation] | Check if DHCP DISCOVER message contains all required +| | ... | fields. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - interface - TG interface where listen for DHCP DISCOVER message. +| | ... | Type: string +| | ... | - src_mac - DHCP client MAC address. Type: string +| | ... | - hostname - DHCP client hostname (Optional, Default="", if not +| | ... | specified, the hostname is not checked). Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Verify DHCP DISCOVER header \| ${nodes['TG']} \ +| | ... | \| eth2 \| 08:00:27:66:b8:57 \| +| | ... | \| Verify DHCP DISCOVER header \| ${nodes['TG']} \ +| | ... | \| eth2 \| 08:00:27:66:b8:57 \| client-hostname \| +| | ... +| | [Arguments] | ${tg_node} | ${interface} | ${src_mac} | ${hostname}=${EMPTY} +| | ${interface_name}= | Get interface name | ${tg_node} | ${interface} +| | ${args}= | Catenate | --rx_if | ${interface_name} | --rx_src_mac | ${src_mac} +| | ${args}= | Run Keyword If | "${hostname}" == "" | Set Variable | ${args} +| | ... | ELSE | Catenate | ${args} | --hostname | ${hostname} +| | Run Traffic Script On Node | dhcp/check_dhcp_discover.py +| | ... | ${tg_node} | ${args} + + +| Verify DHCP REQUEST after OFFER +| | [Documentation] | Check if DHCP REQUEST message contains all required +| | ... | fields. DHCP REQUEST should be send by a client after DHCP OFFER +| | ... | message sent by a server. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - tg_interface - TG interface where listen for DHCP DISCOVER, +| | ... | send DHCP OFFER and listen for DHCP REQUEST messages. Type: string +| | ... | - server_mac - DHCP server MAC address. Type: string +| | ... | - server_ip - DHCP server IP address. Type: string +| | ... | - client_mac - DHCP client MAC address. Type: string +| | ... | - client_ip - IP address that should be offered to client. +| | ... | Type: string +| | ... | - client_mask - IP netmask that should be offered to client. +| | ... | Type: string +| | ... | - hostname - DHCP client hostname (Optional, Default="", if not +| | ... | specified, the hostname is not checked). Type: string +| | ... | - offer_xid - Transaction ID (Optional, Default="", if not specified +| | ... | xid field in DHCP OFFER is same as in DHCP DISCOVER message). +| | ... | Type: integer +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | *Raises:* +| | ... | - DHCP REQUEST Rx timeout - if no DHCP REQUEST is received. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Verify DHCP REQUEST after OFFER \| ${nodes['TG']} \ +| | ... | \| eth2 \| 08:00:27:66:b8:57 \| 192.168.23.1 \ +| | ... | \| 08:00:27:46:2b:4c \| 192.168.23.10 \| 255.255.255.0 \| +| | ... +| | ... | \| Run Keyword And Expect Error \| DHCP REQUEST Rx timeout \ +| | ... | \| Verify DHCP REQUEST after OFFER \ +| | ... | \| ${nodes['TG']} \| eth2 \| 08:00:27:66:b8:57 \| 192.168.23.1 \ +| | ... | \| 08:00:27:46:2b:4c \| 192.168.23.10 \| 255.255.255.0 \ +| | ... | \| offer_xid=11113333 \| +| | ... +| | [Arguments] | ${tg_node} | ${tg_interface} | ${server_mac} | ${server_ip} +| | ... | ${client_mac} | ${client_ip} | ${client_mask} +| | ... | ${hostname}=${EMPTY} | ${offer_xid}=${EMPTY} +| | ${tg_interface_name}= | Get interface name | ${tg_node} | ${tg_interface} +| | ${args}= | Catenate | --rx_if | ${tg_interface_name} | --server_mac +| | ... | ${server_mac} | --server_ip | ${server_ip} | --client_mac +| | ... | ${client_mac} | --client_ip | ${client_ip} | --client_mask +| | ... | ${client_mask} +| | ${args}= | Run Keyword If | "${hostname}" == "" | Set Variable | ${args} +| | ... | ELSE | Catenate | ${args} | --hostname | ${hostname} +| | ${args}= | Run Keyword If | "${offer_xid}" == "" | Set Variable | ${args} +| | ... | ELSE | Catenate | ${args} | --offer_xid | ${offer_xid} +| | Run Traffic Script On Node | dhcp/check_dhcp_request.py +| | ... | ${tg_node} | ${args} + + +| Configure IP on client via DHCP +| | [Documentation] | Run script that sends IP configuration to the DHCP client. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - tg_interface - TG interface where listen for DHCP DISCOVER, +| | ... | send DHCP OFFER and DHCP ACK after DHCP REQUEST messages. +| | ... | Type: string +| | ... | - server_mac - DHCP server MAC address. Type: string +| | ... | - server_ip - DHCP server IP address. Type: string +| | ... | - client_ip - IP address that is offered to client. Type: string +| | ... | - client_mask - IP netmask that is offered to client. Type: string +| | ... | - lease_time - IP lease time in seconds. Type: integer +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure IP on client via DHCP \| ${nodes['TG']} \ +| | ... | \| eth2 \| 08:00:27:66:b8:57 \| 192.168.23.1 \ +| | ... | \| 192.168.23.10 \| 255.255.255.0 \| 86400 \| +| | ... +| | [Arguments] | ${tg_node} | ${tg_interface} +| | ... | ${server_mac} | ${server_ip} | ${client_ip} | ${client_mask} +| | ... | ${lease_time} +| | ${tg_interface_name}= | Get interface name | ${tg_node} | ${tg_interface} +| | ${args}= | Catenate | --rx_if | ${tg_interface_name} +| | ... | --server_mac | ${server_mac} | --server_ip | ${server_ip} +| | ... | --client_ip | ${client_ip} | --client_mask | ${client_mask} +| | ... | --lease_time | ${lease_time} +| | Run Traffic Script On Node | dhcp/check_dhcp_request_ack.py +| | ... | ${tg_node} | ${args} diff --git a/resources/libraries/robot/features/dhcp_proxy.robot b/resources/libraries/robot/features/dhcp_proxy.robot new file mode 100644 index 0000000000..e6ea69d5d0 --- /dev/null +++ b/resources/libraries/robot/features/dhcp_proxy.robot @@ -0,0 +1,159 @@ +# Copyright (c) 2016 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 | Collections +| Resource | resources/libraries/robot/shared/default.robot +| Library | resources.libraries.python.Dhcp.DhcpProxy +| Library | resources.libraries.python.TrafficScriptExecutor +| Documentation | DHCP Proxy specific keywords. + +*** Keywords *** +| Send DHCP messages and check answer +| | [Documentation] | Send and receive DHCP messages between client +| | ... | and server through DHCP proxy. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - tg_interface1 - TG interface. Type: string +| | ... | - tg_interface2 - TG interface. Type: string +| | ... | - server_ip - DHCP server IP address. Type: string +| | ... | - server_mac - DHCP server MAC address. Type: string +| | ... | - client_ip - Client IP address. Type: string +| | ... | - client_mac - Client MAC address. Type: string +| | ... | - proxy_ip - DHCP proxy IP address. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send DHCP messages and check answer \| ${nodes['TG']} \ +| | ... | \| eth3 \| eth4 \| 192.168.0.100 \| 08:00:27:cc:4f:54 \ +| | ... | \| 172.16.0.2 \| 08:00:27:64:18:d2 \| 172.16.0.1 \| +| | ... +| | [Arguments] | ${tg_node} | ${tg_interface1} | ${tg_interface2} +| | ... | ${server_ip} | ${server_mac} | ${client_ip} | ${client_mac} +| | ... | ${proxy_ip} | +| | ${tg_interface_name1}= | Get interface name | ${tg_node} | ${tg_interface1} +| | ${tg_interface_name2}= | Get interface name | ${tg_node} | ${tg_interface2} +| | ${args}= | Catenate | --tx_if | ${tg_interface_name1} +| | ... | --rx_if | ${tg_interface_name2} +| | ... | --server_ip | ${server_ip} +| | ... | --server_mac | ${server_mac} +| | ... | --client_ip | ${client_ip} +| | ... | --client_mac | ${client_mac} +| | ... | --proxy_ip | ${proxy_ip} +| | Run Traffic Script On Node | dhcp/send_and_check_proxy_messages.py +| | ... | ${tg_node} | ${args} + +| Send DHCP DISCOVER and check answer +| | [Documentation] | Send and receive DHCP DISCOVER. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - tg_interface1 - TG interface. Type: string +| | ... | - tg_interface2 - TG interface. Type: string +| | ... | - tx_src_ip - Source address of DHCP DISCOVER packet. Type: string +| | ... | - tx_dst_ip - Destination address of DHCP DISCOVER packet. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send DHCP DISCOVER and check answer \| ${nodes['TG']} \ +| | ... | \| eth3 \| eth4 \| 0.0.0.0 \| 255.255.255.255 \| +| | ... +| | [Arguments] | ${tg_node} | ${tg_interface1} | ${tg_interface2} +| | ... | ${tx_src_ip} | ${tx_dst_ip} | +| | ${tg_interface_name1}= | Get interface name | ${tg_node} | ${tg_interface1} +| | ${tg_interface_name2}= | Get interface name | ${tg_node} | ${tg_interface2} +| | ${args}= | Catenate | --tx_if | ${tg_interface_name1} +| | ... | --rx_if | ${tg_interface_name2} +| | ... | --tx_src_ip | ${tx_src_ip} +| | ... | --tx_dst_ip | ${tx_dst_ip} +| | Run Traffic Script On Node | dhcp/send_and_check_proxy_discover.py +| | ... | ${tg_node} | ${args} + +| DHCP DISCOVER should fail +| | [Documentation] | Send and receive DHCP DISCOVER should fail. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - tg_interface1 - TG interface. Type: string +| | ... | - tg_interface2 - TG interface. Type: string +| | ... | - tx_src_ip - Source address of DHCP DISCOVER packet. Type: string +| | ... | - tx_dst_ip - Destination address of DHCP DISCOVER packet. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| DHCP DISCOVER should fail \| ${nodes['TG']} \ +| | ... | \| eth3 \| eth4 \| 0.0.0.0 \| 255.255.255.1 \| +| | ... +| | [Arguments] | ${tg_node} | ${tg_interface1} | ${tg_interface2} +| | ... | ${tx_src_ip} | ${tx_dst_ip} | +| | ${tg_interface_name1}= | Get interface name | ${tg_node} | ${tg_interface1} +| | ${tg_interface_name2}= | Get interface name | ${tg_node} | ${tg_interface2} +| | ${args}= | Catenate | --tx_if | ${tg_interface_name1} +| | ... | --rx_if | ${tg_interface_name2} +| | ... | --tx_src_ip | ${tx_src_ip} +| | ... | --tx_dst_ip | ${tx_dst_ip} +| | Run Keyword And Expect Error | DHCP DISCOVER Rx timeout +| | ... | Run Traffic Script On Node | dhcp/send_and_check_proxy_discover.py +| | ... | ${tg_node} | ${args} + +| Send DHCPv6 Messages +| | [Documentation] | Send and receive DHCPv6 messages between client +| | ... | and server through DHCPv6 proxy. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - tg_interface1 - TG interface. Type: string +| | ... | - tg_interface2 - TG interface. Type: string +| | ... | - proxy_ip - DHCPv6 proxy IP address. Type: string +| | ... | - proxy_mac - Proxy MAC address. Type: string +| | ... | - server_ip - DHCPv6 server IP address. Type: string +| | ... | - server_mac - Server MAC address. Type: string +| | ... | - client_mac - Client MAC address. Type: string +| | ... | - proxy_to_server_mac - MAC address of proxy interface +| | ... | connected to server. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send DHCPv6 Messages \| ${nodes['TG']} \ +| | ... | \| eth3 \| eth4 \| 3ffe:62::1 \| 08:00:27:54:59:f9 \ +| | ... | \| 3ffe:63::2 \| 08:00:27:cc:4f:54 \| +| | ... | \| 08:00:27:64:18:d2 \| 08:00:27:c9:6a:d5 \| +| | ... +| | [Arguments] | ${tg_node} | ${tg_interface1} | ${tg_interface2} | ${proxy_ip} +| | ... | ${proxy_mac} | ${server_ip} | ${server_mac} | ${client_mac} +| | ... | ${proxy_to_server_mac} +| | ${tg_interface_name1}= | Get interface name | ${tg_node} | ${tg_interface1} +| | ${tg_interface_name2}= | Get interface name | ${tg_node} | ${tg_interface2} +| | ${args}= | Catenate | --tx_if | ${tg_interface_name1} +| | ... | --rx_if | ${tg_interface_name2} +| | ... | --proxy_ip | ${proxy_ip} +| | ... | --proxy_mac | ${proxy_mac} +| | ... | --server_ip | ${server_ip} +| | ... | --server_mac | ${server_mac} +| | ... | --client_mac | ${client_mac} +| | ... | --proxy_to_server_mac | ${proxy_to_server_mac} +| | Run Traffic Script On Node | dhcp/send_dhcp_v6_messages.py +| | ... | ${tg_node} | ${args} diff --git a/resources/libraries/robot/features/policer.robot b/resources/libraries/robot/features/policer.robot new file mode 100644 index 0000000000..321488b8c5 --- /dev/null +++ b/resources/libraries/robot/features/policer.robot @@ -0,0 +1,99 @@ +# Copyright (c) 2016 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 +| Resource | resources/libraries/robot/shared/testing_path.robot +| Library | resources.libraries.python.Policer +| Library | resources.libraries.python.InterfaceUtil +| Library | resources.libraries.python.IPv4Util +| Library | resources.libraries.python.TrafficScriptExecutor +| Library | resources.libraries.python.IPv6Util +| Library | resources.libraries.python.IPv6Setup +| Library | resources.libraries.python.IPv4Setup.Dut | ${nodes['DUT1']} +| ... | WITH NAME | dut1_v4 +| Documentation | *Policer keywords* + +*** Keywords *** +| Configure topology for IPv4 policer test +| | [Documentation] | Setup topology for IPv4 policer testing. +| | ... +| | ... | _NOTE:_ This KW sets following test case variables: +| | ... | - dut_to_tg_if1_ip - DUT first interface IP address. Type: string +| | ... | - dut_to_tg_if2_ip - DUT second interface IP address. Type: string +| | ... | - tg_to_dut_if1_ip - TG first interface IP address. Type: string +| | ... | - tg_to_dut_if2_ip - TG second interface IP address. Type: string +| | Configure path in 2-node circular topology | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['TG']} +| | Set interfaces in 2-node circular topology up +| | Set Interface Address | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${dut_to_tg_if1_ip4} | ${ip4_plen} +| | Set Interface Address | ${dut_node} | ${dut_to_tg_if2} +| | ... | ${dut_to_tg_if2_ip4} | ${ip4_plen} +| | dut1_v4.Set ARP | ${dut_to_tg_if2} | ${tg_to_dut_if2_ip4} +| | ... | ${tg_to_dut_if2_mac} +| | Set Test Variable | ${dut_to_tg_if1_ip} | ${dut_to_tg_if1_ip4} +| | Set Test Variable | ${dut_to_tg_if2_ip} | ${dut_to_tg_if2_ip4} +| | Set Test Variable | ${tg_to_dut_if1_ip} | ${tg_to_dut_if1_ip4} +| | Set Test Variable | ${tg_to_dut_if2_ip} | ${tg_to_dut_if2_ip4} + +| Configure topology for IPv6 policer test +| | [Documentation] | Setup topology for IPv6 policer testing. +| | ... +| | ... | _NOTE:_ This KW sets following test case variables: +| | ... | - dut_to_tg_if1_ip - DUT first interface IP address. Type: string +| | ... | - dut_to_tg_if2_ip - DUT second interface IP address. Type: string +| | ... | - tg_to_dut_if1_ip - TG first interface IP address. Type: string +| | ... | - tg_to_dut_if2_ip - TG second interface IP address. Type: string +| | Configure path in 2-node circular topology | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['TG']} +| | Set interfaces in 2-node circular topology up +| | Vpp Set If IPv6 Addr | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${dut_to_tg_if1_ip6} | ${ip6_plen} +| | Vpp Set If IPv6 Addr | ${dut_node} | ${dut_to_tg_if2} +| | ... | ${dut_to_tg_if2_ip6} | ${ip6_plen} +| | Add IP Neighbor | ${dut_node} | ${dut_to_tg_if2} | ${tg_to_dut_if2_ip6} +| | ... | ${tg_to_dut_if2_mac} +| | Vpp All RA Suppress Link Layer | ${nodes} +| | Set Test Variable | ${dut_to_tg_if1_ip} | ${dut_to_tg_if1_ip6} +| | Set Test Variable | ${dut_to_tg_if2_ip} | ${dut_to_tg_if2_ip6} +| | Set Test Variable | ${tg_to_dut_if1_ip} | ${tg_to_dut_if1_ip6} +| | Set Test Variable | ${tg_to_dut_if2_ip} | ${tg_to_dut_if2_ip6} + +| Send packet and verify marking +| | [Documentation] | Send packet and verify DSCP of the received packet. +| | ... +| | ... | *Arguments:* +| | ... | - node - TG node. Type: dictionary +| | ... | - tx_if - TG transmit interface. Type: string +| | ... | - rx_if - TG receive interface. Type: string +| | ... | - src_mac - Packet source MAC. Type: string +| | ... | - dst_mac - Packet destination MAC. Type: string +| | ... | - src_ip - Packet source IP address. Type: string +| | ... | - dst_ip - Packet destination IP address. Type: string +| | ... | - dscp - DSCP value to verify. Type: enum +| | ... +| | ... | *Example:* +| | ... | \| ${dscp}= \| DSCP AF22 \| +| | ... | \| Send packet and verify marking \| ${nodes['TG']} \| eth1 \| eth2 \ +| | ... | \| 08:00:27:87:4d:f7 \| 52:54:00:d4:d8:22 \| 192.168.122.2 \ +| | ... | \| 192.168.122.1 \| ${dscp} \| +| | [Arguments] | ${node} | ${tx_if} | ${rx_if} | ${src_mac} | ${dst_mac} +| | ... | ${src_ip} | ${dst_ip} | ${dscp} +| | ${tx_if_name}= | Get Interface Name | ${node} | ${tx_if} +| | ${rx_if_name}= | Get Interface Name | ${node} | ${rx_if} +| | ${args}= | Traffic Script Gen Arg | ${rx_if_name} | ${tx_if_name} +| | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} +| | ${dscp_num}= | Get DSCP Num Value | ${dscp} +| | ${args}= | Set Variable | ${args} --dscp ${dscp_num} +| | Run Traffic Script On Node | policer.py | ${node} | ${args} diff --git a/resources/libraries/robot/gre.robot b/resources/libraries/robot/gre.robot deleted file mode 100644 index c237e883a3..0000000000 --- a/resources/libraries/robot/gre.robot +++ /dev/null @@ -1,182 +0,0 @@ -# Copyright (c) 2016 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/interfaces.robot - -*** Keywords *** -| Create GRE tunnel interface and set it up -| | [Documentation] | Create GRE tunnel interface and set it up on defined VPP node and put \ -| | ... | the interface to UP state. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node where to create GRE tunnel. Type: dictionary -| | ... | - source_ip_address - GRE tunnel source IP address. Type: string -| | ... | - destination_ip_address - GRE tunnel destination IP address. -| | ... | Type: string -| | ... -| | ... | *Return:* -| | ... | - name - Name of created GRE tunnel interface. Type: string -| | ... | - index - SW interface index of created GRE tunnel interface. -| | ... | Type: integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| ${gre_name} \| ${gre_index}= \ -| | ... | \| Create GRE tunnel interface and set it up \| ${dut} \ -| | ... | \| 192.0.1.1 \| 192.0.1.2 \| -| | ... -| | [Arguments] | ${dut_node} | ${source_ip_address} | ${destination_ip_address} -| | ${name} | ${index}= | Create GRE tunnel interface -| | ... | ${dut_node} | ${source_ip_address} | ${destination_ip_address} -| | Set Interface State | ${dut_node} | ${index} | up -| | [Return] | ${name} | ${index} - - -| Send ICMPv4 and check received GRE header -| | [Documentation] | Send ICMPv4 packet and check if received packed contains \ -| | ... | correct GRE, IP, MAC headers. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - Node where to run traffic script. Type: dictionary -| | ... | - tx_if - Interface from where send ICPMv4 packet. Type: string -| | ... | - rx_if - Interface where to receive GRE packet. Type: string -| | ... | - tx_dst_mac - Destination MAC address of ICMP packet. Type: string -| | ... | - rx_dst_mac - Expected destination MAC address of GRE packet. -| | ... | Type: string -| | ... | - inner_src_ip - Source IP address of ICMP packet. Type: string -| | ... | - inner_dst_ip - Destination IP address of ICMP packet. -| | ... | Type: string -| | ... | - outer_src_ip - Source IP address of GRE packet. Type: string -| | ... | - outer_dst_ip - Destination IP address of GRE packet. -| | ... | Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send ICMPv4 and check received GRE header \ -| | ... | \| ${tg_node} \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \ -| | ... | \| ${tx_dst_mac} \| ${rx_dst_mac} \| ${net1_host_address} \ -| | ... | \| ${net2_host_address} \| ${dut1_ip_address} \| ${dut2_ip_address} \| -| | ... -| | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if} -| | ... | ${tx_dst_mac} | ${rx_dst_mac} -| | ... | ${inner_src_ip} | ${inner_dst_ip} -| | ... | ${outer_src_ip} | ${outer_dst_ip} -| | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if} -| | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if} -| | ${args}= | Catenate | --tx_if | ${tx_if_name} | --rx_if | ${rx_if_name} -| | ... | --tx_dst_mac | ${tx_dst_mac} | --rx_dst_mac | ${rx_dst_mac} -| | ... | --inner_src_ip | ${inner_src_ip} | --inner_dst_ip | ${inner_dst_ip} -| | ... | --outer_src_ip | ${outer_src_ip} | --outer_dst_ip | ${outer_dst_ip} -| | Run Traffic Script On Node -| | ... | send_icmp_check_gre_headers.py | ${tg_node} | ${args} - - -| Send GRE and check received ICMPv4 header -| | [Documentation] | Send IPv4 ICMPv4 packet encapsulated into GRE and \ -| | ... | check IP, MAC headers on received packed. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - Node where to run traffic script. Type: dictionary -| | ... | - tx_if - Interface from where send ICPMv4 packet. Type: string -| | ... | - rx_if - Interface where receive GRE packet. Type: string -| | ... | - tx_dst_mac - Destination MAC address of GRE packet. Type: string -| | ... | - rx_dst_mac - Expected destination MAC address of ICMP packet. -| | ... | Type: string -| | ... | - inner_src_ip - Source IP address of ICMP packet. Type: string -| | ... | - inner_dst_ip - Destination IP address of ICMP packet. -| | ... | Type: string -| | ... | - outer_src_ip - Source IP address of GRE packet. Type: string -| | ... | - outer_dst_ip - Destination IP address of GRE packet. -| | ... | Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send GRE and check received ICMPv4 header \| ${tg_node} \ -| | ... | \| ${tg_to_dut_if2} \| ${tg_to_dut_if1} \| ${tx_dst_mac} \ -| | ... | \| ${rx_dst_mac} \| ${net2_host_address} \| ${net1_host_address} \ -| | ... | \| ${dut2_ip_address} \| ${dut1_ip_address} \| -| | ... -| | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if} -| | ... | ${tx_dst_mac} | ${rx_dst_mac} -| | ... | ${inner_src_ip} | ${inner_dst_ip} -| | ... | ${outer_src_ip} | ${outer_dst_ip} -| | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if} -| | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if} -| | ${args}= | Catenate | --tx_if | ${tx_if_name} | --rx_if | ${rx_if_name} -| | ... | --tx_dst_mac | ${tx_dst_mac} | --rx_dst_mac | ${rx_dst_mac} -| | ... | --inner_src_ip | ${inner_src_ip} | --inner_dst_ip | ${inner_dst_ip} -| | ... | --outer_src_ip | ${outer_src_ip} | --outer_dst_ip | ${outer_dst_ip} -| | Run Traffic Script On Node -| | ... | send_gre_check_icmp_headers.py | ${tg_node} | ${args} - -| Send GRE and check received GRE header -| | [Documentation] | Send IPv4 UDP packet encapsulated into GRE and \ -| | ... | check if received packed contains correct MAC GRE, IP, UDP headers. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - Node where to run traffic script. Type: dictionary -| | ... | - tx_if - Interface from where send GRE packet. Type: string -| | ... | - rx_if - Interface where to receive GRE packet. Type: string -| | ... | - tx_dst_mac - Destination MAC address of transferred packet. -| | ... | Type: string -| | ... | - tx_src_mac - Source MAC address of transferred packet. Type: string -| | ... | - tx_outer_dst_ip - Destination IP address of GRE packet. Type: string -| | ... | - tx_outer_src_ip - Source IP address of GRE packet. Type: string -| | ... | - tx_inner_dst_ip - Destination IP address of UDP packet. Type: string -| | ... | - tx_inner_src_ip - Source IP address of UDP packet. Type: string -| | ... | - rx_dst_mac - Expected destination MAC address. Type: string -| | ... | - rx_src_mac - Expected source MAC address. Type: string -| | ... | - rx_outer_dst_ip - Expected destination IP address of received GRE -| | ... | packet. Type: string -| | ... | - rx_outer_src_ip - Expected source IP address of received GRE -| | ... | packet. Type: string -| | ... -| | ... | __Note:__ -| | ... | rx_inner_dst_ip and rx_inner_src_ip should be same as transferred -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Send GRE and check received GRE header \| ${tg_node} \ -| | ... | \| port3 \| port3 \| 08:00:27:f3:be:f0 \| 08:00:27:46:2b:4c \ -| | ... | \| 10.0.0.1 \| 10.0.0.2 \| 192.168.3.100 \| 192.168.2.100 \ -| | ... | \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \| 10.0.0.3 \| 10.0.0.1 \| -| | ... -| | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if} -| | ... | ${tx_dst_mac} | ${tx_src_mac} -| | ... | ${tx_outer_dst_ip} | ${tx_outer_src_ip} -| | ... | ${tx_inner_dst_ip} | ${tx_inner_src_ip} -| | ... | ${rx_dst_mac} | ${rx_src_mac} -| | ... | ${rx_outer_dst_ip} | ${rx_outer_src_ip} -| | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if} -| | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if} -| | ${args}= | Catenate | --tx_if | ${tx_if_name} | --rx_if | ${rx_if_name} -| | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_mac | ${tx_src_mac} -| | ... | --tx_outer_dst_ip | ${tx_outer_dst_ip} -| | ... | --tx_outer_src_ip | ${tx_outer_src_ip} -| | ... | --tx_inner_dst_ip | ${tx_inner_dst_ip} -| | ... | --tx_inner_src_ip | ${tx_inner_src_ip} -| | ... | --rx_dst_mac | ${rx_dst_mac} -| | ... | --rx_src_mac | ${rx_src_mac} -| | ... | --rx_outer_dst_ip | ${rx_outer_dst_ip} -| | ... | --rx_outer_src_ip | ${rx_outer_src_ip} -| | Run Traffic Script On Node -| | ... | send_gre_check_gre_headers.py | ${tg_node} | ${args} diff --git a/resources/libraries/robot/honeycomb/policer.robot b/resources/libraries/robot/honeycomb/policer.robot index 17191c5b37..87b97470ac 100644 --- a/resources/libraries/robot/honeycomb/policer.robot +++ b/resources/libraries/robot/honeycomb/policer.robot @@ -12,7 +12,7 @@ # limitations under the License. *** Settings *** -| Resource | resources/libraries/robot/traffic.robot +| Resource | resources/libraries/robot/shared/traffic.robot | Library | resources.libraries.python.honeycomb.Routing.RoutingKeywords | Variables | resources/test_data/honeycomb/policer_variables.py | Documentation | Keywords used to test Policer using Honeycomb. diff --git a/resources/libraries/robot/interfaces.robot b/resources/libraries/robot/interfaces.robot deleted file mode 100644 index c2b897d6a0..0000000000 --- a/resources/libraries/robot/interfaces.robot +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2016 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.NodePath -| Library | resources.libraries.python.VatExecutor - -*** Keywords *** -| VPP reports interfaces through VAT on '${node}' -| | Execute Script | dump_interfaces.vat | ${node} -| | Script Should Have Passed - -| Configure MTU on TG based on MTU on DUT -| | [Documentation] | Type of the tg_node must be TG and dut_node must be DUT -| | [Arguments] | ${tg_node} | ${dut_node} -| | Append Nodes | ${tg_node} | ${dut_node} -| | Compute Path -| | ${tg_port} | ${tg_node}= | First Interface -| | ${dut_port} | ${dut_node}= | Last Interface -| | # get physical layer MTU (max. size of Ethernet frame) -| | ${mtu}= | Get Interface MTU | ${dut_node} | ${dut_port} -| | # Ethernet MTU is physical layer MTU minus size of Ethernet header and FCS -| | ${eth_mtu}= | Evaluate | ${mtu} - 14 - 4 -| | Set Interface Ethernet MTU | ${tg_node} | ${tg_port} | ${eth_mtu} - diff --git a/resources/libraries/robot/ip/ip4.robot b/resources/libraries/robot/ip/ip4.robot new file mode 100644 index 0000000000..03964181b5 --- /dev/null +++ b/resources/libraries/robot/ip/ip4.robot @@ -0,0 +1,160 @@ +# Copyright (c) 2016 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 +| Resource | resources/libraries/robot/shared/counters.robot +| Library | resources.libraries.python.IPv4Util.IPv4Util +| Library | resources.libraries.python.IPv4Setup.IPv4Setup +| Library | resources.libraries.python.NodePath +| Library | resources.libraries.python.Routing +| Library | resources.libraries.python.TrafficScriptExecutor +| Library | resources.libraries.python.InterfaceUtil +| Variables | resources/libraries/python/IPv4NodeAddress.py | ${nodes} + +*** Keywords *** + +| Configure IPv4 addresses on all DUTs +| | [Documentation] | Setup IPv4 address on all DUTs in topology +| | [Arguments] | ${nodes} | ${nodes_addr} +| | ${interfaces}= | VPP nodes set ipv4 addresses | ${nodes} | ${nodes_addr} +| | :FOR | ${interface} | IN | @{interfaces} +| | | Set Interface State | @{interface} | up | if_type=name + +| Configure routes for IPv4 test +| | [Documentation] | Setup routing on all VPP nodes required for IPv4 tests +| | [Arguments] | ${nodes} | ${nodes_addr} +| | Append Nodes | ${nodes['DUT1']} | ${nodes['DUT2']} +| | Compute Path +| | ${tg}= | Set Variable | ${nodes['TG']} +| | ${dut1_if} | ${dut1}= | First Interface +| | ${dut2_if} | ${dut2}= | Last Interface +| | ${dut1_if_addr}= | Get IPv4 address of node "${dut1}" interface "${dut1_if}" from "${nodes_addr}" +| | ${dut2_if_addr}= | Get IPv4 address of node "${dut2}" interface "${dut2_if}" from "${nodes_addr}" +| | @{tg_dut1_links}= | Get active links connecting "${tg}" and "${dut1}" +| | @{tg_dut2_links}= | Get active links connecting "${tg}" and "${dut2}" +| | :FOR | ${link} | IN | @{tg_dut1_links} +| | | ${net}= | Get Link Address | ${link} | ${nodes_addr} +| | | ${prefix}= | Get Link Prefix | ${link} | ${nodes_addr} +| | | Vpp Route Add | ${dut2} | ${net} | ${prefix} | ${dut1_if_addr} | ${dut2_if} +| | :FOR | ${link} | IN | @{tg_dut2_links} +| | | ${net}= | Get Link Address | ${link} | ${nodes_addr} +| | | ${prefix}= | Get Link Prefix | ${link} | ${nodes_addr} +| | | Vpp Route Add | ${dut1} | ${net} | ${prefix} | ${dut2_if_addr} | ${dut1_if} + +| Configure DUT nodes for IPv4 testing +| | Configure IPv4 addresses on all DUTs | ${nodes} | ${nodes_ipv4_addr} +| | Setup ARP on all DUTs | ${nodes} | ${nodes_ipv4_addr} +| | Configure routes for IPv4 test | ${nodes} | ${nodes_ipv4_addr} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Route traffic from interface '${from_port}' on node '${from_node}' to interface '${to_port}' on node '${to_node}' '${hops}' hops away using IPv4 +| | ${src_ip}= | Get IPv4 address of node "${from_node}" interface "${from_port}" from "${nodes_ipv4_addr}" +| | ${dst_ip}= | Get IPv4 address of node "${to_node}" interface "${to_port}" from "${nodes_ipv4_addr}" +| | ${src_mac}= | Get interface mac | ${from_node} | ${from_port} +| | ${dst_mac}= | Get interface mac | ${to_node} | ${to_port} +| | ${is_dst_tg}= | Is TG node | ${to_node} +| | ${adj_node} | ${adj_int}= | Get adjacent node and interface | ${nodes} | ${from_node} | ${from_port} +| | ${from_port_name}= | Get interface name | ${from_node} | ${from_port} +| | ${to_port_name}= | Get interface name | ${to_node} | ${to_port} +| | ${adj_int_mac}= | Get interface MAC | ${adj_node} | ${adj_int} +| | ${args}= | Traffic Script Gen Arg | ${to_port_name} | ${from_port_name} | ${src_mac} +| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} +| | ${args}= | Catenate | ${args} | --hops ${hops} | --first_hop_mac ${adj_int_mac} +| | | ... | --is_dst_tg ${is_dst_tg} +| | Run Traffic Script On Node | ipv4_ping_ttl_check.py | ${from_node} | ${args} + +| Execute IPv4 ICMP echo sweep +| | [Documentation] | Type of the src_node must be TG and dst_node must be DUT +| | [Arguments] | ${src_node} | ${dst_node} | ${start_size} | ${end_size} | ${step} +| | Append Nodes | ${src_node} | ${dst_node} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Interface +| | ${src_ip}= | Get IPv4 address of node "${src_node}" interface "${src_port}" from "${nodes_ipv4_addr}" +| | ${dst_ip}= | Get IPv4 address of node "${dst_node}" interface "${dst_port}" from "${nodes_ipv4_addr}" +| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} +| | ${dst_mac}= | Get Interface Mac | ${dst_node} | ${dst_port} +| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} +| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} +| | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} +| | ${args}= | Set Variable +| | ... | ${args} --start_size ${start_size} --end_size ${end_size} --step ${step} +| | Run Traffic Script On Node | ipv4_sweep_ping.py | ${src_node} | ${args} +| | ... | timeout=${180} + +| Send ARP request and verify response +| | [Arguments] | ${tg_node} | ${vpp_node} +| | ${link_name}= | Get first active connecting link between node "${tg_node}" and "${vpp_node}" +| | ${src_if}= | Get interface by link name | ${tg_node} | ${link_name} +| | ${dst_if}= | Get interface by link name | ${vpp_node} | ${link_name} +| | ${src_ip}= | Get IPv4 address of node "${tg_node}" interface "${src_if}" from "${nodes_ipv4_addr}" +| | ${dst_ip}= | Get IPv4 address of node "${vpp_node}" interface "${dst_if}" from "${nodes_ipv4_addr}" +| | ${src_mac}= | Get node link mac | ${tg_node} | ${link_name} +| | ${dst_mac}= | Get node link mac | ${vpp_node} | ${link_name} +| | ${src_if_name}= | Get interface name | ${tg_node} | ${src_if} +| | ${args}= | Traffic Script Gen Arg | ${src_if_name} | ${src_if_name} | ${src_mac} +| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} +| | Run Traffic Script On Node | arp_request.py | ${tg_node} | ${args} + +| Configure IP addresses on interfaces +| | [Documentation] | Iterates through @{args} list and Set Interface Address +| | ... | for every (${dut_node}, ${interface}, ${address}, +| | ... | ${prefix}) tuple. +| | ... +| | ... | *Arguments:* +| | ... | - ${dut_node} - Node where IP address should be set to. +| | ... | Type: dictionary +| | ... | - ${interface} - Interface name. Type: string +| | ... | - ${address} - IP address. Type: string +| | ... | - ${prefix} - Prefix length. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure IP addresses on interfaces \ +| | ... | \| ${dut1_node} \| ${dut1_to_dut2} \| 192.168.1.1 \| 24 \| +| | ... | \| ... \| ${dut1_node} \| ${dut1_to_tg} \| 192.168.2.1 \| 24 \| +| | ... +| | [Arguments] | @{args} +| | :FOR | ${dut_node} | ${interface} | ${address} | ${prefix} | IN | @{args} +| | | Set Interface Address | ${dut_node} | ${interface} | ${address} +| | | ... | ${prefix} + +| Send ICMP echo request and verify answer +| | [Documentation] | Run traffic script that waits for ICMP reply and ignores +| | ... | all other packets. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - TG node where run traffic script. Type: dictionary +| | ... | - tg_interface - TG interface where send ICMP echo request. +| | ... | Type: string +| | ... | - dst_mac - Destination MAC address. Type: string +| | ... | - src_mac - Source MAC address. Type: string +| | ... | - dst_ip - Destination IP address. Type: string +| | ... | - src_ip - Source IP address. Type: string +| | ... | - timeout - Wait timeout in seconds (Default: 10). Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send ICMP echo request and verify answer \ +| | ... | \| ${nodes['TG']} \| eth2 \ +| | ... | \| 08:00:27:46:2b:4c \| 08:00:27:66:b8:57 \ +| | ... | \| 192.168.23.10 \| 192.168.23.1 \| 10 \| +| | ... +| | [Arguments] | ${tg_node} | ${tg_interface} +| | ... | ${dst_mac} | ${src_mac} | ${dst_ip} | ${src_ip} | ${timeout}=${10} +| | ${tg_interface_name}= | Get interface name | ${tg_node} | ${tg_interface} +| | ${args}= | Catenate | --rx_if | ${tg_interface_name} | --tx_if | ${tg_interface_name} +| | ... | --dst_mac | ${dst_mac} | --src_mac | ${src_mac} +| | ... | --dst_ip | ${dst_ip} | --src_ip | ${src_ip} | --timeout | ${timeout} +| | Run Traffic Script On Node | send_icmp_wait_for_reply.py +| | ... | ${tg_node} | ${args} diff --git a/resources/libraries/robot/ip/ip6.robot b/resources/libraries/robot/ip/ip6.robot new file mode 100644 index 0000000000..43b0b8c646 --- /dev/null +++ b/resources/libraries/robot/ip/ip6.robot @@ -0,0 +1,195 @@ +# Copyright (c) 2016 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. + +"""IPv6 keywords""" + +*** Settings *** +| Library | resources.libraries.python.IPv6Util +| Library | resources.libraries.python.IPv6Setup +| Library | resources.libraries.python.TrafficScriptExecutor +| Library | resources.libraries.python.NodePath +| Library | resources.libraries.python.Routing +| Library | resources.libraries.python.InterfaceUtil +| Library | resources.libraries.python.topology.Topology +| Resource | resources/libraries/robot/shared/default.robot +| Resource | resources/libraries/robot/shared/counters.robot +| Documentation | IPv6 keywords + +*** Keywords *** +| Send IPv6 icmp echo request to DUT1 ingress inteface and verify answer +| | [Documentation] | Type of the src_node must be TG and dst_node must be DUT +| | [Arguments] | ${tg_node} | ${dut_node} | ${nodes_addr} +| | Append Nodes | ${tg_node} | ${dut_node} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Interface +| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} +| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} +| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} +| | ${dst_mac}= | Get Interface Mac | ${dst_node} | ${dst_port} +| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} +| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} | ${src_mac} +| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} +| | Run Traffic Script On Node | icmpv6_echo.py | ${tg_node} | ${args} +| | Get interface statistics | ${dst_node} +| | ${ipv6_counter}= | Get interface ipv6 counter | ${dst_node} | ${dst_port} +| | Should Be Equal | ${ipv6_counter} | ${2} | #ICMPv6 neighbor advertisement + ICMPv6 echo request + +| Execute IPv6 ICMP echo sweep +| | [Documentation] | Type of the src_node must be TG and dst_node must be DUT +| | [Arguments] | ${src_node} | ${dst_node} | ${start_size} | ${end_size} +| | ... | ${step} | ${nodes_addr} +| | Append Nodes | ${src_node} | ${dst_node} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Interface +| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} +| | ... | ${nodes_addr} +| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} +| | ... | ${nodes_addr} +| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} +| | ${dst_mac}= | Get Interface Mac | ${dst_node} | ${dst_port} +| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} +| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} +| | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} +| | ${args}= | Set Variable +| | ... | ${args} --start_size ${start_size} --end_size ${end_size} --step ${step} +| | Run Traffic Script On Node | ipv6_sweep_ping.py | ${src_node} | ${args} +| | ... | timeout=${180} + +| Send IPv6 ICMP echo request to DUT1 egress interface and verify answer +| | [Documentation] | Send traffic from TG to first DUT egress interface +| | [Arguments] | ${tg_node} | ${first_dut} | ${second_dut} | ${nodes_addr} +| | Append Nodes | ${tg_node} | ${first_dut} | ${second_dut} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Egress Interface +| | ${hop_port} | ${hop_node}= | First Ingress Interface +| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} +| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} +| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} +| | ${dst_mac}= | Get Interface Mac | ${hop_node} | ${hop_port} +| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} +| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} | ${src_mac} +| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} +| | Run Traffic Script On Node | icmpv6_echo.py | ${tg_node} | ${args} + + +| Send IPv6 ICMP echo request to DUT2 via DUT1 and verify answer +| | [Documentation] | Send traffic from TG to second DUT through first DUT +| | [Arguments] | ${tg_node} | ${first_dut} | ${second_dut} | ${nodes_addr} +| | Append Nodes | ${tg_node} | ${first_dut} | ${second_dut} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Interface +| | ${hop_port} | ${hop_node}= | First Ingress Interface +| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} +| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} +| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} +| | ${dst_mac}= | Get Interface Mac | ${hop_node} | ${hop_port} +| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} +| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} | ${src_mac} +| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} +| | Run Traffic Script On Node | icmpv6_echo.py | ${tg_node} | ${args} + +| Send IPv6 ICMP echo request to DUT2 egress interface via DUT1 and verify answer +| | [Documentation] | Send traffic from TG to second DUT egress interface through first DUT +| | [Arguments] | ${tg_node} | ${first_dut} | ${second_dut} | ${nodes_addr} +| | Append Nodes | ${tg_node} | ${first_dut} | ${second_dut} | ${tg_node} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Egress Interface +| | ${hop_port} | ${hop_node}= | First Ingress Interface +| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} +| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} +| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} +| | ${dst_mac}= | Get Interface Mac | ${hop_node} | ${hop_port} +| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} +| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} | ${src_mac} +| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} +| | Run Traffic Script On Node | icmpv6_echo.py | ${tg_node} | ${args} + +| Ipv6 tg to tg routed +| | [Documentation] | Send traffic from one TG port to another through DUT nodes +| | ... | and send reply back, also verify hop limit processing +| | [Arguments] | ${tg_node} | ${first_dut} | ${second_dut} | ${nodes_addr} +| | Append Nodes | ${tg_node} | ${first_dut} | ${second_dut} | ${tg_node} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Interface +| | ${src_nh_port} | ${src_nh_node}= | First Ingress Interface +| | ${dst_nh_port} | ${dst_nh_node}= | Last Egress Interface +| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} +| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} +| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} +| | ${dst_mac}= | Get Interface Mac | ${src_node} | ${dst_port} +| | ${src_nh_mac}= | Get Interface Mac | ${src_nh_node} | ${src_nh_port} +| | ${dst_nh_mac}= | Get Interface Mac | ${dst_nh_node} | ${dst_nh_port} +| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} +| | ${dst_port_name}= | Get interface name | ${dst_node} | ${dst_port} +| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${dst_port_name} | ${src_mac} +| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} +| | ${args}= | Catenate | ${args} | --src_nh_mac ${src_nh_mac} +| | | ... | --dst_nh_mac ${dst_nh_mac} | --h_num 2 +| | Run Traffic Script On Node | icmpv6_echo_req_resp.py | ${tg_node} | ${args} + +| Send IPv6 neighbor solicitation and verify answer +| | [Documentation] | Send IPv6 neighbor solicitation from TG to DUT +| | [Arguments] | ${tg_node} | ${dut_node} | ${nodes_addr} +| | Append Nodes | ${tg_node} | ${dut_node} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Interface +| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} +| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} +| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} +| | ${dst_mac}= | Get Interface Mac | ${dst_node} | ${dst_port} +| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} +| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} | ${src_mac} +| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} +| | Run Traffic Script On Node | ipv6_ns.py | ${src_node} | ${args} + +| Configure IPv6 on all DUTs in topology +| | [Documentation] | Setup IPv6 address on all DUTs +| | [Arguments] | ${nodes} | ${nodes_addr} +| | Configure all DUTs before test +| | ${interfaces}= | Nodes Set Ipv6 Addresses | ${nodes} | ${nodes_addr} +| | :FOR | ${interface} | IN | @{interfaces} +| | | Set Interface State | @{interface} | up | if_type=name +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Suppress ICMPv6 router advertisement message +| | [Documentation] | Suppress ICMPv6 router advertisement message for link scope address +| | [Arguments] | ${nodes} +| | Vpp All Ra Suppress Link Layer | ${nodes} + +| Configure IPv6 routing on all DUTs +| | [Documentation] | Setup routing on all VPP nodes required for IPv6 tests +| | [Arguments] | ${nodes} | ${nodes_addr} +| | Append Nodes | ${nodes['DUT1']} | ${nodes['DUT2']} +| | Compute Path +| | ${tg}= | Set Variable | ${nodes['TG']} +| | ${dut1_if} | ${dut1}= | First Interface +| | ${dut2_if} | ${dut2}= | Last Interface +| | ${dut1_if_addr}= | Get Node Port Ipv6 Address | ${dut1} | ${dut1_if} | ${nodes_addr} +| | ${dut2_if_addr}= | Get Node Port Ipv6 Address | ${dut2} | ${dut2_if} | ${nodes_addr} +| | @{tg_dut1_links}= | Get active links connecting "${tg}" and "${dut1}" +| | @{tg_dut2_links}= | Get active links connecting "${tg}" and "${dut2}" +| | :FOR | ${link} | IN | @{tg_dut1_links} +| | | ${net}= | Get Link Address | ${link} | ${nodes_addr} +| | | ${prefix}= | Get Link Prefix | ${link} | ${nodes_addr} +| | | Vpp Route Add | ${dut2} | ${net} | ${prefix} | ${dut1_if_addr} | ${dut2_if} +| | :FOR | ${link} | IN | @{tg_dut2_links} +| | | ${net}= | Get Link Address | ${link} | ${nodes_addr} +| | | ${prefix}= | Get Link Prefix | ${link} | ${nodes_addr} +| | | Vpp Route Add | ${dut1} | ${net} | ${prefix} | ${dut2_if_addr} | ${dut1_if} diff --git a/resources/libraries/robot/ip/map.robot b/resources/libraries/robot/ip/map.robot new file mode 100644 index 0000000000..ac086b4511 --- /dev/null +++ b/resources/libraries/robot/ip/map.robot @@ -0,0 +1,312 @@ +# Copyright (c) 2016 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 *** +| Variables | resources/libraries/python/topology.py +| Library | resources.libraries.python.topology.Topology +| Library | resources.libraries.python.DUTSetup +| Library | resources.libraries.python.TGSetup +| Library | resources.libraries.python.Map +| Documentation | Keywords for MAP feature in VPP. + +*** Keywords *** +| Send IPv4 UDP and check headers for lightweight 4over6 +| | [Documentation] +| | ... | Send empty UDP to given IPv4 dst and UDP port and check received \ +| | ... | packets headers (Ethernet, IPv6, IPv4, UDP). +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - Node where to run traffic script. Type: string +| | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string +| | ... | - rx_if - Interface where to receive IPinIP packet. Type: string +| | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string +| | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string +| | ... | - tx_src_ipv4 - Source IPv4 address. Type: string +| | ... | - tx_dst_udp_port - Destination UDP port. Type: integer +| | ... | - rx_dst_mac - Expected destination MAC address. Type: string +| | ... | - rx_src_mac - Expected source MAC address. Type: string +| | ... | - dst_ipv6 - Expected destination IPv6 address. Type: string +| | ... | - src_ipv6 - Expected source IPv6 address. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send IPv4 UDP and check headers for lightweight 4over6 \ +| | ... | \| ${tg_node} \| eth3 \| eth2 \| 08:00:27:66:b8:57 \| 20.0.0.1 \ +| | ... | \| 20.0.0.2 \| 1232 \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \ +| | ... | \| 2001:1::2 \| 2001:1::1 \| +| | ... +| | [Arguments] +| | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_dst_ipv4} +| | ... | ${tx_src_ipv4} | ${tx_dst_udp_port} | ${rx_dst_mac} | ${rx_src_mac} +| | ... | ${dst_ipv6} | ${src_ipv6} +| | ... +| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} +| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} +| | ${args}= | Catenate +| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} +| | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_ipv4 | ${tx_src_ipv4} +| | ... | --tx_dst_ipv4 | ${tx_dst_ipv4} +| | ... | --tx_dst_udp_port | ${tx_dst_udp_port} +| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} +| | ... | --src_ipv6 | ${src_ipv6} | --dst_ipv6 | ${dst_ipv6} +| | ... +| | Run Traffic Script On Node +| | ... | send_ipv4_udp_check_lw_4o6.py | ${tg_node} | ${args} + +| Send IPv4 ICMP and check headers for lightweight 4over6 +| | [Documentation] +| | ... | Send ICMP request with ID to given IPv4 destination and \ +| | ... | check received packets headers (Ethernet, IPv6, IPv4, ICMP). +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - Node where to run traffic script. Type: string +| | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string +| | ... | - rx_if - Interface where to receive IPinIP packet. Type: string +| | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string +| | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string +| | ... | - tx_src_ipv4 - Source IPv4 address. Type: string +| | ... | - tx_icmp_id - ICMP ID. Type: integer +| | ... | - rx_dst_mac - Expected destination MAC address. Type: string +| | ... | - rx_src_mac - Expected source MAC address. Type: string +| | ... | - dst_ipv6 - Expected destination IPv6 address. Type: string +| | ... | - src_ipv6 - Expected source IPv6 address. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send IPv4 ICMP and check headers for lightweight 4over6 \ +| | ... | \| ${tg_node} \| eth3 \| eth2 \| 08:00:27:66:b8:57 \| 20.0.0.1 \ +| | ... | \| 20.0.0.2 \| 1232 \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \ +| | ... | \| 2001:1::2 \| 2001:1::1 \| +| | ... +| | [Arguments] +| | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_dst_ipv4} +| | ... | ${tx_src_ipv4} | ${tx_icmp_id} | ${rx_dst_mac} | ${rx_src_mac} +| | ... | ${dst_ipv6} | ${src_ipv6} +| | ... +| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} +| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} +| | ${args}= | Catenate +| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} +| | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_ipv4 | ${tx_src_ipv4} +| | ... | --tx_dst_ipv4 | ${tx_dst_ipv4} | --tx_icmp_id | ${tx_icmp_id} +| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} +| | ... | --src_ipv6 | ${src_ipv6} | --dst_ipv6 | ${dst_ipv6} +| | ... +| | Run Traffic Script On Node +| | ... | send_ipv4_icmp_check_lw_4o6.py | ${tg_node} | ${args} + +| Send IPv4 UDP in IPv6 and check headers for lightweight 4over6 +| | [Documentation] +| | ... | Send empty UDP in IPv4 in IPv6 and check if IPv4 packet is correctly \ +| | ... | decapsulated from IPv6. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - Node where to run traffic script. Type: string +| | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string +| | ... | - rx_if - Interface where to receive IPinIP packet. Type: string +| | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string +| | ... | - tx_src_mac - Source MAC address of IPv4 packet. Type: string +| | ... | - tx_dst_ipv6 - Destination IPv6 address. Type: string +| | ... | - tx_src_ipv6 - Source IPv6 address. Type: string +| | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string +| | ... | - tx_src_ipv4 - Source IPv4 address. Type: string +| | ... | - tx_src_udp_port - Source UDP port. Type: integer +| | ... | - rx_dst_mac - Expected destination MAC address. Type: string +| | ... | - rx_src_mac - Expected source MAC address. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send IPv4 UDP in IPv6 and check headers for lightweight 4over6 \ +| | ... | \| ${tg_node} \| eth3 \| eth2 \ +| | ... | \| 08:00:27:66:b8:57 \| 08:00:27:33:54:21 \ +| | ... | \| 2001:1::2 \| 2001:1::1 \| 20.0.0.1 \| 20.0.0.2 \ +| | ... | \| 1232 \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \| +| | ... +| | [Arguments] +| | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_src_mac} +| | ... | ${tx_dst_ipv6} | ${tx_src_ipv6} | ${tx_dst_ipv4} | ${tx_src_ipv4} +| | ... | ${tx_src_udp_port} | ${rx_dst_mac} | ${rx_src_mac} +| | ... +| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} +| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} +| | ${args}= | Catenate +| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} +| | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_mac | ${tx_src_mac} +| | ... | --tx_dst_ipv6 | ${tx_dst_ipv6} | --tx_src_ipv6 | ${tx_src_ipv6} +| | ... | --tx_dst_ipv4 | ${tx_dst_ipv4} | --tx_src_ipv4 | ${tx_src_ipv4} +| | ... | --tx_src_udp_port | ${tx_src_udp_port} +| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} +| | ... +| | Run Traffic Script On Node +| | ... | send_lw_4o6_check_ipv4_udp.py | ${tg_node} | ${args} + +| Send IPv4 UDP in IPv6 and check headers for lightweight hairpinning +| | [Documentation] +| | ... | Send empty UDP in IPv4 in IPv6 and check if IPv4 packet is correctly \ +| | ... | decapsulated and re-encapsulated to another lwB4. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - Node where to run traffic script. Type: string +| | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string +| | ... | - rx_if - Interface where to receive IPinIP packet. Type: string +| | ... | - tx_dst_mac - Destination MAC address of send IPv6 packet. \ +| | ... | Type: string +| | ... | - tx_dst_ipv6 - Destination IPv6 address (lwAFTR). Type: string +| | ... | - tx_src_ipv6 - Source IPv6 address (lwB4_1). Type: string +| | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string +| | ... | - tx_src_ipv4 - Source IPv4 address. Type: string +| | ... | - tx_dst_udp_port - Destination UDP port (PSID_2 related). \ +| | ... | Type: integer +| | ... | - tx_src_udp_port - Source UDP port (PSID_1 related). Type: integer +| | ... | - rx_dst_mac - Expected destination MAC address. Type: string +| | ... | - rx_src_mac - Expected source MAC address. Type: string +| | ... | - rx_dst_ipv6 - Expected destination IPv6 address (lwB4_2). \ +| | ... | Type: string +| | ... | - rx_src_ipv6 - Expected source IPv6 address (lwAFTR). Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send IPv4 UDP in IPv6 and check headers for lightweight hairpinning \ +| | ... | \| ${tg_node} \| port3 \| port3 \| 08:00:27:f3:be:f0 \| 2001:1::1 \ +| | ... | \| 2001:1::2 \| 20.0.0.1 \| 20.0.0.1 \| ${6232} \| ${1232} \ +| | ... | \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \| 2001:1::3 \| 2001:1::1 \| +| | ... +| | [Arguments] +| | ... | ${tg_node} | ${tx_if} | ${rx_if} +| | ... | ${tx_dst_mac} +| | ... | ${tx_dst_ipv6} | ${tx_src_ipv6} +| | ... | ${tx_dst_ipv4} | ${tx_src_ipv4} +| | ... | ${tx_dst_udp_port} | ${tx_src_udp_port} +| | ... | ${rx_dst_mac} | ${rx_src_mac} +| | ... | ${rx_dst_ipv6} | ${rx_src_ipv6} +| | ... +| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} +| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} +| | ${args}= | Catenate +| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} +| | ... | --tx_dst_mac | ${tx_dst_mac} +| | ... | --tx_dst_ipv6 | ${tx_dst_ipv6} | --tx_src_ipv6 | ${tx_src_ipv6} +| | ... | --tx_dst_ipv4 | ${tx_dst_ipv4} | --tx_src_ipv4 | ${tx_src_ipv4} +| | ... | --tx_dst_udp_port | ${tx_dst_udp_port} +| | ... | --tx_src_udp_port | ${tx_src_udp_port} +| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} +| | ... | --rx_dst_ipv6 | ${rx_dst_ipv6} | --rx_src_ipv6 | ${rx_src_ipv6} +| | ... +| | Run Traffic Script On Node +| | ... | send_lw_4o6_check_hairpinning_udp.py | ${tg_node} | ${args} + +| Send IPv4 UDP and check IPv6 headers for MAP-T +| | [Documentation] +| | ... | Send a UDP in IPv4 and check if IPv4 source and destination \ +| | ... | addresses are correctly translated into IPv6 addresses. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - Node where to run traffic script. Type: string +| | ... | - tx_if - Interface from where to send IPv4 UDP packet. Type: string +| | ... | - rx_if - Interface where to receive IPv6 UDP packet. Type: string +| | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string +| | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string +| | ... | - tx_src_ipv4 - Source IPv4 address. Type: string +| | ... | - tx_dst_udp_port - Destination UDP port. Type: integer +| | ... | - rx_dst_mac - Expected destination MAC address. Type: string +| | ... | - rx_src_mac - Expected source MAC address. Type: string +| | ... | - dst_ipv6 - Expected destination IPv6 address. Type: string +| | ... | - src_ipv6 - Expected source IPv6 address. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send IPv4 UDP and check IPv6 headers for MAP-T \ +| | ... | \| ${tg_node} \| port3 \| port3 \| 08:00:27:66:b8:57 \ +| | ... | \| 20.169.201.219 \| 100.0.0.1 \| ${1232} \| 08:00:27:46:2b:4c \ +| | ... | \| 08:00:27:f3:be:f0 \| 2001:db8::14a9:c9db:0 \ +| | ... | \| 2001:db8:ffff::6400:1 \| +| | ... +| | [Arguments] +| | ... | ${tg_node} | ${tx_if} | ${rx_if} +| | ... | ${tx_dst_mac} | ${tx_dst_ipv4} | ${tx_src_ipv4} | ${tx_dst_udp_port} +| | ... | ${rx_dst_mac} | ${rx_src_mac} | ${dst_ipv6} | ${src_ipv6} +| | ... +| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} +| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} +| | ${args}= | Catenate +| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} +| | ... | --tx_dst_mac | ${tx_dst_mac} +| | ... | --tx_src_ipv4 | ${tx_src_ipv4} | --tx_dst_ipv4 | ${tx_dst_ipv4} +| | ... | --tx_dst_udp_port | ${tx_dst_udp_port} +| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} +| | ... | --rx_src_ipv6 | ${src_ipv6} | --rx_dst_ipv6 | ${dst_ipv6} +| | ... +| | Run Traffic Script On Node +| | ... | send_ipv4_udp_check_map_t.py | ${tg_node} | ${args} + +| Send IPv6 UDP and check IPv4 headers for MAP-T +| | [Documentation] +| | ... | Send a UDP in IPv6 and check if IPv6 source and destination \ +| | ... | addresses are correctly translated into IPv4 addresses. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - Node where to run traffic script. Type: string +| | ... | - tx_if - Interface from where to send IPv4 UDP packet. Type: string +| | ... | - rx_if - Interface where to receive IPv6 UDP packet. Type: string +| | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string +| | ... | - tx_src_mac - Source MAC address of IPv4 packet. Type: string +| | ... | - tx_dst_ipv6 - Destination IPv6 address. Type: string +| | ... | - tx_src_ipv6 - Source IPv6 address. Type: string +| | ... | - tx_src_udp_port - Source UDP port. Type: integer +| | ... | - rx_dst_mac - Expected destination MAC address. Type: string +| | ... | - rx_src_mac - Expected source MAC address. Type: string +| | ... | - dst_ipv4 - Expected destination IPv4 address. Type: string +| | ... | - src_ipv4 - Expected source IPv4 address. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send IPv6 UDP and check IPv4 headers for MAP-T \ +| | ... | \| port3 \| port4 \| 08:00:27:f3:be:f0 \| 2001:db8:ffff::6400:1 \ +| | ... | \| 2001:db8::14a9:c9db:0 \| ${1232} \| 08:00:27:58:71:eb \ +| | ... | \| 08:00:27:66:b8:57 \| 100.0.0.1 \| 20.169.201.219 \| +| | ... +| | [Arguments] +| | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_src_mac} +| | ... | ${tx_dst_ipv6} | ${tx_src_ipv6} | ${tx_src_udp_port} +| | ... | ${rx_dst_mac} | ${rx_src_mac} | ${dst_ipv4} | ${src_ipv4} +| | ... +| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} +| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} +| | ${args}= | Catenate +| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} +| | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_mac | ${tx_src_mac} +| | ... | --tx_src_ipv6 | ${tx_src_ipv6} | --tx_dst_ipv6 | ${tx_dst_ipv6} +| | ... | --tx_src_udp_port | ${tx_src_udp_port} +| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} +| | ... | --rx_src_ipv4 | ${src_ipv4} | --rx_dst_ipv4 | ${dst_ipv4} +| | ... +| | Run Traffic Script On Node +| | ... | send_ipv6_udp_check_map_t.py | ${tg_node} | ${args} diff --git a/resources/libraries/robot/ip/snat.robot b/resources/libraries/robot/ip/snat.robot new file mode 100644 index 0000000000..610a9150ee --- /dev/null +++ b/resources/libraries/robot/ip/snat.robot @@ -0,0 +1,150 @@ +# Copyright (c) 2017 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.SNATUtil +| Library | resources.libraries.python.NAT.NATUtil +| Documentation | Keywords for SNAT feature in VPP. + +*** Keywords *** +| Configure inside and outside interfaces +| | [Documentation] | Configure inside and outside interfaces for SNAT. +| | ... +| | ... | *Arguments:* +| | ... | - node - DUT node to set SNAT interfaces on. Type: dictionary +| | ... | - int_in - Inside interface. Type: string +| | ... | - int_out - Outside interface. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure inside and outside interfaces \| ${nodes['DUT1']} \ +| | ... | \| FortyGigabitEtherneta/0/0 \| FortyGigabitEtherneta/0/1 \| +| | ... +| | [Arguments] | ${node} | ${int_in} | ${int_out} +| | ... +| | ${int_in_name}= | Set variable | ${node['interfaces']['${int_in}']['name']} +| | ${int_out_name}= | Set variable | ${node['interfaces']['${int_out}']['name']} +| | Set SNAT Interfaces | ${node} | ${int_in_name} | ${int_out_name} + +| Configure deterministic mode for SNAT +| | [Documentation] | Set deterministic behaviour of SNAT. +| | ... +| | ... | *Arguments:* +| | ... | - node - DUT node to set deterministic mode for SNAT on. +| | ... | Type: dictionary +| | ... | - ip_in - Inside IP. Type: string +| | ... | - subnet_in - Inside IP subnet. Type: string +| | ... | - ip_out - Outside IP. Type: string +| | ... | - subnet_out - Outside IP subnet. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure deterministic mode for SNAT \| ${nodes['DUT1']} \ +| | ... | \| 100.0.0.0 \| 12 \| 12.1.1.0 \| 24 \| +| | ... +| | [Arguments] | ${node} | ${ip_in} | ${subnet_in} | ${ip_out} | ${subnet_out} +| | ... +| | Set SNAT deterministic | ${node} | ${ip_in} | ${subnet_in} | ${ip_out} +| | ... | ${subnet_out} + +| Configure workers for SNAT +| | [Documentation] | Configure workers for SNAT. +| | ... +| | ... | *Arguments:* +| | ... | - node - DUT node to set SNAT workers on. Type: dictionary +| | ... | - lcores - list of cores, format: range e.g. 1-5 or list of ranges \ +| | ... | e.g.: 1-5,18-22. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure workers for SNAT \| ${nodes['DUT1']} \| 12-23,36-47 \| +| | ... +| | [Arguments] | ${node} | ${lcores} +| | ... +| | Set SNAT workers | ${node} | ${lcores} + +| Show SNAT verbose +| | [Documentation] | Get the SNAT settings on the node. +| | ... +| | ... | *Arguments:* +| | ... | - node - DUT node to show SNAT. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Show SNAT verbose \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${node} +| | ... +| | Show SNAT | ${node} + +| Get SNAT deterministic forward +| | [Documentation] | Show forward IP address and port(s). +| | ... +| | ... | *Arguments:* +| | ... | - node - DUT node to get SNAT deterministic forward on. +| | ... | Type: dictionary +| | ... | - ip - IP address. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Get SNAT deterministic forward \| ${nodes['DUT1']} \| 10.0.0.2 \| +| | ... +| | [Arguments] | ${node} | ${ip} +| | ... +| | Show SNAT deterministic forward | ${node} | ${ip} + +| Get SNAT deterministic reverse +| | [Documentation] | Show reverse IP address. +| | ... +| | ... | *Arguments:* +| | ... | - node - DUT node to get SNAT deterministic reverse on. +| | ... | Type: dictionary +| | ... | - ip - IP address. Type: string +| | ... | - port - Port. Type: string or integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Get SNAT deterministic reverse \| ${nodes['DUT1']} \| 10.0.0.2 \ +| | ... | \| 1025 \| +| | ... +| | [Arguments] | ${node} | ${ip} | ${port} +| | ... +| | Show SNAT deterministic reverse | ${node} | ${ip} | ${port} + +| Get NAT interfaces +| | [Documentation] | Get list of interfaces configured with NAT from VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - node - DUT node to get SNAT interfaces on. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Get NAT interfaces \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${node} +| | ... +| | VPP get NAT interfaces | ${node} + +| Get NAT static mappings +| | [Documentation] | Get NAT static mappings from VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - node - DUT node to get SNAT static mappings on. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Get NAT static mappings \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${node} +| | ... +| | VPP get NAT static mappings | ${node} diff --git a/resources/libraries/robot/ipsec.robot b/resources/libraries/robot/ipsec.robot deleted file mode 100644 index 73f7179f30..0000000000 --- a/resources/libraries/robot/ipsec.robot +++ /dev/null @@ -1,280 +0,0 @@ -# Copyright (c) 2016 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/default.robot -| Library | resources.libraries.python.IPsecUtil -| Library | resources.libraries.python.NodePath -| Library | resources.libraries.python.TrafficScriptExecutor -| Library | resources.libraries.python.IPv4Util.IPv4Util -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.Routing -| Library | String -| Library | resources.libraries.python.IPv6Util -| Library | resources.libraries.python.IPv6Setup -| Library | resources.libraries.python.IPv4Setup.Dut | ${nodes['DUT1']} -| ... | WITH NAME | dut1_v4 -| Documentation | *IPsec keywords.* - -*** Keywords *** -| Generate keys for IPSec -| | [Documentation] | Generate keys for IPsec. -| | ... -| | ... | *Arguments:* -| | ... | - crypto_alg - Encryption algorithm. Type: enum -| | ... | - integ_alg - Integrity algorithm. Type: enum -| | ... -| | ... | _NOTE:_ This KW sets following test case variable: -| | ... | - encr_key - Encryption key. Type: string -| | ... | - auth_key - Integrity key. Type: string -| | ... -| | ... | *Example:* -| | ... | \| ${encr_alg}= \| Crypto Alg AES CBC 128 \| -| | ... | \| ${auth_alg}= \| Integ Alg SHA1 96 \| -| | ... | \| Generate keys for IPSec \| ${encr_alg} \| ${auth_alg} \| -| | [Arguments] | ${crypto_alg} | ${integ_alg} -| | ${encr_key_len}= | Get Crypto Alg Key Len | ${crypto_alg} -| | ${encr_key}= | Generate Random String | ${encr_key_len} -| | ${auth_key_len}= | Get Integ Alg Key Len | ${integ_alg} -| | ${auth_key}= | Generate Random String | ${auth_key_len} -| | Set Test Variable | ${encr_key} -| | Set Test Variable | ${auth_key} - -| Configure path for IPSec test -| | [Documentation] | Setup path for IPsec testing TG<-->DUT1. -| | ... -| | ... | _NOTE:_ This KW sets following test case variable: -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - tg_if - TG interface connected to DUT. Type: string -| | ... | - tg_if_mac - TG interface MAC. Type: string -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - dut_if - DUT interface connected to TG. Type: string -| | ... | - dut_if_mac - DUT interface MAC. Type: string -| | ... | - dut_lo - DUT loopback interface. Type: string -| | ... -| | ... | *Example:* -| | ... | \| Configure path for IPSec test \| -| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} -| | Compute Path -| | ${tg_if} | ${tg_node}= | Next Interface -| | ${dut_if} | ${dut_node}= | Next Interface -| | ${dut_if_mac}= | Get Interface Mac | ${dut_node} | ${dut_if} -| | ${tg_if_mac}= | Get Interface Mac | ${tg_node} | ${tg_if} -| | ${dut_lo}= | Vpp Create Loopback | ${dut_node} -| | Set Interface State | ${dut_node} | ${dut_if} | up -| | Set Interface State | ${dut_node} | ${dut_lo} | up -| | Vpp Node Interfaces Ready Wait | ${dut_node} -| | Set Test Variable | ${tg_node} -| | Set Test Variable | ${tg_if} -| | Set Test Variable | ${tg_if_mac} -| | Set Test Variable | ${dut_node} -| | Set Test Variable | ${dut_if} -| | Set Test Variable | ${dut_if_mac} -| | Set Test Variable | ${dut_lo} - -| Configure topology for IPv4 IPsec testing -| | [Documentation] | Setup topology for IPv4 IPsec testing. -| | ... -| | ... | _NOTE:_ This KW sets following test case variable: -| | ... | - dut_tun_ip - DUT tunnel IP address. Type: string -| | ... | - dut_src_ip - DUT source IP address. Type: string -| | ... | - tg_tun_ip - TG tunnel IP address. Type: string -| | ... | - tg_src_ip - TG source IP address. Type: string -| | ... -| | ... | *Example:* -| | ... | \| Configure topology for IPv4 IPsec testing \| -| | Configure path for IPSec test -| | Set Interface Address | ${dut_node} | ${dut_if} | ${dut_if_ip4} -| | ... | ${ip4_plen} -| | Set Interface Address | ${dut_node} | ${dut_lo} | ${dut_lo_ip4} -| | ... | ${ip4_plen} -| | dut1_v4.Set Arp | ${dut_if} | ${tg_if_ip4} | ${tg_if_mac} -| | Vpp Route Add | ${dut_node} | ${tg_lo_ip4} | ${ip4_plen} | ${tg_if_ip4} -| | ... | ${dut_if} -| | Set Test Variable | ${dut_tun_ip} | ${dut_if_ip4} -| | Set Test Variable | ${dut_src_ip} | ${dut_lo_ip4} -| | Set Test Variable | ${tg_tun_ip} | ${tg_if_ip4} -| | Set Test Variable | ${tg_src_ip} | ${tg_lo_ip4} - -| Configure topology for IPv6 IPsec testing -| | [Documentation] | Setup topology fo IPv6 IPsec testing. -| | ... -| | ... | _NOTE:_ This KW sets following test case variable: -| | ... | - dut_tun_ip - DUT tunnel IP address. Type: string -| | ... | - dut_src_ip - DUT source IP address. Type: string -| | ... | - tg_tun_ip - TG tunnel IP address. Type: string -| | ... | - tg_src_ip - TG source IP address. Type: string -| | ... -| | ... | *Example:* -| | ... | \| Configure topology for IPv6 IPsec testing \| -| | Configure path for IPSec test -| | VPP Set If IPv6 Addr | ${dut_node} | ${dut_if} | ${dut_if_ip6} | ${ip6_plen} -| | VPP Set If IPv6 Addr | ${dut_node} | ${dut_lo} | ${dut_lo_ip6} | ${ip6_plen} -| | Add IP Neighbor | ${dut_node} | ${dut_if} | ${tg_if_ip6} | ${tg_if_mac} -| | Vpp All RA Suppress Link Layer | ${nodes} -| | Vpp Route Add | ${dut_node} | ${tg_lo_ip6} | ${ip6_plen_rt} | ${tg_if_ip6} -| | ... | ${dut_if} -| | Set Test Variable | ${dut_tun_ip} | ${dut_if_ip6} -| | Set Test Variable | ${dut_src_ip} | ${dut_lo_ip6} -| | Set Test Variable | ${tg_tun_ip} | ${tg_if_ip6} -| | Set Test Variable | ${tg_src_ip} | ${tg_lo_ip6} - -| Configure manual keyed connection for IPSec -| | [Documentation] | Setup IPsec manual keyed connection on VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - node - VPP node to setup IPsec on. Type: dictionary -| | ... | - interface - Interface to enable IPsec on. Type: string -| | ... | - crypto_alg - Encrytion algorithm. Type: enum -| | ... | - crypto_key - Encryption key. Type: string -| | ... | - integ_alg - Integrity algorithm. Type: enum -| | ... | - integ_key - Integrity key. Type: string -| | ... | - l_spi - Local SPI. Type: integer -| | ... | - r_spi - Remote SPI. Type: integer -| | ... | - l_ip - Local IP address. Type: string -| | ... | - r_ip - Remote IP address. Type: string -| | ... | - l_tunnel - Local tunnel IP address (optional). Type: string -| | ... | - r_tunnel - Remote tunnel IP address (optional). Type: string -| | ... -| | ... | _NOTE:_ This KW sets following test case variables: -| | ... | - l_sa_id -| | ... | - r_sa_id -| | ... -| | ... | *Example:* -| | ... | \| ${encr_alg}= \| Crypto Alg AES CBC 128 \| -| | ... | \| ${auth_alg}= \| Integ Alg SHA1 96 \| -| | ... | \| Configure manual keyed connection for IPSec \| ${nodes['DUT1']} \ -| | ... | \| GigabitEthernet0/8/0 \| ${encr_alg} \| sixteenbytes_key \ -| | ... | \| ${auth_alg} \| twentybytessecretkey \| ${1000} \| ${1001} \ -| | ... | \| 192.168.4.4 \| 192.168.3.3 \| 192.168.100.3 \| 192.168.100.2 \| -| | [Arguments] | ${node} | ${interface} | ${crypto_alg} | ${crypto_key} -| | ... | ${integ_alg} | ${integ_key} | ${l_spi} | ${r_spi} | ${l_ip} -| | ... | ${r_ip} | ${l_tunnel}=${None} | ${r_tunnel}=${None} -| | Set Test Variable | ${l_sa_id} | ${10} -| | Set Test Variable | ${r_sa_id} | ${20} -| | ${spd_id}= | Set Variable | ${1} -| | ${p_hi}= | Set Variable | ${100} -| | ${p_lo}= | Set Variable | ${10} -| | VPP IPsec Add SAD Entry | ${node} | ${l_sa_id} | ${l_spi} | ${crypto_alg} -| | ... | ${crypto_key} | ${integ_alg} | ${integ_key} -| | ... | ${l_tunnel} | ${r_tunnel} -| | VPP IPsec Add SAD Entry | ${node} | ${r_sa_id} | ${r_spi} | ${crypto_alg} -| | ... | ${crypto_key} | ${integ_alg} | ${integ_key} -| | ... | ${r_tunnel} | ${l_tunnel} -| | VPP IPsec Add SPD | ${node} | ${spd_id} -| | VPP IPsec SPD Add If | ${node} | ${spd_id} | ${interface} -| | ${action}= | Policy Action Bypass -| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_hi} | ${action} -| | ... | inbound=${TRUE} | proto=${ESP_PROTO} -| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_hi} | ${action} -| | ... | inbound=${FALSE} | proto=${ESP_PROTO} -| | ${action}= | Policy Action Protect -| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_lo} | ${action} -| | ... | sa_id=${r_sa_id} | laddr_range=${l_ip} -| | ... | raddr_range=${r_ip} | inbound=${TRUE} -| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_lo} | ${action} -| | ... | sa_id=${l_sa_id} | laddr_range=${l_ip} -| | ... | raddr_range=${r_ip} | inbound=${FALSE} - -| Update IPSec SA keys -| | [Documentation] | Update IPsec SA keys on VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - node - VPP node to update SA keys. Type: dictionary -| | ... | - l_sa_id - Local SA ID. Type: string -| | ... | - r_sa_id - Remote SA ID. Type: string -| | ... | - crypto_key - Encryption key. Type: string -| | ... | - integ_key - Integrity key. Type: string -| | ... -| | ... | *Example:* -| | ... | \| Update IPSec SA keys \| ${nodes['DUT1']} \ -| | ... | \| 10 \| 20 \| sixteenbytes_key \| twentybytessecretkey \| -| | [Arguments] | ${node} | ${l_sa_id} | ${r_sa_id} | ${crypto_key} -| | ... | ${integ_key} -| | VPP IPsec SA Set Key | ${dut_node} | ${l_sa_id} | ${crypto_key} -| | ... | ${integ_key} -| | VPP IPsec SA Set Key | ${dut_node} | ${r_sa_id} | ${crypto_key} -| | ... | ${integ_key} - -| Send IPsec Packet and verify ESP encapsulation in received packet -| | [Documentation] | Send IPsec packet from TG to DUT. Receive IPsec packet\ -| | ... | from DUT on TG and verify ESP encapsulation. -| | ... -| | ... | *Arguments:* -| | ... | - node - TG node. Type: dictionary -| | ... | - interface - TG Interface. Type: string -| | ... | - dst_mac - Destination MAC. Type: string -| | ... | - crypto_alg - Encrytion algorithm. Type: enum -| | ... | - crypto_key - Encryption key. Type: string -| | ... | - integ_alg - Integrity algorithm. Type: enum -| | ... | - integ_key - Integrity key. Type: string -| | ... | - l_spi - Local SPI. Type: integer -| | ... | - r_spi - Remote SPI. Type: integer -| | ... | - l_ip - Local IP address. Type: string -| | ... | - r_ip - Remote IP address. Type: string -| | ... | - l_tunnel - Local tunnel IP address (optional). Type: string -| | ... | - r_tunnel - Remote tunnel IP address (optional). Type: string -| | ... -| | ... | *Example:* -| | ... | \| ${encr_alg}= \| Crypto Alg AES CBC 128 \| -| | ... | \| ${auth_alg}= \| Integ Alg SHA1 96 \| -| | ... | \| Send IPsec Packet and verify ESP encapsulation in received packet\ -| | ... | \| ${nodes['TG']} \| eth1 \ -| | ... | \| 52:54:00:d4:d8:22 \| ${encr_alg} \| sixteenbytes_key \ -| | ... | \| ${auth_alg} \| twentybytessecretkey \| ${1001} \| ${1000} \ -| | ... | \| 192.168.3.3 \| 192.168.4.4 \| 192.168.100.2 \| 192.168.100.3 \| -| | [Arguments] | ${node} | ${interface} | ${dst_mac} | ${crypto_alg} -| | ... | ${crypto_key} | ${integ_alg} | ${integ_key} | ${l_spi} -| | ... | ${r_spi} | ${l_ip} | ${r_ip} | ${l_tunnel}=${None} -| | ... | ${r_tunnel}=${None} -| | ${src_mac}= | Get Interface Mac | ${node} | ${interface} -| | ${if_name}= | Get Interface Name | ${node} | ${interface} -| | ${args}= | Traffic Script Gen Arg | ${if_name} | ${if_name} | ${src_mac} -| | ... | ${dst_mac} | ${l_ip} | ${r_ip} -| | ${crypto_alg_str}= | Get Crypto Alg Scapy Name | ${crypto_alg} -| | ${integ_alg_str}= | Get Integ Alg Scapy Name | ${integ_alg} -| | ${args}= | Catenate | ${args} | --crypto_alg ${crypto_alg_str} -| | ... | --crypto_key ${crypto_key} | --integ_alg ${integ_alg_str} -| | ... | --integ_key ${integ_key} | --l_spi ${l_spi} | --r_spi ${r_spi} -| | ${args}= | Set Variable If | "${l_tunnel}" == "${None}" | ${args} -| | ... | ${args} --src_tun ${l_tunnel} -| | ${args}= | Set Variable If | "${r_tunnel}" == "${None}" | ${args} -| | ... | ${args} --dst_tun ${r_tunnel} -| | Run Traffic Script On Node | ipsec.py | ${node} | ${args} - -| Set up IPv4 IPSec functional test -| | [Documentation] -| | ... | Set up IPv4 IPSec functional test -| | ... -| | Set up functional test -| | Configure topology for IPv4 IPsec testing - -| Set up IPv6 IPSec functional test -| | [Documentation] -| | ... | Set up IPv6 IPSec functional test -| | ... -| | Set up functional test -| | Configure topology for IPv6 IPsec testing - -| Tear down IPSec functional test -| | [Documentation] -| | ... | Tear down IPSec functional test -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Tear down IPSec functional test \| ${dut_node} \| -| | ... -| | [Arguments] | ${dut_node} -| | ... -| | VPP IPsec Show | ${dut_node} -| | Tear down functional test diff --git a/resources/libraries/robot/ipv4.robot b/resources/libraries/robot/ipv4.robot deleted file mode 100644 index 3fa522f5c5..0000000000 --- a/resources/libraries/robot/ipv4.robot +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright (c) 2016 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/default.robot -| Resource | resources/libraries/robot/counters.robot -| Library | resources.libraries.python.IPv4Util.IPv4Util -| Library | resources.libraries.python.IPv4Setup.IPv4Setup -| Library | resources.libraries.python.NodePath -| Library | resources.libraries.python.Routing -| Library | resources.libraries.python.TrafficScriptExecutor -| Library | resources.libraries.python.InterfaceUtil -| Variables | resources/libraries/python/IPv4NodeAddress.py | ${nodes} - -*** Keywords *** - -| Configure IPv4 addresses on all DUTs -| | [Documentation] | Setup IPv4 address on all DUTs in topology -| | [Arguments] | ${nodes} | ${nodes_addr} -| | ${interfaces}= | VPP nodes set ipv4 addresses | ${nodes} | ${nodes_addr} -| | :FOR | ${interface} | IN | @{interfaces} -| | | Set Interface State | @{interface} | up | if_type=name - -| Configure routes for IPv4 test -| | [Documentation] | Setup routing on all VPP nodes required for IPv4 tests -| | [Arguments] | ${nodes} | ${nodes_addr} -| | Append Nodes | ${nodes['DUT1']} | ${nodes['DUT2']} -| | Compute Path -| | ${tg}= | Set Variable | ${nodes['TG']} -| | ${dut1_if} | ${dut1}= | First Interface -| | ${dut2_if} | ${dut2}= | Last Interface -| | ${dut1_if_addr}= | Get IPv4 address of node "${dut1}" interface "${dut1_if}" from "${nodes_addr}" -| | ${dut2_if_addr}= | Get IPv4 address of node "${dut2}" interface "${dut2_if}" from "${nodes_addr}" -| | @{tg_dut1_links}= | Get active links connecting "${tg}" and "${dut1}" -| | @{tg_dut2_links}= | Get active links connecting "${tg}" and "${dut2}" -| | :FOR | ${link} | IN | @{tg_dut1_links} -| | | ${net}= | Get Link Address | ${link} | ${nodes_addr} -| | | ${prefix}= | Get Link Prefix | ${link} | ${nodes_addr} -| | | Vpp Route Add | ${dut2} | ${net} | ${prefix} | ${dut1_if_addr} | ${dut2_if} -| | :FOR | ${link} | IN | @{tg_dut2_links} -| | | ${net}= | Get Link Address | ${link} | ${nodes_addr} -| | | ${prefix}= | Get Link Prefix | ${link} | ${nodes_addr} -| | | Vpp Route Add | ${dut1} | ${net} | ${prefix} | ${dut2_if_addr} | ${dut1_if} - -| Configure DUT nodes for IPv4 testing -| | Configure IPv4 addresses on all DUTs | ${nodes} | ${nodes_ipv4_addr} -| | Setup ARP on all DUTs | ${nodes} | ${nodes_ipv4_addr} -| | Configure routes for IPv4 test | ${nodes} | ${nodes_ipv4_addr} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Route traffic from interface '${from_port}' on node '${from_node}' to interface '${to_port}' on node '${to_node}' '${hops}' hops away using IPv4 -| | ${src_ip}= | Get IPv4 address of node "${from_node}" interface "${from_port}" from "${nodes_ipv4_addr}" -| | ${dst_ip}= | Get IPv4 address of node "${to_node}" interface "${to_port}" from "${nodes_ipv4_addr}" -| | ${src_mac}= | Get interface mac | ${from_node} | ${from_port} -| | ${dst_mac}= | Get interface mac | ${to_node} | ${to_port} -| | ${is_dst_tg}= | Is TG node | ${to_node} -| | ${adj_node} | ${adj_int}= | Get adjacent node and interface | ${nodes} | ${from_node} | ${from_port} -| | ${from_port_name}= | Get interface name | ${from_node} | ${from_port} -| | ${to_port_name}= | Get interface name | ${to_node} | ${to_port} -| | ${adj_int_mac}= | Get interface MAC | ${adj_node} | ${adj_int} -| | ${args}= | Traffic Script Gen Arg | ${to_port_name} | ${from_port_name} | ${src_mac} -| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} -| | ${args}= | Catenate | ${args} | --hops ${hops} | --first_hop_mac ${adj_int_mac} -| | | ... | --is_dst_tg ${is_dst_tg} -| | Run Traffic Script On Node | ipv4_ping_ttl_check.py | ${from_node} | ${args} - -| Execute IPv4 ICMP echo sweep -| | [Documentation] | Type of the src_node must be TG and dst_node must be DUT -| | [Arguments] | ${src_node} | ${dst_node} | ${start_size} | ${end_size} | ${step} -| | Append Nodes | ${src_node} | ${dst_node} -| | Compute Path -| | ${src_port} | ${src_node}= | First Interface -| | ${dst_port} | ${dst_node}= | Last Interface -| | ${src_ip}= | Get IPv4 address of node "${src_node}" interface "${src_port}" from "${nodes_ipv4_addr}" -| | ${dst_ip}= | Get IPv4 address of node "${dst_node}" interface "${dst_port}" from "${nodes_ipv4_addr}" -| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} -| | ${dst_mac}= | Get Interface Mac | ${dst_node} | ${dst_port} -| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} -| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} -| | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} -| | ${args}= | Set Variable -| | ... | ${args} --start_size ${start_size} --end_size ${end_size} --step ${step} -| | Run Traffic Script On Node | ipv4_sweep_ping.py | ${src_node} | ${args} -| | ... | timeout=${180} - -| Send ARP request and verify response -| | [Arguments] | ${tg_node} | ${vpp_node} -| | ${link_name}= | Get first active connecting link between node "${tg_node}" and "${vpp_node}" -| | ${src_if}= | Get interface by link name | ${tg_node} | ${link_name} -| | ${dst_if}= | Get interface by link name | ${vpp_node} | ${link_name} -| | ${src_ip}= | Get IPv4 address of node "${tg_node}" interface "${src_if}" from "${nodes_ipv4_addr}" -| | ${dst_ip}= | Get IPv4 address of node "${vpp_node}" interface "${dst_if}" from "${nodes_ipv4_addr}" -| | ${src_mac}= | Get node link mac | ${tg_node} | ${link_name} -| | ${dst_mac}= | Get node link mac | ${vpp_node} | ${link_name} -| | ${src_if_name}= | Get interface name | ${tg_node} | ${src_if} -| | ${args}= | Traffic Script Gen Arg | ${src_if_name} | ${src_if_name} | ${src_mac} -| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} -| | Run Traffic Script On Node | arp_request.py | ${tg_node} | ${args} - -| Configure IP addresses on interfaces -| | [Documentation] | Iterates through @{args} list and Set Interface Address -| | ... | for every (${dut_node}, ${interface}, ${address}, -| | ... | ${prefix}) tuple. -| | ... -| | ... | *Arguments:* -| | ... | - ${dut_node} - Node where IP address should be set to. -| | ... | Type: dictionary -| | ... | - ${interface} - Interface name. Type: string -| | ... | - ${address} - IP address. Type: string -| | ... | - ${prefix} - Prefix length. Type: integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure IP addresses on interfaces \ -| | ... | \| ${dut1_node} \| ${dut1_to_dut2} \| 192.168.1.1 \| 24 \| -| | ... | \| ... \| ${dut1_node} \| ${dut1_to_tg} \| 192.168.2.1 \| 24 \| -| | ... -| | [Arguments] | @{args} -| | :FOR | ${dut_node} | ${interface} | ${address} | ${prefix} | IN | @{args} -| | | Set Interface Address | ${dut_node} | ${interface} | ${address} -| | | ... | ${prefix} - -| Send ICMP echo request and verify answer -| | [Documentation] | Run traffic script that waits for ICMP reply and ignores -| | ... | all other packets. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - TG node where run traffic script. Type: dictionary -| | ... | - tg_interface - TG interface where send ICMP echo request. -| | ... | Type: string -| | ... | - dst_mac - Destination MAC address. Type: string -| | ... | - src_mac - Source MAC address. Type: string -| | ... | - dst_ip - Destination IP address. Type: string -| | ... | - src_ip - Source IP address. Type: string -| | ... | - timeout - Wait timeout in seconds (Default: 10). Type: integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send ICMP echo request and verify answer \ -| | ... | \| ${nodes['TG']} \| eth2 \ -| | ... | \| 08:00:27:46:2b:4c \| 08:00:27:66:b8:57 \ -| | ... | \| 192.168.23.10 \| 192.168.23.1 \| 10 \| -| | ... -| | [Arguments] | ${tg_node} | ${tg_interface} -| | ... | ${dst_mac} | ${src_mac} | ${dst_ip} | ${src_ip} | ${timeout}=${10} -| | ${tg_interface_name}= | Get interface name | ${tg_node} | ${tg_interface} -| | ${args}= | Catenate | --rx_if | ${tg_interface_name} | --tx_if | ${tg_interface_name} -| | ... | --dst_mac | ${dst_mac} | --src_mac | ${src_mac} -| | ... | --dst_ip | ${dst_ip} | --src_ip | ${src_ip} | --timeout | ${timeout} -| | Run Traffic Script On Node | send_icmp_wait_for_reply.py -| | ... | ${tg_node} | ${args} diff --git a/resources/libraries/robot/ipv6.robot b/resources/libraries/robot/ipv6.robot deleted file mode 100644 index b82c995e3a..0000000000 --- a/resources/libraries/robot/ipv6.robot +++ /dev/null @@ -1,195 +0,0 @@ -# Copyright (c) 2016 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. - -"""IPv6 keywords""" - -*** Settings *** -| Library | resources.libraries.python.IPv6Util -| Library | resources.libraries.python.IPv6Setup -| Library | resources.libraries.python.TrafficScriptExecutor -| Library | resources.libraries.python.NodePath -| Library | resources.libraries.python.Routing -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.topology.Topology -| Resource | resources/libraries/robot/default.robot -| Resource | resources/libraries/robot/counters.robot -| Documentation | IPv6 keywords - -*** Keywords *** -| Send IPv6 icmp echo request to DUT1 ingress inteface and verify answer -| | [Documentation] | Type of the src_node must be TG and dst_node must be DUT -| | [Arguments] | ${tg_node} | ${dut_node} | ${nodes_addr} -| | Append Nodes | ${tg_node} | ${dut_node} -| | Compute Path -| | ${src_port} | ${src_node}= | First Interface -| | ${dst_port} | ${dst_node}= | Last Interface -| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} -| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} -| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} -| | ${dst_mac}= | Get Interface Mac | ${dst_node} | ${dst_port} -| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} -| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} | ${src_mac} -| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} -| | Run Traffic Script On Node | icmpv6_echo.py | ${tg_node} | ${args} -| | Get interface statistics | ${dst_node} -| | ${ipv6_counter}= | Get interface ipv6 counter | ${dst_node} | ${dst_port} -| | Should Be Equal | ${ipv6_counter} | ${2} | #ICMPv6 neighbor advertisement + ICMPv6 echo request - -| Execute IPv6 ICMP echo sweep -| | [Documentation] | Type of the src_node must be TG and dst_node must be DUT -| | [Arguments] | ${src_node} | ${dst_node} | ${start_size} | ${end_size} -| | ... | ${step} | ${nodes_addr} -| | Append Nodes | ${src_node} | ${dst_node} -| | Compute Path -| | ${src_port} | ${src_node}= | First Interface -| | ${dst_port} | ${dst_node}= | Last Interface -| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} -| | ... | ${nodes_addr} -| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} -| | ... | ${nodes_addr} -| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} -| | ${dst_mac}= | Get Interface Mac | ${dst_node} | ${dst_port} -| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} -| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} -| | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} -| | ${args}= | Set Variable -| | ... | ${args} --start_size ${start_size} --end_size ${end_size} --step ${step} -| | Run Traffic Script On Node | ipv6_sweep_ping.py | ${src_node} | ${args} -| | ... | timeout=${180} - -| Send IPv6 ICMP echo request to DUT1 egress interface and verify answer -| | [Documentation] | Send traffic from TG to first DUT egress interface -| | [Arguments] | ${tg_node} | ${first_dut} | ${second_dut} | ${nodes_addr} -| | Append Nodes | ${tg_node} | ${first_dut} | ${second_dut} -| | Compute Path -| | ${src_port} | ${src_node}= | First Interface -| | ${dst_port} | ${dst_node}= | Last Egress Interface -| | ${hop_port} | ${hop_node}= | First Ingress Interface -| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} -| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} -| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} -| | ${dst_mac}= | Get Interface Mac | ${hop_node} | ${hop_port} -| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} -| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} | ${src_mac} -| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} -| | Run Traffic Script On Node | icmpv6_echo.py | ${tg_node} | ${args} - - -| Send IPv6 ICMP echo request to DUT2 via DUT1 and verify answer -| | [Documentation] | Send traffic from TG to second DUT through first DUT -| | [Arguments] | ${tg_node} | ${first_dut} | ${second_dut} | ${nodes_addr} -| | Append Nodes | ${tg_node} | ${first_dut} | ${second_dut} -| | Compute Path -| | ${src_port} | ${src_node}= | First Interface -| | ${dst_port} | ${dst_node}= | Last Interface -| | ${hop_port} | ${hop_node}= | First Ingress Interface -| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} -| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} -| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} -| | ${dst_mac}= | Get Interface Mac | ${hop_node} | ${hop_port} -| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} -| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} | ${src_mac} -| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} -| | Run Traffic Script On Node | icmpv6_echo.py | ${tg_node} | ${args} - -| Send IPv6 ICMP echo request to DUT2 egress interface via DUT1 and verify answer -| | [Documentation] | Send traffic from TG to second DUT egress interface through first DUT -| | [Arguments] | ${tg_node} | ${first_dut} | ${second_dut} | ${nodes_addr} -| | Append Nodes | ${tg_node} | ${first_dut} | ${second_dut} | ${tg_node} -| | Compute Path -| | ${src_port} | ${src_node}= | First Interface -| | ${dst_port} | ${dst_node}= | Last Egress Interface -| | ${hop_port} | ${hop_node}= | First Ingress Interface -| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} -| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} -| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} -| | ${dst_mac}= | Get Interface Mac | ${hop_node} | ${hop_port} -| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} -| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} | ${src_mac} -| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} -| | Run Traffic Script On Node | icmpv6_echo.py | ${tg_node} | ${args} - -| Ipv6 tg to tg routed -| | [Documentation] | Send traffic from one TG port to another through DUT nodes -| | ... | and send reply back, also verify hop limit processing -| | [Arguments] | ${tg_node} | ${first_dut} | ${second_dut} | ${nodes_addr} -| | Append Nodes | ${tg_node} | ${first_dut} | ${second_dut} | ${tg_node} -| | Compute Path -| | ${src_port} | ${src_node}= | First Interface -| | ${dst_port} | ${dst_node}= | Last Interface -| | ${src_nh_port} | ${src_nh_node}= | First Ingress Interface -| | ${dst_nh_port} | ${dst_nh_node}= | Last Egress Interface -| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} -| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} -| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} -| | ${dst_mac}= | Get Interface Mac | ${src_node} | ${dst_port} -| | ${src_nh_mac}= | Get Interface Mac | ${src_nh_node} | ${src_nh_port} -| | ${dst_nh_mac}= | Get Interface Mac | ${dst_nh_node} | ${dst_nh_port} -| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} -| | ${dst_port_name}= | Get interface name | ${dst_node} | ${dst_port} -| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${dst_port_name} | ${src_mac} -| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} -| | ${args}= | Catenate | ${args} | --src_nh_mac ${src_nh_mac} -| | | ... | --dst_nh_mac ${dst_nh_mac} | --h_num 2 -| | Run Traffic Script On Node | icmpv6_echo_req_resp.py | ${tg_node} | ${args} - -| Send IPv6 neighbor solicitation and verify answer -| | [Documentation] | Send IPv6 neighbor solicitation from TG to DUT -| | [Arguments] | ${tg_node} | ${dut_node} | ${nodes_addr} -| | Append Nodes | ${tg_node} | ${dut_node} -| | Compute Path -| | ${src_port} | ${src_node}= | First Interface -| | ${dst_port} | ${dst_node}= | Last Interface -| | ${src_ip}= | Get Node Port Ipv6 Address | ${src_node} | ${src_port} | ${nodes_addr} -| | ${dst_ip}= | Get Node Port Ipv6 Address | ${dst_node} | ${dst_port} | ${nodes_addr} -| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} -| | ${dst_mac}= | Get Interface Mac | ${dst_node} | ${dst_port} -| | ${src_port_name}= | Get interface name | ${src_node} | ${src_port} -| | ${args}= | Traffic Script Gen Arg | ${src_port_name} | ${src_port_name} | ${src_mac} -| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} -| | Run Traffic Script On Node | ipv6_ns.py | ${src_node} | ${args} - -| Configure IPv6 on all DUTs in topology -| | [Documentation] | Setup IPv6 address on all DUTs -| | [Arguments] | ${nodes} | ${nodes_addr} -| | Configure all DUTs before test -| | ${interfaces}= | Nodes Set Ipv6 Addresses | ${nodes} | ${nodes_addr} -| | :FOR | ${interface} | IN | @{interfaces} -| | | Set Interface State | @{interface} | up | if_type=name -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Suppress ICMPv6 router advertisement message -| | [Documentation] | Suppress ICMPv6 router advertisement message for link scope address -| | [Arguments] | ${nodes} -| | Vpp All Ra Suppress Link Layer | ${nodes} - -| Configure IPv6 routing on all DUTs -| | [Documentation] | Setup routing on all VPP nodes required for IPv6 tests -| | [Arguments] | ${nodes} | ${nodes_addr} -| | Append Nodes | ${nodes['DUT1']} | ${nodes['DUT2']} -| | Compute Path -| | ${tg}= | Set Variable | ${nodes['TG']} -| | ${dut1_if} | ${dut1}= | First Interface -| | ${dut2_if} | ${dut2}= | Last Interface -| | ${dut1_if_addr}= | Get Node Port Ipv6 Address | ${dut1} | ${dut1_if} | ${nodes_addr} -| | ${dut2_if_addr}= | Get Node Port Ipv6 Address | ${dut2} | ${dut2_if} | ${nodes_addr} -| | @{tg_dut1_links}= | Get active links connecting "${tg}" and "${dut1}" -| | @{tg_dut2_links}= | Get active links connecting "${tg}" and "${dut2}" -| | :FOR | ${link} | IN | @{tg_dut1_links} -| | | ${net}= | Get Link Address | ${link} | ${nodes_addr} -| | | ${prefix}= | Get Link Prefix | ${link} | ${nodes_addr} -| | | Vpp Route Add | ${dut2} | ${net} | ${prefix} | ${dut1_if_addr} | ${dut2_if} -| | :FOR | ${link} | IN | @{tg_dut2_links} -| | | ${net}= | Get Link Address | ${link} | ${nodes_addr} -| | | ${prefix}= | Get Link Prefix | ${link} | ${nodes_addr} -| | | Vpp Route Add | ${dut1} | ${net} | ${prefix} | ${dut2_if_addr} | ${dut1_if} diff --git a/resources/libraries/robot/l2/l2_bridge_domain.robot b/resources/libraries/robot/l2/l2_bridge_domain.robot new file mode 100644 index 0000000000..9c6c29dc7d --- /dev/null +++ b/resources/libraries/robot/l2/l2_bridge_domain.robot @@ -0,0 +1,279 @@ +# Copyright (c) 2016 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 +| Library | resources.libraries.python.NodePath +| Library | resources.libraries.python.VhostUser +| Resource | resources/libraries/robot/shared/interfaces.robot +| Resource | resources/libraries/robot/l2/l2_traffic.robot + +*** Keywords *** +| Configure L2BD forwarding +| | [Documentation] | Setup BD between 2 interfaces on VPP node and if learning +| | ... | is off set static L2FIB entry on second interface +| | [Arguments] | ${node} | ${if1} | ${if2} | ${learn}=${TRUE} | ${mac}=${EMPTY} +| | Set Interface State | ${node} | ${if1} | up +| | Set Interface State | ${node} | ${if2} | up +| | Vpp Add L2 Bridge Domain | ${node} | ${1} | ${if1} | ${if2} | ${learn} +| | Run Keyword If | ${learn} == ${FALSE} +| | ... | Vpp Add L2fib Entry | ${node} | ${mac} | ${if2} | ${1} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Configure path for 3-node BD-SHG test +| | [Documentation] | Compute path for bridge domain split-horizon group testing +| | ... | on three given nodes with following interconnections +| | ... | TG - (2 links) - DUT1 - (1 link) - DUT2 - (2 links) - TG +| | ... | and set corresponding test case variables. +| | ... +| | ... | *Arguments:* +| | ... | - ${tg_node} - TG node. Type: dictionary +| | ... | - ${dut1_node} - DUT1 node. Type: dictionary +| | ... | - ${dut2_node} - DUT2 node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | _NOTE:_ This KW sets following test case variables: +| | ... | - ${tg_node} - TG node. +| | ... | - ${tg_to_dut1_if1} - TG interface 1 towards DUT1. +| | ... | - ${tg_to_dut1_if2} - TG interface 2 towards DUT1. +| | ... | - ${tg_to_dut2_if1} - TG interface 1 towards DUT2. +| | ... | - ${tg_to_dut2_if2} - TG interface 2 towards DUT2. +| | ... | - ${dut1_node} - DUT1 node. +| | ... | - ${dut1_to_tg_if1} - DUT1 interface 1 towards TG. +| | ... | - ${dut1_to_tg_if2} - DUT1 interface 2 towards TG. +| | ... | - ${dut1_to_dut2} - DUT1 interface towards DUT2. +| | ... | - ${dut2_node} - DUT2 node. +| | ... | - ${dut2_to_tg_if1} - DUT2 interface 1 towards TG. +| | ... | - ${dut2_to_tg_if2} - DUT2 interface 2 towards TG. +| | ... | - ${dut2_to_dut1} - DUT2 interface towards DUT1. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Given Configure path for 3-node BD-SHG test \| ${nodes['TG']} \ +| | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \| +| | [Arguments] | ${tg_node} | ${dut1_node} | ${dut2_node} +| | # Compute path TG - DUT1 with two links in between +| | Append Nodes | ${tg_node} | ${dut1_node} | ${tg_node} +| | Compute Path | always_same_link=${FALSE} +| | ${tg_to_dut1_if1} | ${tmp}= | First Interface +| | ${tg_to_dut1_if2} | ${tmp}= | Last Interface +| | ${dut1_to_tg_if1} | ${tmp}= | First Ingress Interface +| | ${dut1_to_tg_if2} | ${tmp}= | Last Egress Interface +| | # Compute path TG - DUT2 with two links in between +| | Clear Path +| | Append Nodes | ${tg_node} | ${dut2_node} | ${tg_node} +| | Compute Path | always_same_link=${FALSE} +| | ${tg_to_dut2_if1} | ${tmp}= | First Interface +| | ${tg_to_dut2_if2} | ${tmp}= | Last Interface +| | ${dut2_to_tg_if1} | ${tmp}= | First Ingress Interface +| | ${dut2_to_tg_if2} | ${tmp}= | Last Egress Interface +| | # Compute path DUT1 - DUT2 with one link in between +| | Clear Path +| | Append Nodes | ${dut1_node} | ${dut2_node} +| | Compute Path +| | ${dut1_to_dut2} | ${tmp}= | Next Interface +| | ${dut2_to_dut1} | ${tmp}= | Next Interface +| | # Set test variables +| | Set Test Variable | ${tg_to_dut1_if1} +| | Set Test Variable | ${tg_to_dut1_if2} +| | Set Test Variable | ${tg_to_dut2_if1} +| | Set Test Variable | ${tg_to_dut2_if2} +| | Set Test Variable | ${dut1_to_tg_if1} +| | Set Test Variable | ${dut1_to_tg_if2} +| | Set Test Variable | ${dut2_to_tg_if1} +| | Set Test Variable | ${dut2_to_tg_if2} +| | Set Test Variable | ${dut1_to_dut2} +| | Set Test Variable | ${dut2_to_dut1} +| | Set Test Variable | ${tg_node} +| | Set Test Variable | ${dut1_node} +| | Set Test Variable | ${dut2_node} + +| Set interfaces in 3-node BD-SHG test up +| | [Documentation] | Set UP state on interfaces in 3-node path on nodes and +| | ... | wait for all interfaces are ready. +| | ... +| | ... | *Arguments:* +| | ... | - No arguments. +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | _NOTE:_ This KW uses test variables sets in +| | ... | "Configure path for 3-node BD-SHG test" KW. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure path for 3-node BD-SHG test \| ${nodes['TG']} \ +| | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \| +| | ... | \| Set interfaces in 3-node BD-SHG test up \| +| | ... +| | Set Interface State | ${tg_node} | ${tg_to_dut1_if1} | up +| | Set Interface State | ${tg_node} | ${tg_to_dut1_if2} | up +| | Set Interface State | ${tg_node} | ${tg_to_dut2_if1} | up +| | Set Interface State | ${tg_node} | ${tg_to_dut2_if2} | up +| | Set Interface State | ${dut1_node} | ${dut1_to_tg_if1} | up +| | Set Interface State | ${dut1_node} | ${dut1_to_tg_if2} | up +| | Set Interface State | ${dut2_node} | ${dut2_to_tg_if1} | up +| | Set Interface State | ${dut2_node} | ${dut2_to_tg_if2} | up +| | Set Interface State | ${dut1_node} | ${dut1_to_dut2} | up +| | Set Interface State | ${dut2_node} | ${dut2_to_dut1} | up +| | Vpp Node Interfaces Ready Wait | ${dut1_node} +| | Vpp Node Interfaces Ready Wait | ${dut2_node} + +| Create bridge domain +| | [Documentation] | Create bridge domain on given VPP node with defined +| | ... | learning status. +| | ... +| | ... | *Arguments:* +| | ... | - ${dut_node} - DUT node. Type: dictionary +| | ... | - ${bd_id} - Bridge domain ID. Type: integer +| | ... | - ${learn} - Enable/disable MAC learn. Type: boolean, \ +| | ... | default value: ${TRUE} +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create bridge domain \| ${nodes['DUT1']} \| 2 \| +| | ... | \| Create bridge domain \| ${nodes['DUT1']} \| 5 \ +| | ... | \| learn=${FALSE} \| +| | [Arguments] | ${dut_node} | ${bd_id} | ${learn}=${TRUE} +| | ${learn} = | Set Variable If | ${learn} == ${TRUE} | ${1} | ${0} +| | Create L2 BD | ${dut_node} | ${bd_id} | learn=${learn} + +| Add interface to bridge domain +| | [Documentation] | Set given interface admin state to up and add this +| | ... | interface to required L2 bridge domain on defined +| | ... | VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - ${dut_node} - DUT node. Type: dictionary +| | ... | - ${dut_if} - DUT node interface name. Type: string +| | ... | - ${bd_id} - Bridge domain ID. Type: integer +| | ... | - ${shg} - Split-horizon group ID. Type: integer, default value: 0 +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Add interface to bridge domain \| ${nodes['DUT2']} \ +| | ... | \| GigabitEthernet0/8/0 \| 3 \| +| | [Arguments] | ${dut_node} | ${dut_if} | ${bd_id} | ${shg}=0 +| | Set Interface State | ${dut_node} | ${dut_if} | up +| | Add Interface To L2 BD | ${dut_node} | ${dut_if} | ${bd_id} | ${shg} + +| Add destination port to L2FIB +| | [Documentation] | Create a static L2FIB entry for required destination port +| | ... | on defined interface and bridge domain ID +| | ... | of the given VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - ${dest_node} - Destination node. Type: dictionary +| | ... | - ${dest_node_if} - Destination node interface name. Type: string +| | ... | - ${vpp_node} - DUT node to add L2FIB entry on. Type: dictionary +| | ... | - ${vpp_node_if} - DUT node interface name. Type: string +| | ... | - ${bd_id} - Bridge domain ID. Type: integer +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Add destination port to L2FIB \| ${nodes['TG']} \ +| | ... | \| eth1 \| ${nodes['DUT2']} \| GigabitEthernet0/8/0 \| 3 \| +| | [Arguments] | ${dest_node} | ${dest_node_if} | ${vpp_node} +| | ... | ${vpp_node_if} | ${bd_id} +| | ${mac}= | Get Interface Mac | ${dest_node} | ${dest_node_if} +| | Vpp Add L2fib Entry | ${vpp_node} | ${mac} | ${vpp_node_if} | ${bd_id} + +| 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 +| | Run Keyword Unless | "${qemu_name}" == "vm_node" | Import Library +| | ... | resources.libraries.python.QemuUtils | WITH NAME | ${qemu_name} +| | Set Test Variable | ${${qemu_name}} | ${None} +| | ${qemu_set_node}= | Run Keyword If | "${qemu_name}" == "vm_node" +| | | ... | Set Variable | Qemu Set Node +| | ... | ELSE | Replace Variables | ${qemu_name}.Qemu Set Node +| | Run keyword | ${qemu_set_node} | ${dut_node} +| | ${qemu_add_vhost}= | Run Keyword If | "${qemu_name}" == "vm_node" +| | | ... | Set Variable | Qemu Add Vhost User If +| | ... | ELSE | Replace Variables | ${qemu_name}.Qemu Add Vhost User If +| | Run keyword | ${qemu_add_vhost} | ${sock1} +| | Run keyword | ${qemu_add_vhost} | ${sock2} +| | ${qemu_start}= | Run Keyword If | "${qemu_name}" == "vm_node" +| | | ... | Set Variable | Qemu Start +| | ... | ELSE | Replace Variables | ${qemu_name}.Qemu Start +| | ${vm}= | Run keyword | ${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} + +| Configure vhost interfaces for L2BD forwarding +| | [Documentation] | Create two Vhost-User interfaces on defined VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - ${dut_node} - DUT node. Type: dictionary +| | ... | - ${sock1} - Socket path for first Vhost-User interface. Type: string +| | ... | - ${sock2} - Socket path for second Vhost-User interface. Type: string +| | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional). +| | ... | Type: string +| | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional). +| | ... | Type: string +| | ... +| | ... | _NOTE:_ This KW sets following test case variable: +| | ... | - ${${vhost_if1}} - First Vhost-User interface. +| | ... | - ${${vhost_if2}} - Second Vhost-User interface. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure vhost interfaces for L2BD forwarding \ +| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| +| | ... | \| Configure vhost interfaces for L2BD forwarding \ +| | ... | \| ${nodes['DUT2']} \| /tmp/sock1 \| /tmp/sock2 \| dut2_vhost_if1 \ +| | ... | \| dut2_vhost_if2 \| +| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1 +| | ... | ${vhost_if2}=vhost_if2 +| | ${vhost_1}= | Vpp Create Vhost User Interface | ${dut_node} | ${sock1} +| | ${vhost_2}= | Vpp Create Vhost User Interface | ${dut_node} | ${sock2} +| | Set Interface State | ${dut_node} | ${vhost_1} | up +| | Set Interface State | ${dut_node} | ${vhost_2} | up +| | Set Test Variable | ${${vhost_if1}} | ${vhost_1} +| | Set Test Variable | ${${vhost_if2}} | ${vhost_2} diff --git a/resources/libraries/robot/l2/l2_traffic.robot b/resources/libraries/robot/l2/l2_traffic.robot new file mode 100644 index 0000000000..bca801778e --- /dev/null +++ b/resources/libraries/robot/l2/l2_traffic.robot @@ -0,0 +1,183 @@ +# Copyright (c) 2016 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.topology.Topology +| Library | resources.libraries.python.TrafficScriptExecutor +| Documentation | Keywords to send and receive different types of traffic \ +| ... | through L2 network. + +*** Keywords *** +| Send ICMP packet and verify received packet +| | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to \ +| | ... | destination interface. Packet can be set with Dot1q or +| | ... | Dot1ad tag(s) when required. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - src_int - Source interface. Type: string +| | ... | - dst_int - Destination interface. Type: string +| | ... | - src_ip - Source IP address (Optional). Type: string +| | ... | - dst_ip - Destination IP address (Optional). Type: string +| | ... | - encaps - Encapsulation: Dot1q or Dot1ad (Optional). Type: string +| | ... | - vlan1 - VLAN (outer) tag (Optional). Type: integer +| | ... | - vlan2 - VLAN inner tag (Optional). Type: integer +| | ... | - encaps_rx - Expected encapsulation on RX side: Dot1q or Dot1ad +| | ... | (Optional). Type: string +| | ... | - vlan1_rx - VLAN (outer) tag on RX side (Optional). Type: integer +| | ... | - vlan2_rx - VLAN inner tag on RX side (Optional). Type: integer +| | ... +| | ... | *Return:* +| | ... +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | _NOTE:_ Default IP is IPv4 +| | ... +| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| +| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=100 \| +| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1ad \| vlan1=110 \ +| | ... | \| vlan2=220 \| +| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=110 \ +| | ... | \| encaps_rx=Dot1q \| +| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=110 \ +| | ... | \| encaps_rx=Dot1q \| vlan1_rx=120 \| +| | ... +| | [Arguments] | ${tg_node} | ${src_int} | ${dst_int} +| | ... | ${src_ip}=192.168.100.1 | ${dst_ip}=192.168.100.2 | ${encaps}=${EMPTY} +| | ... | ${vlan1}=${EMPTY} | ${vlan2}=${EMPTY} | ${encaps_rx}=${EMPTY} +| | ... | ${vlan1_rx}=${EMPTY} | ${vlan2_rx}=${EMPTY} +| | ... +| | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int} +| | ${dst_mac}= | Get Interface Mac | ${tg_node} | ${dst_int} +| | ${src_int_name}= | Get interface name | ${tg_node} | ${src_int} +| | ${dst_int_name}= | Get interface name | ${tg_node} | ${dst_int} +| | ${args}= | Traffic Script Gen Arg | ${dst_int_name} | ${src_int_name} +| | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} +| | ${args}= | Run Keyword If | '${encaps}' == '${EMPTY}' +| | | ... | Set Variable | ${args} +| | ... | ELSE | Catenate | ${args} | --encaps ${encaps} | --vlan1 ${vlan1} +| | ${args}= | Run Keyword If | '${vlan2}' == '${EMPTY}' +| | | ... | Set Variable | ${args} +| | ... | ELSE | Catenate | ${args} | --vlan2 ${vlan2} +| | ${args}= | Run Keyword If | '${encaps_rx}' == '${EMPTY}' +| | | ... | Set Variable | ${args} +| | ... | ELSE | Catenate | ${args} | --encaps_rx ${encaps_rx} +| | ${args}= | Run Keyword If | '${vlan1_rx}' == '${EMPTY}' +| | | ... | Set Variable | ${args} +| | ... | ELSE | Catenate | ${args} | --vlan1_rx ${vlan1_rx} +| | ${args}= | Run Keyword If | '${vlan2_rx}' == '${EMPTY}' +| | | ... | Set Variable | ${args} +| | ... | ELSE | Catenate | ${args} | --vlan2_rx ${vlan2_rx} +| | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args} + +| ICMP packet transmission should fail +| | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to +| | ... | destination interface and expect failure with +| | ... | ICMP echo Rx timeout error message. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - src_int - Source interface. Type: string +| | ... | - dst_int - Destination interface. Type: string +| | ... | - src_ip - Source IP address (Optional). Type: string +| | ... | - dst_ip - Destination IP address (Optional). Type: string +| | ... +| | ... | *Return:* +| | ... +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | _NOTE:_ Default IP is IPv4 +| | ... +| | ... | \| ICMP packet transmission should fail\| ${nodes['TG']} \ +| | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| +| | ... +| | [Arguments] | ${tg_node} | ${src_int} | ${dst_int} | +| | ... | ${src_ip}=192.168.100.1 | ${dst_ip}=192.168.100.2 +| | ... +| | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int} +| | ${dst_mac}= | Get Interface Mac | ${tg_node} | ${dst_int} +| | ${src_int_name}= | Get interface name | ${tg_node} | ${src_int} +| | ${dst_int_name}= | Get interface name | ${tg_node} | ${dst_int} +| | ${args}= | Traffic Script Gen Arg | ${dst_int_name} | ${src_int_name} +| | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} +| | Run Keyword And Expect Error | ICMP echo Rx timeout | +| | ... | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args} + +| Send ICMPv4 bidirectionally and verify received packets +| | [Documentation] | Send ICMPv4 echo request from both directions, +| | ... | from interface1 to interface2 and from interface2 to interface1. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - src_int - Source interface. Type: string +| | ... | - dst_int - Destination interface. Type: string +| | ... | - src_ip - Source IP address (Optional). Type: string +| | ... | - dst_ip - Destination IP address (Optional). Type: string +| | ... +| | ... | *Return:* +| | ... +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send ICMPv4 bidirectionally and verify received packets \ +| | ... | \| ${nodes['TG']} \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| +| | ... +| | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=192.168.100.1 | +| | ... | ${dst_ip}=192.168.100.2 +| | ... +| | Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${int1} | ${int2} | ${src_ip} | ${dst_ip} +| | Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${int2} | ${int1} | ${dst_ip} | ${src_ip} + +| Send ICMPv6 bidirectionally and verify received packets +| | [Documentation] | Send ICMPv6 echo request from both directions, +| | ... | from interface1 to interface2 and from interface2 to interface1. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - src_int - Source interface. Type: string +| | ... | - dst_int - Destination interface. Type: string +| | ... | - src_ip - Source IP address (Optional). Type: string +| | ... | - dst_ip - Destination IP address (Optional). Type: string +| | ... +| | ... | *Return:* +| | ... +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send ICMPv6 bidirectionally and verify received packets \ +| | ... | \| ${nodes['TG']} \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| +| | ... +| | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=3ffe:63::1 | +| | ... | ${dst_ip}=3ffe:63::2 +| | ... +| | Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${int1} | ${int2} | ${src_ip} | ${dst_ip} +| | Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${int2} | ${int1} | ${dst_ip} | ${src_ip} diff --git a/resources/libraries/robot/l2/l2_xconnect.robot b/resources/libraries/robot/l2/l2_xconnect.robot new file mode 100644 index 0000000000..00d33e867a --- /dev/null +++ b/resources/libraries/robot/l2/l2_xconnect.robot @@ -0,0 +1,24 @@ +# Copyright (c) 2016 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 L2XC +| | [Documentation] | Setup Bidirectional Cross Connect on DUTs +| | [Arguments] | ${node} | ${if1} | ${if2} | +| | Set Interface State | ${node} | ${if1} | up +| | Set Interface State | ${node} | ${if2} | up +| | Vpp Setup Bidirectional Cross Connect | ${node} | ${if1} | ${if2} diff --git a/resources/libraries/robot/l2/tagging.robot b/resources/libraries/robot/l2/tagging.robot new file mode 100644 index 0000000000..7731ed193e --- /dev/null +++ b/resources/libraries/robot/l2/tagging.robot @@ -0,0 +1,219 @@ +# Copyright (c) 2016 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 for VLAN tests +| Resource | resources/libraries/robot/shared/default.robot +| Resource | resources/libraries/robot/l2/l2_xconnect.robot +| Library | resources.libraries.python.L2Util +| Library | resources.libraries.python.InterfaceUtil +| Library | resources.libraries.python.NodePath + +*** Keywords *** + +| Initialize VLAN sub-interfaces in 3-node circular topology +| | [Arguments] | ${DUT1} | ${INT1} | ${DUT2} | ${INT2} | ${SUB_ID} +| | ... | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID} | ${TYPE_SUBIF} +| | [Documentation] | *Create two subinterfaces on DUTs.* +| | ... +| | ... | *Arguments:* +| | ... | - DUT1 - Node to add sub-interface. +| | ... | - INT1 - Interface name on which create sub-interface. +| | ... | - DUT2 - Node to add sub-interface. +| | ... | - INT2 - Interface name on which create sub-interface. +| | ... | - SUB_ID - ID of the sub-interface to be created. +| | ... | - OUTER_VLAN_ID - Outer VLAN ID. +| | ... | - INNER_VLAN_ID - Inner VLAN ID. +| | ... | - TYPE_SUBIF - Type of sub-interface. +| | ... +| | ... | _Set testcase variables with name and index of created interfaces:_ +| | ... | - subif_name_1 +| | ... | - subif_index_1 +| | ... | - subif_name_2 +| | ... | - subif_index_2 +| | ... +| | ${INT1_name}= | Get interface name | ${DUT1} | ${INT1} +| | ${subif_name_1} | ${subif_index_1}= | Create subinterface | ${DUT1} +| | ... | ${INT1_name} | ${SUB_ID} +| | ... | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID} +| | ... | ${TYPE_SUBIF} +| | ${INT2_name}= | Get interface name | ${DUT2} | ${INT2} +| | ${subif_name_2} | ${subif_index_2}= | Create subinterface | ${DUT2} +| | ... | ${INT2_name} | ${SUB_ID} +| | ... | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID} +| | ... | ${TYPE_SUBIF} +| | Set Interface State | ${DUT1} | ${subif_index_1} | up +| | Set Interface State | ${DUT2} | ${subif_index_2} | up +| | Set Test Variable | ${subif_name_1} +| | Set Test Variable | ${subif_index_1} +| | Set Test Variable | ${subif_name_2} +| | Set Test Variable | ${subif_index_2} + +| Initialize VLAN dot1q sub-interfaces in 3-node circular topology +| | [Arguments] | ${DUT1} | ${INT1} | ${DUT2} | ${INT2} | ${SUB_ID} +| | [Documentation] | *Create two dot1q subinterfaces on DUTs.* +| | ... +| | ... | *Arguments:* +| | ... | - DUT1 - Node to add sub-interface. +| | ... | - INT1 - Interface name on which create VLAN sub-interface. +| | ... | - DUT2 - Node to add sub-interface. +| | ... | - INT2 - Interface name on which create VLAN sub-interface. +| | ... | - SUB_ID - ID of the sub-interface to be created. +| | ... +| | ... | _Set testcase variables with name and index of created interfaces:_ +| | ... | - subif_name_1 +| | ... | - subif_index_1 +| | ... | - subif_name_2 +| | ... | - subif_index_2 +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Initialize VLAN dot1q sub-interfaces in 3-node circular topology \ +| | ... | \| ${nodes['DUT1']} \| ${dut1_if2} \| ${nodes['DUT2']} \ +| | ... | \| ${dut1_if2} \| 10 \| +| | ... +| | ${INT1_NAME}= | Get interface name | ${DUT1} | ${INT1} +| | ${INT2_NAME}= | Get interface name | ${DUT2} | ${INT2} +| | ${subif_name_1} | ${subif_index_1}= | Create Vlan Subinterface +| | | ... | ${DUT1} | ${INT1_NAME} | ${SUB_ID} +| | ${subif_name_2} | ${subif_index_2}= | Create Vlan Subinterface +| | | ... | ${DUT2} | ${INT2_NAME} | ${SUB_ID} +| | Set Interface State | ${DUT1} | ${subif_index_1} | up +| | Set Interface State | ${DUT2} | ${subif_index_2} | up +| | Set Test Variable | ${subif_name_1} +| | Set Test Variable | ${subif_index_1} +| | Set Test Variable | ${subif_name_2} +| | Set Test Variable | ${subif_index_2} + +| Configure L2 tag rewrite method on interfaces +| | [Arguments] | ${DUT1} | ${SUB_INT1} | ${DUT2} | ${SUB_INT2} +| | ... | ${TAG_REWRITE_METHOD} +| | [Documentation] | *Setup tag rewrite on sub-interfaces on DUTs.* +| | ... +| | ... | *Arguments:* +| | ... | - DUT1 - Node to rewrite tags. +| | ... | - SUB_INT1 - Interface on which rewrite tags. +| | ... | - DUT2 - Node to rewrite tags. +| | ... | - SUB_INT2 - Interface on which rewrite tags. +| | ... | - TAG_REWRITE_METHOD - Method of tag rewrite. +| | ... +| | L2 Vlan tag rewrite | ${DUT1} | ${SUB_INT1} | ${TAG_REWRITE_METHOD} +| | L2 Vlan tag rewrite | ${DUT2} | ${SUB_INT2} | ${TAG_REWRITE_METHOD} + +| Connect interfaces and VLAN sub-interfaces using L2XC +| | [Arguments] | ${DUT1} | ${INT1} | ${SUB_INT1} +| | ... | ${DUT2} | ${INT2} | ${SUB_INT2} +| | [Documentation] | *Add interface and subinterface to bidirectional +| | ... | L2-xconnect on DUTs.* +| | ... +| | ... | *Arguments:* +| | ... | - DUT1 - Node to add bidirectional cross-connect. +| | ... | - INT1 - Interface to add to the cross-connect. +| | ... | - SUB_INT1 - Sub-interface to add to the cross-connect. +| | ... | - DUT2 - Node to add bidirectional cross-connect. +| | ... | - INT2 - Interface to add to the cross-connect. +| | ... | - SUB_INT2 - Sub-interface to add to the cross-connect. +| | ... +| | Configure L2XC | ${DUT1} | ${INT1} | ${SUB_INT1} +| | Configure L2XC | ${DUT2} | ${INT2} | ${SUB_INT2} + +| Create vlan sub-interface +| | [Documentation] | Create VLAN sub-interface on DUT and set admin status up. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - Node to add VLAN sub-intreface. Type: dictionary +| | ... | - interface - Interface to create VLAN sub-interface. Type: string +| | ... | - vlan_id - VLAN ID. Type: integer +| | ... +| | ... | *Return:* +| | ... | - vlan_name - VLAN sub-interface name. Type: string +| | ... | - vlan_index - VLAN sub-interface SW index. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create vlan sub-interface \| ${nodes['DUT1']} \| port3 \| 100 \| +| | ... +| | [Arguments] | ${dut_node} | ${interface} | ${vlan_id} +| | [Return] | ${vlan_name} | ${vlan_index} +| | ${interface_name}= | Get interface name | ${dut_node} | ${interface} +| | ${vlan_name} | ${vlan_index}= | Create Vlan Subinterface +| | ... | ${dut_node} | ${interface_name} | ${vlan_id} +| | Set Interface State | ${dut_node} | ${vlan_index} | up + +| Create tagged sub-interface +| | [Documentation] | Create tagged sub-interface on DUT. Type of tagged \ +| | ... | sub-intreface depends on type_subif value: +| | ... | - one_tag -> VLAN +| | ... | - two_tags -> QinQ VLAN +| | ... | - two_tags dot1ad - DOT1AD +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - Node to add VLAN sub-intreface. Type: dictionary +| | ... | - interface - Interface to create tagged sub-interface. Type: string +| | ... | - subif_id - Sub-interface ID. Type: integer +| | ... | - outer_vlan_id - VLAN (outer) ID (Optional). Type: integer +| | ... | - inner_vlan_id - VLAN inner ID (Optional). Type: integer +| | ... | - type_subif - Sub-interface type (Optional). Type: string +| | ... +| | ... | *Return:* +| | ... | - subif_name - Sub-interface name. Type: string +| | ... | - subif_index - Sub-interface SW index. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create tagged sub-interface \| ${nodes['DUT1']} \| port1 \| 10 \ +| | ... | \| outer_vlan_id=100 \| inner_vlan_id=200 \ +| | ... | \| type_subif=two_tags dot1ad \| +| | ... +| | [Arguments] | ${dut_node} | ${interface} | ${subif_id} +| | ... | ${outer_vlan_id}=${None} | ${inner_vlan_id}=${None} +| | ... | ${type_subif}=${None} +| | [Return] | ${subif_name} | ${subif_index} +| | ${interface_name}= | Get interface name | ${dut_node} | ${interface} +| | ${subif_name} | ${subif_index}= | Create Subinterface +| | ... | ${dut_node} | ${interface_name} | ${subif_id} +| | ... | outer_vlan_id=${outer_vlan_id} | inner_vlan_id=${inner_vlan_id} +| | ... | type_subif=${type_subif} + +| Configure L2 tag rewrite method on interface +| | [Documentation] | Set L2 tag rewrite on (sub-)interface on DUT +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - Node to set L2 tag rewrite method. Type: dictionary +| | ... | - interface - (Sub-)interface name or SW index to set L2 tag rewrite +| | ... | method. Type: string or integer +| | ... | - tag_rewrite_method - Tag rewrite method. Type: string +| | ... | - push_dot1q - True to push tags as Dot1q, False to push tags as +| | ... | Dot1ad (Optional). Type: boolean +| | ... | - tag1_id - VLAN tag1 ID (Optional). Type: integer +| | ... | - tag2_id - VLAN tag2 ID (Optional). Type: integer +| | ... +| | ... | *Return:* +| | ... +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure L2 tag rewrite method on interface \| ${nodes['DUT1']} \ +| | ... | \| 9 \| pop-1 \| +| | ... | \| Configure L2 tag rewrite method on interface \| ${nodes['DUT2']} \ +| | ... | \| 10 \| translate-1-2 \| push_dot1q=${False} \| tag1_id=10 \ +| | ... | \| tag1_id=20 \| +| | ... +| | [Arguments] | ${dut_node} | ${interface} | ${tag_rewrite_method} +| | ... | ${push_dot1q}=${True} | ${tag1_id}=${None} | ${tag2_id}=${None} +| | ${result}= | Evaluate | isinstance($interface, int) +| | ${interface_name}= | Run Keyword If | ${result} | Set Variable | ${interface} +| | ... | ELSE | Get interface name | ${dut_node} | ${interface} +| | L2 Vlan Tag Rewrite | ${dut_node} | ${interface_name} | ${tag_rewrite_method} +| | ... | push_dot1q=${push_dot1q} | tag1_id=${tag1_id} | tag2_id=${tag2_id} diff --git a/resources/libraries/robot/l2_traffic.robot b/resources/libraries/robot/l2_traffic.robot deleted file mode 100644 index bca801778e..0000000000 --- a/resources/libraries/robot/l2_traffic.robot +++ /dev/null @@ -1,183 +0,0 @@ -# Copyright (c) 2016 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.topology.Topology -| Library | resources.libraries.python.TrafficScriptExecutor -| Documentation | Keywords to send and receive different types of traffic \ -| ... | through L2 network. - -*** Keywords *** -| Send ICMP packet and verify received packet -| | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to \ -| | ... | destination interface. Packet can be set with Dot1q or -| | ... | Dot1ad tag(s) when required. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - src_int - Source interface. Type: string -| | ... | - dst_int - Destination interface. Type: string -| | ... | - src_ip - Source IP address (Optional). Type: string -| | ... | - dst_ip - Destination IP address (Optional). Type: string -| | ... | - encaps - Encapsulation: Dot1q or Dot1ad (Optional). Type: string -| | ... | - vlan1 - VLAN (outer) tag (Optional). Type: integer -| | ... | - vlan2 - VLAN inner tag (Optional). Type: integer -| | ... | - encaps_rx - Expected encapsulation on RX side: Dot1q or Dot1ad -| | ... | (Optional). Type: string -| | ... | - vlan1_rx - VLAN (outer) tag on RX side (Optional). Type: integer -| | ... | - vlan2_rx - VLAN inner tag on RX side (Optional). Type: integer -| | ... -| | ... | *Return:* -| | ... -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | _NOTE:_ Default IP is IPv4 -| | ... -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ -| | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ -| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=100 \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ -| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1ad \| vlan1=110 \ -| | ... | \| vlan2=220 \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ -| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=110 \ -| | ... | \| encaps_rx=Dot1q \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ -| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=110 \ -| | ... | \| encaps_rx=Dot1q \| vlan1_rx=120 \| -| | ... -| | [Arguments] | ${tg_node} | ${src_int} | ${dst_int} -| | ... | ${src_ip}=192.168.100.1 | ${dst_ip}=192.168.100.2 | ${encaps}=${EMPTY} -| | ... | ${vlan1}=${EMPTY} | ${vlan2}=${EMPTY} | ${encaps_rx}=${EMPTY} -| | ... | ${vlan1_rx}=${EMPTY} | ${vlan2_rx}=${EMPTY} -| | ... -| | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int} -| | ${dst_mac}= | Get Interface Mac | ${tg_node} | ${dst_int} -| | ${src_int_name}= | Get interface name | ${tg_node} | ${src_int} -| | ${dst_int_name}= | Get interface name | ${tg_node} | ${dst_int} -| | ${args}= | Traffic Script Gen Arg | ${dst_int_name} | ${src_int_name} -| | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} -| | ${args}= | Run Keyword If | '${encaps}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --encaps ${encaps} | --vlan1 ${vlan1} -| | ${args}= | Run Keyword If | '${vlan2}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --vlan2 ${vlan2} -| | ${args}= | Run Keyword If | '${encaps_rx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --encaps_rx ${encaps_rx} -| | ${args}= | Run Keyword If | '${vlan1_rx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --vlan1_rx ${vlan1_rx} -| | ${args}= | Run Keyword If | '${vlan2_rx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --vlan2_rx ${vlan2_rx} -| | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args} - -| ICMP packet transmission should fail -| | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to -| | ... | destination interface and expect failure with -| | ... | ICMP echo Rx timeout error message. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - src_int - Source interface. Type: string -| | ... | - dst_int - Destination interface. Type: string -| | ... | - src_ip - Source IP address (Optional). Type: string -| | ... | - dst_ip - Destination IP address (Optional). Type: string -| | ... -| | ... | *Return:* -| | ... -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | _NOTE:_ Default IP is IPv4 -| | ... -| | ... | \| ICMP packet transmission should fail\| ${nodes['TG']} \ -| | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| -| | ... -| | [Arguments] | ${tg_node} | ${src_int} | ${dst_int} | -| | ... | ${src_ip}=192.168.100.1 | ${dst_ip}=192.168.100.2 -| | ... -| | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int} -| | ${dst_mac}= | Get Interface Mac | ${tg_node} | ${dst_int} -| | ${src_int_name}= | Get interface name | ${tg_node} | ${src_int} -| | ${dst_int_name}= | Get interface name | ${tg_node} | ${dst_int} -| | ${args}= | Traffic Script Gen Arg | ${dst_int_name} | ${src_int_name} -| | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} -| | Run Keyword And Expect Error | ICMP echo Rx timeout | -| | ... | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args} - -| Send ICMPv4 bidirectionally and verify received packets -| | [Documentation] | Send ICMPv4 echo request from both directions, -| | ... | from interface1 to interface2 and from interface2 to interface1. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - src_int - Source interface. Type: string -| | ... | - dst_int - Destination interface. Type: string -| | ... | - src_ip - Source IP address (Optional). Type: string -| | ... | - dst_ip - Destination IP address (Optional). Type: string -| | ... -| | ... | *Return:* -| | ... -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send ICMPv4 bidirectionally and verify received packets \ -| | ... | \| ${nodes['TG']} \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| -| | ... -| | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=192.168.100.1 | -| | ... | ${dst_ip}=192.168.100.2 -| | ... -| | Send ICMP packet and verify received packet -| | ... | ${tg_node} | ${int1} | ${int2} | ${src_ip} | ${dst_ip} -| | Send ICMP packet and verify received packet -| | ... | ${tg_node} | ${int2} | ${int1} | ${dst_ip} | ${src_ip} - -| Send ICMPv6 bidirectionally and verify received packets -| | [Documentation] | Send ICMPv6 echo request from both directions, -| | ... | from interface1 to interface2 and from interface2 to interface1. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | - tg_node - TG node. Type: dictionary -| | ... | - src_int - Source interface. Type: string -| | ... | - dst_int - Destination interface. Type: string -| | ... | - src_ip - Source IP address (Optional). Type: string -| | ... | - dst_ip - Destination IP address (Optional). Type: string -| | ... -| | ... | *Return:* -| | ... -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send ICMPv6 bidirectionally and verify received packets \ -| | ... | \| ${nodes['TG']} \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| -| | ... -| | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=3ffe:63::1 | -| | ... | ${dst_ip}=3ffe:63::2 -| | ... -| | Send ICMP packet and verify received packet -| | ... | ${tg_node} | ${int1} | ${int2} | ${src_ip} | ${dst_ip} -| | Send ICMP packet and verify received packet -| | ... | ${tg_node} | ${int2} | ${int1} | ${dst_ip} | ${src_ip} diff --git a/resources/libraries/robot/l2_xconnect.robot b/resources/libraries/robot/l2_xconnect.robot deleted file mode 100644 index 00d33e867a..0000000000 --- a/resources/libraries/robot/l2_xconnect.robot +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2016 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 L2XC -| | [Documentation] | Setup Bidirectional Cross Connect on DUTs -| | [Arguments] | ${node} | ${if1} | ${if2} | -| | Set Interface State | ${node} | ${if1} | up -| | Set Interface State | ${node} | ${if2} | up -| | Vpp Setup Bidirectional Cross Connect | ${node} | ${if1} | ${if2} diff --git a/resources/libraries/robot/lisp/l2lisp.robot b/resources/libraries/robot/lisp/l2lisp.robot deleted file mode 100644 index 3e908a2378..0000000000 --- a/resources/libraries/robot/lisp/l2lisp.robot +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (c) 2016 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 | LISP-gpe encapsulation suite keywords -| Library | resources.libraries.python.topology.Topology -| Resource | resources/libraries/robot/lisp/lisp_api.robot -| Library | resources.libraries.python.LispSetup.LispLocatorSet -| Library | resources.libraries.python.LispSetup.LispLocator -| Library | resources.libraries.python.LispSetup.LispLocalEid -| Library | resources.libraries.python.LispSetup.LispAdjacency -| Library | resources.libraries.python.LispSetup.LispRemoteMapping -| Library | resources.libraries.python.LispSetup.LispMapResolver -| Library | resources.libraries.python.LispSetup.LispEidTableMap - -*** Keywords *** -| Configure L2 LISP on DUT -| | [Documentation] | Set up LISP L2 topology. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - adjacency - DUT static adjacency settings. Type: dict -| | ... | - settings - DUT other LISP related settings. Type: dict -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Configure LISP GPE topology in 3-node circular topology \| ${dut_node} \| ${adjacency} \ -| | ... | \| ${settings} \| -| | ... -| | [Arguments] -| | ... | ${dut_node} | ${adjacency} | ${settings} -| | ... -| | ${int_idx}= | Get Interface Sw Index | ${dut_node} | ${${adjacency['int']}} -| | Enable Lisp | ${dut_node} -| | Vpp Add Lisp Locator Set | ${dut_node} -| | ... | ${settings['locator_name']} -| | Vpp Add Lisp Locator | ${dut_node} -| | ... | ${settings['locator_name']} -| | ... | ${int_idx} -| | ... | ${settings['priority']} -| | ... | ${settings['weight']} -| | Vpp Lisp Eid Table Mapping | ${dut_node} -| | ... | ${settings['vni']} -| | ... | bd_id=${settings['bd']} -| | Vpp Add Lisp Local Eid | ${dut_node} -| | ... | ${settings['locator_name']} -| | ... | ${settings['vni']} -| | ... | ${adjacency['seid']} -| | Vpp Add Map Resolver | ${dut_node} -| | ... | ${adjacency['map_res']} -| | Vpp Add Lisp Remote Mapping | ${dut_node} -| | ... | ${settings['vni']} -| | ... | ${adjacency['eid']} -| | ... | 0 -| | ... | ${adjacency['seid']} -| | ... | 0 -| | ... | ${adjacency['rloc']} -| | ... | is_mac=${TRUE} -| | Vpp Add Lisp Adjacency | ${dut_node} -| | ... | ${settings['vni']} -| | ... | ${adjacency['eid']} -| | ... | 0 -| | ... | ${adjacency['seid']} -| | ... | 0 -| | ... | is_mac=${TRUE} diff --git a/resources/libraries/robot/lisp/lisp_api.robot b/resources/libraries/robot/lisp/lisp_api.robot deleted file mode 100644 index 1f431245be..0000000000 --- a/resources/libraries/robot/lisp/lisp_api.robot +++ /dev/null @@ -1,399 +0,0 @@ -# Copyright (c) 2016 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/interfaces.robot -| Library | resources.libraries.python.NodePath -| Library | resources.libraries.python.LispSetup.LispStatus -| Library | resources.libraries.python.LispSetup.LispSetup -| Library | resources.libraries.python.LispSetup.LispGpeStatus -| Library | resources.libraries.python.LispUtil - -*** Keywords *** - -| Generate LISP locator_set data -| | [Documentation] | Generate lisp locator_set data for test -| | ... | the lisp locator_set and locator API. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - locator_set_number - Number how many locator_set data -| | ... | will be generated. Type: integer -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | _NOTE:_ This KW sets following test case variables: -| | ... | - locator_set_values - New generated locator_set data. -| | ... | - locator_set_values_vat - New generated locator_set data expected\ -| | ... | from VAT. -| | ... -| | ... | *Example:* -| | ... | \| Given Generate LISP locator_set data \| ${nodes['DUT1']} \ -| | ... | \| ${locator_set_number} \| -| | ... -| | [Arguments] | ${dut_node} | ${locator_set_number} -| | ${locator_set_values} | ${locator_set_values_vat}= -| | ... | Generate Unique Lisp Locator Set Data -| | ... | ${dut_node} | ${locator_set_number} -| | Set Test Variable | ${locator_set_values} -| | Set Test Variable | ${locator_set_values_vat} - -| Configure LISP locator_set data -| | [Documentation] | Set the lisp locator_set and locator on the VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | _NOTE:_ This KW requires following test case variables: -| | ... | - locator_set_values - Generated locator_set data from -| | ... | KW locator_set data is prepared, which will be set on the VPP node. -| | ... -| | ... | *Example:* -| | ... | \| When Configure LISP locator_set data \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${dut_node} -| | Vpp Set Lisp Locator Set | ${dut_node} | ${locator_set_values} - -| LISP locator_set shpuld be configured correctly -| | [Documentation] | Test if the locator_set is set correctly on the VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | _NOTE:_ This KW requires following test case variables: -| | ... | - locator_set_values_vat - Generated locator_set data from -| | ... | KW locator_set data is prepared, which are expected from VPP via VAT. -| | ... -| | ... | *Example:* -| | ... | \| Then LISP locator_set shpuld be configured correctly \ -| | ... | \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${dut_node} -| | ${show_locator_set}= | Vpp Show Lisp Locator Set | ${dut_node} | local -| | Lisp Locator S Should Be Equal -| | ... | ${locator_set_values_vat} | ${show_locator_set} - -| Delete all LISP locator_set from VPP -| | [Documentation] | Delete all lisp locator_set on the VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | _NOTE:_ This KW requires following test case variables: -| | ... | - locator_set_values - Generated locator_set data from -| | ... | KW locator_set data is prepared, which was set on the VPP node. -| | ... -| | ... | *Example:* -| | ... | \| When Delete all LISP locator_set from VPP \ -| | ... | \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${dut_node} -| | Vpp Unset Lisp Locator Set | ${dut_node} | ${locator_set_values} - -| LISP locator_set should be unset -| | [Documentation] | Test if all locator_set are unset from VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Then LISP locator_set should be unset \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${dut_node} -| | ${show_locator_set}= | Vpp Show Lisp Locator Set | ${dut_node} | ${EMPTY} -| | Lisp Is Empty | ${show_locator_set} - -| Lisp locator_set data use for test reset locator_set are prepared -| | [Documentation] | Generate lisp special type of locator_set data. -| | ... | This data will be use for test reset locator_set. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - locator_set_number - Number how many locator_set data -| | ... | it will generate. Type: integer -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | _NOTE:_ This KW sets following test case variables: -| | ... | - locator_set_values - New generate locator_set data. -| | ... | - locator_set_values_vat - New generated locator_set data expected\ -| | ... | from VAT. -| | ... -| | ... | *Example:* -| | ... | \| Given Lisp locator_set data use for test reset locator_set \ -| | ... | are prepared \| ${nodes['DUT1']} \| ${locator_set_number} \| -| | ... -| | [Arguments] | ${dut_node} | ${locator_set_number} -| | ${locator_set_values} | ${locator_set_values_vat}= -| | ... | Generate Duplicate Lisp Locator Set Data -| | ... | ${dut_node} | ${locator_set_number} -| | Set Test Variable | ${locator_set_values} -| | Set Test Variable | ${locator_set_values_vat} - -| Configure LISP eid address -| | [Documentation] | Set the lisp eid address on the VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - set_eid - Test eid data. Type: list -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| When Configure LISP eid address \| ${nodes['DUT1']} \ -| | ... | \| ${eid_table} \| -| | ... -| | [Arguments] | ${dut_node} | ${set_eid} -| | Vpp Set Lisp Eid Table | ${dut_node} | ${set_eid} - -| LISP eid address should be set correctly to eid table -| | [Documentation] | Test if the locator_set is set correctly on the VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - set_eid - Example eid data, which was set to the VPP node. -| | ... | Type: list -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | _NOTE:_ This KW requires following test case variables: -| | ... | - set_eid - Generated eid data, which will be set to the VPP node. -| | ... -| | ... | *Example:* -| | ... | \| Then LISP eid address should be set correctly to eid table \ -| | ... | \| ${nodes['DUT1']} \| ${eid_table} \| -| | ... -| | [Arguments] | ${dut_node} | ${set_eid} -| | ${show_eid}= | Vpp Show Lisp Eid Table | ${dut_node} -| | Lisp Should Be Equal | ${set_eid} | ${show_eid} - -| Delete all LISP eid address from VPP -| | [Documentation] | Delete all lisp eid address from the VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - set_eid - Eid data which will be removed from the VPP node. -| | ... | Type: list -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| When Delete all LISP eid address from VPP \ -| | ... | \| ${nodes['DUT1']} \| ${eid_table} \| -| | ... -| | [Arguments] | ${dut_node} | ${set_eid} -| | Vpp Unset Lisp Eid Table | ${dut_node} | ${set_eid} - -| LISP eid table should be empty -| | [Documentation] | Test if the eid table is empty. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Then LISP eid table should be empty \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${dut_node} -| | ${show_eid}= | Vpp Show Lisp Eid Table | ${dut_node} -| | Lisp Is Empty | ${show_eid} - -| Configure LISP map resolver address -| | [Documentation] | Set the lisp map resolver address in the VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - set_map_resolver - Map resolver data, which will be set on -| | ... | the VPP node. Type: list -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| When Configure LISP map resolver address \| ${nodes['DUT1']} \ -| | ... | \| ${map_resolver} \| -| | ... -| | [Arguments] | ${dut_node} | ${set_map_resolver} -| | Vpp Set Lisp Map Resolver | ${dut_node} | ${set_map_resolver} - -| LISP map resolver address should be configured correctly -| | [Documentation] | Test if the map resolver address is set correctly -| | ... | on the VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - set_map_resolver - Map resolver data, which was set on -| | ... | the VPP node. Type: list -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Then LISP map resolver address should be configured correctly \ -| | ... | \| ${nodes['DUT1']} \| ${map_resolver} \| -| | ... -| | [Arguments] | ${dut_node} | ${set_map_resolver} -| | ${show_map_resolver}= | Vpp Show Lisp Map Resolver | ${dut_node} -| | Lisp Should Be Equal | ${set_map_resolver} | ${show_map_resolver} - -| Delete all LISP map resolver address from VPP -| | [Documentation] | Delete all lisp map resolver address on the VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - map_resolver - Map resolver data, which will be remove from -| | ... | the VPP. Type: list -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| When Delete all LISP map resolver address from VPP \ -| | ... | \| ${nodes['DUT1']} \| ${map_resolver} \| -| | ... -| | [Arguments] | ${dut_node} | ${set_map_resolver} -| | Vpp Unset Lisp Map Resolver | ${dut_node} | ${set_map_resolver} - -| LISP map resolver address should be empty -| | [Documentation] | Test if the map resolver are empty. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Then LISP map resolver address should be empty \ -| | ... | \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${dut_node} -| | ${show_map_resolver}= | Vpp Show Lisp Map Resolver | ${dut_node} -| | Lisp Is Empty | ${show_map_resolver} - -| Enable LISP -| | [Documentation] | Enable LISP on VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Enable LISP \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${dut_node} -| | Vpp Lisp Enable Disable | ${dut_node} | enable - -| LISP should be enabled -| | [Documentation] | Check if the lisp is enabled. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - lisp_status_data - Lisp status data, which was set on -| | ... | the VPP node. Type: list -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| LISP should be enabled \| ${nodes['DUT1']} \ -| | ... | \| ${lisp_status_data} \| -| | ... -| | [Arguments] | ${dut_node} | ${lisp_status_data} -| | ${show_lisp_stat}= | Vpp Show Lisp State | ${dut_node} -| | Lisp Should Be Equal | ${show_lisp_stat} | ${lisp_status_data[1]} - -| Disable LISP -| | [Documentation] | Disable LISP on VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Disable LISP \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${dut_node} -| | Vpp Lisp Enable Disable | ${dut_node} | disable - -| LISP Should be disabled -| | [Documentation] | LISP Should be disabled. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - lisp_status_data - Lisp status data, which was set on -| | ... | the VPP node. Type: list -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| LISP Should be disabled \| ${nodes['DUT1']} \ -| | ... | \| ${lisp_status_data} \| -| | ... -| | [Arguments] | ${dut_node} | ${lisp_status_data} -| | ${show_lisp_stat}= | Vpp Show Lisp State | ${dut_node} -| | Lisp Should Be Equal | ${show_lisp_stat} | ${lisp_status_data[0]} - -| Enable Lisp Gpe -| | [Documentation] | Enable Lisp Gpe on VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Enable Lisp Gpe \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${dut_node} -| | Vpp Lisp Gpe Enable Disable | ${dut_node} | enable - -| Disable Lisp Gpe -| | [Documentation] | Disable Lisp Gpe on VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Disable Lisp Gpe \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${dut_node} -| | Vpp Lisp Gpe Enable Disable | ${dut_node} | disable diff --git a/resources/libraries/robot/lisp/lisp_static_adjacency.robot b/resources/libraries/robot/lisp/lisp_static_adjacency.robot deleted file mode 100644 index 737c535ce8..0000000000 --- a/resources/libraries/robot/lisp/lisp_static_adjacency.robot +++ /dev/null @@ -1,168 +0,0 @@ -# Copyright (c) 2016 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 | Lisp static adjacency suite keywords -| Resource | resources/libraries/robot/lisp/lisp_api.robot -| Library | resources.libraries.python.LispSetup.LispLocatorSet -| Library | resources.libraries.python.LispSetup.LispLocator -| Library | resources.libraries.python.LispSetup.LispLocalEid -| Library | resources.libraries.python.LispSetup.LispAdjacency -| Library | resources.libraries.python.LispSetup.LispRemoteMapping -| Library | resources.libraries.python.IPv4Util.IPv4Util - -*** Keywords *** -| Configure LISP topology in 3-node circular topology -| | [Documentation] | Set up Lisp static adjacency topology. -| | ... -| | ... | *Arguments:* -| | ... | - dut1_node - DUT1 node. Type: dictionary -| | ... | - dut1_int_name - DUT1 node interface name. Type: string -| | ... | - dut1_int_index - DUT1 node interface index. Type: integer -| | ... | - dut2_node - DUT2 node. Type: dictionary -| | ... | - dut2_int_name - DUT2 node interface name. Type: string -| | ... | - dut2_int_index - DUT2 node interface index. Type: integer -| | ... | - locator_set - Locator set values. Type: dictionary -| | ... | - dut1_eid - Dut1 node eid address. Type: dictionary -| | ... | - dut2_eid - Dut2 node eid address. Type: dictionary -| | ... | - dut1_static_adjacency - Dut1 static adjacency. Type: dictionary -| | ... | - dut2_static_adjacency - Dut2 static address. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Configure LISP topology in 3-node circular topology \| ${dut1_node} \| ${interface_name} \ -| | ... | \| None \| ${dut2_node} \| ${interface_name} \| None \ -| | ... | \| ${locator_set} \| ${dut1_eid} \| ${dut2_eid} \ -| | ... | \| ${dut1_static_adjacency} \| ${dut2_static_adjacency} \| -| | ... -| | [Arguments] | ${dut1_node} | ${dut1_int_name} | ${dut1_int_index} -| | ... | ${dut2_node} | ${dut2_int_name} | ${dut2_int_index} -| | ... | ${locator_set} | ${dut1_eid} | ${dut2_eid} -| | ... | ${dut1_static_adjacency} | ${dut2_static_adjacency} -| | ${dut1_int_index}= | Run Keyword If | ${dut1_int_index} is None -| | | ... | Get Interface Sw Index | ${dut1_node} -| | | ... | ${dut1_int_name} -| | | ... | ELSE | Set Variable | ${dut1_int_index} -| | ${dut2_int_index}= | Run Keyword If | ${dut2_int_index} is None -| | | ... | Get Interface Sw Index | ${dut2_node} -| | | ... | ${dut2_int_name} -| | | ... | ELSE | Set Variable | ${dut2_int_index} -| | Enable Lisp | ${dut1_node} -| | Vpp Add Lisp Locator Set | ${dut1_node} | ${locator_set['locator_name']} -| | Vpp Add Lisp Locator | ${dut1_node} | ${locator_set['locator_name']} -| | ... | ${dut1_int_index} | ${locator_set['priority']} -| | ... | ${locator_set['weight']} -| | Vpp Add Lisp Local Eid | ${dut1_node} | ${dut1_eid['locator_name']} -| | ... | ${dut1_eid['vni']} | ${dut1_eid['eid']} -| | ... | ${dut1_eid['prefix']} -| | Vpp Add Lisp Remote Mapping | ${dut1_node} | ${dut1_static_adjacency['vni']} -| | ... | ${dut1_static_adjacency['deid']} -| | ... | ${dut1_static_adjacency['prefix']} -| | ... | ${dut1_static_adjacency['seid']} -| | ... | ${dut1_static_adjacency['prefix']} -| | ... | ${dut1_static_adjacency['rloc']} -| | Vpp Add Lisp Adjacency | ${dut1_node} | ${dut1_static_adjacency['vni']} -| | ... | ${dut1_static_adjacency['deid']} -| | ... | ${dut1_static_adjacency['prefix']} -| | ... | ${dut1_static_adjacency['seid']} -| | ... | ${dut1_static_adjacency['prefix']} -| | Enable Lisp | ${dut2_node} -| | Vpp Add Lisp Locator Set | ${dut2_node} | ${locator_set['locator_name']} -| | Vpp Add Lisp Locator | ${dut2_node} | ${locator_set['locator_name']} -| | ... | ${dut2_int_index} | ${locator_set['priority']} -| | ... | ${locator_set['weight']} -| | Vpp Add Lisp Local Eid | ${dut2_node} | ${dut2_eid['locator_name']} -| | ... | ${dut2_eid['vni']} | ${dut2_eid['eid']} -| | ... | ${dut2_eid['prefix']} -| | Vpp Add Lisp Remote Mapping | ${dut2_node} | ${dut2_static_adjacency['vni']} -| | ... | ${dut2_static_adjacency['deid']} -| | ... | ${dut2_static_adjacency['prefix']} -| | ... | ${dut2_static_adjacency['seid']} -| | ... | ${dut2_static_adjacency['prefix']} -| | ... | ${dut2_static_adjacency['rloc']} -| | Vpp Add Lisp Adjacency | ${dut2_node} | ${dut2_static_adjacency['vni']} -| | ... | ${dut2_static_adjacency['deid']} -| | ... | ${dut2_static_adjacency['prefix']} -| | ... | ${dut2_static_adjacency['seid']} -| | ... | ${dut2_static_adjacency['prefix']} - -| Change LISP Configuration -| | [Documentation] | Change configuration of the Lisp protocol. -| | ... -| | ... | *Arguments:* -| | ... | - dut1_node - DUT1 node. Type: dictionary -| | ... | - dut2_node - DUT2 node. Type: dictionary -| | ... | - dut1_to_dut2 - DUT1 towards DUT2 interface name. Type: string -| | ... | - dut2_to_dut1 - DUT2 towards DUT1 interface name. Type: string -| | ... | - dut1_to_dut2_mac - DUT1 towards DUT2 interface mac address. -| | ... | Type: string -| | ... | - dut2_to_dut1_mac - DUT2 towards DUT1 interface mac address. -| | ... | Type: string -| | ... | - new_dut1_ip - New DUT1 towards DUT2 interface IP address. -| | ... | Type: string -| | ... | - new_dut2_ip - New DUT2 towards DUT1 interface IP address. -| | ... | Type: string -| | ... | - prefix - Prefix of the DUT nodes. Type: integer -| | ... | - old_dut1_static_adjacency - Old DUT1 static adjacency. -| | ... | Type: dictionary -| | ... | - new_dut1_static_adjacency - New DUT1 static adjacency. -| | ... | Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Change LISP Configuration \| ${dut1_node} \| ${dut2_node} \ -| | ... | \| ${dut1_to_dut2} \| ${dut2_to_dut1} | "08:00:27:20:e0:0d" \ -| | ... | \| "08:00:27:b1:94:b1" \| "6.3.0.1" \| "6.3.0.20" \| "24" \ -| | ... | \| ${old_dut1_static_adjacency} \| ${new_dut1_static_adjacency} \| -| | ... -| | [Arguments] | ${dut1_node} | ${dut2_node} | ${dut1_to_dut2} -| | ... | ${dut2_to_dut1} | ${dut1_to_dut2_mac} | ${dut2_to_dut1_mac} -| | ... | ${new_dut1_ip} | ${new_dut2_ip} | ${prefix} -| | ... | ${old_dut1_static_adjacency} | ${new_dut1_static_adjacency} -| | Flush IPv4 Addresses "${dut2_to_dut1}" "${dut2_node}" -| | Vpp Del Lisp Remote Mapping | ${dut1_node} -| | ... | ${old_dut1_static_adjacency['vni']} -| | ... | ${old_dut1_static_adjacency['deid']} -| | ... | ${old_dut1_static_adjacency['prefix']} -| | ... | ${old_dut1_static_adjacency['seid']} -| | ... | ${old_dut1_static_adjacency['prefix']} -| | ... | ${old_dut1_static_adjacency['rloc']} -| | Vpp Del Lisp Adjacency | ${dut1_node} -| | ... | ${old_dut1_static_adjacency['vni']} -| | ... | ${old_dut1_static_adjacency['deid']} -| | ... | ${old_dut1_static_adjacency['prefix']} -| | ... | ${old_dut1_static_adjacency['seid']} -| | ... | ${old_dut1_static_adjacency['prefix']} -| | Set Interface Address | ${dut2_node} | ${dut2_to_dut1} -| | ... | ${new_dut2_ip} | ${prefix} -| | Add Arp On Dut | ${dut1_node} | ${dut1_to_dut2} | ${new_dut2_ip} -| | ... | ${dut2_to_dut1_mac} -| | Add Arp On Dut | ${dut2_node} | ${dut2_to_dut1} | ${new_dut1_ip} -| | ... | ${dut1_to_dut2_mac} -| | Vpp Add Lisp Remote Mapping | ${dut1_node} -| | ... | ${new_dut1_static_adjacency['vni']} -| | ... | ${new_dut1_static_adjacency['deid']} -| | ... | ${new_dut1_static_adjacency['prefix']} -| | ... | ${new_dut1_static_adjacency['seid']} -| | ... | ${new_dut1_static_adjacency['prefix']} -| | ... | ${new_dut1_static_adjacency['rloc']} -| | Vpp Add Lisp Adjacency | ${dut1_node} -| | ... | ${new_dut1_static_adjacency['vni']} -| | ... | ${new_dut1_static_adjacency['deid']} -| | ... | ${new_dut1_static_adjacency['prefix']} -| | ... | ${new_dut1_static_adjacency['seid']} -| | ... | ${new_dut1_static_adjacency['prefix']} diff --git a/resources/libraries/robot/lisp/lispgpe.robot b/resources/libraries/robot/lisp/lispgpe.robot deleted file mode 100644 index c39b64cf3f..0000000000 --- a/resources/libraries/robot/lisp/lispgpe.robot +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2016 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 | LISP-gpe encapsulation suite keywords -| Library | resources.libraries.python.topology.Topology -| Resource | resources/libraries/robot/lisp/lisp_api.robot -| Library | resources.libraries.python.LispSetup.LispLocatorSet -| Library | resources.libraries.python.LispSetup.LispLocator -| Library | resources.libraries.python.LispSetup.LispLocalEid -| Library | resources.libraries.python.LispSetup.LispAdjacency -| Library | resources.libraries.python.LispSetup.LispRemoteMapping -| Library | resources.libraries.python.LispSetup.LispEidTableMap - -*** Keywords *** -| Configure LISP GPE topology in 3-node circular topology -| | [Documentation] | Configure LISP GPE topology in 3-node circular topology. -| | ... -| | ... | *Arguments:* -| | ... | - dut1_node - DUT1 node. Type: dictionary -| | ... | - dut1_if - DUT1 node interface. Type: string -| | ... | - dut1_int_index - DUT1 node interface index. Type: integer -| | ... | - dut2_node - DUT2 node. Type: dictionary -| | ... | - dut2_if - DUT2 node interface. Type: string -| | ... | - dut2_int_index - DUT2 node interface index. Type: integer -| | ... | - locator_set - Locator set values. Type: dictionary -| | ... | - dut1_eid - DUT1 node eid address. Type: dictionary -| | ... | - dut2_eid - DUT2 node eid address. Type: dictionary -| | ... | - dut1_static_adjacency - DUT1 static adjacency. Type: dictionary -| | ... | - dut2_static_adjacency - DUT2 static adjacency. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Configure LISP GPE topology in 3-node circular topology \| ${dut1_node} \| ${interface_name} \ -| | ... | \| None \| ${dut2_node} \| ${interface_name} \| None \ -| | ... | \| ${locator_set} \| ${dut1_eid} \| ${dut2_eid} \ -| | ... | \| ${dut1_static_adjacency} \| ${dut2_static_adjacency} \| -| | ... -| | [Arguments] -| | ... | ${dut1_node} | ${dut1_if} | ${dut1_int_index} -| | ... | ${dut2_node} | ${dut2_if} | ${dut2_int_index} -| | ... | ${locator_set} | ${dut1_eid} | ${dut2_eid} -| | ... | ${dut1_static_adjacency} | ${dut2_static_adjacency} -| | ... | ${vni_table}=0 | ${vrf_table}=0 -| | ... -# DUT1 settings: -| | ${dut1_int_index}= | Run Keyword If | ${dut1_int_index} is None -| | | ... | Get Interface Sw Index | ${dut1_node} | ${dut1_if} -| | | ... | ELSE | Set Variable | ${dut1_int_index} -| | Enable Lisp | ${dut1_node} -| | Enable Lisp GPE | ${dut1_node} -| | Vpp Add Lisp Locator Set | ${dut1_node} -| | ... | ${locator_set['locator_name']} -| | Vpp Add Lisp Locator | ${dut1_node} -| | ... | ${locator_set['locator_name']} -| | ... | ${dut1_int_index} -| | ... | ${locator_set['priority']} -| | ... | ${locator_set['weight']} -| | Vpp Lisp Eid Table Mapping | ${dut1_node} -| | ... | ${vni_table} -| | ... | vrf=${vrf_table} -| | Vpp Add Lisp Local Eid | ${dut1_node} -| | ... | ${dut1_eid['locator_name']} -| | ... | ${vni_table} -| | ... | ${dut1_eid['eid']} -| | ... | ${dut1_eid['prefix']} -| | Vpp Add Lisp Remote Mapping | ${dut1_node} -| | ... | ${vni_table} -| | ... | ${dut1_static_adjacency['deid']} -| | ... | ${dut1_static_adjacency['prefix']} -| | ... | ${dut1_static_adjacency['seid']} -| | ... | ${dut1_static_adjacency['prefix']} -| | ... | ${dut1_static_adjacency['rloc']} -| | Vpp Add Lisp Adjacency | ${dut1_node} -| | ... | ${vni_table} -| | ... | ${dut1_static_adjacency['deid']} -| | ... | ${dut1_static_adjacency['prefix']} -| | ... | ${dut1_static_adjacency['seid']} -| | ... | ${dut1_static_adjacency['prefix']} -| | ... -# DUT2 settings: -| | ${dut2_int_index}= | Run Keyword If | ${dut2_int_index} is None -| | | ... | Get Interface Sw Index | ${dut2_node} | ${dut2_if} -| | | ... | ELSE | Set Variable | ${dut2_int_index} -| | Enable Lisp | ${dut2_node} -| | Enable Lisp GPE | ${dut2_node} -| | Vpp Add Lisp Locator Set | ${dut2_node} -| | ... | ${locator_set['locator_name']} -| | Vpp Add Lisp Locator | ${dut2_node} -| | ... | ${locator_set['locator_name']} -| | ... | ${dut2_int_index} -| | ... | ${locator_set['priority']} -| | ... | ${locator_set['weight']} -| | Vpp Lisp Eid Table Mapping | ${dut2_node} -| | ... | ${vni_table} -| | ... | vrf=${vrf_table} -| | Vpp Add Lisp Local Eid | ${dut2_node} -| | ... | ${dut2_eid['locator_name']} -| | ... | ${vni_table} -| | ... | ${dut2_eid['eid']} -| | ... | ${dut2_eid['prefix']} -| | Vpp Add Lisp Remote Mapping | ${dut2_node} -| | ... | ${vni_table} -| | ... | ${dut2_static_adjacency['deid']} -| | ... | ${dut2_static_adjacency['prefix']} -| | ... | ${dut2_static_adjacency['seid']} -| | ... | ${dut2_static_adjacency['prefix']} -| | ... | ${dut2_static_adjacency['rloc']} -| | Vpp Add Lisp Adjacency | ${dut2_node} -| | ... | ${vni_table} -| | ... | ${dut2_static_adjacency['deid']} -| | ... | ${dut2_static_adjacency['prefix']} -| | ... | ${dut2_static_adjacency['seid']} -| | ... | ${dut2_static_adjacency['prefix']} diff --git a/resources/libraries/robot/lxc.robot b/resources/libraries/robot/lxc.robot deleted file mode 100644 index 83bd5c1837..0000000000 --- a/resources/libraries/robot/lxc.robot +++ /dev/null @@ -1,257 +0,0 @@ -# Copyright (c) 2017 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 linux container (LXC) -| Library | resources.libraries.python.LXCUtils -| Library | resources.libraries.python.CpuUtils -| Library | resources.libraries.python.topology.Topology - -*** Keywords *** -| Create LXC container on DUT node -| | [Documentation] | Setup lxc container on DUT node. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - lxc_name - Name of LXC container. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create LXC container on DUT node \| ${nodes['DUT1']} \ -| | ... | \| DUT1_slave_1 \| -| | ... -| | [Arguments] | ${dut_node} | ${lxc_name} -| | ... -| | Import Library | resources.libraries.python.LXCUtils -| | ... | container_name=${lxc_name} | WITH NAME | ${lxc_name} -| | Run keyword | ${lxc_name}.Set node | ${dut_node} -| | Run keyword | ${lxc_name}.Create container | force_create=${TRUE} -| | Run keyword | ${lxc_name}.Mount host dir in container - -| Create LXC container on DUT node with cpuset -| | [Documentation] | Create LXC container on DUT node with cpuset. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - lxc_name - Name of LXC container. Type: dictionary -| | ... | - skip - number of cpus which will be skipped. Type: integer -| | ... | - count - number of cpus which will be allocated for lxc. Type: -| | ... | integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create LXC container on DUT node with cpuset \ -| | ... | \| ${nodes['DUT1']} \| DUT1_slave_1 \| 6 \| 1 \| -| | ... -| | [Arguments] | ${dut_node} | ${lxc_name} | ${skip}=${6} | ${count}=${1} -| | ... -| | Import Library | resources.libraries.python.LXCUtils -| | ... | container_name=${lxc_name} | WITH NAME | ${lxc_name} -| | ${dut_numa}= | Get interfaces numa node | ${dut_node} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${lxc_cpus}= | CPU list per node str | ${dut_node} | ${dut_numa} -| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${False} -| | Set Suite Variable | ${lxc_cpus} -| | Run keyword | ${lxc_name}.Set node | ${dut_node} -| | Run keyword | ${lxc_name}.Create container | force_create=${TRUE} -| | Run keyword | ${lxc_name}.Mount host dir in container -| | Run keyword | ${lxc_name}.Container cpuset cpus | 0,${lxc_cpus} - -| Create '${nr}' LXC containers on '${dut}' node -| | [Documentation] | Create and start multiple lxc containers on DUT node. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create 5 LXC containers on DUT1 node \| -| | ... -| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 -| | | Create LXC container on DUT node | ${nodes['${dut}']} -| | | ... | ${dut}_${lxc_base_name}_${number} - -| Create '${nr}' LXC containers on all DUT nodes -| | [Documentation] | Create and start multiple LXC containers on all DUT nodes. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create 5 LXC containers on all DUT nodes \| -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Create '${nr}' LXC containers on '${dut}' node - -| Create '${nr}' LXC containers on '${dut}' node with '${count}' cpus -| | [Documentation] | Create and start multiple LXC containers on DUT node. -| | ... | Set the cpuset.cpus cgroup profile for pin of cpus. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create 5 LXC containers on DUT1 node with 2 cpus \| -| | ... -| | ${skip_cpus}= | Evaluate | ${vpp_cpus}+${system_cpus} -| | ${count_int}= | Convert To Integer | ${count} -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 -| | | ${skip}= | Evaluate | ${skip_cpus} + (${nr} - 1) * ${count} -| | | Create LXC container on DUT node with cpuset | ${nodes['${dut}']} -| | | ... | ${dut}_${lxc_base_name}_${number} | ${skip} | ${count_int} - -| Create '${nr}' LXC containers on all DUT nodes with '${count}' cpus -| | [Documentation] | Create and start multiple LXC containers on all DUT nodes. -| | ... | Set the cpuset.cpus cgroup profile for pin of cpus. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create 5 LXC containers on all DUT nodes with 2 cpus \| -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Create '${nr}' LXC containers on '${dut}' node with '${count}' cpus - -| Destroy LXC container on DUT node -| | [Documentation] | Stop and destroy LXC container on DUT node. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - lxc_name - Name of LXC container. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Destroy LXC container on DUT node \| ${nodes['DUT1']} \ -| | ... | \| DUT1_slave_1 \| -| | ... -| | [Arguments] | ${dut_node} | ${lxc_name} -| | ... -| | Import Library | resources.libraries.python.LXCUtils -| | ... | container_name=${lxc_name} | WITH NAME | ${lxc_name} -| | Run keyword | ${lxc_name}.Set node | ${dut_node} -| | Run keyword | ${lxc_name}.Destroy container - -| Destroy '${nr}' LXC containers on '${dut}' node -| | [Documentation] | Stop and destroy multiple LXC containers on DUT node. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Destroy 5 LXC containers on DUT1 node \| -| | ... -| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 -| | | Destroy LXC container on DUT node | ${nodes['${dut}']} -| | | ... | ${dut}_${lxc_base_name}_${number} - -| Destroy '${nr}' LXC containers on all DUT nodes -| | [Documentation] | Stop and destroy multiple LXC containers on all DUT nodes. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Destroy 5 LXC containers on all DUT nodes \| -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Destroy '${nr}' LXC containers on '${dut}' node - -| Install VPP on LXC container on DUT node -| | [Documentation] | Install vpp on LXC container on DUT node. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - lxc_name - Name of LXC container. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Install VPP on LXC container on DUT node \| ${nodes['DUT1']} \ -| | ... | \| DUT1_slave_1 \| -| | ... -| | [Arguments] | ${dut_node} | ${lxc_name} -| | ... -| | Import Library | resources.libraries.python.LXCUtils -| | ... | container_name=${lxc_name} | WITH NAME | ${lxc_name} -| | Run keyword | ${lxc_name}.Set node | ${dut_node} -| | Run keyword | ${lxc_name}.Install VPP in container - -| Install VPP on '${nr}' LXC containers on '${dut}' node -| | [Documentation] | Install VPP on multiple LXC containers on DUT node. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Install VPP on 5 LXC containers on DUT1 node \| -| | ... -| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 -| | | Install VPP on LXC container on DUT node | ${nodes['${dut}']} -| | | ... | ${dut}_${lxc_base_name}_${number} - -| Install VPP on '${nr}' LXC containers on all DUT nodes -| | [Documentation] | Install VPP on multiple LXC containers on all DUT nodes. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Install VPP on 5 LXC containers on all DUT nodes \| -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Install VPP on '${nr}' LXC containers on '${dut}' node - -| Create startup configuration of VPP on LXC container on DUT node -| | [Documentation] | Create base startup configuration of VPP on LXC container -| | ... | on DUT node. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | - dut_node - DUT node. Type: dictionary -| | ... | - lxc_name - Name of LXC container. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create startup configuration of VPP on LXC container on DUT node \ -| | ... | \| ${nodes['DUT1']} \| DUT1_slave_1 \| -| | ... -| | [Arguments] | ${dut_node} | ${lxc_name} -| | ... -| | Import Library | resources.libraries.python.VppConfigGenerator -| | ... | WITH NAME | ${lxc_name}_conf -| | Run keyword | ${lxc_name}_conf.Set node | ${dut_node} -| | Run keyword | ${lxc_name}_conf.Add unix CLI listen -| | Run keyword | ${lxc_name}_conf.Add unix nodaemon -| | Run keyword | ${lxc_name}_conf.Add unix exec | "/tmp/running.exec" -| | Run keyword | ${lxc_name}_conf.Add CPU main core | "0" -| | Run keyword | ${lxc_name}_conf.Add CPU corelist workers | ${lxc_cpus} -| | Run keyword | ${lxc_name}_conf.Add plugin disable | "dpdk_plugin.so" -| | Run Keyword | ${lxc_name}_conf.Apply config LXC | ${lxc_name} - -| Create startup configuration of VPP on '${nr}' LXC containers on '${dut}' node -| | [Documentation] | Create base startup configuration of VPP on multiple LXC -| | ... | container on DUT node. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create startup configuration of VPP on 1 LXC containers on DUT1 \ -| | ... | node \| -| | ... -| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 -| | | Create startup configuration of VPP on LXC container on DUT node -| | | ... | ${nodes['${dut}']} | ${dut}_${lxc_base_name}_${number} - -| Create startup configuration of VPP on '${nr}' LXC containers on all DUT nodes -| | [Documentation] | Create base startup configuration of VPP on multiple LXC -| | ... | container on all DUT nodes. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create startup configuration of VPP on 1 LXC containers on all \ -| | ... | DUT nodes \| -| | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Create startup configuration of VPP on '${nr}' LXC containers on '${dut}' node diff --git a/resources/libraries/robot/map.robot b/resources/libraries/robot/map.robot deleted file mode 100644 index ac086b4511..0000000000 --- a/resources/libraries/robot/map.robot +++ /dev/null @@ -1,312 +0,0 @@ -# Copyright (c) 2016 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 *** -| Variables | resources/libraries/python/topology.py -| Library | resources.libraries.python.topology.Topology -| Library | resources.libraries.python.DUTSetup -| Library | resources.libraries.python.TGSetup -| Library | resources.libraries.python.Map -| Documentation | Keywords for MAP feature in VPP. - -*** Keywords *** -| Send IPv4 UDP and check headers for lightweight 4over6 -| | [Documentation] -| | ... | Send empty UDP to given IPv4 dst and UDP port and check received \ -| | ... | packets headers (Ethernet, IPv6, IPv4, UDP). -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - Node where to run traffic script. Type: string -| | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string -| | ... | - rx_if - Interface where to receive IPinIP packet. Type: string -| | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string -| | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string -| | ... | - tx_src_ipv4 - Source IPv4 address. Type: string -| | ... | - tx_dst_udp_port - Destination UDP port. Type: integer -| | ... | - rx_dst_mac - Expected destination MAC address. Type: string -| | ... | - rx_src_mac - Expected source MAC address. Type: string -| | ... | - dst_ipv6 - Expected destination IPv6 address. Type: string -| | ... | - src_ipv6 - Expected source IPv6 address. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send IPv4 UDP and check headers for lightweight 4over6 \ -| | ... | \| ${tg_node} \| eth3 \| eth2 \| 08:00:27:66:b8:57 \| 20.0.0.1 \ -| | ... | \| 20.0.0.2 \| 1232 \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \ -| | ... | \| 2001:1::2 \| 2001:1::1 \| -| | ... -| | [Arguments] -| | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_dst_ipv4} -| | ... | ${tx_src_ipv4} | ${tx_dst_udp_port} | ${rx_dst_mac} | ${rx_src_mac} -| | ... | ${dst_ipv6} | ${src_ipv6} -| | ... -| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} -| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} -| | ${args}= | Catenate -| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} -| | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_ipv4 | ${tx_src_ipv4} -| | ... | --tx_dst_ipv4 | ${tx_dst_ipv4} -| | ... | --tx_dst_udp_port | ${tx_dst_udp_port} -| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} -| | ... | --src_ipv6 | ${src_ipv6} | --dst_ipv6 | ${dst_ipv6} -| | ... -| | Run Traffic Script On Node -| | ... | send_ipv4_udp_check_lw_4o6.py | ${tg_node} | ${args} - -| Send IPv4 ICMP and check headers for lightweight 4over6 -| | [Documentation] -| | ... | Send ICMP request with ID to given IPv4 destination and \ -| | ... | check received packets headers (Ethernet, IPv6, IPv4, ICMP). -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - Node where to run traffic script. Type: string -| | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string -| | ... | - rx_if - Interface where to receive IPinIP packet. Type: string -| | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string -| | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string -| | ... | - tx_src_ipv4 - Source IPv4 address. Type: string -| | ... | - tx_icmp_id - ICMP ID. Type: integer -| | ... | - rx_dst_mac - Expected destination MAC address. Type: string -| | ... | - rx_src_mac - Expected source MAC address. Type: string -| | ... | - dst_ipv6 - Expected destination IPv6 address. Type: string -| | ... | - src_ipv6 - Expected source IPv6 address. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send IPv4 ICMP and check headers for lightweight 4over6 \ -| | ... | \| ${tg_node} \| eth3 \| eth2 \| 08:00:27:66:b8:57 \| 20.0.0.1 \ -| | ... | \| 20.0.0.2 \| 1232 \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \ -| | ... | \| 2001:1::2 \| 2001:1::1 \| -| | ... -| | [Arguments] -| | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_dst_ipv4} -| | ... | ${tx_src_ipv4} | ${tx_icmp_id} | ${rx_dst_mac} | ${rx_src_mac} -| | ... | ${dst_ipv6} | ${src_ipv6} -| | ... -| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} -| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} -| | ${args}= | Catenate -| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} -| | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_ipv4 | ${tx_src_ipv4} -| | ... | --tx_dst_ipv4 | ${tx_dst_ipv4} | --tx_icmp_id | ${tx_icmp_id} -| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} -| | ... | --src_ipv6 | ${src_ipv6} | --dst_ipv6 | ${dst_ipv6} -| | ... -| | Run Traffic Script On Node -| | ... | send_ipv4_icmp_check_lw_4o6.py | ${tg_node} | ${args} - -| Send IPv4 UDP in IPv6 and check headers for lightweight 4over6 -| | [Documentation] -| | ... | Send empty UDP in IPv4 in IPv6 and check if IPv4 packet is correctly \ -| | ... | decapsulated from IPv6. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - Node where to run traffic script. Type: string -| | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string -| | ... | - rx_if - Interface where to receive IPinIP packet. Type: string -| | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string -| | ... | - tx_src_mac - Source MAC address of IPv4 packet. Type: string -| | ... | - tx_dst_ipv6 - Destination IPv6 address. Type: string -| | ... | - tx_src_ipv6 - Source IPv6 address. Type: string -| | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string -| | ... | - tx_src_ipv4 - Source IPv4 address. Type: string -| | ... | - tx_src_udp_port - Source UDP port. Type: integer -| | ... | - rx_dst_mac - Expected destination MAC address. Type: string -| | ... | - rx_src_mac - Expected source MAC address. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send IPv4 UDP in IPv6 and check headers for lightweight 4over6 \ -| | ... | \| ${tg_node} \| eth3 \| eth2 \ -| | ... | \| 08:00:27:66:b8:57 \| 08:00:27:33:54:21 \ -| | ... | \| 2001:1::2 \| 2001:1::1 \| 20.0.0.1 \| 20.0.0.2 \ -| | ... | \| 1232 \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \| -| | ... -| | [Arguments] -| | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_src_mac} -| | ... | ${tx_dst_ipv6} | ${tx_src_ipv6} | ${tx_dst_ipv4} | ${tx_src_ipv4} -| | ... | ${tx_src_udp_port} | ${rx_dst_mac} | ${rx_src_mac} -| | ... -| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} -| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} -| | ${args}= | Catenate -| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} -| | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_mac | ${tx_src_mac} -| | ... | --tx_dst_ipv6 | ${tx_dst_ipv6} | --tx_src_ipv6 | ${tx_src_ipv6} -| | ... | --tx_dst_ipv4 | ${tx_dst_ipv4} | --tx_src_ipv4 | ${tx_src_ipv4} -| | ... | --tx_src_udp_port | ${tx_src_udp_port} -| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} -| | ... -| | Run Traffic Script On Node -| | ... | send_lw_4o6_check_ipv4_udp.py | ${tg_node} | ${args} - -| Send IPv4 UDP in IPv6 and check headers for lightweight hairpinning -| | [Documentation] -| | ... | Send empty UDP in IPv4 in IPv6 and check if IPv4 packet is correctly \ -| | ... | decapsulated and re-encapsulated to another lwB4. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - Node where to run traffic script. Type: string -| | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string -| | ... | - rx_if - Interface where to receive IPinIP packet. Type: string -| | ... | - tx_dst_mac - Destination MAC address of send IPv6 packet. \ -| | ... | Type: string -| | ... | - tx_dst_ipv6 - Destination IPv6 address (lwAFTR). Type: string -| | ... | - tx_src_ipv6 - Source IPv6 address (lwB4_1). Type: string -| | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string -| | ... | - tx_src_ipv4 - Source IPv4 address. Type: string -| | ... | - tx_dst_udp_port - Destination UDP port (PSID_2 related). \ -| | ... | Type: integer -| | ... | - tx_src_udp_port - Source UDP port (PSID_1 related). Type: integer -| | ... | - rx_dst_mac - Expected destination MAC address. Type: string -| | ... | - rx_src_mac - Expected source MAC address. Type: string -| | ... | - rx_dst_ipv6 - Expected destination IPv6 address (lwB4_2). \ -| | ... | Type: string -| | ... | - rx_src_ipv6 - Expected source IPv6 address (lwAFTR). Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send IPv4 UDP in IPv6 and check headers for lightweight hairpinning \ -| | ... | \| ${tg_node} \| port3 \| port3 \| 08:00:27:f3:be:f0 \| 2001:1::1 \ -| | ... | \| 2001:1::2 \| 20.0.0.1 \| 20.0.0.1 \| ${6232} \| ${1232} \ -| | ... | \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \| 2001:1::3 \| 2001:1::1 \| -| | ... -| | [Arguments] -| | ... | ${tg_node} | ${tx_if} | ${rx_if} -| | ... | ${tx_dst_mac} -| | ... | ${tx_dst_ipv6} | ${tx_src_ipv6} -| | ... | ${tx_dst_ipv4} | ${tx_src_ipv4} -| | ... | ${tx_dst_udp_port} | ${tx_src_udp_port} -| | ... | ${rx_dst_mac} | ${rx_src_mac} -| | ... | ${rx_dst_ipv6} | ${rx_src_ipv6} -| | ... -| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} -| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} -| | ${args}= | Catenate -| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} -| | ... | --tx_dst_mac | ${tx_dst_mac} -| | ... | --tx_dst_ipv6 | ${tx_dst_ipv6} | --tx_src_ipv6 | ${tx_src_ipv6} -| | ... | --tx_dst_ipv4 | ${tx_dst_ipv4} | --tx_src_ipv4 | ${tx_src_ipv4} -| | ... | --tx_dst_udp_port | ${tx_dst_udp_port} -| | ... | --tx_src_udp_port | ${tx_src_udp_port} -| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} -| | ... | --rx_dst_ipv6 | ${rx_dst_ipv6} | --rx_src_ipv6 | ${rx_src_ipv6} -| | ... -| | Run Traffic Script On Node -| | ... | send_lw_4o6_check_hairpinning_udp.py | ${tg_node} | ${args} - -| Send IPv4 UDP and check IPv6 headers for MAP-T -| | [Documentation] -| | ... | Send a UDP in IPv4 and check if IPv4 source and destination \ -| | ... | addresses are correctly translated into IPv6 addresses. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - Node where to run traffic script. Type: string -| | ... | - tx_if - Interface from where to send IPv4 UDP packet. Type: string -| | ... | - rx_if - Interface where to receive IPv6 UDP packet. Type: string -| | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string -| | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string -| | ... | - tx_src_ipv4 - Source IPv4 address. Type: string -| | ... | - tx_dst_udp_port - Destination UDP port. Type: integer -| | ... | - rx_dst_mac - Expected destination MAC address. Type: string -| | ... | - rx_src_mac - Expected source MAC address. Type: string -| | ... | - dst_ipv6 - Expected destination IPv6 address. Type: string -| | ... | - src_ipv6 - Expected source IPv6 address. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send IPv4 UDP and check IPv6 headers for MAP-T \ -| | ... | \| ${tg_node} \| port3 \| port3 \| 08:00:27:66:b8:57 \ -| | ... | \| 20.169.201.219 \| 100.0.0.1 \| ${1232} \| 08:00:27:46:2b:4c \ -| | ... | \| 08:00:27:f3:be:f0 \| 2001:db8::14a9:c9db:0 \ -| | ... | \| 2001:db8:ffff::6400:1 \| -| | ... -| | [Arguments] -| | ... | ${tg_node} | ${tx_if} | ${rx_if} -| | ... | ${tx_dst_mac} | ${tx_dst_ipv4} | ${tx_src_ipv4} | ${tx_dst_udp_port} -| | ... | ${rx_dst_mac} | ${rx_src_mac} | ${dst_ipv6} | ${src_ipv6} -| | ... -| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} -| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} -| | ${args}= | Catenate -| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} -| | ... | --tx_dst_mac | ${tx_dst_mac} -| | ... | --tx_src_ipv4 | ${tx_src_ipv4} | --tx_dst_ipv4 | ${tx_dst_ipv4} -| | ... | --tx_dst_udp_port | ${tx_dst_udp_port} -| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} -| | ... | --rx_src_ipv6 | ${src_ipv6} | --rx_dst_ipv6 | ${dst_ipv6} -| | ... -| | Run Traffic Script On Node -| | ... | send_ipv4_udp_check_map_t.py | ${tg_node} | ${args} - -| Send IPv6 UDP and check IPv4 headers for MAP-T -| | [Documentation] -| | ... | Send a UDP in IPv6 and check if IPv6 source and destination \ -| | ... | addresses are correctly translated into IPv4 addresses. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - Node where to run traffic script. Type: string -| | ... | - tx_if - Interface from where to send IPv4 UDP packet. Type: string -| | ... | - rx_if - Interface where to receive IPv6 UDP packet. Type: string -| | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string -| | ... | - tx_src_mac - Source MAC address of IPv4 packet. Type: string -| | ... | - tx_dst_ipv6 - Destination IPv6 address. Type: string -| | ... | - tx_src_ipv6 - Source IPv6 address. Type: string -| | ... | - tx_src_udp_port - Source UDP port. Type: integer -| | ... | - rx_dst_mac - Expected destination MAC address. Type: string -| | ... | - rx_src_mac - Expected source MAC address. Type: string -| | ... | - dst_ipv4 - Expected destination IPv4 address. Type: string -| | ... | - src_ipv4 - Expected source IPv4 address. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send IPv6 UDP and check IPv4 headers for MAP-T \ -| | ... | \| port3 \| port4 \| 08:00:27:f3:be:f0 \| 2001:db8:ffff::6400:1 \ -| | ... | \| 2001:db8::14a9:c9db:0 \| ${1232} \| 08:00:27:58:71:eb \ -| | ... | \| 08:00:27:66:b8:57 \| 100.0.0.1 \| 20.169.201.219 \| -| | ... -| | [Arguments] -| | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_src_mac} -| | ... | ${tx_dst_ipv6} | ${tx_src_ipv6} | ${tx_src_udp_port} -| | ... | ${rx_dst_mac} | ${rx_src_mac} | ${dst_ipv4} | ${src_ipv4} -| | ... -| | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if} -| | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if} -| | ${args}= | Catenate -| | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name} -| | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_mac | ${tx_src_mac} -| | ... | --tx_src_ipv6 | ${tx_src_ipv6} | --tx_dst_ipv6 | ${tx_dst_ipv6} -| | ... | --tx_src_udp_port | ${tx_src_udp_port} -| | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac} -| | ... | --rx_src_ipv4 | ${src_ipv4} | --rx_dst_ipv4 | ${dst_ipv4} -| | ... -| | Run Traffic Script On Node -| | ... | send_ipv6_udp_check_map_t.py | ${tg_node} | ${args} diff --git a/resources/libraries/robot/overlay/gre.robot b/resources/libraries/robot/overlay/gre.robot new file mode 100644 index 0000000000..0e825f05fb --- /dev/null +++ b/resources/libraries/robot/overlay/gre.robot @@ -0,0 +1,182 @@ +# Copyright (c) 2016 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/interfaces.robot + +*** Keywords *** +| Create GRE tunnel interface and set it up +| | [Documentation] | Create GRE tunnel interface and set it up on defined VPP node and put \ +| | ... | the interface to UP state. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node where to create GRE tunnel. Type: dictionary +| | ... | - source_ip_address - GRE tunnel source IP address. Type: string +| | ... | - destination_ip_address - GRE tunnel destination IP address. +| | ... | Type: string +| | ... +| | ... | *Return:* +| | ... | - name - Name of created GRE tunnel interface. Type: string +| | ... | - index - SW interface index of created GRE tunnel interface. +| | ... | Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| ${gre_name} \| ${gre_index}= \ +| | ... | \| Create GRE tunnel interface and set it up \| ${dut} \ +| | ... | \| 192.0.1.1 \| 192.0.1.2 \| +| | ... +| | [Arguments] | ${dut_node} | ${source_ip_address} | ${destination_ip_address} +| | ${name} | ${index}= | Create GRE tunnel interface +| | ... | ${dut_node} | ${source_ip_address} | ${destination_ip_address} +| | Set Interface State | ${dut_node} | ${index} | up +| | [Return] | ${name} | ${index} + + +| Send ICMPv4 and check received GRE header +| | [Documentation] | Send ICMPv4 packet and check if received packed contains \ +| | ... | correct GRE, IP, MAC headers. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - Node where to run traffic script. Type: dictionary +| | ... | - tx_if - Interface from where send ICPMv4 packet. Type: string +| | ... | - rx_if - Interface where to receive GRE packet. Type: string +| | ... | - tx_dst_mac - Destination MAC address of ICMP packet. Type: string +| | ... | - rx_dst_mac - Expected destination MAC address of GRE packet. +| | ... | Type: string +| | ... | - inner_src_ip - Source IP address of ICMP packet. Type: string +| | ... | - inner_dst_ip - Destination IP address of ICMP packet. +| | ... | Type: string +| | ... | - outer_src_ip - Source IP address of GRE packet. Type: string +| | ... | - outer_dst_ip - Destination IP address of GRE packet. +| | ... | Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send ICMPv4 and check received GRE header \ +| | ... | \| ${tg_node} \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \ +| | ... | \| ${tx_dst_mac} \| ${rx_dst_mac} \| ${net1_host_address} \ +| | ... | \| ${net2_host_address} \| ${dut1_ip_address} \| ${dut2_ip_address} \| +| | ... +| | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if} +| | ... | ${tx_dst_mac} | ${rx_dst_mac} +| | ... | ${inner_src_ip} | ${inner_dst_ip} +| | ... | ${outer_src_ip} | ${outer_dst_ip} +| | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if} +| | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if} +| | ${args}= | Catenate | --tx_if | ${tx_if_name} | --rx_if | ${rx_if_name} +| | ... | --tx_dst_mac | ${tx_dst_mac} | --rx_dst_mac | ${rx_dst_mac} +| | ... | --inner_src_ip | ${inner_src_ip} | --inner_dst_ip | ${inner_dst_ip} +| | ... | --outer_src_ip | ${outer_src_ip} | --outer_dst_ip | ${outer_dst_ip} +| | Run Traffic Script On Node +| | ... | send_icmp_check_gre_headers.py | ${tg_node} | ${args} + + +| Send GRE and check received ICMPv4 header +| | [Documentation] | Send IPv4 ICMPv4 packet encapsulated into GRE and \ +| | ... | check IP, MAC headers on received packed. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - Node where to run traffic script. Type: dictionary +| | ... | - tx_if - Interface from where send ICPMv4 packet. Type: string +| | ... | - rx_if - Interface where receive GRE packet. Type: string +| | ... | - tx_dst_mac - Destination MAC address of GRE packet. Type: string +| | ... | - rx_dst_mac - Expected destination MAC address of ICMP packet. +| | ... | Type: string +| | ... | - inner_src_ip - Source IP address of ICMP packet. Type: string +| | ... | - inner_dst_ip - Destination IP address of ICMP packet. +| | ... | Type: string +| | ... | - outer_src_ip - Source IP address of GRE packet. Type: string +| | ... | - outer_dst_ip - Destination IP address of GRE packet. +| | ... | Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send GRE and check received ICMPv4 header \| ${tg_node} \ +| | ... | \| ${tg_to_dut_if2} \| ${tg_to_dut_if1} \| ${tx_dst_mac} \ +| | ... | \| ${rx_dst_mac} \| ${net2_host_address} \| ${net1_host_address} \ +| | ... | \| ${dut2_ip_address} \| ${dut1_ip_address} \| +| | ... +| | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if} +| | ... | ${tx_dst_mac} | ${rx_dst_mac} +| | ... | ${inner_src_ip} | ${inner_dst_ip} +| | ... | ${outer_src_ip} | ${outer_dst_ip} +| | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if} +| | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if} +| | ${args}= | Catenate | --tx_if | ${tx_if_name} | --rx_if | ${rx_if_name} +| | ... | --tx_dst_mac | ${tx_dst_mac} | --rx_dst_mac | ${rx_dst_mac} +| | ... | --inner_src_ip | ${inner_src_ip} | --inner_dst_ip | ${inner_dst_ip} +| | ... | --outer_src_ip | ${outer_src_ip} | --outer_dst_ip | ${outer_dst_ip} +| | Run Traffic Script On Node +| | ... | send_gre_check_icmp_headers.py | ${tg_node} | ${args} + +| Send GRE and check received GRE header +| | [Documentation] | Send IPv4 UDP packet encapsulated into GRE and \ +| | ... | check if received packed contains correct MAC GRE, IP, UDP headers. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - Node where to run traffic script. Type: dictionary +| | ... | - tx_if - Interface from where send GRE packet. Type: string +| | ... | - rx_if - Interface where to receive GRE packet. Type: string +| | ... | - tx_dst_mac - Destination MAC address of transferred packet. +| | ... | Type: string +| | ... | - tx_src_mac - Source MAC address of transferred packet. Type: string +| | ... | - tx_outer_dst_ip - Destination IP address of GRE packet. Type: string +| | ... | - tx_outer_src_ip - Source IP address of GRE packet. Type: string +| | ... | - tx_inner_dst_ip - Destination IP address of UDP packet. Type: string +| | ... | - tx_inner_src_ip - Source IP address of UDP packet. Type: string +| | ... | - rx_dst_mac - Expected destination MAC address. Type: string +| | ... | - rx_src_mac - Expected source MAC address. Type: string +| | ... | - rx_outer_dst_ip - Expected destination IP address of received GRE +| | ... | packet. Type: string +| | ... | - rx_outer_src_ip - Expected source IP address of received GRE +| | ... | packet. Type: string +| | ... +| | ... | __Note:__ +| | ... | rx_inner_dst_ip and rx_inner_src_ip should be same as transferred +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Send GRE and check received GRE header \| ${tg_node} \ +| | ... | \| port3 \| port3 \| 08:00:27:f3:be:f0 \| 08:00:27:46:2b:4c \ +| | ... | \| 10.0.0.1 \| 10.0.0.2 \| 192.168.3.100 \| 192.168.2.100 \ +| | ... | \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \| 10.0.0.3 \| 10.0.0.1 \| +| | ... +| | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if} +| | ... | ${tx_dst_mac} | ${tx_src_mac} +| | ... | ${tx_outer_dst_ip} | ${tx_outer_src_ip} +| | ... | ${tx_inner_dst_ip} | ${tx_inner_src_ip} +| | ... | ${rx_dst_mac} | ${rx_src_mac} +| | ... | ${rx_outer_dst_ip} | ${rx_outer_src_ip} +| | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if} +| | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if} +| | ${args}= | Catenate | --tx_if | ${tx_if_name} | --rx_if | ${rx_if_name} +| | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_mac | ${tx_src_mac} +| | ... | --tx_outer_dst_ip | ${tx_outer_dst_ip} +| | ... | --tx_outer_src_ip | ${tx_outer_src_ip} +| | ... | --tx_inner_dst_ip | ${tx_inner_dst_ip} +| | ... | --tx_inner_src_ip | ${tx_inner_src_ip} +| | ... | --rx_dst_mac | ${rx_dst_mac} +| | ... | --rx_src_mac | ${rx_src_mac} +| | ... | --rx_outer_dst_ip | ${rx_outer_dst_ip} +| | ... | --rx_outer_src_ip | ${rx_outer_src_ip} +| | Run Traffic Script On Node +| | ... | send_gre_check_gre_headers.py | ${tg_node} | ${args} diff --git a/resources/libraries/robot/overlay/l2lisp.robot b/resources/libraries/robot/overlay/l2lisp.robot new file mode 100644 index 0000000000..5dcfcc5971 --- /dev/null +++ b/resources/libraries/robot/overlay/l2lisp.robot @@ -0,0 +1,77 @@ +# Copyright (c) 2016 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 | LISP-gpe encapsulation suite keywords +| Library | resources.libraries.python.topology.Topology +| Resource | resources/libraries/robot/overlay/lisp_api.robot +| Library | resources.libraries.python.LispSetup.LispLocatorSet +| Library | resources.libraries.python.LispSetup.LispLocator +| Library | resources.libraries.python.LispSetup.LispLocalEid +| Library | resources.libraries.python.LispSetup.LispAdjacency +| Library | resources.libraries.python.LispSetup.LispRemoteMapping +| Library | resources.libraries.python.LispSetup.LispMapResolver +| Library | resources.libraries.python.LispSetup.LispEidTableMap + +*** Keywords *** +| Configure L2 LISP on DUT +| | [Documentation] | Set up LISP L2 topology. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - adjacency - DUT static adjacency settings. Type: dict +| | ... | - settings - DUT other LISP related settings. Type: dict +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Configure LISP GPE topology in 3-node circular topology \| ${dut_node} \| ${adjacency} \ +| | ... | \| ${settings} \| +| | ... +| | [Arguments] +| | ... | ${dut_node} | ${adjacency} | ${settings} +| | ... +| | ${int_idx}= | Get Interface Sw Index | ${dut_node} | ${${adjacency['int']}} +| | Enable Lisp | ${dut_node} +| | Vpp Add Lisp Locator Set | ${dut_node} +| | ... | ${settings['locator_name']} +| | Vpp Add Lisp Locator | ${dut_node} +| | ... | ${settings['locator_name']} +| | ... | ${int_idx} +| | ... | ${settings['priority']} +| | ... | ${settings['weight']} +| | Vpp Lisp Eid Table Mapping | ${dut_node} +| | ... | ${settings['vni']} +| | ... | bd_id=${settings['bd']} +| | Vpp Add Lisp Local Eid | ${dut_node} +| | ... | ${settings['locator_name']} +| | ... | ${settings['vni']} +| | ... | ${adjacency['seid']} +| | Vpp Add Map Resolver | ${dut_node} +| | ... | ${adjacency['map_res']} +| | Vpp Add Lisp Remote Mapping | ${dut_node} +| | ... | ${settings['vni']} +| | ... | ${adjacency['eid']} +| | ... | 0 +| | ... | ${adjacency['seid']} +| | ... | 0 +| | ... | ${adjacency['rloc']} +| | ... | is_mac=${TRUE} +| | Vpp Add Lisp Adjacency | ${dut_node} +| | ... | ${settings['vni']} +| | ... | ${adjacency['eid']} +| | ... | 0 +| | ... | ${adjacency['seid']} +| | ... | 0 +| | ... | is_mac=${TRUE} diff --git a/resources/libraries/robot/overlay/lisp_api.robot b/resources/libraries/robot/overlay/lisp_api.robot new file mode 100644 index 0000000000..1485a405a6 --- /dev/null +++ b/resources/libraries/robot/overlay/lisp_api.robot @@ -0,0 +1,399 @@ +# Copyright (c) 2016 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/interfaces.robot +| Library | resources.libraries.python.NodePath +| Library | resources.libraries.python.LispSetup.LispStatus +| Library | resources.libraries.python.LispSetup.LispSetup +| Library | resources.libraries.python.LispSetup.LispGpeStatus +| Library | resources.libraries.python.LispUtil + +*** Keywords *** + +| Generate LISP locator_set data +| | [Documentation] | Generate lisp locator_set data for test +| | ... | the lisp locator_set and locator API. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - locator_set_number - Number how many locator_set data +| | ... | will be generated. Type: integer +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | _NOTE:_ This KW sets following test case variables: +| | ... | - locator_set_values - New generated locator_set data. +| | ... | - locator_set_values_vat - New generated locator_set data expected\ +| | ... | from VAT. +| | ... +| | ... | *Example:* +| | ... | \| Given Generate LISP locator_set data \| ${nodes['DUT1']} \ +| | ... | \| ${locator_set_number} \| +| | ... +| | [Arguments] | ${dut_node} | ${locator_set_number} +| | ${locator_set_values} | ${locator_set_values_vat}= +| | ... | Generate Unique Lisp Locator Set Data +| | ... | ${dut_node} | ${locator_set_number} +| | Set Test Variable | ${locator_set_values} +| | Set Test Variable | ${locator_set_values_vat} + +| Configure LISP locator_set data +| | [Documentation] | Set the lisp locator_set and locator on the VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | _NOTE:_ This KW requires following test case variables: +| | ... | - locator_set_values - Generated locator_set data from +| | ... | KW locator_set data is prepared, which will be set on the VPP node. +| | ... +| | ... | *Example:* +| | ... | \| When Configure LISP locator_set data \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${dut_node} +| | Vpp Set Lisp Locator Set | ${dut_node} | ${locator_set_values} + +| LISP locator_set shpuld be configured correctly +| | [Documentation] | Test if the locator_set is set correctly on the VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | _NOTE:_ This KW requires following test case variables: +| | ... | - locator_set_values_vat - Generated locator_set data from +| | ... | KW locator_set data is prepared, which are expected from VPP via VAT. +| | ... +| | ... | *Example:* +| | ... | \| Then LISP locator_set shpuld be configured correctly \ +| | ... | \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${dut_node} +| | ${show_locator_set}= | Vpp Show Lisp Locator Set | ${dut_node} | local +| | Lisp Locator S Should Be Equal +| | ... | ${locator_set_values_vat} | ${show_locator_set} + +| Delete all LISP locator_set from VPP +| | [Documentation] | Delete all lisp locator_set on the VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | _NOTE:_ This KW requires following test case variables: +| | ... | - locator_set_values - Generated locator_set data from +| | ... | KW locator_set data is prepared, which was set on the VPP node. +| | ... +| | ... | *Example:* +| | ... | \| When Delete all LISP locator_set from VPP \ +| | ... | \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${dut_node} +| | Vpp Unset Lisp Locator Set | ${dut_node} | ${locator_set_values} + +| LISP locator_set should be unset +| | [Documentation] | Test if all locator_set are unset from VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Then LISP locator_set should be unset \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${dut_node} +| | ${show_locator_set}= | Vpp Show Lisp Locator Set | ${dut_node} | ${EMPTY} +| | Lisp Is Empty | ${show_locator_set} + +| Lisp locator_set data use for test reset locator_set are prepared +| | [Documentation] | Generate lisp special type of locator_set data. +| | ... | This data will be use for test reset locator_set. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - locator_set_number - Number how many locator_set data +| | ... | it will generate. Type: integer +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | _NOTE:_ This KW sets following test case variables: +| | ... | - locator_set_values - New generate locator_set data. +| | ... | - locator_set_values_vat - New generated locator_set data expected\ +| | ... | from VAT. +| | ... +| | ... | *Example:* +| | ... | \| Given Lisp locator_set data use for test reset locator_set \ +| | ... | are prepared \| ${nodes['DUT1']} \| ${locator_set_number} \| +| | ... +| | [Arguments] | ${dut_node} | ${locator_set_number} +| | ${locator_set_values} | ${locator_set_values_vat}= +| | ... | Generate Duplicate Lisp Locator Set Data +| | ... | ${dut_node} | ${locator_set_number} +| | Set Test Variable | ${locator_set_values} +| | Set Test Variable | ${locator_set_values_vat} + +| Configure LISP eid address +| | [Documentation] | Set the lisp eid address on the VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - set_eid - Test eid data. Type: list +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| When Configure LISP eid address \| ${nodes['DUT1']} \ +| | ... | \| ${eid_table} \| +| | ... +| | [Arguments] | ${dut_node} | ${set_eid} +| | Vpp Set Lisp Eid Table | ${dut_node} | ${set_eid} + +| LISP eid address should be set correctly to eid table +| | [Documentation] | Test if the locator_set is set correctly on the VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - set_eid - Example eid data, which was set to the VPP node. +| | ... | Type: list +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | _NOTE:_ This KW requires following test case variables: +| | ... | - set_eid - Generated eid data, which will be set to the VPP node. +| | ... +| | ... | *Example:* +| | ... | \| Then LISP eid address should be set correctly to eid table \ +| | ... | \| ${nodes['DUT1']} \| ${eid_table} \| +| | ... +| | [Arguments] | ${dut_node} | ${set_eid} +| | ${show_eid}= | Vpp Show Lisp Eid Table | ${dut_node} +| | Lisp Should Be Equal | ${set_eid} | ${show_eid} + +| Delete all LISP eid address from VPP +| | [Documentation] | Delete all lisp eid address from the VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - set_eid - Eid data which will be removed from the VPP node. +| | ... | Type: list +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| When Delete all LISP eid address from VPP \ +| | ... | \| ${nodes['DUT1']} \| ${eid_table} \| +| | ... +| | [Arguments] | ${dut_node} | ${set_eid} +| | Vpp Unset Lisp Eid Table | ${dut_node} | ${set_eid} + +| LISP eid table should be empty +| | [Documentation] | Test if the eid table is empty. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Then LISP eid table should be empty \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${dut_node} +| | ${show_eid}= | Vpp Show Lisp Eid Table | ${dut_node} +| | Lisp Is Empty | ${show_eid} + +| Configure LISP map resolver address +| | [Documentation] | Set the lisp map resolver address in the VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - set_map_resolver - Map resolver data, which will be set on +| | ... | the VPP node. Type: list +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| When Configure LISP map resolver address \| ${nodes['DUT1']} \ +| | ... | \| ${map_resolver} \| +| | ... +| | [Arguments] | ${dut_node} | ${set_map_resolver} +| | Vpp Set Lisp Map Resolver | ${dut_node} | ${set_map_resolver} + +| LISP map resolver address should be configured correctly +| | [Documentation] | Test if the map resolver address is set correctly +| | ... | on the VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - set_map_resolver - Map resolver data, which was set on +| | ... | the VPP node. Type: list +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Then LISP map resolver address should be configured correctly \ +| | ... | \| ${nodes['DUT1']} \| ${map_resolver} \| +| | ... +| | [Arguments] | ${dut_node} | ${set_map_resolver} +| | ${show_map_resolver}= | Vpp Show Lisp Map Resolver | ${dut_node} +| | Lisp Should Be Equal | ${set_map_resolver} | ${show_map_resolver} + +| Delete all LISP map resolver address from VPP +| | [Documentation] | Delete all lisp map resolver address on the VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - map_resolver - Map resolver data, which will be remove from +| | ... | the VPP. Type: list +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| When Delete all LISP map resolver address from VPP \ +| | ... | \| ${nodes['DUT1']} \| ${map_resolver} \| +| | ... +| | [Arguments] | ${dut_node} | ${set_map_resolver} +| | Vpp Unset Lisp Map Resolver | ${dut_node} | ${set_map_resolver} + +| LISP map resolver address should be empty +| | [Documentation] | Test if the map resolver are empty. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Then LISP map resolver address should be empty \ +| | ... | \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${dut_node} +| | ${show_map_resolver}= | Vpp Show Lisp Map Resolver | ${dut_node} +| | Lisp Is Empty | ${show_map_resolver} + +| Enable LISP +| | [Documentation] | Enable LISP on VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Enable LISP \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${dut_node} +| | Vpp Lisp Enable Disable | ${dut_node} | enable + +| LISP should be enabled +| | [Documentation] | Check if the lisp is enabled. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - lisp_status_data - Lisp status data, which was set on +| | ... | the VPP node. Type: list +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| LISP should be enabled \| ${nodes['DUT1']} \ +| | ... | \| ${lisp_status_data} \| +| | ... +| | [Arguments] | ${dut_node} | ${lisp_status_data} +| | ${show_lisp_stat}= | Vpp Show Lisp State | ${dut_node} +| | Lisp Should Be Equal | ${show_lisp_stat} | ${lisp_status_data[1]} + +| Disable LISP +| | [Documentation] | Disable LISP on VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Disable LISP \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${dut_node} +| | Vpp Lisp Enable Disable | ${dut_node} | disable + +| LISP Should be disabled +| | [Documentation] | LISP Should be disabled. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - lisp_status_data - Lisp status data, which was set on +| | ... | the VPP node. Type: list +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| LISP Should be disabled \| ${nodes['DUT1']} \ +| | ... | \| ${lisp_status_data} \| +| | ... +| | [Arguments] | ${dut_node} | ${lisp_status_data} +| | ${show_lisp_stat}= | Vpp Show Lisp State | ${dut_node} +| | Lisp Should Be Equal | ${show_lisp_stat} | ${lisp_status_data[0]} + +| Enable Lisp Gpe +| | [Documentation] | Enable Lisp Gpe on VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Enable Lisp Gpe \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${dut_node} +| | Vpp Lisp Gpe Enable Disable | ${dut_node} | enable + +| Disable Lisp Gpe +| | [Documentation] | Disable Lisp Gpe on VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Disable Lisp Gpe \| ${nodes['DUT1']} \| +| | ... +| | [Arguments] | ${dut_node} +| | Vpp Lisp Gpe Enable Disable | ${dut_node} | disable diff --git a/resources/libraries/robot/overlay/lisp_static_adjacency.robot b/resources/libraries/robot/overlay/lisp_static_adjacency.robot new file mode 100644 index 0000000000..f20fd51eb4 --- /dev/null +++ b/resources/libraries/robot/overlay/lisp_static_adjacency.robot @@ -0,0 +1,168 @@ +# Copyright (c) 2016 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 | Lisp static adjacency suite keywords +| Resource | resources/libraries/robot/overlay/lisp_api.robot +| Library | resources.libraries.python.LispSetup.LispLocatorSet +| Library | resources.libraries.python.LispSetup.LispLocator +| Library | resources.libraries.python.LispSetup.LispLocalEid +| Library | resources.libraries.python.LispSetup.LispAdjacency +| Library | resources.libraries.python.LispSetup.LispRemoteMapping +| Library | resources.libraries.python.IPv4Util.IPv4Util + +*** Keywords *** +| Configure LISP topology in 3-node circular topology +| | [Documentation] | Set up Lisp static adjacency topology. +| | ... +| | ... | *Arguments:* +| | ... | - dut1_node - DUT1 node. Type: dictionary +| | ... | - dut1_int_name - DUT1 node interface name. Type: string +| | ... | - dut1_int_index - DUT1 node interface index. Type: integer +| | ... | - dut2_node - DUT2 node. Type: dictionary +| | ... | - dut2_int_name - DUT2 node interface name. Type: string +| | ... | - dut2_int_index - DUT2 node interface index. Type: integer +| | ... | - locator_set - Locator set values. Type: dictionary +| | ... | - dut1_eid - Dut1 node eid address. Type: dictionary +| | ... | - dut2_eid - Dut2 node eid address. Type: dictionary +| | ... | - dut1_static_adjacency - Dut1 static adjacency. Type: dictionary +| | ... | - dut2_static_adjacency - Dut2 static address. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Configure LISP topology in 3-node circular topology \| ${dut1_node} \| ${interface_name} \ +| | ... | \| None \| ${dut2_node} \| ${interface_name} \| None \ +| | ... | \| ${locator_set} \| ${dut1_eid} \| ${dut2_eid} \ +| | ... | \| ${dut1_static_adjacency} \| ${dut2_static_adjacency} \| +| | ... +| | [Arguments] | ${dut1_node} | ${dut1_int_name} | ${dut1_int_index} +| | ... | ${dut2_node} | ${dut2_int_name} | ${dut2_int_index} +| | ... | ${locator_set} | ${dut1_eid} | ${dut2_eid} +| | ... | ${dut1_static_adjacency} | ${dut2_static_adjacency} +| | ${dut1_int_index}= | Run Keyword If | ${dut1_int_index} is None +| | | ... | Get Interface Sw Index | ${dut1_node} +| | | ... | ${dut1_int_name} +| | | ... | ELSE | Set Variable | ${dut1_int_index} +| | ${dut2_int_index}= | Run Keyword If | ${dut2_int_index} is None +| | | ... | Get Interface Sw Index | ${dut2_node} +| | | ... | ${dut2_int_name} +| | | ... | ELSE | Set Variable | ${dut2_int_index} +| | Enable Lisp | ${dut1_node} +| | Vpp Add Lisp Locator Set | ${dut1_node} | ${locator_set['locator_name']} +| | Vpp Add Lisp Locator | ${dut1_node} | ${locator_set['locator_name']} +| | ... | ${dut1_int_index} | ${locator_set['priority']} +| | ... | ${locator_set['weight']} +| | Vpp Add Lisp Local Eid | ${dut1_node} | ${dut1_eid['locator_name']} +| | ... | ${dut1_eid['vni']} | ${dut1_eid['eid']} +| | ... | ${dut1_eid['prefix']} +| | Vpp Add Lisp Remote Mapping | ${dut1_node} | ${dut1_static_adjacency['vni']} +| | ... | ${dut1_static_adjacency['deid']} +| | ... | ${dut1_static_adjacency['prefix']} +| | ... | ${dut1_static_adjacency['seid']} +| | ... | ${dut1_static_adjacency['prefix']} +| | ... | ${dut1_static_adjacency['rloc']} +| | Vpp Add Lisp Adjacency | ${dut1_node} | ${dut1_static_adjacency['vni']} +| | ... | ${dut1_static_adjacency['deid']} +| | ... | ${dut1_static_adjacency['prefix']} +| | ... | ${dut1_static_adjacency['seid']} +| | ... | ${dut1_static_adjacency['prefix']} +| | Enable Lisp | ${dut2_node} +| | Vpp Add Lisp Locator Set | ${dut2_node} | ${locator_set['locator_name']} +| | Vpp Add Lisp Locator | ${dut2_node} | ${locator_set['locator_name']} +| | ... | ${dut2_int_index} | ${locator_set['priority']} +| | ... | ${locator_set['weight']} +| | Vpp Add Lisp Local Eid | ${dut2_node} | ${dut2_eid['locator_name']} +| | ... | ${dut2_eid['vni']} | ${dut2_eid['eid']} +| | ... | ${dut2_eid['prefix']} +| | Vpp Add Lisp Remote Mapping | ${dut2_node} | ${dut2_static_adjacency['vni']} +| | ... | ${dut2_static_adjacency['deid']} +| | ... | ${dut2_static_adjacency['prefix']} +| | ... | ${dut2_static_adjacency['seid']} +| | ... | ${dut2_static_adjacency['prefix']} +| | ... | ${dut2_static_adjacency['rloc']} +| | Vpp Add Lisp Adjacency | ${dut2_node} | ${dut2_static_adjacency['vni']} +| | ... | ${dut2_static_adjacency['deid']} +| | ... | ${dut2_static_adjacency['prefix']} +| | ... | ${dut2_static_adjacency['seid']} +| | ... | ${dut2_static_adjacency['prefix']} + +| Change LISP Configuration +| | [Documentation] | Change configuration of the Lisp protocol. +| | ... +| | ... | *Arguments:* +| | ... | - dut1_node - DUT1 node. Type: dictionary +| | ... | - dut2_node - DUT2 node. Type: dictionary +| | ... | - dut1_to_dut2 - DUT1 towards DUT2 interface name. Type: string +| | ... | - dut2_to_dut1 - DUT2 towards DUT1 interface name. Type: string +| | ... | - dut1_to_dut2_mac - DUT1 towards DUT2 interface mac address. +| | ... | Type: string +| | ... | - dut2_to_dut1_mac - DUT2 towards DUT1 interface mac address. +| | ... | Type: string +| | ... | - new_dut1_ip - New DUT1 towards DUT2 interface IP address. +| | ... | Type: string +| | ... | - new_dut2_ip - New DUT2 towards DUT1 interface IP address. +| | ... | Type: string +| | ... | - prefix - Prefix of the DUT nodes. Type: integer +| | ... | - old_dut1_static_adjacency - Old DUT1 static adjacency. +| | ... | Type: dictionary +| | ... | - new_dut1_static_adjacency - New DUT1 static adjacency. +| | ... | Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Change LISP Configuration \| ${dut1_node} \| ${dut2_node} \ +| | ... | \| ${dut1_to_dut2} \| ${dut2_to_dut1} | "08:00:27:20:e0:0d" \ +| | ... | \| "08:00:27:b1:94:b1" \| "6.3.0.1" \| "6.3.0.20" \| "24" \ +| | ... | \| ${old_dut1_static_adjacency} \| ${new_dut1_static_adjacency} \| +| | ... +| | [Arguments] | ${dut1_node} | ${dut2_node} | ${dut1_to_dut2} +| | ... | ${dut2_to_dut1} | ${dut1_to_dut2_mac} | ${dut2_to_dut1_mac} +| | ... | ${new_dut1_ip} | ${new_dut2_ip} | ${prefix} +| | ... | ${old_dut1_static_adjacency} | ${new_dut1_static_adjacency} +| | Flush IPv4 Addresses "${dut2_to_dut1}" "${dut2_node}" +| | Vpp Del Lisp Remote Mapping | ${dut1_node} +| | ... | ${old_dut1_static_adjacency['vni']} +| | ... | ${old_dut1_static_adjacency['deid']} +| | ... | ${old_dut1_static_adjacency['prefix']} +| | ... | ${old_dut1_static_adjacency['seid']} +| | ... | ${old_dut1_static_adjacency['prefix']} +| | ... | ${old_dut1_static_adjacency['rloc']} +| | Vpp Del Lisp Adjacency | ${dut1_node} +| | ... | ${old_dut1_static_adjacency['vni']} +| | ... | ${old_dut1_static_adjacency['deid']} +| | ... | ${old_dut1_static_adjacency['prefix']} +| | ... | ${old_dut1_static_adjacency['seid']} +| | ... | ${old_dut1_static_adjacency['prefix']} +| | Set Interface Address | ${dut2_node} | ${dut2_to_dut1} +| | ... | ${new_dut2_ip} | ${prefix} +| | Add Arp On Dut | ${dut1_node} | ${dut1_to_dut2} | ${new_dut2_ip} +| | ... | ${dut2_to_dut1_mac} +| | Add Arp On Dut | ${dut2_node} | ${dut2_to_dut1} | ${new_dut1_ip} +| | ... | ${dut1_to_dut2_mac} +| | Vpp Add Lisp Remote Mapping | ${dut1_node} +| | ... | ${new_dut1_static_adjacency['vni']} +| | ... | ${new_dut1_static_adjacency['deid']} +| | ... | ${new_dut1_static_adjacency['prefix']} +| | ... | ${new_dut1_static_adjacency['seid']} +| | ... | ${new_dut1_static_adjacency['prefix']} +| | ... | ${new_dut1_static_adjacency['rloc']} +| | Vpp Add Lisp Adjacency | ${dut1_node} +| | ... | ${new_dut1_static_adjacency['vni']} +| | ... | ${new_dut1_static_adjacency['deid']} +| | ... | ${new_dut1_static_adjacency['prefix']} +| | ... | ${new_dut1_static_adjacency['seid']} +| | ... | ${new_dut1_static_adjacency['prefix']} diff --git a/resources/libraries/robot/overlay/lispgpe.robot b/resources/libraries/robot/overlay/lispgpe.robot new file mode 100644 index 0000000000..d5115d8242 --- /dev/null +++ b/resources/libraries/robot/overlay/lispgpe.robot @@ -0,0 +1,126 @@ +# Copyright (c) 2016 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 | LISP-gpe encapsulation suite keywords +| Library | resources.libraries.python.topology.Topology +| Resource | resources/libraries/robot/overlay/lisp_api.robot +| Library | resources.libraries.python.LispSetup.LispLocatorSet +| Library | resources.libraries.python.LispSetup.LispLocator +| Library | resources.libraries.python.LispSetup.LispLocalEid +| Library | resources.libraries.python.LispSetup.LispAdjacency +| Library | resources.libraries.python.LispSetup.LispRemoteMapping +| Library | resources.libraries.python.LispSetup.LispEidTableMap + +*** Keywords *** +| Configure LISP GPE topology in 3-node circular topology +| | [Documentation] | Configure LISP GPE topology in 3-node circular topology. +| | ... +| | ... | *Arguments:* +| | ... | - dut1_node - DUT1 node. Type: dictionary +| | ... | - dut1_if - DUT1 node interface. Type: string +| | ... | - dut1_int_index - DUT1 node interface index. Type: integer +| | ... | - dut2_node - DUT2 node. Type: dictionary +| | ... | - dut2_if - DUT2 node interface. Type: string +| | ... | - dut2_int_index - DUT2 node interface index. Type: integer +| | ... | - locator_set - Locator set values. Type: dictionary +| | ... | - dut1_eid - DUT1 node eid address. Type: dictionary +| | ... | - dut2_eid - DUT2 node eid address. Type: dictionary +| | ... | - dut1_static_adjacency - DUT1 static adjacency. Type: dictionary +| | ... | - dut2_static_adjacency - DUT2 static adjacency. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Configure LISP GPE topology in 3-node circular topology \| ${dut1_node} \| ${interface_name} \ +| | ... | \| None \| ${dut2_node} \| ${interface_name} \| None \ +| | ... | \| ${locator_set} \| ${dut1_eid} \| ${dut2_eid} \ +| | ... | \| ${dut1_static_adjacency} \| ${dut2_static_adjacency} \| +| | ... +| | [Arguments] +| | ... | ${dut1_node} | ${dut1_if} | ${dut1_int_index} +| | ... | ${dut2_node} | ${dut2_if} | ${dut2_int_index} +| | ... | ${locator_set} | ${dut1_eid} | ${dut2_eid} +| | ... | ${dut1_static_adjacency} | ${dut2_static_adjacency} +| | ... | ${vni_table}=0 | ${vrf_table}=0 +| | ... +# DUT1 settings: +| | ${dut1_int_index}= | Run Keyword If | ${dut1_int_index} is None +| | | ... | Get Interface Sw Index | ${dut1_node} | ${dut1_if} +| | | ... | ELSE | Set Variable | ${dut1_int_index} +| | Enable Lisp | ${dut1_node} +| | Enable Lisp GPE | ${dut1_node} +| | Vpp Add Lisp Locator Set | ${dut1_node} +| | ... | ${locator_set['locator_name']} +| | Vpp Add Lisp Locator | ${dut1_node} +| | ... | ${locator_set['locator_name']} +| | ... | ${dut1_int_index} +| | ... | ${locator_set['priority']} +| | ... | ${locator_set['weight']} +| | Vpp Lisp Eid Table Mapping | ${dut1_node} +| | ... | ${vni_table} +| | ... | vrf=${vrf_table} +| | Vpp Add Lisp Local Eid | ${dut1_node} +| | ... | ${dut1_eid['locator_name']} +| | ... | ${vni_table} +| | ... | ${dut1_eid['eid']} +| | ... | ${dut1_eid['prefix']} +| | Vpp Add Lisp Remote Mapping | ${dut1_node} +| | ... | ${vni_table} +| | ... | ${dut1_static_adjacency['deid']} +| | ... | ${dut1_static_adjacency['prefix']} +| | ... | ${dut1_static_adjacency['seid']} +| | ... | ${dut1_static_adjacency['prefix']} +| | ... | ${dut1_static_adjacency['rloc']} +| | Vpp Add Lisp Adjacency | ${dut1_node} +| | ... | ${vni_table} +| | ... | ${dut1_static_adjacency['deid']} +| | ... | ${dut1_static_adjacency['prefix']} +| | ... | ${dut1_static_adjacency['seid']} +| | ... | ${dut1_static_adjacency['prefix']} +| | ... +# DUT2 settings: +| | ${dut2_int_index}= | Run Keyword If | ${dut2_int_index} is None +| | | ... | Get Interface Sw Index | ${dut2_node} | ${dut2_if} +| | | ... | ELSE | Set Variable | ${dut2_int_index} +| | Enable Lisp | ${dut2_node} +| | Enable Lisp GPE | ${dut2_node} +| | Vpp Add Lisp Locator Set | ${dut2_node} +| | ... | ${locator_set['locator_name']} +| | Vpp Add Lisp Locator | ${dut2_node} +| | ... | ${locator_set['locator_name']} +| | ... | ${dut2_int_index} +| | ... | ${locator_set['priority']} +| | ... | ${locator_set['weight']} +| | Vpp Lisp Eid Table Mapping | ${dut2_node} +| | ... | ${vni_table} +| | ... | vrf=${vrf_table} +| | Vpp Add Lisp Local Eid | ${dut2_node} +| | ... | ${dut2_eid['locator_name']} +| | ... | ${vni_table} +| | ... | ${dut2_eid['eid']} +| | ... | ${dut2_eid['prefix']} +| | Vpp Add Lisp Remote Mapping | ${dut2_node} +| | ... | ${vni_table} +| | ... | ${dut2_static_adjacency['deid']} +| | ... | ${dut2_static_adjacency['prefix']} +| | ... | ${dut2_static_adjacency['seid']} +| | ... | ${dut2_static_adjacency['prefix']} +| | ... | ${dut2_static_adjacency['rloc']} +| | Vpp Add Lisp Adjacency | ${dut2_node} +| | ... | ${vni_table} +| | ... | ${dut2_static_adjacency['deid']} +| | ... | ${dut2_static_adjacency['prefix']} +| | ... | ${dut2_static_adjacency['seid']} +| | ... | ${dut2_static_adjacency['prefix']} diff --git a/resources/libraries/robot/overlay/vxlan.robot b/resources/libraries/robot/overlay/vxlan.robot new file mode 100644 index 0000000000..69f4c10a88 --- /dev/null +++ b/resources/libraries/robot/overlay/vxlan.robot @@ -0,0 +1,135 @@ +# Copyright (c) 2016 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 | Collections +| Resource | resources/libraries/robot/shared/default.robot +| Resource | resources/libraries/robot/shared/interfaces.robot +| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot +| Resource | resources/libraries/robot/l2/l2_xconnect.robot +| Library | resources.libraries.python.L2Util +| Library | resources.libraries.python.IPUtil +| Library | resources.libraries.python.IPv4Util +| Library | resources.libraries.python.IPv6Util +| Library | resources.libraries.python.IPv4Setup +| Library | resources.libraries.python.NodePath + +*** Keywords *** +| Configure IP addresses and neighbors on interfaces +| | [Documentation] | *Set IPv4 addresses on interfaces on DUTs.* +| | ... | If interface index is None then is determines with Get Interface Sw Index +| | ... | in this case it is required the interface to be present in topology dict. +| | ... | It also executes VPP IP Probe to determine MACs to IPs on DUTs +| | ... +| | ... | _Set testcase variables with IP addresses and prefix length:_ +| | ... | - ${dut1s_ip_address} +| | ... | - ${dut2s_ip_address} +| | ... | - ${duts_ip_address_prefix} +| | ... +| | [Arguments] | ${DUT1} | ${DUT1_INT_NAME} | ${DUT1_INT_INDEX} +| | ... | ${DUT2} | ${DUT2_INT_NAME} | ${DUT2_INT_INDEX} +| | Set Test Variable | ${dut1s_ip_address} | 172.16.0.1 +| | Set Test Variable | ${dut2s_ip_address} | 172.16.0.2 +| | Set Test Variable | ${duts_ip_address_prefix} | 24 +| | ${DUT1_INT_KEY}= | Run Keyword If | ${DUT1_INT_INDEX} is None +| | | ... | Get Interface by name | ${DUT1} | ${DUT1_INT_NAME} +| | ${DUT2_INT_KEY}= | Run Keyword If | ${DUT2_INT_INDEX} is None +| | | ... | Get Interface by name | ${DUT2} | ${DUT2_INT_NAME} +| | ${DUT1_INT_INDEX}= | Run Keyword If | ${DUT1_INT_INDEX} is None +| | | ... | Get Interface Sw Index | ${DUT1} | ${DUT1_INT_KEY} +| | | ... | ELSE | Set Variable | ${DUT1_INT_INDEX} +| | ${DUT2_INT_INDEX}= | Run Keyword If | ${DUT2_INT_INDEX} is None +| | | ... | Get Interface Sw Index | ${DUT2} | ${DUT2_INT_KEY} +| | | ... | ELSE | Set Variable | ${DUT2_INT_INDEX} +| | ${DUT1_INT_MAC}= | Vpp Get Interface Mac | ${DUT1} | ${DUT1_INT_INDEX} +| | ${DUT2_INT_MAC}= | Vpp Get Interface Mac | ${DUT2} | ${DUT2_INT_INDEX} +| | Set Interface Address | ${DUT1} | ${DUT1_INT_INDEX} +| | ... | ${dut1s_ip_address} | ${duts_ip_address_prefix} +| | Set Interface Address | ${DUT2} | ${DUT2_INT_INDEX} +| | ... | ${dut2s_ip_address} | ${duts_ip_address_prefix} +| | Add IP Neighbor | ${DUT1} | ${DUT1_INT_INDEX} | ${dut2s_ip_address} | ${DUT2_INT_MAC} +| | Add IP Neighbor | ${DUT2} | ${DUT2_INT_INDEX} | ${dut1s_ip_address} | ${DUT1_INT_MAC} + +| Add interfaces to L2BD +| | [Arguments] | ${DUT} | ${BID} | ${INTERFACE_1} | ${INTERFACE_2} +| | Vpp Add L2 Bridge Domain | ${DUT} | ${BID} | ${INTERFACE_1} | ${INTERFACE_2} + +| Create vlan interfaces for VXLAN +| | [Documentation] | *Create VLAN subinterface on interfaces on DUTs with given VLAN ID.* +| | ... +| | ... | _Set testcase variables with name and index of created interfaces:_ +| | ... | - ${dut1s_vlan_name} +| | ... | - ${dut1s_vlan_index} +| | ... | - ${dut2s_vlan_name} +| | ... | - ${dut2s_vlan_index} +| | ... +| | [Arguments] | ${VLAN} | ${DUT1} | ${INT1} | ${DUT2} | ${INT2} +| | ${INT1_NAME}= | Get interface name | ${DUT1} | ${INT1} +| | ${INT2_NAME}= | Get interface name | ${DUT2} | ${INT2} +| | ${dut1s_vlan_name} | ${dut1s_vlan_index}= | Create Vlan Subinterface +| | | ... | ${DUT1} | ${INT1_NAME} | ${VLAN} +| | ${dut2s_vlan_name} | ${dut2s_vlan_index}= | Create Vlan Subinterface +| | | ... | ${DUT2} | ${INT2_NAME} | ${VLAN} +| | Set Interface State | ${DUT1} | ${dut1s_vlan_index} | up +| | Set Interface State | ${DUT2} | ${dut2s_vlan_index} | up +| | Set Test Variable | ${dut1s_vlan_name} +| | Set Test Variable | ${dut1s_vlan_index} +| | Set Test Variable | ${dut2s_vlan_name} +| | Set Test Variable | ${dut2s_vlan_index} + +| Send VXLAN encapsulated packet and verify received packet +| | [Documentation] | Send VXLAN encapsulated Ethernet frame and check \ +| | ... | received one. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - Node where to run traffic script. Type: dictionary +| | ... | - tx_if - Interface from where send VXLAN packet. Type: string +| | ... | - rx_if - Interface where receive VXLAN packet. Type: string +| | ... | - tx_src_mac - Source MAC address of sent packet. Type: string +| | ... | - tx_dst_mac - Destination MAC address of sent packet. Type: string +| | ... | - tx_src_ip - Source IP address of sent VXLAN packet. Type: string +| | ... | - tx_dst_ip - Destination IP address of sent VXLAN packet. +| | ... | Type: string +| | ... | - tx_vni - VNI of sent VXLAN packet. Type: string +| | ... | - rx_src_ip - Source IP address of received VXLAN packet. Type: string +| | ... | - rx_dst_ip - Destination IP address of received VXLAN packet. +| | ... | Type: string +| | ... | - rx_vni - VNI of received VXLAN packet. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send VXLAN encapsulated packet and verify received packet \| ${tg_node} \| port4 \| port4 \ +| | ... | \| fa:16:3e:6d:f9:c5 \| fa:16:3e:e6:6d:9a \| 192.168.0.1 \ +| | ... | \| 192.168.0.2 \| ${101} \| 192.168.0.2 \| 192.168.0.1 \| ${102} \| +| | ... +| | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if} +| | ... | ${tx_src_mac} | ${tx_dst_mac} +| | ... | ${tx_src_ip} | ${tx_dst_ip} | ${tx_vni} +| | ... | ${rx_src_ip} | ${rx_dst_ip} | ${rx_vni} +| | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if} +| | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if} +| | ${args}= | Catenate +| | ... | --tx_if ${tx_if_name} +| | ... | --rx_if ${rx_if_name} +| | ... | --tx_src_mac ${tx_src_mac} +| | ... | --tx_dst_mac ${tx_dst_mac} +| | ... | --tx_src_ip ${tx_src_ip} +| | ... | --tx_dst_ip ${tx_dst_ip} +| | ... | --tx_vni ${tx_vni} +| | ... | --rx_src_ip ${rx_src_ip} +| | ... | --rx_dst_ip ${rx_dst_ip} +| | ... | --rx_vni ${rx_vni} +| | Run Traffic Script On Node | send_vxlan_check_vxlan.py | ${tg_node} | ${args} diff --git a/resources/libraries/robot/performance/performance_configuration.robot b/resources/libraries/robot/performance/performance_configuration.robot new file mode 100644 index 0000000000..17b8c68545 --- /dev/null +++ b/resources/libraries/robot/performance/performance_configuration.robot @@ -0,0 +1,1597 @@ +# Copyright (c) 2017 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 | Collections +| Library | resources.libraries.python.topology.Topology +| Library | resources.libraries.python.NodePath +| Library | resources.libraries.python.DpdkUtil +| Library | resources.libraries.python.InterfaceUtil +| Library | resources.libraries.python.VhostUser +| Library | resources.libraries.python.TrafficGenerator +| Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl +| Resource | resources/libraries/robot/shared/default.robot +| Resource | resources/libraries/robot/shared/interfaces.robot +| Resource | resources/libraries/robot/shared/counters.robot +| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot +| Resource | resources/libraries/robot/l2/l2_xconnect.robot +| Resource | resources/libraries/robot/ip/ip4.robot +| Resource | resources/libraries/robot/ip/ip6.robot +| Resource | resources/libraries/robot/vm/qemu.robot +| Resource | resources/libraries/robot/l2/tagging.robot +| Documentation | Performance suite keywords - configuration. + +*** Keywords *** +| Set interfaces in path in 2-node circular topology up +| | [Documentation] +| | ... | *Set UP state on VPP interfaces in path on nodes in 2-node circular +| | ... | topology.* +| | ... +| | Set Interface State | ${dut1} | ${dut1_if1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up +| | Vpp Node Interfaces Ready Wait | ${dut1} + +| Set interfaces in path in 3-node circular topology up +| | [Documentation] +| | ... | *Set UP state on VPP interfaces in path on nodes in 3-node circular +| | ... | topology.* +| | ... +| | Set Interface State | ${dut1} | ${dut1_if1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up +| | Set Interface State | ${dut2} | ${dut2_if1} | up +| | Set Interface State | ${dut2} | ${dut2_if2} | up +| | Vpp Node Interfaces Ready Wait | ${dut1} +| | Vpp Node Interfaces Ready Wait | ${dut2} + +| Initialize IPSec in 3-node circular topology +| | [Documentation] +| | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular +| | ... | topology. Get the interface MAC addresses and setup ARP on all VPP +| | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG and +| | ... | DUT1-DUT2 links. Set routing for encrypted traffic on both DUT nodes +| | ... | with prefix /8 and next hop of neighbour DUT or TG interface IPv4 +| | ... | address. +| | ... +| | VPP Show Crypto Device Mapping | ${dut1} +| | VPP Show Crypto Device Mapping | ${dut2} +| | Set interfaces in path in 3-node circular topology up +| | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut1_if1_mac}= | Get Interface MAC | ${dut1} | ${dut1_if1} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | ${dut2_if2_mac}= | Get Interface MAC | ${dut2} | ${dut2_if2} +| | Set Interface State | ${dut1} | ${dut1_if1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up +| | Set Interface State | ${dut2} | ${dut2_if1} | up +| | Set Interface State | ${dut2} | ${dut2_if2} | up +| | Set Test Variable | ${tg_if1_mac} +| | Set Test Variable | ${tg_if2_mac} +| | Set Test Variable | ${dut1_if1_mac} +| | Set Test Variable | ${dut1_if2_mac} +| | Set Test Variable | ${dut2_if1_mac} +| | Set Test Variable | ${dut2_if2_mac} +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} +| | ... | ${dut1_if1_ip4} | 24 +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} +| | ... | ${dut1_if2_ip4} | 24 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} +| | ... | ${dut2_if1_ip4} | 24 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} +| | ... | ${dut2_if2_ip4} | 24 +| | Add arp on dut | ${dut1} | ${dut1_if1} | ${tg_if1_ip4} | ${tg_if1_mac} +| | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_if1_ip4} | ${dut2_if1_mac} +| | Add arp on dut | ${dut2} | ${dut2_if2} | ${tg_if2_ip4} | ${tg_if2_mac} +| | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_if2_ip4} | ${dut1_if2_mac} +| | Vpp Route Add | ${dut1} | ${laddr_ip4} | 8 | ${tg_if1_ip4} | ${dut1_if1} +| | Vpp Route Add | ${dut2} | ${raddr_ip4} | 8 | ${tg_if2_ip4} | ${dut2_if2} + +| Initialize IPv4 forwarding in 3-node circular topology +| | [Documentation] +| | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular +| | ... | topology. Get the interface MAC addresses and setup ARP on all VPP +| | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG links and +| | ... | /30 prefix on DUT1-DUT2 link. Set routing on both DUT nodes with +| | ... | prefix /24 and next hop of neighbour DUT interface IPv4 address. +| | ... +| | Set Interface State | ${dut1} | ${dut1_if1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up +| | Set Interface State | ${dut2} | ${dut2_if1} | up +| | Set Interface State | ${dut2} | ${dut2_if2} | up +| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | dut1_v4.set_arp | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac} +| | dut1_v4.set_arp | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac} +| | dut2_v4.set_arp | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac} +| | dut2_v4.set_arp | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac} +| | dut1_v4.set_ip | ${dut1_if1} | 10.10.10.1 | 24 +| | dut1_v4.set_ip | ${dut1_if2} | 1.1.1.1 | 30 +| | dut2_v4.set_ip | ${dut2_if1} | 1.1.1.2 | 30 +| | dut2_v4.set_ip | ${dut2_if2} | 20.20.20.1 | 24 +| | dut1_v4.set_route | 20.20.20.0 | 24 | 1.1.1.2 | ${dut1_if2} +| | dut2_v4.set_route | 10.10.10.0 | 24 | 1.1.1.1 | ${dut2_if1} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize IPv4 forwarding in 2-node circular topology +| | [Documentation] +| | ... | Set UP state on VPP interfaces in path on nodes in 2-node circular +| | ... | topology. Get the interface MAC addresses and setup ARP on all VPP +| | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG links and +| | ... | /30 prefix on DUT1 link. Set routing on DUT node with prefix /24 and +| | ... | next hop of neighbour DUT interface IPv4 address. +| | ... +| | Set Interface State | ${dut1} | ${dut1_if1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up +| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | dut1_v4.set_arp | ${dut1_if1} | 10.10.10.3 | ${tg1_if1_mac} +| | dut1_v4.set_arp | ${dut1_if2} | 20.20.20.3 | ${tg1_if2_mac} +| | dut1_v4.set_ip | ${dut1_if1} | 10.10.10.2 | 24 +| | dut1_v4.set_ip | ${dut1_if2} | 20.20.20.2 | 24 +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize IPv4 forwarding with scaling in 3-node circular topology +| | [Documentation] +| | ... | Custom setup of IPv4 topology with scalability of ip routes on all +| | ... | DUT nodes in 3-node circular topology +| | ... +| | ... | *Arguments:* +| | ... | - ${count} - IP route count. Type: integer +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Initialize IPv4 forwarding with scaling in 3-node circular \ +| | ... | topology \| 100000 \| +| | ... +| | [Arguments] | ${count} +| | ... +| | Set Interface State | ${dut1} | ${dut1_if1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up +| | Set Interface State | ${dut2} | ${dut2_if1} | up +| | Set Interface State | ${dut2} | ${dut2_if2} | up +| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac} +| | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac} +| | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac} +| | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.1 | ${tg1_if2_mac} +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30 +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.2 | 30 +| | Vpp Route Add | ${dut1} | 10.0.0.0 | 32 | 1.1.1.1 | ${dut1_if1} +| | ... | count=${count} +| | Vpp Route Add | ${dut1} | 20.0.0.0 | 32 | 2.2.2.2 | ${dut1_if2} +| | ... | count=${count} +| | Vpp Route Add | ${dut2} | 10.0.0.0 | 32 | 2.2.2.1 | ${dut2_if1} +| | ... | count=${count} +| | Vpp Route Add | ${dut2} | 20.0.0.0 | 32 | 3.3.3.1 | ${dut2_if2} +| | ... | count=${count} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize IPv4 forwarding with vhost in 3-node circular topology +| | [Documentation] +| | ... | Create vhost-user interfaces in VPP. Set UP state of all VPP +| | ... | interfaces in path on nodes in 3-node circular topology. Create 2 +| | ... | FIB tables on each DUT with multipath routing. Assign pair of +| | ... | Physical and Virtual interfaces on both nodes to each FIB table. +| | ... | Setup IPv4 addresses with /30 prefix on DUT-TG links and /30 prefix +| | ... | on DUT1-DUT2 link. Set routing on all DUT nodes in all FIB tables +| | ... | with prefix /24 and next hop of neighbour IPv4 address. Setup +| | ... | ARP on all VPP interfaces. +| | ... +| | ... | *Arguments:* +| | ... | - sock1 - Sock path for first Vhost-User interface. Type: string +| | ... | - sock2 - Sock path for second Vhost-User interface. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| IPv4 forwarding with vhost initialized in a 3-node circular \ +| | ... | topology \| /tmp/sock1 \| /tmp/sock2 \| +| | ... +| | [Arguments] | ${sock1} | ${sock2} +| | ... +| | Set interfaces in path in 3-node circular topology up +| | Configure vhost interfaces for L2BD forwarding | ${dut1} +| | ... | ${sock1} | ${sock2} +| | ${dut1_vif1}= | Set Variable | ${vhost_if1} +| | ${dut1_vif2}= | Set Variable | ${vhost_if2} +| | Set Interface State | ${dut1} | ${dut1_vif1} | up +| | Set Interface State | ${dut1} | ${dut1_vif2} | up +| | Configure vhost interfaces for L2BD forwarding | ${dut2} +| | ... | ${sock1} | ${sock2} +| | ${dut2_vif1}= | Set Variable | ${vhost_if1} +| | ${dut2_vif2}= | Set Variable | ${vhost_if2} +| | Set Interface State | ${dut2} | ${dut2_vif1} | up +| | Set Interface State | ${dut2} | ${dut2_vif2} | up +| | ${dut1_vif1_idx}= | Get Interface SW Index | ${dut1} | ${dut1_vif1} +| | ${dut1_vif2_idx}= | Get Interface SW Index | ${dut1} | ${dut1_vif2} +| | ${dut1_if1_idx}= | Get Interface SW Index | ${dut1} | ${dut1_if1} +| | ${dut1_if2_idx}= | Get Interface SW Index | ${dut1} | ${dut1_if2} +| | ${dut2_vif1_idx}= | Get Interface SW Index | ${dut2} | ${dut2_vif1} +| | ${dut2_vif2_idx}= | Get Interface SW Index | ${dut2} | ${dut2_vif2} +| | ${dut2_if1_idx}= | Get Interface SW Index | ${dut2} | ${dut2_if1} +| | ${dut2_if2_idx}= | Get Interface SW Index | ${dut2} | ${dut2_if2} +| | Add fib table | ${dut1} | 20.20.20.0 | 24 | ${fib_table_1} +| | ... | via 4.4.4.2 sw_if_index ${dut1_vif1_idx} multipath +| | Add fib table | ${dut1} | 10.10.10.0 | 24 | ${fib_table_1} +| | ... | via 1.1.1.2 sw_if_index ${dut1_if1_idx} multipath +| | Add fib table | ${dut1} | 20.20.20.0 | 24 | ${fib_table_2} +| | ... | via 2.2.2.2 sw_if_index ${dut1_if2_idx} multipath +| | Add fib table | ${dut1} | 10.10.10.0 | 24 | ${fib_table_2} +| | ... | via 5.5.5.2 sw_if_index ${dut1_vif2_idx} multipath +| | Add fib table | ${dut2} | 10.10.10.0 | 24 | ${fib_table_1} +| | ... | via 2.2.2.1 sw_if_index ${dut2_if1_idx} multipath +| | Add fib table | ${dut2} | 20.20.20.0 | 24 | ${fib_table_1} +| | ... | via 4.4.4.1 sw_if_index ${dut2_vif1_idx} multipath +| | Add fib table | ${dut2} | 10.10.10.0 | 24 | ${fib_table_2} +| | ... | via 5.5.5.2 sw_if_index ${dut2_vif2_idx} multipath +| | Add fib table | ${dut2} | 20.20.20.0 | 24 | ${fib_table_2} +| | ... | via 3.3.3.2 sw_if_index ${dut2_if2_idx} multipath +| | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1} +| | Assign Interface To Fib Table | ${dut1} | ${dut1_vif1} | ${fib_table_1} +| | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2} +| | Assign Interface To Fib Table | ${dut1} | ${dut1_vif2} | ${fib_table_2} +| | Assign Interface To Fib Table | ${dut2} | ${dut2_if1} | ${fib_table_1} +| | Assign Interface To Fib Table | ${dut2} | ${dut2_vif1} | ${fib_table_1} +| | Assign Interface To Fib Table | ${dut2} | ${dut2_if2} | ${fib_table_2} +| | Assign Interface To Fib Table | ${dut2} | ${dut2_vif2} | ${fib_table_2} +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30 +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30 +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_vif1} | 4.4.4.1 | 30 +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_vif2} | 5.5.5.1 | 30 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.1 | 30 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_vif1} | 4.4.4.1 | 30 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_vif2} | 5.5.5.1 | 30 +| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | ${dut1_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut1} +| | ... | ${dut1_vif1_idx} +| | ${dut1_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut1} +| | ... | ${dut1_vif2_idx} +| | ${dut2_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut2} +| | ... | ${dut2_vif1_idx} +| | ${dut2_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut2} +| | ... | ${dut2_vif2_idx} +| | Set Test Variable | ${dut1_vif1_mac} +| | Set Test Variable | ${dut1_vif2_mac} +| | Set Test Variable | ${dut2_vif1_mac} +| | Set Test Variable | ${dut2_vif2_mac} +| | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac} +| | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac} +| | Add arp on dut | ${dut1} | ${dut1_vif1} | 4.4.4.2 | 52:54:00:00:04:01 +| | Add arp on dut | ${dut1} | ${dut1_vif2} | 5.5.5.2 | 52:54:00:00:04:02 +| | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac} +| | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.2 | ${tg1_if2_mac} +| | Add arp on dut | ${dut2} | ${dut2_vif1} | 4.4.4.2 | 52:54:00:00:04:01 +| | Add arp on dut | ${dut2} | ${dut2_vif2} | 5.5.5.2 | 52:54:00:00:04:02 +| | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 4.4.4.2 | ${dut1_vif1} +| | ... | vrf=${fib_table_1} +| | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | 1.1.1.1 | ${dut1_if1} +| | ... | vrf=${fib_table_1} +| | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 2.2.2.2 | ${dut1_if2} +| | ... | vrf=${fib_table_2} +| | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | 5.5.5.2 | ${dut1_vif2} +| | ... | vrf=${fib_table_2} +| | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | 4.4.4.2 | ${dut2_vif1} +| | ... | vrf=${fib_table_1} +| | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 2.2.2.1 | ${dut2_if1} +| | ... | vrf=${fib_table_1} +| | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | 3.3.3.2 | ${dut2_if2} +| | ... | vrf=${fib_table_2} +| | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 5.5.5.2 | ${dut2_vif2} +| | ... | vrf=${fib_table_2} + +| Initialize IPv4 forwarding with vhost for '${nr}' VMs in 3-node circular topology +| | [Documentation] +| | ... | Create pairs of Vhost-User interfaces for defined number of VMs on all +| | ... | VPP nodes. Set UP state of all VPP interfaces in path. Create ${nr}+1 +| | ... | FIB tables on each DUT with multipath routing. Assign each Virtual +| | ... | interface to FIB table with Physical interface or Virtual interface on +| | ... | both nodes. Setup IPv4 addresses with /30 prefix on DUT-TG links and +| | ... | /30 prefix on DUT1-DUT2 link. Set routing on all DUT nodes in all FIB +| | ... | tables with prefix /24 and next hop of neighbour IPv4 address. Setup +| | ... | ARP on all VPP interfaces. +| | ... +| | ... | *Arguments:* +| | ... | _None_ +| | ... +| | ... | *Note:* +| | ... | Socket paths for VM are defined in following format: +| | ... | - /tmp/sock-${VM_ID}-1 +| | ... | - /tmp/sock-${VM_ID}-2 +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| IPv4 forwarding with Vhost-User for '2' VMs initialized in \ +| | ... | a 3-node circular topology \| +| | ... +| | Set interfaces in path in 3-node circular topology up +| | ${fib_table_1}= | Set Variable | ${101} +| | ${fib_table_2}= | Evaluate | ${fib_table_1}+${nr} +| | ${dut1_if1_idx}= | Get Interface SW Index | ${dut1} | ${dut1_if1} +| | ${dut1_if2_idx}= | Get Interface SW Index | ${dut1} | ${dut1_if2} +| | Add fib table | ${dut1} | 10.10.10.0 | 24 | ${fib_table_1} +| | ... | via 1.1.1.2 sw_if_index ${dut1_if1_idx} multipath +| | Add fib table | ${dut1} | 20.20.20.0 | 24 | ${fib_table_2} +| | ... | via 2.2.2.2 sw_if_index ${dut1_if2_idx} multipath +| | ${dut2_if1_idx}= | Get Interface SW Index | ${dut2} | ${dut2_if1} +| | ${dut2_if2_idx}= | Get Interface SW Index | ${dut2} | ${dut2_if2} +| | Add fib table | ${dut2} | 10.10.10.0 | 24 | ${fib_table_1} +| | ... | via 2.2.2.1 sw_if_index ${dut2_if1_idx} multipath +| | Add fib table | ${dut2} | 20.20.20.0 | 24 | ${fib_table_2} +| | ... | via 3.3.3.2 sw_if_index ${dut2_if2_idx} multipath +| | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1} +| | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2} +| | Assign Interface To Fib Table | ${dut2} | ${dut2_if1} | ${fib_table_1} +| | Assign Interface To Fib Table | ${dut2} | ${dut2_if2} | ${fib_table_2} +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30 +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.1 | 30 +| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac} +| | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac} +| | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac} +| | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.2 | ${tg1_if2_mac} +| | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | 1.1.1.1 | ${dut1_if1} +| | ... | vrf=${fib_table_1} +| | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 2.2.2.2 | ${dut1_if2} +| | ... | vrf=${fib_table_2} +| | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 2.2.2.1 | ${dut2_if1} +| | ... | vrf=${fib_table_1} +| | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | 3.3.3.2 | ${dut2_if2} +| | ... | vrf=${fib_table_2} +| | ${ip_base_start}= | Set Variable | ${4} +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | ${sock1}= | Set Variable | /tmp/sock-${number}-1 +| | | ${sock2}= | Set Variable | /tmp/sock-${number}-2 +| | | ${fib_table_1}= | Evaluate | ${100}+${number} +| | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${1} +| | | ${ip_base_vif1}= | Evaluate | ${ip_base_start}+(${number}-1)*2 +| | | ${ip_base_vif2}= | Evaluate | ${ip_base_vif1}+1 +| | | ${ip_net_vif1}= | Set Variable +| | | ... | ${ip_base_vif1}.${ip_base_vif1}.${ip_base_vif1} +| | | ${ip_net_vif2}= | Set Variable +| | | ... | ${ip_base_vif2}.${ip_base_vif2}.${ip_base_vif2} +| | | Configure vhost interfaces for L2BD forwarding | ${dut1} +| | | ... | ${sock1} | ${sock2} | 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 +| | | ${dut1_vif1_idx}= | Get Interface SW Index | ${dut1} +| | | ... | ${dut1-vhost-${number}-if1} +| | | ${dut1_vif2_idx}= | Get Interface SW Index | ${dut1} +| | | ... | ${dut1-vhost-${number}-if2} +| | | Configure vhost interfaces for L2BD forwarding | ${dut2} +| | | ... | ${sock1} | ${sock2} | dut2-vhost-${number}-if1 +| | | ... | dut2-vhost-${number}-if2 +| | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if1} | up +| | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if2} | up +| | | ${dut2_vif1_idx}= | Get Interface SW Index | ${dut2} +| | | ... | ${dut2-vhost-${number}-if1} +| | | ${dut2_vif2_idx}= | Get Interface SW Index | ${dut2} +| | | ... | ${dut2-vhost-${number}-if2} +| | | Add fib table | ${dut1} | 20.20.20.0 | 24 | ${fib_table_1} +| | | ... | via ${ip_net_vif1}.1 sw_if_index ${dut1_vif1_idx} multipath +| | | Add fib table | ${dut1} | 10.10.10.0 | 24 | ${fib_table_2} +| | | ... | via ${ip_net_vif2}.2 sw_if_index ${dut1_vif2_idx} multipath +| | | Add fib table | ${dut2} | 20.20.20.0 | 24 | ${fib_table_1} +| | | ... | via ${ip_net_vif1}.1 sw_if_index ${dut2_vif1_idx} multipath +| | | Add fib table | ${dut2} | 10.10.10.0 | 24 | ${fib_table_2} +| | | ... | via ${ip_net_vif2}.2 sw_if_index ${dut2_vif2_idx} multipath +| | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if1} +| | | ... | ${fib_table_1} +| | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if2} +| | | ... | ${fib_table_2} +| | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if1} +| | | ... | ${fib_table_1} +| | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if2} +| | | ... | ${fib_table_2} +| | | Configure IP addresses on interfaces +| | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30 +| | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30 +| | | ... | ${dut2} | ${dut2-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30 +| | | ... | ${dut2} | ${dut2-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30 +| | | ${dut1_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut1} +| | | ... | ${dut1_vif1_idx} +| | | ${dut1_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut1} +| | | ... | ${dut1_vif2_idx} +| | | ${dut2_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut2} +| | | ... | ${dut2_vif1_idx} +| | | ${dut2_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut2} +| | | ... | ${dut2_vif2_idx} +| | | Set Test Variable | ${dut1-vhost-${number}-if1_mac} +| | | ... | ${dut1_vif1_mac} +| | | Set Test Variable | ${dut1-vhost-${number}-if2_mac} +| | | ... | ${dut1_vif2_mac} +| | | Set Test Variable | ${dut2-vhost-${number}-if1_mac} +| | | ... | ${dut2_vif1_mac} +| | | Set Test Variable | ${dut2-vhost-${number}-if2_mac} +| | | ... | ${dut2_vif2_mac} +| | | ${qemu_id}= | Set Variable If | ${number} < 10 | 0${number} +| | | ... | ${number} +| | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if1} +| | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01 +| | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if2} +| | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02 +| | | Add arp on dut | ${dut2} | ${dut2-vhost-${number}-if1} +| | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01 +| | | Add arp on dut | ${dut2} | ${dut2-vhost-${number}-if2} +| | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02 +| | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | ${ip_net_vif1}.2 +| | | ... | ${dut1-vhost-${number}-if1} | vrf=${fib_table_1} +| | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | ${ip_net_vif2}.2 +| | | ... | ${dut1-vhost-${number}-if2} | vrf=${fib_table_2} +| | | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | ${ip_net_vif1}.2 +| | | ... | ${dut2-vhost-${number}-if1} | vrf=${fib_table_1} +| | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | ${ip_net_vif2}.2 +| | | ... | ${dut2-vhost-${number}-if2} | vrf=${fib_table_2} + +| Initialize IPv4 policer 2r3c-${t} in 3-node circular topology +| | [Documentation] +| | ... | Setup of 2r3c color-aware or color-blind policer with dst ip match +| | ... | on all DUT nodes in 3-node circular topology. Policer is applied on +| | ... | links TG - DUT1 and DUT2 - TG. +| | ... +| | ${dscp}= | DSCP AF22 +| | Policer Set Name | policer1 +| | Policer Set CIR | ${cir} +| | Policer Set EIR | ${eir} +| | Policer Set CB | ${cb} +| | Policer Set EB | ${eb} +| | Policer Set Rate Type pps +| | Policer Set Round Type Closest +| | Policer Set Type 2R3C 2698 +| | Policer Set Conform Action Transmit +| | Policer Set Exceed Action Mark and Transmit | ${dscp} +| | Policer Set Violate Action Transmit +| | Policer Enable Color Aware +| | Run Keyword If | ${t} == 'ca' | Policer Enable Color Aware +| | Policer Classify Set Precolor Exceed +| | Policer Set Node | ${dut1} +| | Policer Classify Set Interface | ${dut1_if1} +| | Policer Classify Set Match IP | 20.20.20.2 | ${False} +| | Policer Set Configuration +| | Policer Set Node | ${dut2} +| | Policer Classify Set Interface | ${dut2_if2} +| | Policer Classify Set Match IP | 10.10.10.2 | ${False} +| | Policer Set Configuration + +| Initialize IPv6 forwarding in 3-node circular topology +| | [Documentation] +| | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular +| | ... | topology. Get the interface MAC addresses and setup neighbour on all +| | ... | VPP interfaces. Setup IPv6 addresses with /128 prefixes on all +| | ... | interfaces. Set routing on both DUT nodes with prefix /64 and +| | ... | next hop of neighbour DUT interface IPv6 address. +| | ... +| | ${prefix}= | Set Variable | 64 +| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:1::1 | ${prefix} +| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:3::1 | ${prefix} +| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:3::2 | ${prefix} +| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:2::1 | ${prefix} +| | Suppress ICMPv6 router advertisement message | ${nodes} +| | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac} +| | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac} +| | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:3::2 | ${dut2_if1_mac} +| | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:3::1 | ${dut1_if2_mac} +| | Vpp Route Add | ${dut1} | 2001:2::0 | ${prefix} | 2001:3::2 | ${dut1_if2} +| | Vpp Route Add | ${dut2} | 2001:1::0 | ${prefix} | 2001:3::1 | ${dut2_if1} + +| Initialize IPv6 forwarding with scaling in 3-node circular topology +| | [Documentation] +| | ... | Custom setup of IPv6 topology with scalability of ip routes on all +| | ... | DUT nodes in 3-node circular topology +| | ... +| | ... | *Arguments:* +| | ... | - ${count} - IP route count. Type: integer +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Initialize IPv6 forwarding with scaling in 3-node circular \ +| | ... | topology \| 100000 \| +| | ... +| | [Arguments] | ${count} +| | ... +| | ${subn_prefix}= | Set Variable | 64 +| | ${host_prefix}= | Set Variable | 128 +| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:3::1 | ${subn_prefix} +| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:4::1 | ${subn_prefix} +| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:4::2 | ${subn_prefix} +| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:5::1 | ${subn_prefix} +| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | Suppress ICMPv6 router advertisement message | ${nodes} +| | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:3::2 | ${tg1_if1_mac} +| | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:4::2 | ${dut2_if1_mac} +| | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:4::1 | ${dut1_if2_mac} +| | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:5::2 | ${tg1_if2_mac} +| | Vpp Route Add | ${dut1} | 2001:2::0 | ${host_prefix} | 2001:4::2 +| | ... | interface=${dut1_if2} | count=${count} +| | Vpp Route Add | ${dut1} | 2001:1::0 | ${host_prefix} | 2001:3::2 +| | ... | interface=${dut1_if1} | count=${count} +| | Vpp Route Add | ${dut2} | 2001:1::0 | ${host_prefix} | 2001:4::1 +| | ... | interface=${dut2_if1} | count=${count} +| | Vpp Route Add | ${dut2} | 2001:2::0 | ${host_prefix} | 2001:5::2 +| | ... | interface=${dut2_if2} | count=${count} + +| Initialize IPv6 iAcl whitelist in 3-node circular topology +| | [Documentation] +| | ... | Creates classify L3 table on DUTs. IPv6 iAcl security whitelist +| | ... | ingress /64 filter entries applied on links TG - DUT1 and DUT2 - TG. +| | ... +| | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3 +| | ... | ${dut1} | ip6 | dst +| | And Vpp Configures Classify Session L3 +| | ... | ${dut1} | permit | ${table_idx} | ${skip_n} | ${match_n} +| | ... | ip6 | dst | 2001:2::2 +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1} | ${dut1_if1} | ip6 | ${table_idx} +| | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3 +| | ... | ${dut2} | ip6 | dst +| | And Vpp Configures Classify Session L3 +| | ... | ${dut2} | permit | ${table_idx} | ${skip_n} | ${match_n} +| | ... | ip6 | dst | 2001:1::2 +| | And Vpp Enable Input Acl Interface +| | ... | ${dut2} | ${dut2_if2} | ip6 | ${table_idx} + +| Initialize L2 xconnect in 3-node circular topology +| | [Documentation] +| | ... | Setup L2 xconnect topology by cross connecting two interfaces on +| | ... | each DUT. Interfaces are brought up. +| | ... | +| | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_if2} +| | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize L2 xconnect with VXLANoIPv4 in 3-node circular topology +| | [Documentation] +| | ... | Setup L2 xconnect topology with VXLANoIPv4 by cross connecting +| | ... | physical and vxlan interfaces on each DUT. All interfaces are brought +| | ... | up. IPv4 addresses with prefix /24 are configured on interfaces +| | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as +| | ... | interfaces. +| | ... +| | Set interfaces in path in 3-node circular topology up +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1 | 24 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2 | 24 +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac} +| | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac} +| | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24 +| | ... | 172.16.0.1 | 172.16.0.2 +| | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1s_vxlan} +| | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24 +| | ... | 172.16.0.2 | 172.16.0.1 +| | Configure L2XC | ${dut2} | ${dut2_if2} | ${dut2s_vxlan} + +| Initialize L2 xconnect with Vhost-User in 3-node circular topology +| | [Documentation] +| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Cross +| | ... | connect each Vhost interface with one physical interface. +| | ... +| | ... | *Arguments:* +| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string +| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| L2 xconnect with Vhost-User initialized in a 3-node \ +| | ... | circular topology \| /tmp/sock1 \| /tmp/sock2 \| +| | ... +| | [Arguments] | ${sock1} | ${sock2} +| | ... +| | Configure vhost interfaces for L2BD forwarding | ${dut1} +| | ... | ${sock1} | ${sock2} +| | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1} +| | Configure L2XC | ${dut1} | ${dut1_if2} | ${vhost_if2} +| | Configure vhost interfaces for L2BD forwarding | ${dut2} +| | ... | ${sock1} | ${sock2} +| | Configure L2XC | ${dut2} | ${dut2_if1} | ${vhost_if1} +| | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize L2 xconnect with Vhost-User for '${nr}' in 3-node circular topology +| | [Documentation] +| | ... | Create pairs of Vhost-User interfaces on all defined VPP nodes. Cross +| | ... | connect each Vhost interface with one physical interface or virtual +| | ... | interface to create a chain accross DUT node. +| | ... +| | ... | *Arguments:* +| | ... | _None_ +| | ... +| | ... | *Note:* +| | ... | Socket paths for VM are defined in following format: +| | ... | - /tmp/sock-${VM_ID}-1 +| | ... | - /tmp/sock-${VM_ID}-2 +| | ... +| | ... | *Example:* +| | ... +| | ... | \| L2 xconnect with Vhost-User for '2' initialized in a 3-node \ +| | ... | circular topology \| +| | ... +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | ${sock1}= | Set Variable | /tmp/sock-${number}-1 +| | | ${sock2}= | Set Variable | /tmp/sock-${number}-2 +| | | ${prev_index}= | Evaluate | ${number}-1 +| | | Configure vhost interfaces for L2BD forwarding | ${dut1} +| | | ... | ${sock1} | ${sock2} | dut1-vhost-${number}-if1 +| | | ... | dut1-vhost-${number}-if2 +| | | ${dut1_xconnect_if1}= | Set Variable If | ${number}==1 | ${dut1_if1} +| | | ... | ${dut1-vhost-${prev_index}-if2} +| | | Configure L2XC | ${dut1} | ${dut1_xconnect_if1} +| | | ... | ${dut1-vhost-${number}-if1} +| | | Configure vhost interfaces for L2BD forwarding | ${dut2} +| | | ... | ${sock1} | ${sock2} | dut2-vhost-${number}-if1 +| | | ... | dut2-vhost-${number}-if2 +| | | ${dut2_xconnect_if1}= | Set Variable If | ${number}==1 | ${dut2_if1} +| | | ... | ${dut2-vhost-${prev_index}-if2} +| | | Configure L2XC | ${dut2} | ${dut2_xconnect_if1} +| | | ... | ${dut2-vhost-${number}-if1} +| | | Run Keyword If | ${number}==${nr} | Configure L2XC +| | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | ${dut1_if2} +| | | Run Keyword If | ${number}==${nr} | Configure L2XC +| | | ... | ${dut2} | ${dut2-vhost-${number}-if2} | ${dut2_if2} + +| Initialize L2 xconnect with Vhost-User and VLAN in 3-node circular topology +| | [Documentation] +| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Cross +| | ... | connect each Vhost interface with one physical interface. +| | ... | Setup VLAN between DUTs. All interfaces are brought up. +| | ... +| | ... | *Arguments:* +| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string +| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string +| | ... | - subid - ID of the sub-interface to be created. Type: string +| | ... | - tag_rewrite - Method of tag rewrite. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| L2 xconnect with Vhost-User and VLAN initialized in a 3-node\ +| | ... | circular topology \| /tmp/sock1 \| /tmp/sock2 \| 10 \| pop-1 \| +| | ... +| | [Arguments] | ${sock1} | ${sock2} | ${subid} | ${tag_rewrite} +| | ... +| | Set interfaces in path in 3-node circular topology up +| | Initialize VLAN dot1q sub-interfaces in 3-node circular topology +| | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid} +| | Configure L2 tag rewrite method on interfaces +| | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2} +| | ... | ${tag_rewrite} +| | Configure vhost interfaces for L2BD forwarding | ${dut1} +| | ... | ${sock1} | ${sock2} +| | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1} +| | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2} +| | Configure vhost interfaces for L2BD forwarding | ${dut2} +| | ... | ${sock1} | ${sock2} +| | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1} +| | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize L2 bridge domain in 3-node circular topology +| | [Documentation] +| | ... | Setup L2 DB topology by adding two interfaces on each DUT into BD +| | ... | that is created automatically with index 1. Learning is enabled. +| | ... | Interfaces are brought up. +| | ... +| | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2} +| | Configure L2BD forwarding | ${dut2} | ${dut2_if1} | ${dut2_if2} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize L2 bridge domains with Vhost-User in 3-node circular topology +| | [Documentation] +| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each +| | ... | Vhost-User interface into L2 bridge domains with learning enabled +| | ... | with physical inteface. +| | ... +| | ... | *Arguments:* +| | ... | - bd_id1 - Bridge domain ID. Type: integer +| | ... | - bd_id2 - Bridge domain ID. Type: integer +| | ... | - sock1 - Sock path for first Vhost-User interface. Type: string +| | ... | - sock2 - Sock path for second Vhost-User interface. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| L2 bridge domains with Vhost-User initialized in a 3-node \ +| | ... | circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \| +| | ... +| | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} +| | ... +| | Configure vhost interfaces for L2BD forwarding | ${dut1} +| | ... | ${sock1} | ${sock2} +| | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id2} +| | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2} +| | Configure vhost interfaces for L2BD forwarding | ${dut2} +| | ... | ${sock1} | ${sock2} +| | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2} +| | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize L2 bridge domains with Vhost-User for '${nr}' VMs in 3-node circular topology +| | [Documentation] +| | ... | Create pairs of Vhost-User interfaces for defined number of VMs on all +| | ... | defined VPP nodes. Add each Vhost-User interface into L2 bridge +| | ... | domains with learning enabled with physical inteface or Vhost-User +| | ... | interface of another VM. +| | ... +| | ... | *Arguments:* +| | ... | _None_ +| | ... +| | ... | *Note:* +| | ... | Socket paths for VM are defined in following format: +| | ... | - /tmp/sock-${VM_ID}-1 +| | ... | - /tmp/sock-${VM_ID}-2 +| | ... +| | ... | *Example:* +| | ... +| | ... | \| L2 bridge domains with Vhost-User for '2' VMs initialized in \ +| | ... | a 3-node circular topology \| +| | ... +| | ${bd_id2}= | Evaluate | ${nr}+1 +| | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${1} +| | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id2} +| | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${1} +| | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2} +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | ${sock1}= | Set Variable | /tmp/sock-${number}-1 +| | | ${sock2}= | Set Variable | /tmp/sock-${number}-2 +| | | Configure vhost interfaces for L2BD forwarding | ${dut1} +| | | ... | ${sock1} | ${sock2} | dut1-vhost-${number}-if1 +| | | ... | dut1-vhost-${number}-if2 +| | | ${bd_id2}= | Evaluate | ${number}+1 +| | | Add interface to bridge domain | ${dut1} +| | | ... | ${dut1-vhost-${number}-if1} | ${number} +| | | Add interface to bridge domain | ${dut1} +| | | ... | ${dut1-vhost-${number}-if2} | ${bd_id2} +| | | Configure vhost interfaces for L2BD forwarding | ${dut2} +| | | ... | ${sock1} | ${sock2} | dut2-vhost-${number}-if1 +| | | ... | dut2-vhost-${number}-if2 +| | | Add interface to bridge domain | ${dut2} +| | | ... | ${dut2-vhost-${number}-if1} | ${number} +| | | Add interface to bridge domain | ${dut2} +| | | ... | ${dut2-vhost-${number}-if2} | ${bd_id2} + +| Initialize L2 bridge domain with VXLANoIPv4 in 3-node circular topology +| | [Documentation] +| | ... | Setup L2 bridge domain topology with VXLANoIPv4 by connecting +| | ... | physical and vxlan interfaces on each DUT. All interfaces are brought +| | ... | up. IPv4 addresses with prefix /24 are configured on interfaces +| | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as +| | ... | interfaces. +| | ... +| | Set interfaces in path in 3-node circular topology up +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1 +| | ... | 24 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2 +| | ... | 24 +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac} +| | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac} +| | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24 +| | ... | 172.16.0.1 | 172.16.0.2 +| | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24 +| | ... | 172.16.0.2 | 172.16.0.1 +| | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1s_vxlan} +| | Configure L2BD forwarding | ${dut2} | ${dut2_if2} | ${dut2s_vxlan} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize L2 bridge domains with Vhost-User and VXLANoIPv4 in 3-node circular topology +| | [Documentation] +| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each +| | ... | Vhost-User interface into L2 bridge domains with learning enabled +| | ... | with physical inteface. +| | ... | Setup VXLANoIPv4 between DUTs by connecting physical and vxlan +| | ... | interfaces on each DUT. All interfaces are brought up. +| | ... | IPv4 addresses with prefix /24 are configured on interfaces between +| | ... | DUTs. VXLAN sub-interfaces has same IPv4 address as interfaces. +| | ... +| | ... | *Arguments:* +| | ... | - bd_id1 - Bridge domain ID. Type: integer +| | ... | - bd_id2 - Bridge domain ID. Type: integer +| | ... | - sock1 - Sock path for first Vhost-User interface. Type: string +| | ... | - sock2 - Sock path for second Vhost-User interface. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| L2 bridge domains with Vhost-User and VXLANoIPv4 initialized in a\ +| | ... | 3-node circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \| +| | ... +| | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} +| | ... +| | Set interfaces in path in 3-node circular topology up +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1 +| | ... | 24 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2 +| | ... | 24 +| | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24 +| | ... | 172.16.0.1 | 172.16.0.2 +| | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24 +| | ... | 172.16.0.2 | 172.16.0.1 +| | Configure vhost interfaces for L2BD forwarding | ${dut1} +| | ... | ${sock1} | ${sock2} +| | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2} +| | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${bd_id2} +| | Configure vhost interfaces for L2BD forwarding | ${dut2} +| | ... | ${sock1} | ${sock2} +| | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${bd_id1} +| | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2} +| | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize L2 bridge domains with Vhost-User in 2-node circular topology +| | [Documentation] +| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each +| | ... | Vhost-User interface into L2 bridge domains with learning enabled +| | ... | with physical inteface. +| | ... +| | ... | *Arguments:* +| | ... | - bd_id1 - Bridge domain ID. Type: integer +| | ... | - bd_id2 - Bridge domain ID. Type: integer +| | ... | - sock1 - Sock path for first Vhost-User interface. Type: string +| | ... | - sock2 - Sock path for second Vhost-User interface. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| L2 bridge domains with Vhost-User initialized in a 2-node \ +| | ... | circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \| +| | ... +| | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} +| | ... +| | Configure vhost interfaces for L2BD forwarding | ${dut1} +| | ... | ${sock1} | ${sock2} +| | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id2} +| | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize L2 bridge domains with Vhost-User and VLAN in a 3-node circular topology +| | [Documentation] +| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each +| | ... | Vhost-User interface into L2 bridge domains with learning enabled +| | ... | with physical inteface. +| | ... | Setup VLAN between DUTs. All interfaces are brought up. +| | ... +| | ... | *Arguments:* +| | ... | - bd_id1 - Bridge domain ID. Type: integer +| | ... | - bd_id2 - Bridge domain ID. Type: integer +| | ... | - sock1 - Sock path for first Vhost-User interface. Type: string +| | ... | - sock2 - Sock path for second Vhost-User interface. Type: string +| | ... | - subid - ID of the sub-interface to be created. Type: string +| | ... | - tag_rewrite - Method of tag rewrite. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| L2 bridge domains with Vhost-User and VLAN initialized in a 3-node\ +| | ... | circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \| 10\ +| | ... | pop-1 \| +| | ... +| | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} | ${subid} +| | ... | ${tag_rewrite} +| | ... +| | Set interfaces in path in 3-node circular topology up +| | Initialize VLAN dot1q sub-interfaces in 3-node circular topology +| | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid} +| | Configure L2 tag rewrite method on interfaces +| | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2} +| | ... | ${tag_rewrite} +| | Configure vhost interfaces for L2BD forwarding | ${dut1} +| | ... | ${sock1} | ${sock2} +| | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2} +| | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2} +| | Configure vhost interfaces for L2BD forwarding | ${dut2} +| | ... | ${sock1} | ${sock2} +| | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1} +| | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1} +| | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2} +| | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Add PCI devices to DUTs in 3-node single link topology +| | [Documentation] +| | ... | Add PCI devices to VPP configuration file. +| | ... +| | ${dut1_if1_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if1} +| | ${dut1_if2_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if2} +| | ${dut2_if1_pci}= | Get Interface PCI Addr | ${dut2} | ${dut2_if1} +| | ${dut2_if2_pci}= | Get Interface PCI Addr | ${dut2} | ${dut2_if2} +| | Run keyword | DUT1.Add DPDK Dev | ${dut1_if1_pci} | ${dut1_if2_pci} +| | Run keyword | DUT2.Add DPDK Dev | ${dut2_if1_pci} | ${dut2_if2_pci} + +| Add PCI devices to DUTs in 2-node single link topology +| | [Documentation] +| | ... | Add PCI devices to VPP configuration file. +| | ... +| | ${dut1_if1_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if1} +| | ${dut1_if2_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if2} +| | Run keyword | DUT1.Add DPDK Dev | ${dut1_if1_pci} | ${dut1_if2_pci} + +| Configure guest VM with dpdk-testpmd connected via vhost-user +| | [Documentation] +| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting +| | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd +| | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4, +| | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss, +| | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is io. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary +| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string +| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string +| | ... | - vm_name - QemuUtil instance name. Type: string +| | ... | - skip - Number of cpus which will be skipped. Type: integer +| | ... | - count - Number of cpus which will be allocated for qemu. +| | ... | Type: integer +| | ... | - qemu_id - Qemu Id when starting more then one guest VM on DUT node. +| | ... | Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure guest VM with dpdk-testpmd connected via vhost-user \ +| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \| ${6} \ +| | ... | \| ${5} \| +| | ... | \| Configure guest VM with dpdk-testpmd connected via vhost-user \ +| | ... | \| ${nodes['DUT1']} \| /tmp/sock-2-1 \| /tmp/sock-2-2 \| DUT1_VM2 \ +| | ... | \| qemu_id=${2} \| +| | ... +| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6} +| | ... | ${count}=${5} | ${qemu_id}=${1} +| | ... +| | Import Library | resources.libraries.python.QemuUtils | qemu_id=${qemu_id} +| | ... | WITH NAME | ${vm_name} +| | ${serial_port}= | Evaluate | ${qemu_id} + ${4555} +| | Run keyword | ${vm_name}.Qemu Set Serial Port | ${serial_port} +| | ${ssh_fwd_port}= | Evaluate | ${qemu_id} + ${10021} +| | Run keyword | ${vm_name}.Qemu Set Ssh Fwd Port | ${ssh_fwd_port} +| | ${dut_numa}= | Get interfaces numa node | ${dut_node} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${skip_cnt}= | Evaluate | ${skip} + (${qemu_id} - 1) * ${count} +| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} +| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${count} | smt_used=${False} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} +| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} +| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} +| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} +| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 +| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 +| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} +| | ${vm}= | Run keyword | ${vm_name}.Qemu Start +| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} +| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f | eal_mem_channels=4 +| | ... | pmd_fwd_mode=io | pmd_disable_hw_vlan=${True} +| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz} +| | Return From Keyword | ${vm} + +| Configure '${nr}' guest VMs with dpdk-testpmd connected via vhost-user in 3-node circular topology +| | [Documentation] +| | ... | Start QEMU guests with two vhost-user interfaces and interconnecting +| | ... | DPDK testpmd for defined number of VMs on all defined VPP nodes. +| | ... +| | ... | *Arguments:* +| | ... | _None_ +| | ... +| | ... | _NOTE:_ This KW expects following test case variables to be set: +| | ... | - ${system_cpus} - Number of CPUs allocated for OS itself. +| | ... | - ${vpp_cpus} - Number of CPUs allocated for VPP. +| | ... | - ${vm_cpus} - Number of CPUs to be allocated per QEMU instance. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| '2' Configure guest VM with dpdk-testpmd connected via vhost-user \ +| | ... | in a 3-node circular topology \| +| | ... +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | ${sock1}= | Set Variable | /tmp/sock-${number}-1 +| | | ${sock2}= | Set Variable | /tmp/sock-${number}-2 +| | | ${skip_cpus}= | Evaluate | ${vpp_cpus}+${system_cpus} +| | | ${vm1}= | Configure guest VM with dpdk-testpmd connected via vhost-user +| | | ... | ${dut1} | ${sock1} | ${sock2} | DUT1_VM${number} +| | | ... | skip=${skip_cpus} | count=${vm_cpus} | qemu_id=${number} +| | | Set To Dictionary | ${dut1_vm_refs} | DUT1_VM${number} | ${vm1} +| | | ${vm2}= | Configure guest VM with dpdk-testpmd connected via vhost-user +| | | ... | ${dut2} | ${sock1} | ${sock2} | DUT2_VM${number} +| | | ... | skip=${skip_cpus} | count=${vm_cpus} | qemu_id=${number} +| | | Set To Dictionary | ${dut2_vm_refs} | DUT2_VM${number} | ${vm2} + +| Configure guest VM with dpdk-testpmd using SMT connected via vhost-user +| | [Documentation] +| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting +| | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd +| | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4, +| | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss, +| | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is io. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary +| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string +| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string +| | ... | - vm_name - QemuUtil instance name. Type: string +| | ... | - skip - number of cpus which will be skipped. Type: int +| | ... | - count - number of cpus which will be allocated for qemu. Type: int +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Guest VM with dpdk-testpmd using SMT connected via vhost-user is \ +| | ... | setup \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \ +| | ... | \| ${6} \| ${5} \| +| | ... +| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6} +| | ... | ${count}=${5} +| | ... +| | Import Library | resources.libraries.python.QemuUtils +| | ... | WITH NAME | ${vm_name} +| | ${dut_numa}= | Get interfaces numa node | ${dut_node} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} +| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} +| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} +| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} +| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} +| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 +| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 +| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} +| | ${vm}= | Run keyword | ${vm_name}.Qemu Start +| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} +| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f | eal_mem_channels=4 +| | ... | pmd_fwd_mode=io | pmd_disable_hw_vlan=${True} +| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz} +| | Return From Keyword | ${vm} + +| Configure guest VM with dpdk-testpmd-mac connected via vhost-user +| | [Documentation] +| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting +| | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd +| | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4, +| | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss, +| | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is mac rewrite. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary +| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string +| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string +| | ... | - vm_name - QemuUtil instance name. Type: string +| | ... | - eth0_mac - MAC address of first Vhost interface. Type: string +| | ... | - eth1_mac - MAC address of second Vhost interface. Type: string +| | ... | - skip - number of cpus which will be skipped. Type: integer +| | ... | - count - number of cpus which will be allocated for qemu. +| | ... | Type: integer +| | ... | - qemu_id - Qemu Id when starting more then one guest VM on DUT node. +| | ... | Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Guest VM with dpdk-testpmd for Vhost L2BD forwarding is setup \ +| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \ +| | ... | \| 00:00:00:00:00:01 \| 00:00:00:00:00:02 \| ${6} \| ${5} \| +| | ... | \| Guest VM with dpdk-testpmd for Vhost L2BD forwarding is setup \ +| | ... | \| ${nodes['DUT1']} \| /tmp/sock-2-1 \| /tmp/sock-2-2 \| DUT1_VM2 \ +| | ... | \| 00:00:00:00:02:01 \| 00:00:00:00:02:02 \| ${6} \| ${5} \ +| | ... | \| qemu_id=${2} \| +| | ... +| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} +| | ... | ${eth0_mac} | ${eth1_mac} | ${skip}=${6} | ${count}=${5} +| | ... | ${qemu_id}=${1} +| | ... +| | Import Library | resources.libraries.python.QemuUtils | qemu_id=${qemu_id} +| | ... | WITH NAME | ${vm_name} +| | ${serial_port}= | Evaluate | ${qemu_id} + ${4555} +| | Run keyword | ${vm_name}.Qemu Set Serial Port | ${serial_port} +| | ${ssh_fwd_port}= | Evaluate | ${qemu_id} + ${10021} +| | Run keyword | ${vm_name}.Qemu Set Ssh Fwd Port | ${ssh_fwd_port} +| | ${dut_numa}= | Get interfaces numa node | ${dut_node} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${skip_cnt}= | Evaluate | ${skip} + (${qemu_id} - 1) * ${count} +| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} +| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${count} | smt_used=${False} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} +| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} +| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} +| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} +| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 +| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 +| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} +| | ${vm}= | Run keyword | ${vm_name}.Qemu Start +| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} +| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f +| | ... | eal_mem_channels=4 | pmd_fwd_mode=mac | pmd_eth_peer_0=0,${eth0_mac} +| | ... | pmd_eth_peer_1=1,${eth1_mac} | pmd_disable_hw_vlan=${True} +| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz} +| | Return From Keyword | ${vm} + +| Configure '${nr}' guest VMs with dpdk-testpmd-mac connected via vhost-user in 3-node circular topology +| | [Documentation] +| | ... | Start QEMU guests with two vhost-user interfaces and interconnecting +| | ... | DPDK testpmd with fwd mode set to mac rewrite for defined number of +| | ... | VMs on all defined VPP nodes. +| | ... +| | ... | *Arguments:* +| | ... | _None_ +| | ... +| | ... | _NOTE:_ This KW expects following test case variables to be set: +| | ... | - ${system_cpus} - Number of CPUs allocated for OS itself. +| | ... | - ${vpp_cpus} - Number of CPUs allocated for VPP. +| | ... | - ${vm_cpus} - Number of CPUs to be allocated per QEMU instance. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| '2' Guest VMs with dpdk-testpmd-mac connected via vhost-user is \ +| | ... | setup in a 3-node circular topology \| +| | ... +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | ${sock1}= | Set Variable | /tmp/sock-${number}-1 +| | | ${sock2}= | Set Variable | /tmp/sock-${number}-2 +| | | ${skip_cpus}= | Evaluate | ${vpp_cpus}+${system_cpus} +| | | ${vm1}= +| | | ... | Configure guest VM with dpdk-testpmd-mac connected via vhost-user +| | | ... | ${dut1} | ${sock1} | ${sock2} | DUT1_VM${number} +| | | ... | ${dut1-vhost-${number}-if1_mac} +| | | ... | ${dut1-vhost-${number}-if2_mac} | skip=${skip_cpus} +| | | ... | count=${vm_cpus} | qemu_id=${number} +| | | Set To Dictionary | ${dut1_vm_refs} | DUT1_VM${number} | ${vm1} +| | | ${vm2}= +| | | ... | Configure guest VM with dpdk-testpmd-mac connected via vhost-user +| | | ... | ${dut2} | ${sock1} | ${sock2} | DUT2_VM${number} +| | | ... | ${dut2-vhost-${number}-if1_mac} +| | | ... | ${dut2-vhost-${number}-if2_mac} | skip=${skip_cpus} +| | | ... | count=${vm_cpus} | qemu_id=${number} +| | | Set To Dictionary | ${dut2_vm_refs} | DUT2_VM${number} | ${vm2} + +| Configure guest VM with dpdk-testpmd-mac using SMT connected via vhost-user +| | [Documentation] +| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting +| | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd +| | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4, +| | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss, +| | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is mac rewrite. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary +| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string +| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string +| | ... | - vm_name - QemuUtil instance name. Type: string +| | ... | - eth0_mac - MAC address of first Vhost interface. Type: string +| | ... | - eth1_mac - MAC address of second Vhost interface. Type: string +| | ... | - skip - number of cpus which will be skipped. Type: int +| | ... | - count - number of cpus which will be allocated for qemu. Type: int +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure guest VM with dpdk-testpmd-mac using SMT connected via \ +| | ... | vhost-user \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM\ +| | ... | \| 00:00:00:00:00:01 \| 00:00:00:00:00:02 \| ${6} \| ${5} \| +| | ... +| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} +| | ... | ${eth0_mac} | ${eth1_mac} | ${skip}=${6} | ${count}=${5} +| | ... +| | Import Library | resources.libraries.python.QemuUtils +| | ... | WITH NAME | ${vm_name} +| | ${dut_numa}= | Get interfaces numa node | ${dut_node} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} +| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} +| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} +| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} +| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} +| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 +| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 +| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} +| | ${vm}= | Run keyword | ${vm_name}.Qemu Start +| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} +| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f +| | ... | eal_mem_channels=4 | pmd_fwd_mode=mac | pmd_eth_peer_0=0,${eth0_mac} +| | ... | pmd_eth_peer_1=1,${eth1_mac} | pmd_disable_hw_vlan=${True} +| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz} +| | Return From Keyword | ${vm} + +| Configure guest VM with linux bridge connected via vhost-user +| | [Documentation] +| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting +| | ... | linux bridge. Qemu Guest uses 2048M. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary +| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string +| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string +| | ... | - vm_name - QemuUtil instance name. Type: string +| | ... | - skip - number of cpus which will be skipped. Type: int +| | ... | - count - number of cpus which will be allocated for qemu. Type: int +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure guest VM with linux bridge connected via vhost-user \ +| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \| ${6} \ +| | ... | \| ${5} \| +| | ... +| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6} +| | ... | ${count}=${5} +| | ... +| | Import Library | resources.libraries.python.QemuUtils +| | ... | WITH NAME | ${vm_name} +| | ${dut_numa}= | Get interfaces numa node | ${dut_node} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} +| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${False} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} +| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} +| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} +| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} +| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 +| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 +| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} +| | ${vm}= | Run keyword | ${vm_name}.Qemu Start +| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} +| | ${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 +| | Return From Keyword | ${vm} + +| Configure guest VM with linux bridge using SMT connected via vhost-user +| | [Documentation] +| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting +| | ... | linux bridge. Qemu Guest uses 2048M. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary +| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string +| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string +| | ... | - vm_name - QemuUtil instance name. Type: string +| | ... | - skip - number of cpus which will be skipped. Type: int +| | ... | - count - number of cpus which will be allocated for qemu. Type: int +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Guest VM with Linux Bridge using SMT connected via vhost-user is \ +| | ... | setup \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \ +| | ... | \| ${6}\| ${5} \| +| | ... +| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6} +| | ... | ${count}=${5} +| | ... +| | Import Library | resources.libraries.python.QemuUtils +| | ... | WITH NAME | ${vm_name} +| | ${dut_numa}= | Get interfaces numa node | ${dut_node} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} +| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} +| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} +| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} +| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} +| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} +| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 +| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 +| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} +| | ${vm}= | Run keyword | ${vm_name}.Qemu Start +| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} +| | ${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 +| | Return From Keyword | ${vm} + +| 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. +| | ... +| | ... | *Arguments:* +| | ... | -${dut1_dut2_address} - Ip address from DUT1 to DUT2. Type: string +| | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string +| | ... | -${dut2_dut1_address} - Ip address from DUT2 to DUT1. Type: string +| | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string +| | ... | -${duts_prefix} - ip prefix. Type: int +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Initialize LISP IPv4 forwarding in 3-node circular topology \ +| | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \ +| | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \| +| | ... +| | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address} +| | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${duts_prefix} +| | ... +| | Set Interface State | ${dut1} | ${dut1_if1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up +| | Set Interface State | ${dut2} | ${dut2_if1} | up +| | Set Interface State | ${dut2} | ${dut2_if2} | up +| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac} +| | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_address} +| | ... | ${dut2_if1_mac} +| | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_address} +| | ... | ${dut1_if2_mac} +| | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac} +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} +| | ... | ${dut1_tg_address} | ${duts_prefix} +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} +| | ... | ${dut1_dut2_address} | ${duts_prefix} +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} +| | ... | ${dut2_dut1_address} | ${duts_prefix} +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} +| | ... | ${dut2_tg_address} | ${duts_prefix} +| | All Vpp Interfaces Ready Wait | ${nodes} + +| Initialize LISP GPE IPv4 over IPsec in 3-node circular topology +| | [Documentation] | Setup Lisp GPE IPv4 forwarding over IPsec. +| | ... +| | ... | *Arguments:* +| | ... | -${encr_alg} - Encryption algorithm. Type: string +| | ... | -${auth_alg} - Authentication algorithm. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Initialize LISP GPE IPv4 over IPsec in 3-node circular topology\ +| | ... | \| ${encr_alg} \| ${auth_alg} +| | ... +| | [Arguments] | ${encr_alg} | ${auth_alg} +| | ... +| | Generate keys for IPSec | ${encr_alg} | ${auth_alg} +| | Initialize LISP IPv4 forwarding in 3-node circular topology +| | ... | ${dut1_to_dut2_ip4} | ${dut1_to_tg_ip4} | ${dut2_to_dut1_ip4} +| | ... | ${dut2_to_tg_ip4} | ${prefix4} +| | Configure LISP GPE topology in 3-node circular topology +| | ... | ${dut1} | ${dut1_if2} | ${NONE} +| | ... | ${dut2} | ${dut2_if1} | ${NONE} +| | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid} +| | ... | ${dut1_ip4_static_adjacency} | ${dut2_ip4_static_adjacency} +| | Configure manual keyed connection for IPSec +| | ... | ${dut1} | ${dut1_if2} | ${encr_alg} | ${encr_key} +| | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi} +| | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4} +| | Configure manual keyed connection for IPSec +| | ... | ${dut2} | ${dut2_if1} | ${encr_alg} | ${encr_key} +| | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi} +| | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4} + +| Initialize LISP IPv6 forwarding in 3-node circular topology +| | [Documentation] | Custom setup of IPv6 topology on all DUT nodes \ +| | ... | Don`t set route. +| | ... +| | ... | *Arguments:* +| | ... | -${dut1_dut2_address} - Ip address from DUT1 to DUT2. Type: string +| | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string +| | ... | -${dut2_dut1_address} - Ip address from DUT2 to DUT1. Type: string +| | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string +| | ... | -${duts_prefix} - ip prefix. Type: int +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Initialize LISP IPv6 forwarding in 3-node circular topology \ +| | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \ +| | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \| +| | ... +| | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address} +| | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${prefix} +| | ... +| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_address} +| | ... | ${prefix} +| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_address} +| | ... | ${prefix} +| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_address} +| | ... | ${prefix} +| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_address} +| | ... | ${prefix} +| | Suppress ICMPv6 router advertisement message | ${nodes} +| | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac} +| | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac} +| | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_address} +| | ... | ${dut2_if1_mac} +| | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_address} +| | ... | ${dut1_if2_mac} + +| Initialize LISP IPv4 over IPv6 forwarding in 3-node circular topology +| | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \ +| | ... | Don`t set route. +| | ... +| | ... | *Arguments:* +| | ... | - ${dut1_dut2_ip6_address} - IPv6 address from DUT1 to DUT2. +| | ... | Type: string +| | ... | - ${dut1_tg_ip4_address} - IPv4 address from DUT1 to tg. Type: string +| | ... | - ${dut2_dut1_ip6_address} - IPv6 address from DUT2 to DUT1. +| | ... | Type: string +| | ... | - ${dut1_tg_ip4_address} - IPv4 address from DUT1 to tg. Type: string +| | ... | - ${prefix4} - IPv4 prefix. Type: int +| | ... | - ${prefix6} - IPv6 prefix. Type: int +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Lisp IPv4 over IPv6 forwarding initialized in a 3-node circular \ +| | ... | topology \| ${dut1_dut2_ip6_address} \| ${dut1_tg_ip4_address} \ +| | ... | \| ${dut2_dut1_ip6_address} \| ${dut2_tg_ip4_address} \ +| | ... | \| ${prefix4} \| ${prefix6} \| +| | ... +| | [Arguments] | ${dut1_dut2_ip6_address} | ${dut1_tg_ip4_address} +| | ... | ${dut2_dut1_ip6_address} | ${dut2_tg_ip4_address} +| | ... | ${prefix4} | ${prefix6} +| | ... +| | Set Interface State | ${dut1} | ${dut1_if1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up +| | Set Interface State | ${dut2} | ${dut2_if1} | up +| | Set Interface State | ${dut2} | ${dut2_if2} | up +| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} +| | ... | ${dut1_tg_ip4_address} | ${prefix4} +| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_ip6_address} +| | ... | ${prefix6} +| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_ip6_address} +| | ... | ${prefix6} +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} +| | ... | ${dut2_tg_ip4_address} | ${prefix4} +| | Suppress ICMPv6 router advertisement message | ${nodes} +| | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac} +| | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac} +| | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip6_address} +| | ... | ${dut2_if1_mac} +| | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip6_address} +| | ... | ${dut1_if2_mac} + +| Initialize LISP IPv6 over IPv4 forwarding in 3-node circular topology +| | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \ +| | ... | Don`t set route. +| | ... +| | ... | *Arguments:* +| | ... | - ${dut1_dut2_ip4_address} - IPv4 address from DUT1 to DUT2. +| | ... | Type: string +| | ... | - ${dut1_tg_ip6_address} - IPv6 address from DUT1 to tg. Type: string +| | ... | - ${dut2_dut1_ip4_address} - IPv4 address from DUT2 to DUT1. +| | ... | Type: string +| | ... | - ${dut1_tg_ip6_address} - IPv6 address from DUT1 to tg. Type: string +| | ... | - ${prefix4} - IPv4 prefix. Type: int +| | ... | - ${prefix6} - IPv6 prefix. Type: int +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... | \| Lisp IPv6 over IPv4 forwarding initialized in a 3-node circular \ +| | ... | topology \| ${dut1_dut2_ip4_address} \| ${dut1_tg_ip6_address} \ +| | ... | \| ${dut2_dut1_ip4_address} \| ${dut2_tg_ip6_address} \ +| | ... | \| ${prefix6} \| ${prefix4} \| +| | ... +| | [Arguments] | ${dut1_dut2_ip4_address} | ${dut1_tg_ip6_address} +| | ... | ${dut2_dut1_ip4_address} | ${dut2_tg_ip6_address} +| | ... | ${prefix6} | ${prefix4} +| | ... +| | Set Interface State | ${dut1} | ${dut1_if1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up +| | Set Interface State | ${dut2} | ${dut2_if1} | up +| | Set Interface State | ${dut2} | ${dut2_if2} | up +| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_ip6_address} +| | ... | ${prefix6} +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} +| | ... | ${dut1_dut2_ip4_address} | ${prefix4} +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} +| | ... | ${dut2_dut1_ip4_address} | ${prefix4} +| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_ip6_address} +| | ... | ${prefix6} +| | Suppress ICMPv6 router advertisement message | ${nodes} +| | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac} +| | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac} +| | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip4_address} +| | ... | ${dut2_if1_mac} +| | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip4_address} +| | ... | ${dut1_if2_mac} + +| Initialize SNAT in 3-node circular topology +| | [Documentation] | Initialization of 3-node topology with SNAT between DUTs: +| | ... | - set interfaces up +| | ... | - set IP addresses +| | ... | - set ARP +| | ... | - create routes +| | ... | - set SNAT - only on DUT1 +| | ... +| | Set Interface State | ${dut1} | ${dut1_if1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up +| | Set Interface State | ${dut2} | ${dut2_if1} | up +| | Set Interface State | ${dut2} | ${dut2_if2} | up +| | All Vpp Interfaces Ready Wait | ${nodes} +| | ... +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 10.0.0.1 | 20 +| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 11.0.0.1 | 20 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 11.0.0.2 | 20 +| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 12.0.0.1 | 20 +| | ... +| | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} +| | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} +| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} +| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} +| | ... +| | Add arp on dut | ${dut1} | ${dut1_if1} | 10.0.0.2 | ${tg_if1_mac} +| | Add arp on dut | ${dut1} | ${dut1_if2} | 11.0.0.2 | ${dut2_if1_mac} +| | Add arp on dut | ${dut2} | ${dut2_if1} | 11.0.0.1 | ${dut1_if2_mac} +| | Add arp on dut | ${dut2} | ${dut2_if2} | 12.0.0.2 | ${tg_if2_mac} +| | ... +| | Vpp Route Add | ${dut1} | 12.0.0.2 | 32 | 11.0.0.2 | ${dut1_if2} +| | Vpp Route Add | ${dut1} | 20.0.0.0 | 18 | 10.0.0.2 | ${dut1_if1} +| | Vpp Route Add | ${dut2} | 12.0.0.0 | 24 | 12.0.0.2 | ${dut2_if2} +| | Vpp Route Add | ${dut2} | 200.0.0.0 | 30 | 11.0.0.1 | ${dut2_if1} +| | ... +| | Configure inside and outside interfaces +| | ... | ${dut1} | ${dut1_if1} | ${dut1_if2} +| | Configure deterministic mode for SNAT +| | ... | ${dut1} | 20.0.0.0 | 18 | 200.0.0.0 | 30 diff --git a/resources/libraries/robot/performance/performance_setup.robot b/resources/libraries/robot/performance/performance_setup.robot new file mode 100644 index 0000000000..a2aaa52bc8 --- /dev/null +++ b/resources/libraries/robot/performance/performance_setup.robot @@ -0,0 +1,532 @@ +# Copyright (c) 2017 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/performance/performance_configuration.robot +| Resource | resources/libraries/robot/performance/performance_utils.robot +| Documentation | Performance suite keywords - Suite and test setups and +| ... | teardowns. + +*** Keywords *** + +# Keywords used in setups and teardowns + +| Set variables in 2-node circular topology +| | [Documentation] +| | ... | Compute path for testing on two given nodes in circular +| | ... | topology and set corresponding suite variables. +| | ... +| | ... | _NOTE:_ This KW sets following suite variables: +| | ... | - tg - TG node +| | ... | - tg_if1 - 1st TG interface towards DUT. +| | ... | - tg_if2 - 2nd TG interface towards DUT. +| | ... | - dut1 - DUT1 node +| | ... | - dut1_if1 - 1st DUT interface towards TG. +| | ... | - dut1_if2 - 2nd DUT interface towards TG. +| | ... +| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | Compute Path | always_same_link=${FALSE} +| | ${tg_if1} | ${tg}= | First Interface +| | ${dut1_if1} | ${dut1}= | First Ingress Interface +| | ${dut1_if2} | ${dut1}= | Last Egress Interface +| | ${tg_if2} | ${tg}= | Last Interface +| | Set Suite Variable | ${tg} +| | Set Suite Variable | ${tg_if1} +| | Set Suite Variable | ${tg_if2} +| | Set Suite Variable | ${dut1} +| | Set Suite Variable | ${dut1_if1} +| | Set Suite Variable | ${dut1_if2} + +| Set variables in 3-node circular topology +| | [Documentation] +| | ... | Compute path for testing on three given nodes in circular +| | ... | topology and set corresponding suite variables. +| | ... +| | ... | _NOTE:_ This KW sets following suite variables: +| | ... | - tg - TG node +| | ... | - tg_if1 - TG interface towards DUT1. +| | ... | - tg_if2 - TG interface towards DUT2. +| | ... | - dut1 - DUT1 node +| | ... | - dut1_if1 - DUT1 interface towards TG. +| | ... | - dut1_if2 - DUT1 interface towards DUT2. +| | ... | - dut2 - DUT2 node +| | ... | - dut2_if1 - DUT2 interface towards DUT1. +| | ... | - dut2_if2 - DUT2 interface towards TG. +| | ... +| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} +| | ... | ${nodes['TG']} +| | Compute Path +| | ${tg_if1} | ${tg}= | Next Interface +| | ${dut1_if1} | ${dut1}= | Next Interface +| | ${dut1_if2} | ${dut1}= | Next Interface +| | ${dut2_if1} | ${dut2}= | Next Interface +| | ${dut2_if2} | ${dut2}= | Next Interface +| | ${tg_if2} | ${tg}= | Next Interface +| | Set Suite Variable | ${tg} +| | Set Suite Variable | ${tg_if1} +| | Set Suite Variable | ${tg_if2} +| | Set Suite Variable | ${dut1} +| | Set Suite Variable | ${dut1_if1} +| | Set Suite Variable | ${dut1_if2} +| | Set Suite Variable | ${dut2} +| | Set Suite Variable | ${dut2_if1} +| | Set Suite Variable | ${dut2_if2} + +| Set variables in 2-node circular topology with DUT interface model +| | [Documentation] +| | ... | Compute path for testing on two given nodes in circular topology +| | ... | based on interface model provided as an argument and set +| | ... | corresponding suite variables. +| | ... +| | ... | *Arguments:* +| | ... | - iface_model - Interface model. Type: string +| | ... +| | ... | _NOTE:_ This KW sets following suite variables: +| | ... | - tg - TG node +| | ... | - tg_if1 - 1st TG interface towards DUT. +| | ... | - tg_if2 - 2nd TG interface towards DUT. +| | ... | - dut1 - DUT1 node +| | ... | - dut1_if1 - 1st DUT interface towards TG. +| | ... | - dut1_if2 - 2nd DUT interface towards TG. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Set variables in 2-node circular topology with DUT interface model\ +| | ... | \| Intel-X520-DA2 \| +| | ... +| | [Arguments] | ${iface_model} +| | ... +| | ${iface_model_list}= | Create list | ${iface_model} +| | Append Node | ${nodes['TG']} +| | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list} +| | Append Node | ${nodes['TG']} +| | Compute Path | always_same_link=${FALSE} +| | ${tg_if1} | ${tg}= | First Interface +| | ${dut1_if1} | ${dut1}= | First Ingress Interface +| | ${dut1_if2} | ${dut1}= | Last Egress Interface +| | ${tg_if2} | ${tg}= | Last Interface +| | Set Suite Variable | ${tg} +| | Set Suite Variable | ${tg_if1} +| | Set Suite Variable | ${tg_if2} +| | Set Suite Variable | ${dut1} +| | Set Suite Variable | ${dut1_if1} +| | Set Suite Variable | ${dut1_if2} + +| Set variables in 3-node circular topology with DUT interface model +| | [Documentation] +| | ... | Compute path for testing on three given nodes in circular topology +| | ... | based on interface model provided as an argument and set +| | ... | corresponding suite variables. +| | ... +| | ... | *Arguments:* +| | ... | - iface_model - Interface model. Type: string +| | ... +| | ... | _NOTE:_ This KW sets following suite variables: +| | ... | - tg - TG node +| | ... | - tg_if1 - TG interface towards DUT1. +| | ... | - tg_if2 - TG interface towards DUT2. +| | ... | - dut1 - DUT1 node +| | ... | - dut1_if1 - DUT1 interface towards TG. +| | ... | - dut1_if2 - DUT1 interface towards DUT2. +| | ... | - dut2 - DUT2 node +| | ... | - dut2_if1 - DUT2 interface towards TG. +| | ... | - dut2_if2 - DUT2 interface towards DUT1. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Set variables in 3-node circular topology with DUT interface model\ +| | ... | \| Intel-X520-DA2 \| +| | ... +| | [Arguments] | ${iface_model} +| | ... +| | ${iface_model_list}= | Create list | ${iface_model} +| | Append Node | ${nodes['TG']} +| | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list} +| | Append Node | ${nodes['DUT2']} | filter_list=${iface_model_list} +| | Append Node | ${nodes['TG']} +| | Compute Path +| | ${tg_if1} | ${tg}= | Next Interface +| | ${dut1_if1} | ${dut1}= | Next Interface +| | ${dut1_if2} | ${dut1}= | Next Interface +| | ${dut2_if1} | ${dut2}= | Next Interface +| | ${dut2_if2} | ${dut2}= | Next Interface +| | ${tg_if2} | ${tg}= | Next Interface +| | Set Suite Variable | ${tg} +| | Set Suite Variable | ${tg_if1} +| | Set Suite Variable | ${tg_if2} +| | Set Suite Variable | ${dut1} +| | Set Suite Variable | ${dut1_if1} +| | Set Suite Variable | ${dut1_if2} +| | Set Suite Variable | ${dut2} +| | Set Suite Variable | ${dut2_if1} +| | Set Suite Variable | ${dut2_if2} + +| Tear down guest VM with dpdk-testpmd +| | [Documentation] +| | ... | Stop all qemu processes with dpdk-testpmd running on ${dut_node}. +| | ... | Argument is dictionary of all qemu nodes running with its names. +| | ... | Dpdk-testpmd is stopped gracefully with printing stats. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - Node where to clean qemu. Type: dictionary +| | ... | - dut_vm_refs - VM references on node. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Tear down guest VM with dpdk-testpmd \| ${node['DUT1']} \ +| | ... | \| ${dut_vm_refs} \| +| | ... +| | [Arguments] | ${dut_node} | ${dut_vm_refs} +| | ${vms_number}= | Get Length | ${dut_vm_refs} +| | ${index}= | Set Variable | ${0} +| | :FOR | ${vm_name} | IN | @{dut_vm_refs} +| | | ${vm}= | Get From Dictionary | ${dut_vm_refs} | ${vm_name} +| | | ${index}= | Evaluate | ${index} + 1 +| | | Dpdk Testpmd Stop | ${vm} +| | | Run Keyword | ${vm_name}.Qemu Set Node | ${dut_node} +| | | Run Keyword | ${vm_name}.Qemu Clear Socks +| | | Run Keyword If | '${index}' == '${vms_number}' | ${vm_name}.Qemu Kill All + +| Tear down guest VM +| | [Documentation] +| | ... | Stop all qemu processes running on ${dut_node}. +| | ... | Argument is dictionary of all qemu nodes running with its names. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - Node where to clean qemu. Type: dictionary +| | ... | - dut_vm_refs - VM references on node. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Tear down guest VM \| ${node['DUT1']} \ +| | ... | \| ${dut_vm_refs} \| +| | ... +| | [Arguments] | ${dut_node} | ${dut_vm_refs} +| | ${vms_number}= | Get Length | ${dut_vm_refs} +| | ${index}= | Set Variable | ${0} +| | :FOR | ${vm_name} | IN | @{dut_vm_refs} +| | | ${vm}= | Get From Dictionary | ${dut_vm_refs} | ${vm_name} +| | | ${index}= | Evaluate | ${index} + 1 +| | | Run Keyword | ${vm_name}.Qemu Set Node | ${dut_node} +| | | Run Keyword | ${vm_name}.Qemu Clear Socks +| | | Run Keyword If | '${index}' == '${vms_number}' | ${vm_name}.Qemu Kill All + +# Suite setups + +| Set up 2-node performance topology with DUT's NIC model +| | [Documentation] +| | ... | Suite preparation phase that setup default startup configuration of +| | ... | VPP on all DUTs. Updates interfaces on all nodes and setup global +| | ... | variables used in test cases based on interface model provided as an +| | ... | argument. Initializes traffic generator. +| | ... +| | ... | *Arguments:* +| | ... | - topology_type - Topology type. Type: string +| | ... | - nic_model - Interface model. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| 2-node Performance Suite Setup \| L2 \| Intel-X520-DA2 \| +| | ... +| | [Arguments] | ${topology_type} | ${nic_model} +| | ... +| | Show vpp version on all DUTs +| | Set variables in 2-node circular topology with DUT interface model +| | ... | ${nic_model} +| | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2} +| | ... | ${dut1} | ${dut1_if1} | ${dut1} | ${dut1_if2} | ${topology_type} + +| Set up 2-node-switched performance topology with DUT's NIC model +| | [Documentation] +| | ... | Suite preparation phase that setup default startup configuration of +| | ... | VPP on all DUTs. Updates interfaces on all nodes and setup global +| | ... | variables used in test cases based on interface model provided as an +| | ... | argument. Initializes traffic generator. +| | ... +| | ... | *Arguments:* +| | ... | - topology_type - Topology type. Type: string +| | ... | - nic_model - Interface model. Type: string +| | ... | - tg_if1_dest_mac - Interface 1 destination MAC address. Type: string +| | ... | - tg_if2_dest_mac - Interface 2 destination MAC address. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| 2-node Performance Suite Setup \| L2 \| Intel-X520-DA2 \ +| | ... | \| 22:22:33:44:55:66 \| 22:22:33:44:55:55 \| +| | ... +| | [Arguments] | ${topology_type} | ${nic_model} | ${tg_if1_dest_mac} +| | ... | ${tg_if2_dest_mac} +| | ... +| | Show vpp version on all DUTs +| | Set variables in 2-node circular topology with DUT interface model +| | ... | ${nic_model} +| | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2} +| | ... | ${dut1} | ${dut1_if1} | ${dut1} | ${dut1_if2} | ${topology_type} +| | ... | ${tg_if1_dest_mac} | ${tg_if2_dest_mac} + +| Set up 3-node performance topology with DUT's NIC model +| | [Documentation] +| | ... | Suite preparation phase that setup default startup configuration of +| | ... | VPP on all DUTs. Updates interfaces on all nodes and setup global +| | ... | variables used in test cases based on interface model provided as an +| | ... | argument. Initializes traffic generator. +| | ... +| | ... | *Arguments:* +| | ... | - topology_type - Topology type. Type: string +| | ... | - nic_model - Interface model. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Set up 3-node performance topology with DUT's NIC model \| L2 \ +| | ... | \| Intel-X520-DA2 \| +| | ... +| | [Arguments] | ${topology_type} | ${nic_model} +| | ... +| | Show vpp version on all DUTs +| | Set variables in 3-node circular topology with DUT interface model +| | ... | ${nic_model} +| | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2} +| | ... | ${dut1} | ${dut1_if1} | ${dut2} | ${dut2_if2} | ${topology_type} + +| Set up DPDK 2-node performance topology with DUT's NIC model +| | [Documentation] +| | ... | Updates interfaces on all nodes and setup global +| | ... | variables used in test cases based on interface model provided as an +| | ... | argument. Initializes traffic generator. Initializes DPDK test +| | ... | environment. +| | ... +| | ... | *Arguments:* +| | ... | - topology_type - Topology type. Type: string +| | ... | - nic_model - Interface model. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Set up DPDK 2-node performance topology with DUT's NIC model \ +| | ... | \| L2 \| Intel-X520-DA2 \| +| | ... +| | [Arguments] | ${topology_type} | ${nic_model} +| | ... +| | Set variables in 2-node circular topology with DUT interface model +| | ... | ${nic_model} +| | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2} +| | ... | ${dut1} | ${dut1_if1} | ${dut1} | ${dut1_if2} | ${topology_type} +| | Initialize DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2} + +| Set up DPDK 3-node performance topology with DUT's NIC model +| | [Documentation] +| | ... | Updates interfaces on all nodes and setup global +| | ... | variables used in test cases based on interface model provided as an +| | ... | argument. Initializes traffic generator. Initializes DPDK test +| | ... | environment. +| | ... +| | ... | *Arguments:* +| | ... | - topology_type - Topology type. Type: string +| | ... | - nic_model - Interface model. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| 3-node Performance Suite Setup \| L2 \| Intel-X520-DA2 \| +| | ... +| | [Arguments] | ${topology_type} | ${nic_model} +| | ... +| | Set variables in 3-node circular topology with DUT interface model +| | ... | ${nic_model} +| | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2} +| | ... | ${dut1} | ${dut1_if1} | ${dut2} | ${dut2_if2} | ${topology_type} +| | Initialize DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2} +| | Initialize DPDK Environment | ${dut2} | ${dut2_if1} | ${dut2_if2} + +| Set up IPSec performance test suite +| | [Documentation] +| | ... | Suite preparation phase that sets default startup configuration of +| | ... | VPP on all DUTs. Updates interfaces on all nodes and sets global +| | ... | variables used in test cases based on interface model provided as an +| | ... | argument. Initializes traffic generator. +| | ... | Then it configures crypto device and kernel module on all DUTs. +| | ... +| | ... | *Arguments:* +| | ... | - topology_type - Topology type. Type: string +| | ... | - nic_model - Interface model. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Set up IPSec performance test suite \| L2 \ +| | ... | \| Intel-X520-DA2 \| +| | ... +| | [Arguments] | ${topology_type} | ${nic_model} +| | ... +| | Set up 3-node performance topology with DUT's NIC model +| | ... | ${topology_type} | ${nic_model} +| | Configure crypto device on all DUTs | force_init=${True} +| | Configure kernel module on all DUTs | igb_uio | force_load=${True} + +# Suite teardowns + +| Tear down 3-node performance topology +| | [Documentation] +| | ... | Suite teardown phase with traffic generator teardown. +| | ... +| | Teardown traffic generator | ${tg} + +| Tear down 2-node performance topology +| | [Documentation] +| | ... | Suite teardown phase with traffic generator teardown. +| | ... +| | Teardown traffic generator | ${tg} + +# Tests setups + +| Set up performance test +| | [Documentation] | Common test setup for performance tests. +| | ... +| | Reset VAT History On All DUTs | ${nodes} +| | Create base startup configuration of VPP on all DUTs + +# Tests teardowns + +| Tear down performance discovery test +| | [Documentation] | Common test teardown for ndrdisc and pdrdisc performance \ +| | ... | tests. +| | ... +| | ... | *Arguments:* +| | ... | - rate - Rate for sending packets. Type: string +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - topology_type - Topology type. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Tear down performance discovery test \| 4.0mpps \| 64 \ +| | ... | \| 3-node-IPv4 \| +| | ... +| | [Arguments] | ${rate} | ${framesize} | ${topology_type} +| | ... +| | Show VAT History On All DUTs | ${nodes} +| | Show statistics on all DUTs +| | Run Keyword If Test Failed +| | ... | Traffic should pass with no loss | ${perf_trial_duration} | ${rate} +| | ... | ${framesize} | ${topology_type} | fail_on_loss=${False} + +| Tear down performance ndrchk test +| | [Documentation] | Common test teardown for ndrchk performance tests. +| | ... +| | Show VAT History On All DUTs | ${nodes} +| | Show statistics on all DUTs + +| Tear down performance pdrchk test +| | [Documentation] | Common test teardown for pdrchk performance tests. +| | ... +| | Show VAT History On All DUTs | ${nodes} +| | Show statistics on all DUTs + +| Tear down performance test with vhost and VM with dpdk-testpmd +| | [Documentation] | Common test teardown for performance tests which use +| | ... | vhost(s) and VM(s) with dpdk-testpmd. +| | ... +| | ... | *Arguments:* +| | ... | - rate - Rate for sending packets. Type: string +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - topology_type - Topology type. Type: string +| | ... | - dut1_node - Node where to clean qemu. Type: dictionary +| | ... | - dut1_vm_refs - VM references on node. Type: dictionary +| | ... | - dut2_node - Node where to clean qemu. Type: dictionary +| | ... | - dut2_vm_refs - VM references on node. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Tear down performance test with vhost and VM with dpdk-testpmd \ +| | ... | \| 4.0mpps \| 64 \| 3-node-IPv4 \| ${node['DUT1']} \| ${dut_vm_refs} \ +| | ... | \| ${node['DUT2']} \| ${dut_vm_refs} \| +| | ... +| | [Arguments] | ${rate} | ${framesize} | ${topology_type} +| | ... | ${dut1_node}=${None} | ${dut1_vm_refs}=${None} +| | ... | ${dut2_node}=${None} | ${dut2_vm_refs}=${None} +| | ... +| | Show VAT History On All DUTs | ${nodes} +| | Show VPP vhost on all DUTs +| | Show statistics on all DUTs +| | Run Keyword If Test Failed +| | ... | Traffic should pass with no loss | ${perf_trial_duration} | ${rate} +| | ... | ${framesize} | ${topology_type} | fail_on_loss=${False} +| | Run keyword unless | ${dut1_node}==${None} +| | ... | Tear down guest VM with dpdk-testpmd | ${dut1} | ${dut1_vm_refs} +| | Run keyword unless | ${dut2_node}==${None} +| | ... | Tear down guest VM with dpdk-testpmd | ${dut2} | ${dut2_vm_refs} + +| Tear down performance pdrchk test with vhost and VM with dpdk-testpmd +| | [Documentation] | Common test teardown for performance pdrchk tests which \ +| | ... | use vhost(s) and VM(s) with dpdk-testpmd. +| | ... +| | ... | *Arguments:* +| | ... | - rate - Rate for sending packets. Type: string +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - topology_type - Topology type. Type: string +| | ... | - dut1_node - Node where to clean qemu. Type: dictionary +| | ... | - dut1_vm_refs - VM references on node. Type: dictionary +| | ... | - dut2_node - Node where to clean qemu. Type: dictionary +| | ... | - dut2_vm_refs - VM references on node. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Tear down performance pdrchk test with vhost and VM with \ +| | ... | dpdk-testpmd \| 4.0mpps \| 64 \| 3-node-IPv4 \| ${node['DUT1']} \ +| | ... | \| ${dut_vm_refs} \| ${node['DUT2']} \| ${dut_vm_refs} \| +| | ... +| | [Arguments] | ${rate} | ${framesize} | ${topology_type} +| | ... | ${dut1_node}=${None} | ${dut1_vm_refs}=${None} +| | ... | ${dut2_node}=${None} | ${dut2_vm_refs}=${None} +| | ... +| | Show VAT History On All DUTs | ${nodes} +| | Show VPP vhost on all DUTs +| | Show statistics on all DUTs +| | Run keyword unless | ${dut1_node}==${None} +| | ... | Tear down guest VM with dpdk-testpmd | ${dut1} | ${dut1_vm_refs} +| | Run keyword unless | ${dut2_node}==${None} +| | ... | Tear down guest VM with dpdk-testpmd | ${dut2} | ${dut2_vm_refs} + +| Tear down DPDK 3-node performance topology +| | [Documentation] +| | ... | Suite teardown phase with traffic generator teardown. +| | ... | Cleanup DPDK test environment. +| | ... +| | Teardown traffic generator | ${tg} +| | Cleanup DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2} +| | Cleanup DPDK Environment | ${dut2} | ${dut2_if1} | ${dut2_if2} + +| Tear down DPDK 2-node performance topology +| | [Documentation] +| | ... | Suite teardown phase with traffic generator teardown. +| | ... | Cleanup DPDK test environment. +| | ... +| | Teardown traffic generator | ${tg} +| | Cleanup DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2} + +| Tear down performance discovery test with SNAT +| | [Documentation] | Common test teardown for ndrdisc and pdrdisc performance \ +| | ... | tests with SNAT feature used. +| | ... +| | ... | *Arguments:* +| | ... | - rate - Rate for sending packets. Type: string +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - topology_type - Topology type. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Tear down performance discovery test with SNAT \| 4.0mpps \| 64 \ +| | ... | \| ${traffic_profile} \| +| | ... +| | [Arguments] | ${rate} | ${framesize} | ${traffic_profile} +| | ... +| | Tear down performance discovery test | ${rate}pps | ${framesize} +| | ... | ${traffic_profile} +| | Show SNAT verbose | ${dut1} +| | Show SNAT verbose | ${dut2} diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot new file mode 100644 index 0000000000..544aaeb343 --- /dev/null +++ b/resources/libraries/robot/performance/performance_utils.robot @@ -0,0 +1,545 @@ +# Copyright (c) 2017 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 | Collections +| Library | resources.libraries.python.topology.Topology +| Library | resources.libraries.python.NodePath +| Library | resources.libraries.python.DpdkUtil +| Library | resources.libraries.python.InterfaceUtil +| Library | resources.libraries.python.VhostUser +| Library | resources.libraries.python.TrafficGenerator +| Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl +| Resource | resources/libraries/robot/shared/default.robot +| Resource | resources/libraries/robot/shared/interfaces.robot +| Resource | resources/libraries/robot/shared/counters.robot +| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot +| Resource | resources/libraries/robot/l2/l2_xconnect.robot +| Resource | resources/libraries/robot/ip/ip4.robot +| Resource | resources/libraries/robot/ip/ip6.robot +| Resource | resources/libraries/robot/vm/qemu.robot +| Resource | resources/libraries/robot/l2/tagging.robot +| Documentation | Performance suite keywords - utilities to find and verify NDR +| ... | and PDR. + +*** Keywords *** +| Calculate pps +| | [Documentation] +| | ... | Calculate pps for given rate and L2 frame size, +| | ... | additional 20B are added to L2 frame size as padding. +| | ... +| | ... | *Arguments* +| | ... | - bps - Rate in bps. Type: integer +| | ... | - framesize - L2 frame size in Bytes. Type: integer +| | ... +| | ... | *Return* +| | ... | - Calculated pps. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Calculate pps \| 10000000000 \| 64 \| +| | ... +| | [Arguments] | ${bps} | ${framesize} +| | ... +| | ${framesize}= | Get Frame Size | ${framesize} +| | ${ret}= | Evaluate | (${bps}/((${framesize}+20)*8)).__trunc__() +| | Return From Keyword | ${ret} + +| Get Frame Size +| | [Documentation] +| | ... | Framesize can be either integer in case of a single packet +| | ... | in stream, or set of packets in case of IMIX type or simmilar. +| | ... | This keyword returns average framesize. +| | ... +| | ... | *Arguments:* +| | ... | - framesize - Framesize. Type: integer or string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Get Frame Size \| IMIX_v4_1 \| +| | ... +| | [Arguments] | ${framesize} +| | ... +| | Run Keyword If | '${framesize}' == 'IMIX_v4_1' +| | ... | Return From Keyword | 353.83333 +| | Return From Keyword | ${framesize} + +| Is DPDK performance test +| | [Documentation] +| | ... | Return TRUE if variable DPDK_TEST exist, otherwise FALSE. +| | ${ret} | ${tmp}= | Run Keyword And Ignore Error +| | ... | Variable Should Exist | ${DPDK_TEST} +| | Return From Keyword If | "${ret}" == "PASS" | ${TRUE} +| | Return From Keyword | ${FALSE} + +| Find NDR using linear search and pps +| | [Documentation] +| | ... | Find throughput by using RFC2544 linear search with non drop rate. +| | ... +| | ... | *Arguments:* +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - start_rate - Initial start rate [pps]. Type: float +| | ... | - step_rate - Step of linear search [pps]. Type: float +| | ... | - topology_type - Topology type. Type: string +| | ... | - min_rate - Lower limit of search [pps]. Type: float +| | ... | - max_rate - Upper limit of search [pps]. Type: float +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Find NDR using linear search and pps \| 64 \| 5000000 \ +| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| +| | ... +| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate} +| | ... | ${topology_type} | ${min_rate} | ${max_rate} +| | ... +| | ${duration}= | Set Variable | ${perf_trial_duration} +| | Set Duration | ${duration} +| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} +| | Set Search Linear Step | ${step_rate} +| | Set Search Frame Size | ${framesize} +| | Set Search Rate Type pps +| | Linear Search | ${start_rate} | ${topology_type} +| | ${rate_per_stream} | ${lat}= | Verify Search Result +| | ${tmp}= | Create List | 100%NDR | ${lat} +| | ${latency}= | Create List | ${tmp} +| | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5) +| | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p} +| | ... | ${framesize} | ${topology_type} +| | ${tmp}= | Create List | 50%NDR | ${lat_50p} +| | Append To List | ${latency} | ${tmp} +| | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1) +| | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p} +| | ... | ${framesize} | ${topology_type} +| | ${tmp}= | Create List | 10%NDR | ${lat_10p} +| | Append To List | ${latency} | ${tmp} +| | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2 +| | ... | ${latency} +| | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps +| | ... | ${framesize} | ${topology_type} | fail_on_loss=${False} + +| Find PDR using linear search and pps +| | [Documentation] +| | ... | Find throughput by using RFC2544 linear search with partial drop rate +| | ... | with PDR threshold and type specified by parameter. +| | ... +| | ... | *Arguments:* +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - start_rate - Initial start rate [pps]. Type: float +| | ... | - step_rate - Step of linear search [pps]. Type: float +| | ... | - topology_type - Topology type. Type: string +| | ... | - min_rate - Lower limit of search [pps]. Type: float +| | ... | - max_rate - Upper limit of search [pps]. Type: float +| | ... | - loss_acceptance - Accepted loss during search. Type: float +| | ... | - loss_acceptance_type - Percentage or frames. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Find PDR using linear search and pps \| 64 \| 5000000 \ +| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 0.5 \| percentage \| +| | ... +| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate} +| | ... | ${topology_type} | ${min_rate} | ${max_rate} +| | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames' +| | ... +| | ${duration}= | Set Variable | ${perf_trial_duration} +| | Set Duration | ${duration} +| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} +| | Set Search Linear Step | ${step_rate} +| | Set Search Frame Size | ${framesize} +| | Set Search Rate Type pps +| | Set Loss Acceptance | ${loss_acceptance} +| | Run Keyword If | '${loss_acceptance_type}' == 'percentage' +| | ... | Set Loss Acceptance Type Percentage +| | Linear Search | ${start_rate} | ${topology_type} +| | ${rate_per_stream} | ${lat}= | Verify Search Result +| | ${tmp}= | Create List | 100%PDR | ${lat} +| | ${latency}= | Create List | ${tmp} +| | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2 +| | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency} +| | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps +| | ... | ${framesize} | ${topology_type} | ${loss_acceptance} +| | ... | ${loss_acceptance_type} | fail_on_loss=${False} + +| Find NDR using binary search and pps +| | [Documentation] +| | ... | Find throughput by using RFC2544 binary search with non drop rate. +| | ... +| | ... | *Arguments:* +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - binary_min - Lower boundary of search [pps]. Type: float +| | ... | - binary_max - Upper boundary of search [pps]. Type: float +| | ... | - topology_type - Topology type. Type: string +| | ... | - min_rate - Lower limit of search [pps]. Type: float +| | ... | - max_rate - Upper limit of search [pps]. Type: float +| | ... | - threshold - Threshold to stop search [pps]. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Find NDR using binary search and pps \| 64 \| 6000000 \ +| | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \| +| | ... +| | [Arguments] | ${framesize} | ${binary_min} | ${binary_max} +| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold} +| | ... +| | ${duration}= | Set Variable | ${perf_trial_duration} +| | Set Duration | ${duration} +| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} +| | Set Search Frame Size | ${framesize} +| | Set Search Rate Type pps +| | Set Binary Convergence Threshold | ${threshold} +| | Binary Search | ${binary_min} | ${binary_max} | ${topology_type} +| | ${rate_per_stream} | ${lat}= | Verify Search Result +| | ${tmp}= | Create List | 100%NDR | ${lat} +| | ${latency}= | Create List | ${tmp} +| | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5) +| | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p} +| | ... | ${framesize} | ${topology_type} +| | ${tmp}= | Create List | 50%NDR | ${lat_50p} +| | Append To List | ${latency} | ${tmp} +| | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1) +| | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p} +| | ... | ${framesize} | ${topology_type} +| | ${tmp}= | Create List | 10%NDR | ${lat_10p} +| | Append To List | ${latency} | ${tmp} +| | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2 +| | ... | ${latency} +| | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps +| | ... | ${framesize} | ${topology_type} | fail_on_loss=${False} + +| Find PDR using binary search and pps +| | [Documentation] +| | ... | Find throughput by using RFC2544 binary search with partial drop rate +| | ... | with PDR threshold and type specified by parameter. +| | ... +| | ... | *Arguments:* +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - binary_min - Lower boundary of search [pps]. Type: float +| | ... | - binary_max - Upper boundary of search [pps]. Type: float +| | ... | - topology_type - Topology type. Type: string +| | ... | - min_rate - Lower limit of search [pps]. Type: float +| | ... | - max_rate - Upper limit of search [pps]. Type: float +| | ... | - threshold - Threshold to stop search [pps]. Type: integer +| | ... | - loss_acceptance - Accepted loss during search. Type: float +| | ... | - loss_acceptance_type - Percentage or frames. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Find PDR using binary search and pps \| 64 \| 6000000 \ +| | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \| 0.5 \ +| | ... | \| percentage \| +| | ... +| | [Arguments] | ${framesize} | ${binary_min} | ${binary_max} +| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold} +| | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames' +| | ... +| | ${duration}= | Set Variable | ${perf_trial_duration} +| | Set Duration | ${duration} +| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} +| | Set Search Frame Size | ${framesize} +| | Set Search Rate Type pps +| | Set Loss Acceptance | ${loss_acceptance} +| | Run Keyword If | '${loss_acceptance_type}' == 'percentage' +| | ... | Set Loss Acceptance Type Percentage +| | Set Binary Convergence Threshold | ${threshold} +| | Binary Search | ${binary_min} | ${binary_max} | ${topology_type} +| | ${rate_per_stream} | ${lat}= | Verify Search Result +| | ${tmp}= | Create List | 100%PDR | ${lat} +| | ${latency}= | Create List | ${tmp} +| | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2 +| | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency} +| | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps +| | ... | ${framesize} | ${topology_type} | ${loss_acceptance} +| | ... | ${loss_acceptance_type} | fail_on_loss=${False} + +| Find NDR using combined search and pps +| | [Documentation] +| | ... | Find throughput by using RFC2544 combined search (linear+binary) with +| | ... | non drop rate. +| | ... +| | ... | *Arguments:* +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - start_rate - Initial start rate [pps]. Type: float +| | ... | - step_rate - Step of linear search [pps]. Type: float +| | ... | - topology_type - Topology type. Type: string +| | ... | - min_rate - Lower limit of search [pps]. Type: float +| | ... | - max_rate - Upper limit of search [pps]. Type: float +| | ... | - threshold - Threshold to stop search [pps]. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Find NDR using combined search and pps \| 64 \| 5000000 \ +| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \| +| | ... +| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate} +| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold} +| | ... +| | ${duration}= | Set Variable | ${perf_trial_duration} +| | Set Duration | ${duration} +| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} +| | Set Search Linear Step | ${step_rate} +| | Set Search Frame Size | ${framesize} +| | Set Search Rate Type pps +| | Set Binary Convergence Threshold | ${threshold} +| | Combined Search | ${start_rate} | ${topology_type} +| | ${rate_per_stream} | ${lat}= | Verify Search Result +| | ${tmp}= | Create List | 100%NDR | ${lat} +| | ${latency}= | Create List | ${tmp} +| | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5) +| | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p} +| | ... | ${framesize} | ${topology_type} +| | ${tmp}= | Create List | 50%NDR | ${lat_50p} +| | Append To List | ${latency} | ${tmp} +| | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1) +| | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p} +| | ... | ${framesize} | ${topology_type} +| | ${tmp}= | Create List | 10%NDR | ${lat_10p} +| | Append To List | ${latency} | ${tmp} +| | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2 +| | ... | ${latency} +| | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps +| | ... | ${framesize} | ${topology_type} +| | ... | fail_on_loss=${False} + +| Find PDR using combined search and pps +| | [Documentation] +| | ... | Find throughput by using RFC2544 combined search (linear+binary) with +| | ... | partial drop rate with PDR threshold and type specified by parameter. +| | ... +| | ... | *Arguments:* +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - start_rate - Initial start rate [pps]. Type: float +| | ... | - step_rate - Step of linear search [pps]. Type: float +| | ... | - topology_type - Topology type. Type: string +| | ... | - min_rate - Lower limit of search [pps]. Type: float +| | ... | - max_rate - Upper limit of search [pps]. Type: float +| | ... | - threshold - Threshold to stop search [pps]. Type: integer +| | ... | - loss_acceptance - Accepted loss during search. Type: float +| | ... | - loss_acceptance_type - Percentage or frames. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Find PDR using combined search and pps \| 64 \| 5000000 \ +| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \| 0.5 \ +| | ... | \| percentage \| +| | ... +| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate} +| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold} +| | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames' +| | ... +| | ${duration}= | Set Variable | ${perf_trial_duration} +| | Set Duration | ${duration} +| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} +| | Set Search Linear Step | ${step_rate} +| | Set Search Frame Size | ${framesize} +| | Set Search Rate Type pps +| | Set Loss Acceptance | ${loss_acceptance} +| | Run Keyword If | '${loss_acceptance_type}' == 'percentage' +| | ... | Set Loss Acceptance Type Percentage +| | Set Binary Convergence Threshold | ${threshold} +| | Combined Search | ${start_rate} | ${topology_type} +| | ${rate_per_stream} | ${lat}= | Verify Search Result +| | ${tmp}= | Create List | 100%PDR | ${lat} +| | ${latency}= | Create List | ${tmp} +| | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2 +| | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency} +| | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps +| | ... | ${framesize} | ${topology_type} | ${loss_acceptance} +| | ... | ${loss_acceptance_type} | fail_on_loss=${False} + +| Display result of NDR search +| | [Documentation] +| | ... | Display result of NDR search in packet per seconds (total and per +| | ... | stream) and Gbps total bandwidth with untagged packet. +| | ... | Througput is calculated as: +| | ... | Measured rate per stream * Total number of streams +| | ... | Bandwidth is calculated as: +| | ... | (Througput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC +| | ... +| | ... | *Arguments:* +| | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - nr_streams - Total number of streams. Type: integer +| | ... | - latency - Latency stats. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Display result of NDR search \| 4400000 \| 64 \| 2 \ +| | ... | \| [100%NDR, [10/10/10, 1/2/3]] \| +| | ... +| | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams} | ${latency} +| | ... +| | ${framesize}= | Get Frame Size | ${framesize} +| | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams} +| | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9) +| | Set Test Message | FINAL_RATE: ${rate_total} pps +| | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes +| | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged) +| | ... | append=yes +| | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes +| | :FOR | ${lat} | IN | @{latency} +| | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes + +| Display result of PDR search +| | [Documentation] +| | ... | Display result of PDR search in packet per seconds (total and per +| | ... | stream) and Gbps total bandwidth with untagged packet. +| | ... | Througput is calculated as: +| | ... | Measured rate per stream * Total number of streams +| | ... | Bandwidth is calculated as: +| | ... | (Througput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC +| | ... +| | ... | *Arguments:* +| | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - nr_streams - Total number of streams. Type: integer +| | ... | - loss_acceptance - Accepted loss during search. Type: float +| | ... | - loss_acceptance_type - Percentage or frames. Type: string +| | ... | - latency - Latency stats. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Display result of PDR search \| 4400000 \| 64 \| 2 \| 0.5 \ +| | ... | \| percentage \| [100%NDR, [10/10/10, 1/2/3]] \| +| | ... +| | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams} +| | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency} +| | ... +| | ${framesize}= | Get Frame Size | ${framesize} +| | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams} +| | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9) +| | Set Test Message | FINAL_RATE: ${rate_total} pps +| | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes +| | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged) +| | ... | append=yes +| | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes +| | :FOR | ${lat} | IN | @{latency} +| | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes +| | Set Test Message +| | ... | ${\n}LOSS_ACCEPTANCE: ${loss_acceptance} ${loss_acceptance_type} +| | ... | append=yes + +| Measure latency pps +| | [Documentation] +| | ... | Send traffic at specified rate. Measure min/avg/max latency +| | ... +| | ... | *Arguments:* +| | ... | - duration - Duration of traffic run [s]. Type: integer +| | ... | - rate - Rate for sending packets. Type: integer +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - topology_type - Topology type. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Measure latency \| 10 \| 4.0 \| 64 \| 3-node-IPv4 \| +| | ... +| | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type} +| | ... +| | Return From Keyword If | ${rate} <= 10000 | ${-1} +| | ${ret}= | Is DPDK performance test +| | Run Keyword If | ${ret}==${FALSE} | Clear all counters on all DUTs +| | Send traffic on tg | ${duration} | ${rate}pps | ${framesize} +| | ... | ${topology_type} | warmup_time=0 +| | Run Keyword If | ${ret}==${FALSE} | Show statistics on all DUTs +| | Run keyword and return | Get latency + +| Traffic should pass with no loss +| | [Documentation] +| | ... | Send traffic at specified rate. No packet loss is accepted at loss +| | ... | evaluation. +| | ... +| | ... | *Arguments:* +| | ... | - duration - Duration of traffic run [s]. Type: integer +| | ... | - rate - Rate for sending packets. Type: string +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - topology_type - Topology type. Type: string +| | ... | - fail_on_loss - If True, the keyword fails if loss occurred. +| | ... | Type: boolean +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Traffic should pass with no loss \| 10 \| 4.0mpps \| 64 \ +| | ... | \| 3-node-IPv4 \| +| | ... +| | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type} +| | ... | ${fail_on_loss}=${True} +| | ... +| | Clear and show runtime counters with running traffic | ${duration} +| | ... | ${rate} | ${framesize} | ${topology_type} +| | ${ret}= | Is DPDK performance test +| | Run Keyword If | ${ret}==${FALSE} | Clear all counters on all DUTs +| | Send traffic on tg | ${duration} | ${rate} | ${framesize} +| | ... | ${topology_type} | warmup_time=0 +| | Run Keyword If | ${ret}==${FALSE} | Show statistics on all DUTs +| | Run Keyword If | ${fail_on_loss} | No traffic loss occurred + +| Traffic should pass with partial loss +| | [Documentation] +| | ... | Send traffic at specified rate. Partial packet loss is accepted +| | ... | within loss acceptance value specified as argument. +| | ... +| | ... | *Arguments:* +| | ... | - duration - Duration of traffic run [s]. Type: integer +| | ... | - rate - Rate for sending packets. Type: string +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - topology_type - Topology type. Type: string +| | ... | - loss_acceptance - Accepted loss during search. Type: float +| | ... | - loss_acceptance_type - Percentage or frames. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \ +| | ... | \| 3-node-IPv4 \| 0.5 \| percentage \| +| | ... +| | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type} +| | ... | ${loss_acceptance} | ${loss_acceptance_type} +| | ... | ${fail_on_loss}=${True} +| | ... +| | Clear and show runtime counters with running traffic | ${duration} +| | ... | ${rate} | ${framesize} | ${topology_type} +| | ${ret}= | Is DPDK performance test +| | Run Keyword If | ${ret}==${FALSE} | Clear all counters on all DUTs +| | Send traffic on tg | ${duration} | ${rate} | ${framesize} +| | ... | ${topology_type} | warmup_time=0 +| | Run Keyword If | ${ret}==${FALSE} | Show statistics on all DUTs +| | Run Keyword If | ${fail_on_loss} | Partial traffic loss accepted +| | ... | ${loss_acceptance} | ${loss_acceptance_type} + +| Clear and show runtime counters with running traffic +| | [Documentation] +| | ... | Start traffic at specified rate then clear runtime counters on all +| | ... | DUTs. Wait for specified amount of time and capture runtime counters +| | ... | on all DUTs. Finally stop traffic +| | ... +| | ... | *Arguments:* +| | ... | - duration - Duration of traffic run [s]. Type: integer +| | ... | - rate - Rate for sending packets. Type: string +| | ... | - framesize - L2 Frame Size [B]. Type: integer +| | ... | - topology_type - Topology type. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \ +| | ... | \| 3-node-IPv4 \| 0.5 \| percentage \| +| | ... +| | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type} +| | ... +| | Send traffic on tg | -1 | ${rate} | ${framesize} | ${topology_type} +| | ... | warmup_time=0 | async_call=${True} | latency=${False} +| | ${ret}= | Is DPDK performance test +| | Run Keyword If | ${ret}==${FALSE} | Clear runtime counters on all DUTs +| | Sleep | ${duration} +| | Run Keyword If | ${ret}==${FALSE} | Show runtime counters on all DUTs +| | Stop traffic on tg diff --git a/resources/libraries/robot/performance_configuration.robot b/resources/libraries/robot/performance_configuration.robot deleted file mode 100644 index 1141c34be4..0000000000 --- a/resources/libraries/robot/performance_configuration.robot +++ /dev/null @@ -1,1597 +0,0 @@ -# Copyright (c) 2017 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 | Collections -| Library | resources.libraries.python.topology.Topology -| Library | resources.libraries.python.NodePath -| Library | resources.libraries.python.DpdkUtil -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.VhostUser -| Library | resources.libraries.python.TrafficGenerator -| Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl -| Resource | resources/libraries/robot/default.robot -| Resource | resources/libraries/robot/interfaces.robot -| Resource | resources/libraries/robot/counters.robot -| Resource | resources/libraries/robot/bridge_domain.robot -| Resource | resources/libraries/robot/l2_xconnect.robot -| Resource | resources/libraries/robot/ipv4.robot -| Resource | resources/libraries/robot/ipv6.robot -| Resource | resources/libraries/robot/qemu.robot -| Resource | resources/libraries/robot/tagging.robot -| Documentation | Performance suite keywords - configuration. - -*** Keywords *** -| Set interfaces in path in 2-node circular topology up -| | [Documentation] -| | ... | *Set UP state on VPP interfaces in path on nodes in 2-node circular -| | ... | topology.* -| | ... -| | Set Interface State | ${dut1} | ${dut1_if1} | up -| | Set Interface State | ${dut1} | ${dut1_if2} | up -| | Vpp Node Interfaces Ready Wait | ${dut1} - -| Set interfaces in path in 3-node circular topology up -| | [Documentation] -| | ... | *Set UP state on VPP interfaces in path on nodes in 3-node circular -| | ... | topology.* -| | ... -| | Set Interface State | ${dut1} | ${dut1_if1} | up -| | Set Interface State | ${dut1} | ${dut1_if2} | up -| | Set Interface State | ${dut2} | ${dut2_if1} | up -| | Set Interface State | ${dut2} | ${dut2_if2} | up -| | Vpp Node Interfaces Ready Wait | ${dut1} -| | Vpp Node Interfaces Ready Wait | ${dut2} - -| Initialize IPSec in 3-node circular topology -| | [Documentation] -| | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular -| | ... | topology. Get the interface MAC addresses and setup ARP on all VPP -| | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG and -| | ... | DUT1-DUT2 links. Set routing for encrypted traffic on both DUT nodes -| | ... | with prefix /8 and next hop of neighbour DUT or TG interface IPv4 -| | ... | address. -| | ... -| | VPP Show Crypto Device Mapping | ${dut1} -| | VPP Show Crypto Device Mapping | ${dut2} -| | Set interfaces in path in 3-node circular topology up -| | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut1_if1_mac}= | Get Interface MAC | ${dut1} | ${dut1_if1} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | ${dut2_if2_mac}= | Get Interface MAC | ${dut2} | ${dut2_if2} -| | Set Interface State | ${dut1} | ${dut1_if1} | up -| | Set Interface State | ${dut1} | ${dut1_if2} | up -| | Set Interface State | ${dut2} | ${dut2_if1} | up -| | Set Interface State | ${dut2} | ${dut2_if2} | up -| | Set Test Variable | ${tg_if1_mac} -| | Set Test Variable | ${tg_if2_mac} -| | Set Test Variable | ${dut1_if1_mac} -| | Set Test Variable | ${dut1_if2_mac} -| | Set Test Variable | ${dut2_if1_mac} -| | Set Test Variable | ${dut2_if2_mac} -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} -| | ... | ${dut1_if1_ip4} | 24 -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} -| | ... | ${dut1_if2_ip4} | 24 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} -| | ... | ${dut2_if1_ip4} | 24 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} -| | ... | ${dut2_if2_ip4} | 24 -| | Add arp on dut | ${dut1} | ${dut1_if1} | ${tg_if1_ip4} | ${tg_if1_mac} -| | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_if1_ip4} | ${dut2_if1_mac} -| | Add arp on dut | ${dut2} | ${dut2_if2} | ${tg_if2_ip4} | ${tg_if2_mac} -| | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_if2_ip4} | ${dut1_if2_mac} -| | Vpp Route Add | ${dut1} | ${laddr_ip4} | 8 | ${tg_if1_ip4} | ${dut1_if1} -| | Vpp Route Add | ${dut2} | ${raddr_ip4} | 8 | ${tg_if2_ip4} | ${dut2_if2} - -| Initialize IPv4 forwarding in 3-node circular topology -| | [Documentation] -| | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular -| | ... | topology. Get the interface MAC addresses and setup ARP on all VPP -| | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG links and -| | ... | /30 prefix on DUT1-DUT2 link. Set routing on both DUT nodes with -| | ... | prefix /24 and next hop of neighbour DUT interface IPv4 address. -| | ... -| | Set Interface State | ${dut1} | ${dut1_if1} | up -| | Set Interface State | ${dut1} | ${dut1_if2} | up -| | Set Interface State | ${dut2} | ${dut2_if1} | up -| | Set Interface State | ${dut2} | ${dut2_if2} | up -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | dut1_v4.set_arp | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac} -| | dut1_v4.set_arp | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac} -| | dut2_v4.set_arp | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac} -| | dut2_v4.set_arp | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac} -| | dut1_v4.set_ip | ${dut1_if1} | 10.10.10.1 | 24 -| | dut1_v4.set_ip | ${dut1_if2} | 1.1.1.1 | 30 -| | dut2_v4.set_ip | ${dut2_if1} | 1.1.1.2 | 30 -| | dut2_v4.set_ip | ${dut2_if2} | 20.20.20.1 | 24 -| | dut1_v4.set_route | 20.20.20.0 | 24 | 1.1.1.2 | ${dut1_if2} -| | dut2_v4.set_route | 10.10.10.0 | 24 | 1.1.1.1 | ${dut2_if1} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize IPv4 forwarding in 2-node circular topology -| | [Documentation] -| | ... | Set UP state on VPP interfaces in path on nodes in 2-node circular -| | ... | topology. Get the interface MAC addresses and setup ARP on all VPP -| | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG links and -| | ... | /30 prefix on DUT1 link. Set routing on DUT node with prefix /24 and -| | ... | next hop of neighbour DUT interface IPv4 address. -| | ... -| | Set Interface State | ${dut1} | ${dut1_if1} | up -| | Set Interface State | ${dut1} | ${dut1_if2} | up -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | dut1_v4.set_arp | ${dut1_if1} | 10.10.10.3 | ${tg1_if1_mac} -| | dut1_v4.set_arp | ${dut1_if2} | 20.20.20.3 | ${tg1_if2_mac} -| | dut1_v4.set_ip | ${dut1_if1} | 10.10.10.2 | 24 -| | dut1_v4.set_ip | ${dut1_if2} | 20.20.20.2 | 24 -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize IPv4 forwarding with scaling in 3-node circular topology -| | [Documentation] -| | ... | Custom setup of IPv4 topology with scalability of ip routes on all -| | ... | DUT nodes in 3-node circular topology -| | ... -| | ... | *Arguments:* -| | ... | - ${count} - IP route count. Type: integer -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Initialize IPv4 forwarding with scaling in 3-node circular \ -| | ... | topology \| 100000 \| -| | ... -| | [Arguments] | ${count} -| | ... -| | Set Interface State | ${dut1} | ${dut1_if1} | up -| | Set Interface State | ${dut1} | ${dut1_if2} | up -| | Set Interface State | ${dut2} | ${dut2_if1} | up -| | Set Interface State | ${dut2} | ${dut2_if2} | up -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac} -| | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac} -| | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac} -| | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.1 | ${tg1_if2_mac} -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30 -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.2 | 30 -| | Vpp Route Add | ${dut1} | 10.0.0.0 | 32 | 1.1.1.1 | ${dut1_if1} -| | ... | count=${count} -| | Vpp Route Add | ${dut1} | 20.0.0.0 | 32 | 2.2.2.2 | ${dut1_if2} -| | ... | count=${count} -| | Vpp Route Add | ${dut2} | 10.0.0.0 | 32 | 2.2.2.1 | ${dut2_if1} -| | ... | count=${count} -| | Vpp Route Add | ${dut2} | 20.0.0.0 | 32 | 3.3.3.1 | ${dut2_if2} -| | ... | count=${count} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize IPv4 forwarding with vhost in 3-node circular topology -| | [Documentation] -| | ... | Create vhost-user interfaces in VPP. Set UP state of all VPP -| | ... | interfaces in path on nodes in 3-node circular topology. Create 2 -| | ... | FIB tables on each DUT with multipath routing. Assign pair of -| | ... | Physical and Virtual interfaces on both nodes to each FIB table. -| | ... | Setup IPv4 addresses with /30 prefix on DUT-TG links and /30 prefix -| | ... | on DUT1-DUT2 link. Set routing on all DUT nodes in all FIB tables -| | ... | with prefix /24 and next hop of neighbour IPv4 address. Setup -| | ... | ARP on all VPP interfaces. -| | ... -| | ... | *Arguments:* -| | ... | - sock1 - Sock path for first Vhost-User interface. Type: string -| | ... | - sock2 - Sock path for second Vhost-User interface. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| IPv4 forwarding with vhost initialized in a 3-node circular \ -| | ... | topology \| /tmp/sock1 \| /tmp/sock2 \| -| | ... -| | [Arguments] | ${sock1} | ${sock2} -| | ... -| | Set interfaces in path in 3-node circular topology up -| | Configure vhost interfaces for L2BD forwarding | ${dut1} -| | ... | ${sock1} | ${sock2} -| | ${dut1_vif1}= | Set Variable | ${vhost_if1} -| | ${dut1_vif2}= | Set Variable | ${vhost_if2} -| | Set Interface State | ${dut1} | ${dut1_vif1} | up -| | Set Interface State | ${dut1} | ${dut1_vif2} | up -| | Configure vhost interfaces for L2BD forwarding | ${dut2} -| | ... | ${sock1} | ${sock2} -| | ${dut2_vif1}= | Set Variable | ${vhost_if1} -| | ${dut2_vif2}= | Set Variable | ${vhost_if2} -| | Set Interface State | ${dut2} | ${dut2_vif1} | up -| | Set Interface State | ${dut2} | ${dut2_vif2} | up -| | ${dut1_vif1_idx}= | Get Interface SW Index | ${dut1} | ${dut1_vif1} -| | ${dut1_vif2_idx}= | Get Interface SW Index | ${dut1} | ${dut1_vif2} -| | ${dut1_if1_idx}= | Get Interface SW Index | ${dut1} | ${dut1_if1} -| | ${dut1_if2_idx}= | Get Interface SW Index | ${dut1} | ${dut1_if2} -| | ${dut2_vif1_idx}= | Get Interface SW Index | ${dut2} | ${dut2_vif1} -| | ${dut2_vif2_idx}= | Get Interface SW Index | ${dut2} | ${dut2_vif2} -| | ${dut2_if1_idx}= | Get Interface SW Index | ${dut2} | ${dut2_if1} -| | ${dut2_if2_idx}= | Get Interface SW Index | ${dut2} | ${dut2_if2} -| | Add fib table | ${dut1} | 20.20.20.0 | 24 | ${fib_table_1} -| | ... | via 4.4.4.2 sw_if_index ${dut1_vif1_idx} multipath -| | Add fib table | ${dut1} | 10.10.10.0 | 24 | ${fib_table_1} -| | ... | via 1.1.1.2 sw_if_index ${dut1_if1_idx} multipath -| | Add fib table | ${dut1} | 20.20.20.0 | 24 | ${fib_table_2} -| | ... | via 2.2.2.2 sw_if_index ${dut1_if2_idx} multipath -| | Add fib table | ${dut1} | 10.10.10.0 | 24 | ${fib_table_2} -| | ... | via 5.5.5.2 sw_if_index ${dut1_vif2_idx} multipath -| | Add fib table | ${dut2} | 10.10.10.0 | 24 | ${fib_table_1} -| | ... | via 2.2.2.1 sw_if_index ${dut2_if1_idx} multipath -| | Add fib table | ${dut2} | 20.20.20.0 | 24 | ${fib_table_1} -| | ... | via 4.4.4.1 sw_if_index ${dut2_vif1_idx} multipath -| | Add fib table | ${dut2} | 10.10.10.0 | 24 | ${fib_table_2} -| | ... | via 5.5.5.2 sw_if_index ${dut2_vif2_idx} multipath -| | Add fib table | ${dut2} | 20.20.20.0 | 24 | ${fib_table_2} -| | ... | via 3.3.3.2 sw_if_index ${dut2_if2_idx} multipath -| | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1} -| | Assign Interface To Fib Table | ${dut1} | ${dut1_vif1} | ${fib_table_1} -| | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2} -| | Assign Interface To Fib Table | ${dut1} | ${dut1_vif2} | ${fib_table_2} -| | Assign Interface To Fib Table | ${dut2} | ${dut2_if1} | ${fib_table_1} -| | Assign Interface To Fib Table | ${dut2} | ${dut2_vif1} | ${fib_table_1} -| | Assign Interface To Fib Table | ${dut2} | ${dut2_if2} | ${fib_table_2} -| | Assign Interface To Fib Table | ${dut2} | ${dut2_vif2} | ${fib_table_2} -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30 -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30 -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_vif1} | 4.4.4.1 | 30 -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_vif2} | 5.5.5.1 | 30 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.1 | 30 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_vif1} | 4.4.4.1 | 30 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_vif2} | 5.5.5.1 | 30 -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | ${dut1_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut1} -| | ... | ${dut1_vif1_idx} -| | ${dut1_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut1} -| | ... | ${dut1_vif2_idx} -| | ${dut2_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut2} -| | ... | ${dut2_vif1_idx} -| | ${dut2_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut2} -| | ... | ${dut2_vif2_idx} -| | Set Test Variable | ${dut1_vif1_mac} -| | Set Test Variable | ${dut1_vif2_mac} -| | Set Test Variable | ${dut2_vif1_mac} -| | Set Test Variable | ${dut2_vif2_mac} -| | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac} -| | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac} -| | Add arp on dut | ${dut1} | ${dut1_vif1} | 4.4.4.2 | 52:54:00:00:04:01 -| | Add arp on dut | ${dut1} | ${dut1_vif2} | 5.5.5.2 | 52:54:00:00:04:02 -| | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac} -| | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.2 | ${tg1_if2_mac} -| | Add arp on dut | ${dut2} | ${dut2_vif1} | 4.4.4.2 | 52:54:00:00:04:01 -| | Add arp on dut | ${dut2} | ${dut2_vif2} | 5.5.5.2 | 52:54:00:00:04:02 -| | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 4.4.4.2 | ${dut1_vif1} -| | ... | vrf=${fib_table_1} -| | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | 1.1.1.1 | ${dut1_if1} -| | ... | vrf=${fib_table_1} -| | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 2.2.2.2 | ${dut1_if2} -| | ... | vrf=${fib_table_2} -| | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | 5.5.5.2 | ${dut1_vif2} -| | ... | vrf=${fib_table_2} -| | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | 4.4.4.2 | ${dut2_vif1} -| | ... | vrf=${fib_table_1} -| | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 2.2.2.1 | ${dut2_if1} -| | ... | vrf=${fib_table_1} -| | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | 3.3.3.2 | ${dut2_if2} -| | ... | vrf=${fib_table_2} -| | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 5.5.5.2 | ${dut2_vif2} -| | ... | vrf=${fib_table_2} - -| Initialize IPv4 forwarding with vhost for '${nr}' VMs in 3-node circular topology -| | [Documentation] -| | ... | Create pairs of Vhost-User interfaces for defined number of VMs on all -| | ... | VPP nodes. Set UP state of all VPP interfaces in path. Create ${nr}+1 -| | ... | FIB tables on each DUT with multipath routing. Assign each Virtual -| | ... | interface to FIB table with Physical interface or Virtual interface on -| | ... | both nodes. Setup IPv4 addresses with /30 prefix on DUT-TG links and -| | ... | /30 prefix on DUT1-DUT2 link. Set routing on all DUT nodes in all FIB -| | ... | tables with prefix /24 and next hop of neighbour IPv4 address. Setup -| | ... | ARP on all VPP interfaces. -| | ... -| | ... | *Arguments:* -| | ... | _None_ -| | ... -| | ... | *Note:* -| | ... | Socket paths for VM are defined in following format: -| | ... | - /tmp/sock-${VM_ID}-1 -| | ... | - /tmp/sock-${VM_ID}-2 -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| IPv4 forwarding with Vhost-User for '2' VMs initialized in \ -| | ... | a 3-node circular topology \| -| | ... -| | Set interfaces in path in 3-node circular topology up -| | ${fib_table_1}= | Set Variable | ${101} -| | ${fib_table_2}= | Evaluate | ${fib_table_1}+${nr} -| | ${dut1_if1_idx}= | Get Interface SW Index | ${dut1} | ${dut1_if1} -| | ${dut1_if2_idx}= | Get Interface SW Index | ${dut1} | ${dut1_if2} -| | Add fib table | ${dut1} | 10.10.10.0 | 24 | ${fib_table_1} -| | ... | via 1.1.1.2 sw_if_index ${dut1_if1_idx} multipath -| | Add fib table | ${dut1} | 20.20.20.0 | 24 | ${fib_table_2} -| | ... | via 2.2.2.2 sw_if_index ${dut1_if2_idx} multipath -| | ${dut2_if1_idx}= | Get Interface SW Index | ${dut2} | ${dut2_if1} -| | ${dut2_if2_idx}= | Get Interface SW Index | ${dut2} | ${dut2_if2} -| | Add fib table | ${dut2} | 10.10.10.0 | 24 | ${fib_table_1} -| | ... | via 2.2.2.1 sw_if_index ${dut2_if1_idx} multipath -| | Add fib table | ${dut2} | 20.20.20.0 | 24 | ${fib_table_2} -| | ... | via 3.3.3.2 sw_if_index ${dut2_if2_idx} multipath -| | Assign Interface To Fib Table | ${dut1} | ${dut1_if1} | ${fib_table_1} -| | Assign Interface To Fib Table | ${dut1} | ${dut1_if2} | ${fib_table_2} -| | Assign Interface To Fib Table | ${dut2} | ${dut2_if1} | ${fib_table_1} -| | Assign Interface To Fib Table | ${dut2} | ${dut2_if2} | ${fib_table_2} -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 1.1.1.2 | 30 -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 2.2.2.1 | 30 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 2.2.2.2 | 30 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 3.3.3.1 | 30 -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | Add arp on dut | ${dut1} | ${dut1_if1} | 1.1.1.1 | ${tg1_if1_mac} -| | Add arp on dut | ${dut1} | ${dut1_if2} | 2.2.2.2 | ${dut2_if1_mac} -| | Add arp on dut | ${dut2} | ${dut2_if1} | 2.2.2.1 | ${dut1_if2_mac} -| | Add arp on dut | ${dut2} | ${dut2_if2} | 3.3.3.2 | ${tg1_if2_mac} -| | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | 1.1.1.1 | ${dut1_if1} -| | ... | vrf=${fib_table_1} -| | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | 2.2.2.2 | ${dut1_if2} -| | ... | vrf=${fib_table_2} -| | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | 2.2.2.1 | ${dut2_if1} -| | ... | vrf=${fib_table_1} -| | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | 3.3.3.2 | ${dut2_if2} -| | ... | vrf=${fib_table_2} -| | ${ip_base_start}= | Set Variable | ${4} -| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 -| | | ${sock1}= | Set Variable | /tmp/sock-${number}-1 -| | | ${sock2}= | Set Variable | /tmp/sock-${number}-2 -| | | ${fib_table_1}= | Evaluate | ${100}+${number} -| | | ${fib_table_2}= | Evaluate | ${fib_table_1}+${1} -| | | ${ip_base_vif1}= | Evaluate | ${ip_base_start}+(${number}-1)*2 -| | | ${ip_base_vif2}= | Evaluate | ${ip_base_vif1}+1 -| | | ${ip_net_vif1}= | Set Variable -| | | ... | ${ip_base_vif1}.${ip_base_vif1}.${ip_base_vif1} -| | | ${ip_net_vif2}= | Set Variable -| | | ... | ${ip_base_vif2}.${ip_base_vif2}.${ip_base_vif2} -| | | Configure vhost interfaces for L2BD forwarding | ${dut1} -| | | ... | ${sock1} | ${sock2} | 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 -| | | ${dut1_vif1_idx}= | Get Interface SW Index | ${dut1} -| | | ... | ${dut1-vhost-${number}-if1} -| | | ${dut1_vif2_idx}= | Get Interface SW Index | ${dut1} -| | | ... | ${dut1-vhost-${number}-if2} -| | | Configure vhost interfaces for L2BD forwarding | ${dut2} -| | | ... | ${sock1} | ${sock2} | dut2-vhost-${number}-if1 -| | | ... | dut2-vhost-${number}-if2 -| | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if1} | up -| | | Set Interface State | ${dut2} | ${dut2-vhost-${number}-if2} | up -| | | ${dut2_vif1_idx}= | Get Interface SW Index | ${dut2} -| | | ... | ${dut2-vhost-${number}-if1} -| | | ${dut2_vif2_idx}= | Get Interface SW Index | ${dut2} -| | | ... | ${dut2-vhost-${number}-if2} -| | | Add fib table | ${dut1} | 20.20.20.0 | 24 | ${fib_table_1} -| | | ... | via ${ip_net_vif1}.1 sw_if_index ${dut1_vif1_idx} multipath -| | | Add fib table | ${dut1} | 10.10.10.0 | 24 | ${fib_table_2} -| | | ... | via ${ip_net_vif2}.2 sw_if_index ${dut1_vif2_idx} multipath -| | | Add fib table | ${dut2} | 20.20.20.0 | 24 | ${fib_table_1} -| | | ... | via ${ip_net_vif1}.1 sw_if_index ${dut2_vif1_idx} multipath -| | | Add fib table | ${dut2} | 10.10.10.0 | 24 | ${fib_table_2} -| | | ... | via ${ip_net_vif2}.2 sw_if_index ${dut2_vif2_idx} multipath -| | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if1} -| | | ... | ${fib_table_1} -| | | Assign Interface To Fib Table | ${dut1} | ${dut1-vhost-${number}-if2} -| | | ... | ${fib_table_2} -| | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if1} -| | | ... | ${fib_table_1} -| | | Assign Interface To Fib Table | ${dut2} | ${dut2-vhost-${number}-if2} -| | | ... | ${fib_table_2} -| | | Configure IP addresses on interfaces -| | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30 -| | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30 -| | | ... | ${dut2} | ${dut2-vhost-${number}-if1} | ${ip_net_vif1}.1 | 30 -| | | ... | ${dut2} | ${dut2-vhost-${number}-if2} | ${ip_net_vif2}.1 | 30 -| | | ${dut1_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut1} -| | | ... | ${dut1_vif1_idx} -| | | ${dut1_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut1} -| | | ... | ${dut1_vif2_idx} -| | | ${dut2_vif1_mac}= | Get Vhost User Mac By Sw Index | ${dut2} -| | | ... | ${dut2_vif1_idx} -| | | ${dut2_vif2_mac}= | Get Vhost User Mac By Sw Index | ${dut2} -| | | ... | ${dut2_vif2_idx} -| | | Set Test Variable | ${dut1-vhost-${number}-if1_mac} -| | | ... | ${dut1_vif1_mac} -| | | Set Test Variable | ${dut1-vhost-${number}-if2_mac} -| | | ... | ${dut1_vif2_mac} -| | | Set Test Variable | ${dut2-vhost-${number}-if1_mac} -| | | ... | ${dut2_vif1_mac} -| | | Set Test Variable | ${dut2-vhost-${number}-if2_mac} -| | | ... | ${dut2_vif2_mac} -| | | ${qemu_id}= | Set Variable If | ${number} < 10 | 0${number} -| | | ... | ${number} -| | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if1} -| | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01 -| | | Add arp on dut | ${dut1} | ${dut1-vhost-${number}-if2} -| | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02 -| | | Add arp on dut | ${dut2} | ${dut2-vhost-${number}-if1} -| | | ... | ${ip_net_vif1}.2 | 52:54:00:00:${qemu_id}:01 -| | | Add arp on dut | ${dut2} | ${dut2-vhost-${number}-if2} -| | | ... | ${ip_net_vif2}.2 | 52:54:00:00:${qemu_id}:02 -| | | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | ${ip_net_vif1}.2 -| | | ... | ${dut1-vhost-${number}-if1} | vrf=${fib_table_1} -| | | Vpp Route Add | ${dut1} | 10.10.10.0 | 24 | ${ip_net_vif2}.2 -| | | ... | ${dut1-vhost-${number}-if2} | vrf=${fib_table_2} -| | | Vpp Route Add | ${dut2} | 20.20.20.0 | 24 | ${ip_net_vif1}.2 -| | | ... | ${dut2-vhost-${number}-if1} | vrf=${fib_table_1} -| | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | ${ip_net_vif2}.2 -| | | ... | ${dut2-vhost-${number}-if2} | vrf=${fib_table_2} - -| Initialize IPv4 policer 2r3c-${t} in 3-node circular topology -| | [Documentation] -| | ... | Setup of 2r3c color-aware or color-blind policer with dst ip match -| | ... | on all DUT nodes in 3-node circular topology. Policer is applied on -| | ... | links TG - DUT1 and DUT2 - TG. -| | ... -| | ${dscp}= | DSCP AF22 -| | Policer Set Name | policer1 -| | Policer Set CIR | ${cir} -| | Policer Set EIR | ${eir} -| | Policer Set CB | ${cb} -| | Policer Set EB | ${eb} -| | Policer Set Rate Type pps -| | Policer Set Round Type Closest -| | Policer Set Type 2R3C 2698 -| | Policer Set Conform Action Transmit -| | Policer Set Exceed Action Mark and Transmit | ${dscp} -| | Policer Set Violate Action Transmit -| | Policer Enable Color Aware -| | Run Keyword If | ${t} == 'ca' | Policer Enable Color Aware -| | Policer Classify Set Precolor Exceed -| | Policer Set Node | ${dut1} -| | Policer Classify Set Interface | ${dut1_if1} -| | Policer Classify Set Match IP | 20.20.20.2 | ${False} -| | Policer Set Configuration -| | Policer Set Node | ${dut2} -| | Policer Classify Set Interface | ${dut2_if2} -| | Policer Classify Set Match IP | 10.10.10.2 | ${False} -| | Policer Set Configuration - -| Initialize IPv6 forwarding in 3-node circular topology -| | [Documentation] -| | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular -| | ... | topology. Get the interface MAC addresses and setup neighbour on all -| | ... | VPP interfaces. Setup IPv6 addresses with /128 prefixes on all -| | ... | interfaces. Set routing on both DUT nodes with prefix /64 and -| | ... | next hop of neighbour DUT interface IPv6 address. -| | ... -| | ${prefix}= | Set Variable | 64 -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:1::1 | ${prefix} -| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:3::1 | ${prefix} -| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:3::2 | ${prefix} -| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:2::1 | ${prefix} -| | Suppress ICMPv6 router advertisement message | ${nodes} -| | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac} -| | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac} -| | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:3::2 | ${dut2_if1_mac} -| | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:3::1 | ${dut1_if2_mac} -| | Vpp Route Add | ${dut1} | 2001:2::0 | ${prefix} | 2001:3::2 | ${dut1_if2} -| | Vpp Route Add | ${dut2} | 2001:1::0 | ${prefix} | 2001:3::1 | ${dut2_if1} - -| Initialize IPv6 forwarding with scaling in 3-node circular topology -| | [Documentation] -| | ... | Custom setup of IPv6 topology with scalability of ip routes on all -| | ... | DUT nodes in 3-node circular topology -| | ... -| | ... | *Arguments:* -| | ... | - ${count} - IP route count. Type: integer -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Initialize IPv6 forwarding with scaling in 3-node circular \ -| | ... | topology \| 100000 \| -| | ... -| | [Arguments] | ${count} -| | ... -| | ${subn_prefix}= | Set Variable | 64 -| | ${host_prefix}= | Set Variable | 128 -| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | 2001:3::1 | ${subn_prefix} -| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | 2001:4::1 | ${subn_prefix} -| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | 2001:4::2 | ${subn_prefix} -| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | 2001:5::1 | ${subn_prefix} -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | Suppress ICMPv6 router advertisement message | ${nodes} -| | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:3::2 | ${tg1_if1_mac} -| | Add Ip Neighbor | ${dut1} | ${dut1_if2} | 2001:4::2 | ${dut2_if1_mac} -| | Add Ip Neighbor | ${dut2} | ${dut2_if1} | 2001:4::1 | ${dut1_if2_mac} -| | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:5::2 | ${tg1_if2_mac} -| | Vpp Route Add | ${dut1} | 2001:2::0 | ${host_prefix} | 2001:4::2 -| | ... | interface=${dut1_if2} | count=${count} -| | Vpp Route Add | ${dut1} | 2001:1::0 | ${host_prefix} | 2001:3::2 -| | ... | interface=${dut1_if1} | count=${count} -| | Vpp Route Add | ${dut2} | 2001:1::0 | ${host_prefix} | 2001:4::1 -| | ... | interface=${dut2_if1} | count=${count} -| | Vpp Route Add | ${dut2} | 2001:2::0 | ${host_prefix} | 2001:5::2 -| | ... | interface=${dut2_if2} | count=${count} - -| Initialize IPv6 iAcl whitelist in 3-node circular topology -| | [Documentation] -| | ... | Creates classify L3 table on DUTs. IPv6 iAcl security whitelist -| | ... | ingress /64 filter entries applied on links TG - DUT1 and DUT2 - TG. -| | ... -| | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3 -| | ... | ${dut1} | ip6 | dst -| | And Vpp Configures Classify Session L3 -| | ... | ${dut1} | permit | ${table_idx} | ${skip_n} | ${match_n} -| | ... | ip6 | dst | 2001:2::2 -| | And Vpp Enable Input Acl Interface -| | ... | ${dut1} | ${dut1_if1} | ip6 | ${table_idx} -| | ${table_idx} | ${skip_n} | ${match_n}= | And Vpp Creates Classify Table L3 -| | ... | ${dut2} | ip6 | dst -| | And Vpp Configures Classify Session L3 -| | ... | ${dut2} | permit | ${table_idx} | ${skip_n} | ${match_n} -| | ... | ip6 | dst | 2001:1::2 -| | And Vpp Enable Input Acl Interface -| | ... | ${dut2} | ${dut2_if2} | ip6 | ${table_idx} - -| Initialize L2 xconnect in 3-node circular topology -| | [Documentation] -| | ... | Setup L2 xconnect topology by cross connecting two interfaces on -| | ... | each DUT. Interfaces are brought up. -| | ... | -| | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_if2} -| | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize L2 xconnect with VXLANoIPv4 in 3-node circular topology -| | [Documentation] -| | ... | Setup L2 xconnect topology with VXLANoIPv4 by cross connecting -| | ... | physical and vxlan interfaces on each DUT. All interfaces are brought -| | ... | up. IPv4 addresses with prefix /24 are configured on interfaces -| | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as -| | ... | interfaces. -| | ... -| | Set interfaces in path in 3-node circular topology up -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1 | 24 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2 | 24 -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac} -| | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac} -| | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24 -| | ... | 172.16.0.1 | 172.16.0.2 -| | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1s_vxlan} -| | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24 -| | ... | 172.16.0.2 | 172.16.0.1 -| | Configure L2XC | ${dut2} | ${dut2_if2} | ${dut2s_vxlan} - -| Initialize L2 xconnect with Vhost-User in 3-node circular topology -| | [Documentation] -| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Cross -| | ... | connect each Vhost interface with one physical interface. -| | ... -| | ... | *Arguments:* -| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string -| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| L2 xconnect with Vhost-User initialized in a 3-node \ -| | ... | circular topology \| /tmp/sock1 \| /tmp/sock2 \| -| | ... -| | [Arguments] | ${sock1} | ${sock2} -| | ... -| | Configure vhost interfaces for L2BD forwarding | ${dut1} -| | ... | ${sock1} | ${sock2} -| | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1} -| | Configure L2XC | ${dut1} | ${dut1_if2} | ${vhost_if2} -| | Configure vhost interfaces for L2BD forwarding | ${dut2} -| | ... | ${sock1} | ${sock2} -| | Configure L2XC | ${dut2} | ${dut2_if1} | ${vhost_if1} -| | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize L2 xconnect with Vhost-User for '${nr}' in 3-node circular topology -| | [Documentation] -| | ... | Create pairs of Vhost-User interfaces on all defined VPP nodes. Cross -| | ... | connect each Vhost interface with one physical interface or virtual -| | ... | interface to create a chain accross DUT node. -| | ... -| | ... | *Arguments:* -| | ... | _None_ -| | ... -| | ... | *Note:* -| | ... | Socket paths for VM are defined in following format: -| | ... | - /tmp/sock-${VM_ID}-1 -| | ... | - /tmp/sock-${VM_ID}-2 -| | ... -| | ... | *Example:* -| | ... -| | ... | \| L2 xconnect with Vhost-User for '2' initialized in a 3-node \ -| | ... | circular topology \| -| | ... -| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 -| | | ${sock1}= | Set Variable | /tmp/sock-${number}-1 -| | | ${sock2}= | Set Variable | /tmp/sock-${number}-2 -| | | ${prev_index}= | Evaluate | ${number}-1 -| | | Configure vhost interfaces for L2BD forwarding | ${dut1} -| | | ... | ${sock1} | ${sock2} | dut1-vhost-${number}-if1 -| | | ... | dut1-vhost-${number}-if2 -| | | ${dut1_xconnect_if1}= | Set Variable If | ${number}==1 | ${dut1_if1} -| | | ... | ${dut1-vhost-${prev_index}-if2} -| | | Configure L2XC | ${dut1} | ${dut1_xconnect_if1} -| | | ... | ${dut1-vhost-${number}-if1} -| | | Configure vhost interfaces for L2BD forwarding | ${dut2} -| | | ... | ${sock1} | ${sock2} | dut2-vhost-${number}-if1 -| | | ... | dut2-vhost-${number}-if2 -| | | ${dut2_xconnect_if1}= | Set Variable If | ${number}==1 | ${dut2_if1} -| | | ... | ${dut2-vhost-${prev_index}-if2} -| | | Configure L2XC | ${dut2} | ${dut2_xconnect_if1} -| | | ... | ${dut2-vhost-${number}-if1} -| | | Run Keyword If | ${number}==${nr} | Configure L2XC -| | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | ${dut1_if2} -| | | Run Keyword If | ${number}==${nr} | Configure L2XC -| | | ... | ${dut2} | ${dut2-vhost-${number}-if2} | ${dut2_if2} - -| Initialize L2 xconnect with Vhost-User and VLAN in 3-node circular topology -| | [Documentation] -| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Cross -| | ... | connect each Vhost interface with one physical interface. -| | ... | Setup VLAN between DUTs. All interfaces are brought up. -| | ... -| | ... | *Arguments:* -| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string -| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string -| | ... | - subid - ID of the sub-interface to be created. Type: string -| | ... | - tag_rewrite - Method of tag rewrite. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| L2 xconnect with Vhost-User and VLAN initialized in a 3-node\ -| | ... | circular topology \| /tmp/sock1 \| /tmp/sock2 \| 10 \| pop-1 \| -| | ... -| | [Arguments] | ${sock1} | ${sock2} | ${subid} | ${tag_rewrite} -| | ... -| | Set interfaces in path in 3-node circular topology up -| | Initialize VLAN dot1q sub-interfaces in 3-node circular topology -| | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid} -| | Configure L2 tag rewrite method on interfaces -| | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2} -| | ... | ${tag_rewrite} -| | Configure vhost interfaces for L2BD forwarding | ${dut1} -| | ... | ${sock1} | ${sock2} -| | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1} -| | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2} -| | Configure vhost interfaces for L2BD forwarding | ${dut2} -| | ... | ${sock1} | ${sock2} -| | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1} -| | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize L2 bridge domain in 3-node circular topology -| | [Documentation] -| | ... | Setup L2 DB topology by adding two interfaces on each DUT into BD -| | ... | that is created automatically with index 1. Learning is enabled. -| | ... | Interfaces are brought up. -| | ... -| | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2} -| | Configure L2BD forwarding | ${dut2} | ${dut2_if1} | ${dut2_if2} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize L2 bridge domains with Vhost-User in 3-node circular topology -| | [Documentation] -| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each -| | ... | Vhost-User interface into L2 bridge domains with learning enabled -| | ... | with physical inteface. -| | ... -| | ... | *Arguments:* -| | ... | - bd_id1 - Bridge domain ID. Type: integer -| | ... | - bd_id2 - Bridge domain ID. Type: integer -| | ... | - sock1 - Sock path for first Vhost-User interface. Type: string -| | ... | - sock2 - Sock path for second Vhost-User interface. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| L2 bridge domains with Vhost-User initialized in a 3-node \ -| | ... | circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \| -| | ... -| | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} -| | ... -| | Configure vhost interfaces for L2BD forwarding | ${dut1} -| | ... | ${sock1} | ${sock2} -| | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id2} -| | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2} -| | Configure vhost interfaces for L2BD forwarding | ${dut2} -| | ... | ${sock1} | ${sock2} -| | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2} -| | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize L2 bridge domains with Vhost-User for '${nr}' VMs in 3-node circular topology -| | [Documentation] -| | ... | Create pairs of Vhost-User interfaces for defined number of VMs on all -| | ... | defined VPP nodes. Add each Vhost-User interface into L2 bridge -| | ... | domains with learning enabled with physical inteface or Vhost-User -| | ... | interface of another VM. -| | ... -| | ... | *Arguments:* -| | ... | _None_ -| | ... -| | ... | *Note:* -| | ... | Socket paths for VM are defined in following format: -| | ... | - /tmp/sock-${VM_ID}-1 -| | ... | - /tmp/sock-${VM_ID}-2 -| | ... -| | ... | *Example:* -| | ... -| | ... | \| L2 bridge domains with Vhost-User for '2' VMs initialized in \ -| | ... | a 3-node circular topology \| -| | ... -| | ${bd_id2}= | Evaluate | ${nr}+1 -| | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${1} -| | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id2} -| | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${1} -| | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2} -| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 -| | | ${sock1}= | Set Variable | /tmp/sock-${number}-1 -| | | ${sock2}= | Set Variable | /tmp/sock-${number}-2 -| | | Configure vhost interfaces for L2BD forwarding | ${dut1} -| | | ... | ${sock1} | ${sock2} | dut1-vhost-${number}-if1 -| | | ... | dut1-vhost-${number}-if2 -| | | ${bd_id2}= | Evaluate | ${number}+1 -| | | Add interface to bridge domain | ${dut1} -| | | ... | ${dut1-vhost-${number}-if1} | ${number} -| | | Add interface to bridge domain | ${dut1} -| | | ... | ${dut1-vhost-${number}-if2} | ${bd_id2} -| | | Configure vhost interfaces for L2BD forwarding | ${dut2} -| | | ... | ${sock1} | ${sock2} | dut2-vhost-${number}-if1 -| | | ... | dut2-vhost-${number}-if2 -| | | Add interface to bridge domain | ${dut2} -| | | ... | ${dut2-vhost-${number}-if1} | ${number} -| | | Add interface to bridge domain | ${dut2} -| | | ... | ${dut2-vhost-${number}-if2} | ${bd_id2} - -| Initialize L2 bridge domain with VXLANoIPv4 in 3-node circular topology -| | [Documentation] -| | ... | Setup L2 bridge domain topology with VXLANoIPv4 by connecting -| | ... | physical and vxlan interfaces on each DUT. All interfaces are brought -| | ... | up. IPv4 addresses with prefix /24 are configured on interfaces -| | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as -| | ... | interfaces. -| | ... -| | Set interfaces in path in 3-node circular topology up -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1 -| | ... | 24 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2 -| | ... | 24 -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | Add arp on dut | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac} -| | Add arp on dut | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac} -| | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24 -| | ... | 172.16.0.1 | 172.16.0.2 -| | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24 -| | ... | 172.16.0.2 | 172.16.0.1 -| | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1s_vxlan} -| | Configure L2BD forwarding | ${dut2} | ${dut2_if2} | ${dut2s_vxlan} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize L2 bridge domains with Vhost-User and VXLANoIPv4 in 3-node circular topology -| | [Documentation] -| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each -| | ... | Vhost-User interface into L2 bridge domains with learning enabled -| | ... | with physical inteface. -| | ... | Setup VXLANoIPv4 between DUTs by connecting physical and vxlan -| | ... | interfaces on each DUT. All interfaces are brought up. -| | ... | IPv4 addresses with prefix /24 are configured on interfaces between -| | ... | DUTs. VXLAN sub-interfaces has same IPv4 address as interfaces. -| | ... -| | ... | *Arguments:* -| | ... | - bd_id1 - Bridge domain ID. Type: integer -| | ... | - bd_id2 - Bridge domain ID. Type: integer -| | ... | - sock1 - Sock path for first Vhost-User interface. Type: string -| | ... | - sock2 - Sock path for second Vhost-User interface. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| L2 bridge domains with Vhost-User and VXLANoIPv4 initialized in a\ -| | ... | 3-node circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \| -| | ... -| | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} -| | ... -| | Set interfaces in path in 3-node circular topology up -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 172.16.0.1 -| | ... | 24 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 172.16.0.2 -| | ... | 24 -| | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24 -| | ... | 172.16.0.1 | 172.16.0.2 -| | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24 -| | ... | 172.16.0.2 | 172.16.0.1 -| | Configure vhost interfaces for L2BD forwarding | ${dut1} -| | ... | ${sock1} | ${sock2} -| | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2} -| | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${bd_id2} -| | Configure vhost interfaces for L2BD forwarding | ${dut2} -| | ... | ${sock1} | ${sock2} -| | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${bd_id1} -| | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2} -| | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize L2 bridge domains with Vhost-User in 2-node circular topology -| | [Documentation] -| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each -| | ... | Vhost-User interface into L2 bridge domains with learning enabled -| | ... | with physical inteface. -| | ... -| | ... | *Arguments:* -| | ... | - bd_id1 - Bridge domain ID. Type: integer -| | ... | - bd_id2 - Bridge domain ID. Type: integer -| | ... | - sock1 - Sock path for first Vhost-User interface. Type: string -| | ... | - sock2 - Sock path for second Vhost-User interface. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| L2 bridge domains with Vhost-User initialized in a 2-node \ -| | ... | circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \| -| | ... -| | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} -| | ... -| | Configure vhost interfaces for L2BD forwarding | ${dut1} -| | ... | ${sock1} | ${sock2} -| | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id2} -| | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize L2 bridge domains with Vhost-User and VLAN in a 3-node circular topology -| | [Documentation] -| | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each -| | ... | Vhost-User interface into L2 bridge domains with learning enabled -| | ... | with physical inteface. -| | ... | Setup VLAN between DUTs. All interfaces are brought up. -| | ... -| | ... | *Arguments:* -| | ... | - bd_id1 - Bridge domain ID. Type: integer -| | ... | - bd_id2 - Bridge domain ID. Type: integer -| | ... | - sock1 - Sock path for first Vhost-User interface. Type: string -| | ... | - sock2 - Sock path for second Vhost-User interface. Type: string -| | ... | - subid - ID of the sub-interface to be created. Type: string -| | ... | - tag_rewrite - Method of tag rewrite. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| L2 bridge domains with Vhost-User and VLAN initialized in a 3-node\ -| | ... | circular topology \| 1 \| 2 \| /tmp/sock1 \| /tmp/sock2 \| 10\ -| | ... | pop-1 \| -| | ... -| | [Arguments] | ${bd_id1} | ${bd_id2} | ${sock1} | ${sock2} | ${subid} -| | ... | ${tag_rewrite} -| | ... -| | Set interfaces in path in 3-node circular topology up -| | Initialize VLAN dot1q sub-interfaces in 3-node circular topology -| | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid} -| | Configure L2 tag rewrite method on interfaces -| | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2} -| | ... | ${tag_rewrite} -| | Configure vhost interfaces for L2BD forwarding | ${dut1} -| | ... | ${sock1} | ${sock2} -| | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2} -| | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2} -| | Configure vhost interfaces for L2BD forwarding | ${dut2} -| | ... | ${sock1} | ${sock2} -| | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1} -| | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1} -| | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2} -| | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Add PCI devices to DUTs in 3-node single link topology -| | [Documentation] -| | ... | Add PCI devices to VPP configuration file. -| | ... -| | ${dut1_if1_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if1} -| | ${dut1_if2_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if2} -| | ${dut2_if1_pci}= | Get Interface PCI Addr | ${dut2} | ${dut2_if1} -| | ${dut2_if2_pci}= | Get Interface PCI Addr | ${dut2} | ${dut2_if2} -| | Run keyword | DUT1.Add DPDK Dev | ${dut1_if1_pci} | ${dut1_if2_pci} -| | Run keyword | DUT2.Add DPDK Dev | ${dut2_if1_pci} | ${dut2_if2_pci} - -| Add PCI devices to DUTs in 2-node single link topology -| | [Documentation] -| | ... | Add PCI devices to VPP configuration file. -| | ... -| | ${dut1_if1_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if1} -| | ${dut1_if2_pci}= | Get Interface PCI Addr | ${dut1} | ${dut1_if2} -| | Run keyword | DUT1.Add DPDK Dev | ${dut1_if1_pci} | ${dut1_if2_pci} - -| Configure guest VM with dpdk-testpmd connected via vhost-user -| | [Documentation] -| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting -| | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd -| | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4, -| | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss, -| | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is io. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary -| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string -| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string -| | ... | - vm_name - QemuUtil instance name. Type: string -| | ... | - skip - Number of cpus which will be skipped. Type: integer -| | ... | - count - Number of cpus which will be allocated for qemu. -| | ... | Type: integer -| | ... | - qemu_id - Qemu Id when starting more then one guest VM on DUT node. -| | ... | Type: integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure guest VM with dpdk-testpmd connected via vhost-user \ -| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \| ${6} \ -| | ... | \| ${5} \| -| | ... | \| Configure guest VM with dpdk-testpmd connected via vhost-user \ -| | ... | \| ${nodes['DUT1']} \| /tmp/sock-2-1 \| /tmp/sock-2-2 \| DUT1_VM2 \ -| | ... | \| qemu_id=${2} \| -| | ... -| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6} -| | ... | ${count}=${5} | ${qemu_id}=${1} -| | ... -| | Import Library | resources.libraries.python.QemuUtils | qemu_id=${qemu_id} -| | ... | WITH NAME | ${vm_name} -| | ${serial_port}= | Evaluate | ${qemu_id} + ${4555} -| | Run keyword | ${vm_name}.Qemu Set Serial Port | ${serial_port} -| | ${ssh_fwd_port}= | Evaluate | ${qemu_id} + ${10021} -| | Run keyword | ${vm_name}.Qemu Set Ssh Fwd Port | ${ssh_fwd_port} -| | ${dut_numa}= | Get interfaces numa node | ${dut_node} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${skip_cnt}= | Evaluate | ${skip} + (${qemu_id} - 1) * ${count} -| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} -| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${count} | smt_used=${False} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} -| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} -| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} -| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} -| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 -| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 -| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} -| | ${vm}= | Run keyword | ${vm_name}.Qemu Start -| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} -| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f | eal_mem_channels=4 -| | ... | pmd_fwd_mode=io | pmd_disable_hw_vlan=${True} -| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz} -| | Return From Keyword | ${vm} - -| Configure '${nr}' guest VMs with dpdk-testpmd connected via vhost-user in 3-node circular topology -| | [Documentation] -| | ... | Start QEMU guests with two vhost-user interfaces and interconnecting -| | ... | DPDK testpmd for defined number of VMs on all defined VPP nodes. -| | ... -| | ... | *Arguments:* -| | ... | _None_ -| | ... -| | ... | _NOTE:_ This KW expects following test case variables to be set: -| | ... | - ${system_cpus} - Number of CPUs allocated for OS itself. -| | ... | - ${vpp_cpus} - Number of CPUs allocated for VPP. -| | ... | - ${vm_cpus} - Number of CPUs to be allocated per QEMU instance. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| '2' Configure guest VM with dpdk-testpmd connected via vhost-user \ -| | ... | in a 3-node circular topology \| -| | ... -| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 -| | | ${sock1}= | Set Variable | /tmp/sock-${number}-1 -| | | ${sock2}= | Set Variable | /tmp/sock-${number}-2 -| | | ${skip_cpus}= | Evaluate | ${vpp_cpus}+${system_cpus} -| | | ${vm1}= | Configure guest VM with dpdk-testpmd connected via vhost-user -| | | ... | ${dut1} | ${sock1} | ${sock2} | DUT1_VM${number} -| | | ... | skip=${skip_cpus} | count=${vm_cpus} | qemu_id=${number} -| | | Set To Dictionary | ${dut1_vm_refs} | DUT1_VM${number} | ${vm1} -| | | ${vm2}= | Configure guest VM with dpdk-testpmd connected via vhost-user -| | | ... | ${dut2} | ${sock1} | ${sock2} | DUT2_VM${number} -| | | ... | skip=${skip_cpus} | count=${vm_cpus} | qemu_id=${number} -| | | Set To Dictionary | ${dut2_vm_refs} | DUT2_VM${number} | ${vm2} - -| Configure guest VM with dpdk-testpmd using SMT connected via vhost-user -| | [Documentation] -| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting -| | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd -| | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4, -| | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss, -| | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is io. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary -| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string -| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string -| | ... | - vm_name - QemuUtil instance name. Type: string -| | ... | - skip - number of cpus which will be skipped. Type: int -| | ... | - count - number of cpus which will be allocated for qemu. Type: int -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Guest VM with dpdk-testpmd using SMT connected via vhost-user is \ -| | ... | setup \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \ -| | ... | \| ${6} \| ${5} \| -| | ... -| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6} -| | ... | ${count}=${5} -| | ... -| | Import Library | resources.libraries.python.QemuUtils -| | ... | WITH NAME | ${vm_name} -| | ${dut_numa}= | Get interfaces numa node | ${dut_node} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} -| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} -| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} -| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} -| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} -| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 -| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 -| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} -| | ${vm}= | Run keyword | ${vm_name}.Qemu Start -| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} -| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f | eal_mem_channels=4 -| | ... | pmd_fwd_mode=io | pmd_disable_hw_vlan=${True} -| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz} -| | Return From Keyword | ${vm} - -| Configure guest VM with dpdk-testpmd-mac connected via vhost-user -| | [Documentation] -| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting -| | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd -| | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4, -| | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss, -| | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is mac rewrite. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary -| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string -| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string -| | ... | - vm_name - QemuUtil instance name. Type: string -| | ... | - eth0_mac - MAC address of first Vhost interface. Type: string -| | ... | - eth1_mac - MAC address of second Vhost interface. Type: string -| | ... | - skip - number of cpus which will be skipped. Type: integer -| | ... | - count - number of cpus which will be allocated for qemu. -| | ... | Type: integer -| | ... | - qemu_id - Qemu Id when starting more then one guest VM on DUT node. -| | ... | Type: integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Guest VM with dpdk-testpmd for Vhost L2BD forwarding is setup \ -| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \ -| | ... | \| 00:00:00:00:00:01 \| 00:00:00:00:00:02 \| ${6} \| ${5} \| -| | ... | \| Guest VM with dpdk-testpmd for Vhost L2BD forwarding is setup \ -| | ... | \| ${nodes['DUT1']} \| /tmp/sock-2-1 \| /tmp/sock-2-2 \| DUT1_VM2 \ -| | ... | \| 00:00:00:00:02:01 \| 00:00:00:00:02:02 \| ${6} \| ${5} \ -| | ... | \| qemu_id=${2} \| -| | ... -| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} -| | ... | ${eth0_mac} | ${eth1_mac} | ${skip}=${6} | ${count}=${5} -| | ... | ${qemu_id}=${1} -| | ... -| | Import Library | resources.libraries.python.QemuUtils | qemu_id=${qemu_id} -| | ... | WITH NAME | ${vm_name} -| | ${serial_port}= | Evaluate | ${qemu_id} + ${4555} -| | Run keyword | ${vm_name}.Qemu Set Serial Port | ${serial_port} -| | ${ssh_fwd_port}= | Evaluate | ${qemu_id} + ${10021} -| | Run keyword | ${vm_name}.Qemu Set Ssh Fwd Port | ${ssh_fwd_port} -| | ${dut_numa}= | Get interfaces numa node | ${dut_node} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${skip_cnt}= | Evaluate | ${skip} + (${qemu_id} - 1) * ${count} -| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} -| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${count} | smt_used=${False} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} -| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} -| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} -| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} -| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 -| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 -| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} -| | ${vm}= | Run keyword | ${vm_name}.Qemu Start -| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} -| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f -| | ... | eal_mem_channels=4 | pmd_fwd_mode=mac | pmd_eth_peer_0=0,${eth0_mac} -| | ... | pmd_eth_peer_1=1,${eth1_mac} | pmd_disable_hw_vlan=${True} -| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz} -| | Return From Keyword | ${vm} - -| Configure '${nr}' guest VMs with dpdk-testpmd-mac connected via vhost-user in 3-node circular topology -| | [Documentation] -| | ... | Start QEMU guests with two vhost-user interfaces and interconnecting -| | ... | DPDK testpmd with fwd mode set to mac rewrite for defined number of -| | ... | VMs on all defined VPP nodes. -| | ... -| | ... | *Arguments:* -| | ... | _None_ -| | ... -| | ... | _NOTE:_ This KW expects following test case variables to be set: -| | ... | - ${system_cpus} - Number of CPUs allocated for OS itself. -| | ... | - ${vpp_cpus} - Number of CPUs allocated for VPP. -| | ... | - ${vm_cpus} - Number of CPUs to be allocated per QEMU instance. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| '2' Guest VMs with dpdk-testpmd-mac connected via vhost-user is \ -| | ... | setup in a 3-node circular topology \| -| | ... -| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 -| | | ${sock1}= | Set Variable | /tmp/sock-${number}-1 -| | | ${sock2}= | Set Variable | /tmp/sock-${number}-2 -| | | ${skip_cpus}= | Evaluate | ${vpp_cpus}+${system_cpus} -| | | ${vm1}= -| | | ... | Configure guest VM with dpdk-testpmd-mac connected via vhost-user -| | | ... | ${dut1} | ${sock1} | ${sock2} | DUT1_VM${number} -| | | ... | ${dut1-vhost-${number}-if1_mac} -| | | ... | ${dut1-vhost-${number}-if2_mac} | skip=${skip_cpus} -| | | ... | count=${vm_cpus} | qemu_id=${number} -| | | Set To Dictionary | ${dut1_vm_refs} | DUT1_VM${number} | ${vm1} -| | | ${vm2}= -| | | ... | Configure guest VM with dpdk-testpmd-mac connected via vhost-user -| | | ... | ${dut2} | ${sock1} | ${sock2} | DUT2_VM${number} -| | | ... | ${dut2-vhost-${number}-if1_mac} -| | | ... | ${dut2-vhost-${number}-if2_mac} | skip=${skip_cpus} -| | | ... | count=${vm_cpus} | qemu_id=${number} -| | | Set To Dictionary | ${dut2_vm_refs} | DUT2_VM${number} | ${vm2} - -| Configure guest VM with dpdk-testpmd-mac using SMT connected via vhost-user -| | [Documentation] -| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting -| | ... | DPDK testpmd. Qemu Guest uses by default 5 cores and 2048M. Testpmd -| | ... | uses 5 cores (1 main core and 4 cores dedicated to io) mem-channel=4, -| | ... | txq/rxq=256, burst=64, disable-hw-vlan, disable-rss, -| | ... | driver usr/lib/librte_pmd_virtio.so and fwd mode is mac rewrite. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary -| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string -| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string -| | ... | - vm_name - QemuUtil instance name. Type: string -| | ... | - eth0_mac - MAC address of first Vhost interface. Type: string -| | ... | - eth1_mac - MAC address of second Vhost interface. Type: string -| | ... | - skip - number of cpus which will be skipped. Type: int -| | ... | - count - number of cpus which will be allocated for qemu. Type: int -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure guest VM with dpdk-testpmd-mac using SMT connected via \ -| | ... | vhost-user \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM\ -| | ... | \| 00:00:00:00:00:01 \| 00:00:00:00:00:02 \| ${6} \| ${5} \| -| | ... -| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} -| | ... | ${eth0_mac} | ${eth1_mac} | ${skip}=${6} | ${count}=${5} -| | ... -| | Import Library | resources.libraries.python.QemuUtils -| | ... | WITH NAME | ${vm_name} -| | ${dut_numa}= | Get interfaces numa node | ${dut_node} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} -| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} -| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} -| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} -| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} -| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 -| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 -| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} -| | ${vm}= | Run keyword | ${vm_name}.Qemu Start -| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} -| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f -| | ... | eal_mem_channels=4 | pmd_fwd_mode=mac | pmd_eth_peer_0=0,${eth0_mac} -| | ... | pmd_eth_peer_1=1,${eth1_mac} | pmd_disable_hw_vlan=${True} -| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz} -| | Return From Keyword | ${vm} - -| Configure guest VM with linux bridge connected via vhost-user -| | [Documentation] -| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting -| | ... | linux bridge. Qemu Guest uses 2048M. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary -| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string -| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string -| | ... | - vm_name - QemuUtil instance name. Type: string -| | ... | - skip - number of cpus which will be skipped. Type: int -| | ... | - count - number of cpus which will be allocated for qemu. Type: int -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure guest VM with linux bridge connected via vhost-user \ -| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \| ${6} \ -| | ... | \| ${5} \| -| | ... -| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6} -| | ... | ${count}=${5} -| | ... -| | Import Library | resources.libraries.python.QemuUtils -| | ... | WITH NAME | ${vm_name} -| | ${dut_numa}= | Get interfaces numa node | ${dut_node} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} -| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${False} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} -| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} -| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} -| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} -| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 -| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 -| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} -| | ${vm}= | Run keyword | ${vm_name}.Qemu Start -| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} -| | ${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 -| | Return From Keyword | ${vm} - -| Configure guest VM with linux bridge using SMT connected via vhost-user -| | [Documentation] -| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting -| | ... | linux bridge. Qemu Guest uses 2048M. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - DUT node to start guest VM on. Type: dictionary -| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string -| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string -| | ... | - vm_name - QemuUtil instance name. Type: string -| | ... | - skip - number of cpus which will be skipped. Type: int -| | ... | - count - number of cpus which will be allocated for qemu. Type: int -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Guest VM with Linux Bridge using SMT connected via vhost-user is \ -| | ... | setup \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \ -| | ... | \| ${6}\| ${5} \| -| | ... -| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vm_name} | ${skip}=${6} -| | ... | ${count}=${5} -| | ... -| | Import Library | resources.libraries.python.QemuUtils -| | ... | WITH NAME | ${vm_name} -| | ${dut_numa}= | Get interfaces numa node | ${dut_node} -| | ... | ${dut1_if1} | ${dut1_if2} -| | ${qemu_cpus}= | Cpu slice of list per node | ${dut_node} | ${dut_numa} -| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1} -| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2} -| | Run Keyword | ${vm_name}.Build QEMU | ${dut_node} | apply_patch=${True} -| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin} -| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node} -| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1 -| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048 -| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image} -| | ${vm}= | Run keyword | ${vm_name}.Qemu Start -| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus} -| | ${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 -| | Return From Keyword | ${vm} - -| 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. -| | ... -| | ... | *Arguments:* -| | ... | -${dut1_dut2_address} - Ip address from DUT1 to DUT2. Type: string -| | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string -| | ... | -${dut2_dut1_address} - Ip address from DUT2 to DUT1. Type: string -| | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string -| | ... | -${duts_prefix} - ip prefix. Type: int -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Initialize LISP IPv4 forwarding in 3-node circular topology \ -| | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \ -| | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \| -| | ... -| | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address} -| | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${duts_prefix} -| | ... -| | Set Interface State | ${dut1} | ${dut1_if1} | up -| | Set Interface State | ${dut1} | ${dut1_if2} | up -| | Set Interface State | ${dut2} | ${dut2_if1} | up -| | Set Interface State | ${dut2} | ${dut2_if2} | up -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac} -| | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_address} -| | ... | ${dut2_if1_mac} -| | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_address} -| | ... | ${dut1_if2_mac} -| | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac} -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} -| | ... | ${dut1_tg_address} | ${duts_prefix} -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} -| | ... | ${dut1_dut2_address} | ${duts_prefix} -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} -| | ... | ${dut2_dut1_address} | ${duts_prefix} -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} -| | ... | ${dut2_tg_address} | ${duts_prefix} -| | All Vpp Interfaces Ready Wait | ${nodes} - -| Initialize LISP GPE IPv4 over IPsec in 3-node circular topology -| | [Documentation] | Setup Lisp GPE IPv4 forwarding over IPsec. -| | ... -| | ... | *Arguments:* -| | ... | -${encr_alg} - Encryption algorithm. Type: string -| | ... | -${auth_alg} - Authentication algorithm. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Initialize LISP GPE IPv4 over IPsec in 3-node circular topology\ -| | ... | \| ${encr_alg} \| ${auth_alg} -| | ... -| | [Arguments] | ${encr_alg} | ${auth_alg} -| | ... -| | Generate keys for IPSec | ${encr_alg} | ${auth_alg} -| | Initialize LISP IPv4 forwarding in 3-node circular topology -| | ... | ${dut1_to_dut2_ip4} | ${dut1_to_tg_ip4} | ${dut2_to_dut1_ip4} -| | ... | ${dut2_to_tg_ip4} | ${prefix4} -| | Configure LISP GPE topology in 3-node circular topology -| | ... | ${dut1} | ${dut1_if2} | ${NONE} -| | ... | ${dut2} | ${dut2_if1} | ${NONE} -| | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid} -| | ... | ${dut1_ip4_static_adjacency} | ${dut2_ip4_static_adjacency} -| | Configure manual keyed connection for IPSec -| | ... | ${dut1} | ${dut1_if2} | ${encr_alg} | ${encr_key} -| | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi} -| | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4} -| | Configure manual keyed connection for IPSec -| | ... | ${dut2} | ${dut2_if1} | ${encr_alg} | ${encr_key} -| | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi} -| | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4} - -| Initialize LISP IPv6 forwarding in 3-node circular topology -| | [Documentation] | Custom setup of IPv6 topology on all DUT nodes \ -| | ... | Don`t set route. -| | ... -| | ... | *Arguments:* -| | ... | -${dut1_dut2_address} - Ip address from DUT1 to DUT2. Type: string -| | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string -| | ... | -${dut2_dut1_address} - Ip address from DUT2 to DUT1. Type: string -| | ... | -${dut1_tg_address} - Ip address from DUT1 to tg. Type: string -| | ... | -${duts_prefix} - ip prefix. Type: int -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Initialize LISP IPv6 forwarding in 3-node circular topology \ -| | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \ -| | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \| -| | ... -| | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address} -| | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${prefix} -| | ... -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_address} -| | ... | ${prefix} -| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_address} -| | ... | ${prefix} -| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_address} -| | ... | ${prefix} -| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_address} -| | ... | ${prefix} -| | Suppress ICMPv6 router advertisement message | ${nodes} -| | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac} -| | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac} -| | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_address} -| | ... | ${dut2_if1_mac} -| | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_address} -| | ... | ${dut1_if2_mac} - -| Initialize LISP IPv4 over IPv6 forwarding in 3-node circular topology -| | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \ -| | ... | Don`t set route. -| | ... -| | ... | *Arguments:* -| | ... | - ${dut1_dut2_ip6_address} - IPv6 address from DUT1 to DUT2. -| | ... | Type: string -| | ... | - ${dut1_tg_ip4_address} - IPv4 address from DUT1 to tg. Type: string -| | ... | - ${dut2_dut1_ip6_address} - IPv6 address from DUT2 to DUT1. -| | ... | Type: string -| | ... | - ${dut1_tg_ip4_address} - IPv4 address from DUT1 to tg. Type: string -| | ... | - ${prefix4} - IPv4 prefix. Type: int -| | ... | - ${prefix6} - IPv6 prefix. Type: int -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Lisp IPv4 over IPv6 forwarding initialized in a 3-node circular \ -| | ... | topology \| ${dut1_dut2_ip6_address} \| ${dut1_tg_ip4_address} \ -| | ... | \| ${dut2_dut1_ip6_address} \| ${dut2_tg_ip4_address} \ -| | ... | \| ${prefix4} \| ${prefix6} \| -| | ... -| | [Arguments] | ${dut1_dut2_ip6_address} | ${dut1_tg_ip4_address} -| | ... | ${dut2_dut1_ip6_address} | ${dut2_tg_ip4_address} -| | ... | ${prefix4} | ${prefix6} -| | ... -| | Set Interface State | ${dut1} | ${dut1_if1} | up -| | Set Interface State | ${dut1} | ${dut1_if2} | up -| | Set Interface State | ${dut2} | ${dut2_if1} | up -| | Set Interface State | ${dut2} | ${dut2_if2} | up -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} -| | ... | ${dut1_tg_ip4_address} | ${prefix4} -| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if2} | ${dut1_dut2_ip6_address} -| | ... | ${prefix6} -| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if1} | ${dut2_dut1_ip6_address} -| | ... | ${prefix6} -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} -| | ... | ${dut2_tg_ip4_address} | ${prefix4} -| | Suppress ICMPv6 router advertisement message | ${nodes} -| | Add arp on dut | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac} -| | Add arp on dut | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac} -| | Add Ip Neighbor | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip6_address} -| | ... | ${dut2_if1_mac} -| | Add Ip Neighbor | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip6_address} -| | ... | ${dut1_if2_mac} - -| Initialize LISP IPv6 over IPv4 forwarding in 3-node circular topology -| | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \ -| | ... | Don`t set route. -| | ... -| | ... | *Arguments:* -| | ... | - ${dut1_dut2_ip4_address} - IPv4 address from DUT1 to DUT2. -| | ... | Type: string -| | ... | - ${dut1_tg_ip6_address} - IPv6 address from DUT1 to tg. Type: string -| | ... | - ${dut2_dut1_ip4_address} - IPv4 address from DUT2 to DUT1. -| | ... | Type: string -| | ... | - ${dut1_tg_ip6_address} - IPv6 address from DUT1 to tg. Type: string -| | ... | - ${prefix4} - IPv4 prefix. Type: int -| | ... | - ${prefix6} - IPv6 prefix. Type: int -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... | \| Lisp IPv6 over IPv4 forwarding initialized in a 3-node circular \ -| | ... | topology \| ${dut1_dut2_ip4_address} \| ${dut1_tg_ip6_address} \ -| | ... | \| ${dut2_dut1_ip4_address} \| ${dut2_tg_ip6_address} \ -| | ... | \| ${prefix6} \| ${prefix4} \| -| | ... -| | [Arguments] | ${dut1_dut2_ip4_address} | ${dut1_tg_ip6_address} -| | ... | ${dut2_dut1_ip4_address} | ${dut2_tg_ip6_address} -| | ... | ${prefix6} | ${prefix4} -| | ... -| | Set Interface State | ${dut1} | ${dut1_if1} | up -| | Set Interface State | ${dut1} | ${dut1_if2} | up -| | Set Interface State | ${dut2} | ${dut2_if1} | up -| | Set Interface State | ${dut2} | ${dut2_if2} | up -| | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | VPP Set If IPv6 Addr | ${dut1} | ${dut1_if1} | ${dut1_tg_ip6_address} -| | ... | ${prefix6} -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} -| | ... | ${dut1_dut2_ip4_address} | ${prefix4} -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} -| | ... | ${dut2_dut1_ip4_address} | ${prefix4} -| | VPP Set If IPv6 Addr | ${dut2} | ${dut2_if2} | ${dut2_tg_ip6_address} -| | ... | ${prefix6} -| | Suppress ICMPv6 router advertisement message | ${nodes} -| | Add Ip Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac} -| | Add Ip Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac} -| | Add arp on dut | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip4_address} -| | ... | ${dut2_if1_mac} -| | Add arp on dut | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip4_address} -| | ... | ${dut1_if2_mac} - -| Initialize SNAT in 3-node circular topology -| | [Documentation] | Initialization of 3-node topology with SNAT between DUTs: -| | ... | - set interfaces up -| | ... | - set IP addresses -| | ... | - set ARP -| | ... | - create routes -| | ... | - set SNAT - only on DUT1 -| | ... -| | Set Interface State | ${dut1} | ${dut1_if1} | up -| | Set Interface State | ${dut1} | ${dut1_if2} | up -| | Set Interface State | ${dut2} | ${dut2_if1} | up -| | Set Interface State | ${dut2} | ${dut2_if2} | up -| | All Vpp Interfaces Ready Wait | ${nodes} -| | ... -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if1} | 10.0.0.1 | 20 -| | Configure IP addresses on interfaces | ${dut1} | ${dut1_if2} | 11.0.0.1 | 20 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if1} | 11.0.0.2 | 20 -| | Configure IP addresses on interfaces | ${dut2} | ${dut2_if2} | 12.0.0.1 | 20 -| | ... -| | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1} -| | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2} -| | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2} -| | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1} -| | ... -| | Add arp on dut | ${dut1} | ${dut1_if1} | 10.0.0.2 | ${tg_if1_mac} -| | Add arp on dut | ${dut1} | ${dut1_if2} | 11.0.0.2 | ${dut2_if1_mac} -| | Add arp on dut | ${dut2} | ${dut2_if1} | 11.0.0.1 | ${dut1_if2_mac} -| | Add arp on dut | ${dut2} | ${dut2_if2} | 12.0.0.2 | ${tg_if2_mac} -| | ... -| | Vpp Route Add | ${dut1} | 12.0.0.2 | 32 | 11.0.0.2 | ${dut1_if2} -| | Vpp Route Add | ${dut1} | 20.0.0.0 | 18 | 10.0.0.2 | ${dut1_if1} -| | Vpp Route Add | ${dut2} | 12.0.0.0 | 24 | 12.0.0.2 | ${dut2_if2} -| | Vpp Route Add | ${dut2} | 200.0.0.0 | 30 | 11.0.0.1 | ${dut2_if1} -| | ... -| | Configure inside and outside interfaces -| | ... | ${dut1} | ${dut1_if1} | ${dut1_if2} -| | Configure deterministic mode for SNAT -| | ... | ${dut1} | 20.0.0.0 | 18 | 200.0.0.0 | 30 diff --git a/resources/libraries/robot/performance_setup.robot b/resources/libraries/robot/performance_setup.robot deleted file mode 100644 index da23ca8196..0000000000 --- a/resources/libraries/robot/performance_setup.robot +++ /dev/null @@ -1,532 +0,0 @@ -# Copyright (c) 2017 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/performance_configuration.robot -| Resource | resources/libraries/robot/performance_utils.robot -| Documentation | Performance suite keywords - Suite and test setups and -| ... | teardowns. - -*** Keywords *** - -# Keywords used in setups and teardowns - -| Set variables in 2-node circular topology -| | [Documentation] -| | ... | Compute path for testing on two given nodes in circular -| | ... | topology and set corresponding suite variables. -| | ... -| | ... | _NOTE:_ This KW sets following suite variables: -| | ... | - tg - TG node -| | ... | - tg_if1 - 1st TG interface towards DUT. -| | ... | - tg_if2 - 2nd TG interface towards DUT. -| | ... | - dut1 - DUT1 node -| | ... | - dut1_if1 - 1st DUT interface towards TG. -| | ... | - dut1_if2 - 2nd DUT interface towards TG. -| | ... -| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} -| | Compute Path | always_same_link=${FALSE} -| | ${tg_if1} | ${tg}= | First Interface -| | ${dut1_if1} | ${dut1}= | First Ingress Interface -| | ${dut1_if2} | ${dut1}= | Last Egress Interface -| | ${tg_if2} | ${tg}= | Last Interface -| | Set Suite Variable | ${tg} -| | Set Suite Variable | ${tg_if1} -| | Set Suite Variable | ${tg_if2} -| | Set Suite Variable | ${dut1} -| | Set Suite Variable | ${dut1_if1} -| | Set Suite Variable | ${dut1_if2} - -| Set variables in 3-node circular topology -| | [Documentation] -| | ... | Compute path for testing on three given nodes in circular -| | ... | topology and set corresponding suite variables. -| | ... -| | ... | _NOTE:_ This KW sets following suite variables: -| | ... | - tg - TG node -| | ... | - tg_if1 - TG interface towards DUT1. -| | ... | - tg_if2 - TG interface towards DUT2. -| | ... | - dut1 - DUT1 node -| | ... | - dut1_if1 - DUT1 interface towards TG. -| | ... | - dut1_if2 - DUT1 interface towards DUT2. -| | ... | - dut2 - DUT2 node -| | ... | - dut2_if1 - DUT2 interface towards DUT1. -| | ... | - dut2_if2 - DUT2 interface towards TG. -| | ... -| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} -| | ... | ${nodes['TG']} -| | Compute Path -| | ${tg_if1} | ${tg}= | Next Interface -| | ${dut1_if1} | ${dut1}= | Next Interface -| | ${dut1_if2} | ${dut1}= | Next Interface -| | ${dut2_if1} | ${dut2}= | Next Interface -| | ${dut2_if2} | ${dut2}= | Next Interface -| | ${tg_if2} | ${tg}= | Next Interface -| | Set Suite Variable | ${tg} -| | Set Suite Variable | ${tg_if1} -| | Set Suite Variable | ${tg_if2} -| | Set Suite Variable | ${dut1} -| | Set Suite Variable | ${dut1_if1} -| | Set Suite Variable | ${dut1_if2} -| | Set Suite Variable | ${dut2} -| | Set Suite Variable | ${dut2_if1} -| | Set Suite Variable | ${dut2_if2} - -| Set variables in 2-node circular topology with DUT interface model -| | [Documentation] -| | ... | Compute path for testing on two given nodes in circular topology -| | ... | based on interface model provided as an argument and set -| | ... | corresponding suite variables. -| | ... -| | ... | *Arguments:* -| | ... | - iface_model - Interface model. Type: string -| | ... -| | ... | _NOTE:_ This KW sets following suite variables: -| | ... | - tg - TG node -| | ... | - tg_if1 - 1st TG interface towards DUT. -| | ... | - tg_if2 - 2nd TG interface towards DUT. -| | ... | - dut1 - DUT1 node -| | ... | - dut1_if1 - 1st DUT interface towards TG. -| | ... | - dut1_if2 - 2nd DUT interface towards TG. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Set variables in 2-node circular topology with DUT interface model\ -| | ... | \| Intel-X520-DA2 \| -| | ... -| | [Arguments] | ${iface_model} -| | ... -| | ${iface_model_list}= | Create list | ${iface_model} -| | Append Node | ${nodes['TG']} -| | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list} -| | Append Node | ${nodes['TG']} -| | Compute Path | always_same_link=${FALSE} -| | ${tg_if1} | ${tg}= | First Interface -| | ${dut1_if1} | ${dut1}= | First Ingress Interface -| | ${dut1_if2} | ${dut1}= | Last Egress Interface -| | ${tg_if2} | ${tg}= | Last Interface -| | Set Suite Variable | ${tg} -| | Set Suite Variable | ${tg_if1} -| | Set Suite Variable | ${tg_if2} -| | Set Suite Variable | ${dut1} -| | Set Suite Variable | ${dut1_if1} -| | Set Suite Variable | ${dut1_if2} - -| Set variables in 3-node circular topology with DUT interface model -| | [Documentation] -| | ... | Compute path for testing on three given nodes in circular topology -| | ... | based on interface model provided as an argument and set -| | ... | corresponding suite variables. -| | ... -| | ... | *Arguments:* -| | ... | - iface_model - Interface model. Type: string -| | ... -| | ... | _NOTE:_ This KW sets following suite variables: -| | ... | - tg - TG node -| | ... | - tg_if1 - TG interface towards DUT1. -| | ... | - tg_if2 - TG interface towards DUT2. -| | ... | - dut1 - DUT1 node -| | ... | - dut1_if1 - DUT1 interface towards TG. -| | ... | - dut1_if2 - DUT1 interface towards DUT2. -| | ... | - dut2 - DUT2 node -| | ... | - dut2_if1 - DUT2 interface towards TG. -| | ... | - dut2_if2 - DUT2 interface towards DUT1. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Set variables in 3-node circular topology with DUT interface model\ -| | ... | \| Intel-X520-DA2 \| -| | ... -| | [Arguments] | ${iface_model} -| | ... -| | ${iface_model_list}= | Create list | ${iface_model} -| | Append Node | ${nodes['TG']} -| | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list} -| | Append Node | ${nodes['DUT2']} | filter_list=${iface_model_list} -| | Append Node | ${nodes['TG']} -| | Compute Path -| | ${tg_if1} | ${tg}= | Next Interface -| | ${dut1_if1} | ${dut1}= | Next Interface -| | ${dut1_if2} | ${dut1}= | Next Interface -| | ${dut2_if1} | ${dut2}= | Next Interface -| | ${dut2_if2} | ${dut2}= | Next Interface -| | ${tg_if2} | ${tg}= | Next Interface -| | Set Suite Variable | ${tg} -| | Set Suite Variable | ${tg_if1} -| | Set Suite Variable | ${tg_if2} -| | Set Suite Variable | ${dut1} -| | Set Suite Variable | ${dut1_if1} -| | Set Suite Variable | ${dut1_if2} -| | Set Suite Variable | ${dut2} -| | Set Suite Variable | ${dut2_if1} -| | Set Suite Variable | ${dut2_if2} - -| Tear down guest VM with dpdk-testpmd -| | [Documentation] -| | ... | Stop all qemu processes with dpdk-testpmd running on ${dut_node}. -| | ... | Argument is dictionary of all qemu nodes running with its names. -| | ... | Dpdk-testpmd is stopped gracefully with printing stats. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - Node where to clean qemu. Type: dictionary -| | ... | - dut_vm_refs - VM references on node. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Tear down guest VM with dpdk-testpmd \| ${node['DUT1']} \ -| | ... | \| ${dut_vm_refs} \| -| | ... -| | [Arguments] | ${dut_node} | ${dut_vm_refs} -| | ${vms_number}= | Get Length | ${dut_vm_refs} -| | ${index}= | Set Variable | ${0} -| | :FOR | ${vm_name} | IN | @{dut_vm_refs} -| | | ${vm}= | Get From Dictionary | ${dut_vm_refs} | ${vm_name} -| | | ${index}= | Evaluate | ${index} + 1 -| | | Dpdk Testpmd Stop | ${vm} -| | | Run Keyword | ${vm_name}.Qemu Set Node | ${dut_node} -| | | Run Keyword | ${vm_name}.Qemu Clear Socks -| | | Run Keyword If | '${index}' == '${vms_number}' | ${vm_name}.Qemu Kill All - -| Tear down guest VM -| | [Documentation] -| | ... | Stop all qemu processes running on ${dut_node}. -| | ... | Argument is dictionary of all qemu nodes running with its names. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - Node where to clean qemu. Type: dictionary -| | ... | - dut_vm_refs - VM references on node. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Tear down guest VM \| ${node['DUT1']} \ -| | ... | \| ${dut_vm_refs} \| -| | ... -| | [Arguments] | ${dut_node} | ${dut_vm_refs} -| | ${vms_number}= | Get Length | ${dut_vm_refs} -| | ${index}= | Set Variable | ${0} -| | :FOR | ${vm_name} | IN | @{dut_vm_refs} -| | | ${vm}= | Get From Dictionary | ${dut_vm_refs} | ${vm_name} -| | | ${index}= | Evaluate | ${index} + 1 -| | | Run Keyword | ${vm_name}.Qemu Set Node | ${dut_node} -| | | Run Keyword | ${vm_name}.Qemu Clear Socks -| | | Run Keyword If | '${index}' == '${vms_number}' | ${vm_name}.Qemu Kill All - -# Suite setups - -| Set up 2-node performance topology with DUT's NIC model -| | [Documentation] -| | ... | Suite preparation phase that setup default startup configuration of -| | ... | VPP on all DUTs. Updates interfaces on all nodes and setup global -| | ... | variables used in test cases based on interface model provided as an -| | ... | argument. Initializes traffic generator. -| | ... -| | ... | *Arguments:* -| | ... | - topology_type - Topology type. Type: string -| | ... | - nic_model - Interface model. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| 2-node Performance Suite Setup \| L2 \| Intel-X520-DA2 \| -| | ... -| | [Arguments] | ${topology_type} | ${nic_model} -| | ... -| | Show vpp version on all DUTs -| | Set variables in 2-node circular topology with DUT interface model -| | ... | ${nic_model} -| | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2} -| | ... | ${dut1} | ${dut1_if1} | ${dut1} | ${dut1_if2} | ${topology_type} - -| Set up 2-node-switched performance topology with DUT's NIC model -| | [Documentation] -| | ... | Suite preparation phase that setup default startup configuration of -| | ... | VPP on all DUTs. Updates interfaces on all nodes and setup global -| | ... | variables used in test cases based on interface model provided as an -| | ... | argument. Initializes traffic generator. -| | ... -| | ... | *Arguments:* -| | ... | - topology_type - Topology type. Type: string -| | ... | - nic_model - Interface model. Type: string -| | ... | - tg_if1_dest_mac - Interface 1 destination MAC address. Type: string -| | ... | - tg_if2_dest_mac - Interface 2 destination MAC address. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| 2-node Performance Suite Setup \| L2 \| Intel-X520-DA2 \ -| | ... | \| 22:22:33:44:55:66 \| 22:22:33:44:55:55 \| -| | ... -| | [Arguments] | ${topology_type} | ${nic_model} | ${tg_if1_dest_mac} -| | ... | ${tg_if2_dest_mac} -| | ... -| | Show vpp version on all DUTs -| | Set variables in 2-node circular topology with DUT interface model -| | ... | ${nic_model} -| | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2} -| | ... | ${dut1} | ${dut1_if1} | ${dut1} | ${dut1_if2} | ${topology_type} -| | ... | ${tg_if1_dest_mac} | ${tg_if2_dest_mac} - -| Set up 3-node performance topology with DUT's NIC model -| | [Documentation] -| | ... | Suite preparation phase that setup default startup configuration of -| | ... | VPP on all DUTs. Updates interfaces on all nodes and setup global -| | ... | variables used in test cases based on interface model provided as an -| | ... | argument. Initializes traffic generator. -| | ... -| | ... | *Arguments:* -| | ... | - topology_type - Topology type. Type: string -| | ... | - nic_model - Interface model. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Set up 3-node performance topology with DUT's NIC model \| L2 \ -| | ... | \| Intel-X520-DA2 \| -| | ... -| | [Arguments] | ${topology_type} | ${nic_model} -| | ... -| | Show vpp version on all DUTs -| | Set variables in 3-node circular topology with DUT interface model -| | ... | ${nic_model} -| | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2} -| | ... | ${dut1} | ${dut1_if1} | ${dut2} | ${dut2_if2} | ${topology_type} - -| Set up DPDK 2-node performance topology with DUT's NIC model -| | [Documentation] -| | ... | Updates interfaces on all nodes and setup global -| | ... | variables used in test cases based on interface model provided as an -| | ... | argument. Initializes traffic generator. Initializes DPDK test -| | ... | environment. -| | ... -| | ... | *Arguments:* -| | ... | - topology_type - Topology type. Type: string -| | ... | - nic_model - Interface model. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Set up DPDK 2-node performance topology with DUT's NIC model \ -| | ... | \| L2 \| Intel-X520-DA2 \| -| | ... -| | [Arguments] | ${topology_type} | ${nic_model} -| | ... -| | Set variables in 2-node circular topology with DUT interface model -| | ... | ${nic_model} -| | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2} -| | ... | ${dut1} | ${dut1_if1} | ${dut1} | ${dut1_if2} | ${topology_type} -| | Initialize DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2} - -| Set up DPDK 3-node performance topology with DUT's NIC model -| | [Documentation] -| | ... | Updates interfaces on all nodes and setup global -| | ... | variables used in test cases based on interface model provided as an -| | ... | argument. Initializes traffic generator. Initializes DPDK test -| | ... | environment. -| | ... -| | ... | *Arguments:* -| | ... | - topology_type - Topology type. Type: string -| | ... | - nic_model - Interface model. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| 3-node Performance Suite Setup \| L2 \| Intel-X520-DA2 \| -| | ... -| | [Arguments] | ${topology_type} | ${nic_model} -| | ... -| | Set variables in 3-node circular topology with DUT interface model -| | ... | ${nic_model} -| | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2} -| | ... | ${dut1} | ${dut1_if1} | ${dut2} | ${dut2_if2} | ${topology_type} -| | Initialize DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2} -| | Initialize DPDK Environment | ${dut2} | ${dut2_if1} | ${dut2_if2} - -| Set up IPSec performance test suite -| | [Documentation] -| | ... | Suite preparation phase that sets default startup configuration of -| | ... | VPP on all DUTs. Updates interfaces on all nodes and sets global -| | ... | variables used in test cases based on interface model provided as an -| | ... | argument. Initializes traffic generator. -| | ... | Then it configures crypto device and kernel module on all DUTs. -| | ... -| | ... | *Arguments:* -| | ... | - topology_type - Topology type. Type: string -| | ... | - nic_model - Interface model. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Set up IPSec performance test suite \| L2 \ -| | ... | \| Intel-X520-DA2 \| -| | ... -| | [Arguments] | ${topology_type} | ${nic_model} -| | ... -| | Set up 3-node performance topology with DUT's NIC model -| | ... | ${topology_type} | ${nic_model} -| | Configure crypto device on all DUTs | force_init=${True} -| | Configure kernel module on all DUTs | igb_uio | force_load=${True} - -# Suite teardowns - -| Tear down 3-node performance topology -| | [Documentation] -| | ... | Suite teardown phase with traffic generator teardown. -| | ... -| | Teardown traffic generator | ${tg} - -| Tear down 2-node performance topology -| | [Documentation] -| | ... | Suite teardown phase with traffic generator teardown. -| | ... -| | Teardown traffic generator | ${tg} - -# Tests setups - -| Set up performance test -| | [Documentation] | Common test setup for performance tests. -| | ... -| | Reset VAT History On All DUTs | ${nodes} -| | Create base startup configuration of VPP on all DUTs - -# Tests teardowns - -| Tear down performance discovery test -| | [Documentation] | Common test teardown for ndrdisc and pdrdisc performance \ -| | ... | tests. -| | ... -| | ... | *Arguments:* -| | ... | - rate - Rate for sending packets. Type: string -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - topology_type - Topology type. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Tear down performance discovery test \| 4.0mpps \| 64 \ -| | ... | \| 3-node-IPv4 \| -| | ... -| | [Arguments] | ${rate} | ${framesize} | ${topology_type} -| | ... -| | Show VAT History On All DUTs | ${nodes} -| | Show statistics on all DUTs -| | Run Keyword If Test Failed -| | ... | Traffic should pass with no loss | ${perf_trial_duration} | ${rate} -| | ... | ${framesize} | ${topology_type} | fail_on_loss=${False} - -| Tear down performance ndrchk test -| | [Documentation] | Common test teardown for ndrchk performance tests. -| | ... -| | Show VAT History On All DUTs | ${nodes} -| | Show statistics on all DUTs - -| Tear down performance pdrchk test -| | [Documentation] | Common test teardown for pdrchk performance tests. -| | ... -| | Show VAT History On All DUTs | ${nodes} -| | Show statistics on all DUTs - -| Tear down performance test with vhost and VM with dpdk-testpmd -| | [Documentation] | Common test teardown for performance tests which use -| | ... | vhost(s) and VM(s) with dpdk-testpmd. -| | ... -| | ... | *Arguments:* -| | ... | - rate - Rate for sending packets. Type: string -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - topology_type - Topology type. Type: string -| | ... | - dut1_node - Node where to clean qemu. Type: dictionary -| | ... | - dut1_vm_refs - VM references on node. Type: dictionary -| | ... | - dut2_node - Node where to clean qemu. Type: dictionary -| | ... | - dut2_vm_refs - VM references on node. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Tear down performance test with vhost and VM with dpdk-testpmd \ -| | ... | \| 4.0mpps \| 64 \| 3-node-IPv4 \| ${node['DUT1']} \| ${dut_vm_refs} \ -| | ... | \| ${node['DUT2']} \| ${dut_vm_refs} \| -| | ... -| | [Arguments] | ${rate} | ${framesize} | ${topology_type} -| | ... | ${dut1_node}=${None} | ${dut1_vm_refs}=${None} -| | ... | ${dut2_node}=${None} | ${dut2_vm_refs}=${None} -| | ... -| | Show VAT History On All DUTs | ${nodes} -| | Show VPP vhost on all DUTs -| | Show statistics on all DUTs -| | Run Keyword If Test Failed -| | ... | Traffic should pass with no loss | ${perf_trial_duration} | ${rate} -| | ... | ${framesize} | ${topology_type} | fail_on_loss=${False} -| | Run keyword unless | ${dut1_node}==${None} -| | ... | Tear down guest VM with dpdk-testpmd | ${dut1} | ${dut1_vm_refs} -| | Run keyword unless | ${dut2_node}==${None} -| | ... | Tear down guest VM with dpdk-testpmd | ${dut2} | ${dut2_vm_refs} - -| Tear down performance pdrchk test with vhost and VM with dpdk-testpmd -| | [Documentation] | Common test teardown for performance pdrchk tests which \ -| | ... | use vhost(s) and VM(s) with dpdk-testpmd. -| | ... -| | ... | *Arguments:* -| | ... | - rate - Rate for sending packets. Type: string -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - topology_type - Topology type. Type: string -| | ... | - dut1_node - Node where to clean qemu. Type: dictionary -| | ... | - dut1_vm_refs - VM references on node. Type: dictionary -| | ... | - dut2_node - Node where to clean qemu. Type: dictionary -| | ... | - dut2_vm_refs - VM references on node. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Tear down performance pdrchk test with vhost and VM with \ -| | ... | dpdk-testpmd \| 4.0mpps \| 64 \| 3-node-IPv4 \| ${node['DUT1']} \ -| | ... | \| ${dut_vm_refs} \| ${node['DUT2']} \| ${dut_vm_refs} \| -| | ... -| | [Arguments] | ${rate} | ${framesize} | ${topology_type} -| | ... | ${dut1_node}=${None} | ${dut1_vm_refs}=${None} -| | ... | ${dut2_node}=${None} | ${dut2_vm_refs}=${None} -| | ... -| | Show VAT History On All DUTs | ${nodes} -| | Show VPP vhost on all DUTs -| | Show statistics on all DUTs -| | Run keyword unless | ${dut1_node}==${None} -| | ... | Tear down guest VM with dpdk-testpmd | ${dut1} | ${dut1_vm_refs} -| | Run keyword unless | ${dut2_node}==${None} -| | ... | Tear down guest VM with dpdk-testpmd | ${dut2} | ${dut2_vm_refs} - -| Tear down DPDK 3-node performance topology -| | [Documentation] -| | ... | Suite teardown phase with traffic generator teardown. -| | ... | Cleanup DPDK test environment. -| | ... -| | Teardown traffic generator | ${tg} -| | Cleanup DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2} -| | Cleanup DPDK Environment | ${dut2} | ${dut2_if1} | ${dut2_if2} - -| Tear down DPDK 2-node performance topology -| | [Documentation] -| | ... | Suite teardown phase with traffic generator teardown. -| | ... | Cleanup DPDK test environment. -| | ... -| | Teardown traffic generator | ${tg} -| | Cleanup DPDK Environment | ${dut1} | ${dut1_if1} | ${dut1_if2} - -| Tear down performance discovery test with SNAT -| | [Documentation] | Common test teardown for ndrdisc and pdrdisc performance \ -| | ... | tests with SNAT feature used. -| | ... -| | ... | *Arguments:* -| | ... | - rate - Rate for sending packets. Type: string -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - topology_type - Topology type. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Tear down performance discovery test with SNAT \| 4.0mpps \| 64 \ -| | ... | \| ${traffic_profile} \| -| | ... -| | [Arguments] | ${rate} | ${framesize} | ${traffic_profile} -| | ... -| | Tear down performance discovery test | ${rate}pps | ${framesize} -| | ... | ${traffic_profile} -| | Show SNAT verbose | ${dut1} -| | Show SNAT verbose | ${dut2} diff --git a/resources/libraries/robot/performance_utils.robot b/resources/libraries/robot/performance_utils.robot deleted file mode 100644 index 76f88b31dd..0000000000 --- a/resources/libraries/robot/performance_utils.robot +++ /dev/null @@ -1,545 +0,0 @@ -# Copyright (c) 2017 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 | Collections -| Library | resources.libraries.python.topology.Topology -| Library | resources.libraries.python.NodePath -| Library | resources.libraries.python.DpdkUtil -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.VhostUser -| Library | resources.libraries.python.TrafficGenerator -| Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl -| Resource | resources/libraries/robot/default.robot -| Resource | resources/libraries/robot/interfaces.robot -| Resource | resources/libraries/robot/counters.robot -| Resource | resources/libraries/robot/bridge_domain.robot -| Resource | resources/libraries/robot/l2_xconnect.robot -| Resource | resources/libraries/robot/ipv4.robot -| Resource | resources/libraries/robot/ipv6.robot -| Resource | resources/libraries/robot/qemu.robot -| Resource | resources/libraries/robot/tagging.robot -| Documentation | Performance suite keywords - utilities to find and verify NDR -| ... | and PDR. - -*** Keywords *** -| Calculate pps -| | [Documentation] -| | ... | Calculate pps for given rate and L2 frame size, -| | ... | additional 20B are added to L2 frame size as padding. -| | ... -| | ... | *Arguments* -| | ... | - bps - Rate in bps. Type: integer -| | ... | - framesize - L2 frame size in Bytes. Type: integer -| | ... -| | ... | *Return* -| | ... | - Calculated pps. Type: integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Calculate pps \| 10000000000 \| 64 \| -| | ... -| | [Arguments] | ${bps} | ${framesize} -| | ... -| | ${framesize}= | Get Frame Size | ${framesize} -| | ${ret}= | Evaluate | (${bps}/((${framesize}+20)*8)).__trunc__() -| | Return From Keyword | ${ret} - -| Get Frame Size -| | [Documentation] -| | ... | Framesize can be either integer in case of a single packet -| | ... | in stream, or set of packets in case of IMIX type or simmilar. -| | ... | This keyword returns average framesize. -| | ... -| | ... | *Arguments:* -| | ... | - framesize - Framesize. Type: integer or string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Get Frame Size \| IMIX_v4_1 \| -| | ... -| | [Arguments] | ${framesize} -| | ... -| | Run Keyword If | '${framesize}' == 'IMIX_v4_1' -| | ... | Return From Keyword | 353.83333 -| | Return From Keyword | ${framesize} - -| Is DPDK performance test -| | [Documentation] -| | ... | Return TRUE if variable DPDK_TEST exist, otherwise FALSE. -| | ${ret} | ${tmp}= | Run Keyword And Ignore Error -| | ... | Variable Should Exist | ${DPDK_TEST} -| | Return From Keyword If | "${ret}" == "PASS" | ${TRUE} -| | Return From Keyword | ${FALSE} - -| Find NDR using linear search and pps -| | [Documentation] -| | ... | Find throughput by using RFC2544 linear search with non drop rate. -| | ... -| | ... | *Arguments:* -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - start_rate - Initial start rate [pps]. Type: float -| | ... | - step_rate - Step of linear search [pps]. Type: float -| | ... | - topology_type - Topology type. Type: string -| | ... | - min_rate - Lower limit of search [pps]. Type: float -| | ... | - max_rate - Upper limit of search [pps]. Type: float -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Find NDR using linear search and pps \| 64 \| 5000000 \ -| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| -| | ... -| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate} -| | ... | ${topology_type} | ${min_rate} | ${max_rate} -| | ... -| | ${duration}= | Set Variable | ${perf_trial_duration} -| | Set Duration | ${duration} -| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} -| | Set Search Linear Step | ${step_rate} -| | Set Search Frame Size | ${framesize} -| | Set Search Rate Type pps -| | Linear Search | ${start_rate} | ${topology_type} -| | ${rate_per_stream} | ${lat}= | Verify Search Result -| | ${tmp}= | Create List | 100%NDR | ${lat} -| | ${latency}= | Create List | ${tmp} -| | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5) -| | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p} -| | ... | ${framesize} | ${topology_type} -| | ${tmp}= | Create List | 50%NDR | ${lat_50p} -| | Append To List | ${latency} | ${tmp} -| | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1) -| | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p} -| | ... | ${framesize} | ${topology_type} -| | ${tmp}= | Create List | 10%NDR | ${lat_10p} -| | Append To List | ${latency} | ${tmp} -| | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2 -| | ... | ${latency} -| | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps -| | ... | ${framesize} | ${topology_type} | fail_on_loss=${False} - -| Find PDR using linear search and pps -| | [Documentation] -| | ... | Find throughput by using RFC2544 linear search with partial drop rate -| | ... | with PDR threshold and type specified by parameter. -| | ... -| | ... | *Arguments:* -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - start_rate - Initial start rate [pps]. Type: float -| | ... | - step_rate - Step of linear search [pps]. Type: float -| | ... | - topology_type - Topology type. Type: string -| | ... | - min_rate - Lower limit of search [pps]. Type: float -| | ... | - max_rate - Upper limit of search [pps]. Type: float -| | ... | - loss_acceptance - Accepted loss during search. Type: float -| | ... | - loss_acceptance_type - Percentage or frames. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Find PDR using linear search and pps \| 64 \| 5000000 \ -| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 0.5 \| percentage \| -| | ... -| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate} -| | ... | ${topology_type} | ${min_rate} | ${max_rate} -| | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames' -| | ... -| | ${duration}= | Set Variable | ${perf_trial_duration} -| | Set Duration | ${duration} -| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} -| | Set Search Linear Step | ${step_rate} -| | Set Search Frame Size | ${framesize} -| | Set Search Rate Type pps -| | Set Loss Acceptance | ${loss_acceptance} -| | Run Keyword If | '${loss_acceptance_type}' == 'percentage' -| | ... | Set Loss Acceptance Type Percentage -| | Linear Search | ${start_rate} | ${topology_type} -| | ${rate_per_stream} | ${lat}= | Verify Search Result -| | ${tmp}= | Create List | 100%PDR | ${lat} -| | ${latency}= | Create List | ${tmp} -| | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2 -| | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency} -| | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps -| | ... | ${framesize} | ${topology_type} | ${loss_acceptance} -| | ... | ${loss_acceptance_type} | fail_on_loss=${False} - -| Find NDR using binary search and pps -| | [Documentation] -| | ... | Find throughput by using RFC2544 binary search with non drop rate. -| | ... -| | ... | *Arguments:* -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - binary_min - Lower boundary of search [pps]. Type: float -| | ... | - binary_max - Upper boundary of search [pps]. Type: float -| | ... | - topology_type - Topology type. Type: string -| | ... | - min_rate - Lower limit of search [pps]. Type: float -| | ... | - max_rate - Upper limit of search [pps]. Type: float -| | ... | - threshold - Threshold to stop search [pps]. Type: integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Find NDR using binary search and pps \| 64 \| 6000000 \ -| | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \| -| | ... -| | [Arguments] | ${framesize} | ${binary_min} | ${binary_max} -| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold} -| | ... -| | ${duration}= | Set Variable | ${perf_trial_duration} -| | Set Duration | ${duration} -| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} -| | Set Search Frame Size | ${framesize} -| | Set Search Rate Type pps -| | Set Binary Convergence Threshold | ${threshold} -| | Binary Search | ${binary_min} | ${binary_max} | ${topology_type} -| | ${rate_per_stream} | ${lat}= | Verify Search Result -| | ${tmp}= | Create List | 100%NDR | ${lat} -| | ${latency}= | Create List | ${tmp} -| | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5) -| | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p} -| | ... | ${framesize} | ${topology_type} -| | ${tmp}= | Create List | 50%NDR | ${lat_50p} -| | Append To List | ${latency} | ${tmp} -| | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1) -| | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p} -| | ... | ${framesize} | ${topology_type} -| | ${tmp}= | Create List | 10%NDR | ${lat_10p} -| | Append To List | ${latency} | ${tmp} -| | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2 -| | ... | ${latency} -| | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps -| | ... | ${framesize} | ${topology_type} | fail_on_loss=${False} - -| Find PDR using binary search and pps -| | [Documentation] -| | ... | Find throughput by using RFC2544 binary search with partial drop rate -| | ... | with PDR threshold and type specified by parameter. -| | ... -| | ... | *Arguments:* -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - binary_min - Lower boundary of search [pps]. Type: float -| | ... | - binary_max - Upper boundary of search [pps]. Type: float -| | ... | - topology_type - Topology type. Type: string -| | ... | - min_rate - Lower limit of search [pps]. Type: float -| | ... | - max_rate - Upper limit of search [pps]. Type: float -| | ... | - threshold - Threshold to stop search [pps]. Type: integer -| | ... | - loss_acceptance - Accepted loss during search. Type: float -| | ... | - loss_acceptance_type - Percentage or frames. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Find PDR using binary search and pps \| 64 \| 6000000 \ -| | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \| 0.5 \ -| | ... | \| percentage \| -| | ... -| | [Arguments] | ${framesize} | ${binary_min} | ${binary_max} -| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold} -| | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames' -| | ... -| | ${duration}= | Set Variable | ${perf_trial_duration} -| | Set Duration | ${duration} -| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} -| | Set Search Frame Size | ${framesize} -| | Set Search Rate Type pps -| | Set Loss Acceptance | ${loss_acceptance} -| | Run Keyword If | '${loss_acceptance_type}' == 'percentage' -| | ... | Set Loss Acceptance Type Percentage -| | Set Binary Convergence Threshold | ${threshold} -| | Binary Search | ${binary_min} | ${binary_max} | ${topology_type} -| | ${rate_per_stream} | ${lat}= | Verify Search Result -| | ${tmp}= | Create List | 100%PDR | ${lat} -| | ${latency}= | Create List | ${tmp} -| | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2 -| | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency} -| | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps -| | ... | ${framesize} | ${topology_type} | ${loss_acceptance} -| | ... | ${loss_acceptance_type} | fail_on_loss=${False} - -| Find NDR using combined search and pps -| | [Documentation] -| | ... | Find throughput by using RFC2544 combined search (linear+binary) with -| | ... | non drop rate. -| | ... -| | ... | *Arguments:* -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - start_rate - Initial start rate [pps]. Type: float -| | ... | - step_rate - Step of linear search [pps]. Type: float -| | ... | - topology_type - Topology type. Type: string -| | ... | - min_rate - Lower limit of search [pps]. Type: float -| | ... | - max_rate - Upper limit of search [pps]. Type: float -| | ... | - threshold - Threshold to stop search [pps]. Type: integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Find NDR using combined search and pps \| 64 \| 5000000 \ -| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \| -| | ... -| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate} -| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold} -| | ... -| | ${duration}= | Set Variable | ${perf_trial_duration} -| | Set Duration | ${duration} -| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} -| | Set Search Linear Step | ${step_rate} -| | Set Search Frame Size | ${framesize} -| | Set Search Rate Type pps -| | Set Binary Convergence Threshold | ${threshold} -| | Combined Search | ${start_rate} | ${topology_type} -| | ${rate_per_stream} | ${lat}= | Verify Search Result -| | ${tmp}= | Create List | 100%NDR | ${lat} -| | ${latency}= | Create List | ${tmp} -| | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5) -| | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p} -| | ... | ${framesize} | ${topology_type} -| | ${tmp}= | Create List | 50%NDR | ${lat_50p} -| | Append To List | ${latency} | ${tmp} -| | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1) -| | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p} -| | ... | ${framesize} | ${topology_type} -| | ${tmp}= | Create List | 10%NDR | ${lat_10p} -| | Append To List | ${latency} | ${tmp} -| | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2 -| | ... | ${latency} -| | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps -| | ... | ${framesize} | ${topology_type} -| | ... | fail_on_loss=${False} - -| Find PDR using combined search and pps -| | [Documentation] -| | ... | Find throughput by using RFC2544 combined search (linear+binary) with -| | ... | partial drop rate with PDR threshold and type specified by parameter. -| | ... -| | ... | *Arguments:* -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - start_rate - Initial start rate [pps]. Type: float -| | ... | - step_rate - Step of linear search [pps]. Type: float -| | ... | - topology_type - Topology type. Type: string -| | ... | - min_rate - Lower limit of search [pps]. Type: float -| | ... | - max_rate - Upper limit of search [pps]. Type: float -| | ... | - threshold - Threshold to stop search [pps]. Type: integer -| | ... | - loss_acceptance - Accepted loss during search. Type: float -| | ... | - loss_acceptance_type - Percentage or frames. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Find PDR using combined search and pps \| 64 \| 5000000 \ -| | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \| 0.5 \ -| | ... | \| percentage \| -| | ... -| | [Arguments] | ${framesize} | ${start_rate} | ${step_rate} -| | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold} -| | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames' -| | ... -| | ${duration}= | Set Variable | ${perf_trial_duration} -| | Set Duration | ${duration} -| | Set Search Rate Boundaries | ${max_rate} | ${min_rate} -| | Set Search Linear Step | ${step_rate} -| | Set Search Frame Size | ${framesize} -| | Set Search Rate Type pps -| | Set Loss Acceptance | ${loss_acceptance} -| | Run Keyword If | '${loss_acceptance_type}' == 'percentage' -| | ... | Set Loss Acceptance Type Percentage -| | Set Binary Convergence Threshold | ${threshold} -| | Combined Search | ${start_rate} | ${topology_type} -| | ${rate_per_stream} | ${lat}= | Verify Search Result -| | ${tmp}= | Create List | 100%PDR | ${lat} -| | ${latency}= | Create List | ${tmp} -| | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2 -| | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency} -| | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps -| | ... | ${framesize} | ${topology_type} | ${loss_acceptance} -| | ... | ${loss_acceptance_type} | fail_on_loss=${False} - -| Display result of NDR search -| | [Documentation] -| | ... | Display result of NDR search in packet per seconds (total and per -| | ... | stream) and Gbps total bandwidth with untagged packet. -| | ... | Througput is calculated as: -| | ... | Measured rate per stream * Total number of streams -| | ... | Bandwidth is calculated as: -| | ... | (Througput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC -| | ... -| | ... | *Arguments:* -| | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - nr_streams - Total number of streams. Type: integer -| | ... | - latency - Latency stats. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Display result of NDR search \| 4400000 \| 64 \| 2 \ -| | ... | \| [100%NDR, [10/10/10, 1/2/3]] \| -| | ... -| | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams} | ${latency} -| | ... -| | ${framesize}= | Get Frame Size | ${framesize} -| | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams} -| | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9) -| | Set Test Message | FINAL_RATE: ${rate_total} pps -| | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes -| | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged) -| | ... | append=yes -| | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes -| | :FOR | ${lat} | IN | @{latency} -| | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes - -| Display result of PDR search -| | [Documentation] -| | ... | Display result of PDR search in packet per seconds (total and per -| | ... | stream) and Gbps total bandwidth with untagged packet. -| | ... | Througput is calculated as: -| | ... | Measured rate per stream * Total number of streams -| | ... | Bandwidth is calculated as: -| | ... | (Througput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC -| | ... -| | ... | *Arguments:* -| | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - nr_streams - Total number of streams. Type: integer -| | ... | - loss_acceptance - Accepted loss during search. Type: float -| | ... | - loss_acceptance_type - Percentage or frames. Type: string -| | ... | - latency - Latency stats. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Display result of PDR search \| 4400000 \| 64 \| 2 \| 0.5 \ -| | ... | \| percentage \| [100%NDR, [10/10/10, 1/2/3]] \| -| | ... -| | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams} -| | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency} -| | ... -| | ${framesize}= | Get Frame Size | ${framesize} -| | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams} -| | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9) -| | Set Test Message | FINAL_RATE: ${rate_total} pps -| | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes -| | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged) -| | ... | append=yes -| | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes -| | :FOR | ${lat} | IN | @{latency} -| | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes -| | Set Test Message -| | ... | ${\n}LOSS_ACCEPTANCE: ${loss_acceptance} ${loss_acceptance_type} -| | ... | append=yes - -| Measure latency pps -| | [Documentation] -| | ... | Send traffic at specified rate. Measure min/avg/max latency -| | ... -| | ... | *Arguments:* -| | ... | - duration - Duration of traffic run [s]. Type: integer -| | ... | - rate - Rate for sending packets. Type: integer -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - topology_type - Topology type. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Measure latency \| 10 \| 4.0 \| 64 \| 3-node-IPv4 \| -| | ... -| | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type} -| | ... -| | Return From Keyword If | ${rate} <= 10000 | ${-1} -| | ${ret}= | Is DPDK performance test -| | Run Keyword If | ${ret}==${FALSE} | Clear all counters on all DUTs -| | Send traffic on tg | ${duration} | ${rate}pps | ${framesize} -| | ... | ${topology_type} | warmup_time=0 -| | Run Keyword If | ${ret}==${FALSE} | Show statistics on all DUTs -| | Run keyword and return | Get latency - -| Traffic should pass with no loss -| | [Documentation] -| | ... | Send traffic at specified rate. No packet loss is accepted at loss -| | ... | evaluation. -| | ... -| | ... | *Arguments:* -| | ... | - duration - Duration of traffic run [s]. Type: integer -| | ... | - rate - Rate for sending packets. Type: string -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - topology_type - Topology type. Type: string -| | ... | - fail_on_loss - If True, the keyword fails if loss occurred. -| | ... | Type: boolean -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Traffic should pass with no loss \| 10 \| 4.0mpps \| 64 \ -| | ... | \| 3-node-IPv4 \| -| | ... -| | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type} -| | ... | ${fail_on_loss}=${True} -| | ... -| | Clear and show runtime counters with running traffic | ${duration} -| | ... | ${rate} | ${framesize} | ${topology_type} -| | ${ret}= | Is DPDK performance test -| | Run Keyword If | ${ret}==${FALSE} | Clear all counters on all DUTs -| | Send traffic on tg | ${duration} | ${rate} | ${framesize} -| | ... | ${topology_type} | warmup_time=0 -| | Run Keyword If | ${ret}==${FALSE} | Show statistics on all DUTs -| | Run Keyword If | ${fail_on_loss} | No traffic loss occurred - -| Traffic should pass with partial loss -| | [Documentation] -| | ... | Send traffic at specified rate. Partial packet loss is accepted -| | ... | within loss acceptance value specified as argument. -| | ... -| | ... | *Arguments:* -| | ... | - duration - Duration of traffic run [s]. Type: integer -| | ... | - rate - Rate for sending packets. Type: string -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - topology_type - Topology type. Type: string -| | ... | - loss_acceptance - Accepted loss during search. Type: float -| | ... | - loss_acceptance_type - Percentage or frames. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \ -| | ... | \| 3-node-IPv4 \| 0.5 \| percentage \| -| | ... -| | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type} -| | ... | ${loss_acceptance} | ${loss_acceptance_type} -| | ... | ${fail_on_loss}=${True} -| | ... -| | Clear and show runtime counters with running traffic | ${duration} -| | ... | ${rate} | ${framesize} | ${topology_type} -| | ${ret}= | Is DPDK performance test -| | Run Keyword If | ${ret}==${FALSE} | Clear all counters on all DUTs -| | Send traffic on tg | ${duration} | ${rate} | ${framesize} -| | ... | ${topology_type} | warmup_time=0 -| | Run Keyword If | ${ret}==${FALSE} | Show statistics on all DUTs -| | Run Keyword If | ${fail_on_loss} | Partial traffic loss accepted -| | ... | ${loss_acceptance} | ${loss_acceptance_type} - -| Clear and show runtime counters with running traffic -| | [Documentation] -| | ... | Start traffic at specified rate then clear runtime counters on all -| | ... | DUTs. Wait for specified amount of time and capture runtime counters -| | ... | on all DUTs. Finally stop traffic -| | ... -| | ... | *Arguments:* -| | ... | - duration - Duration of traffic run [s]. Type: integer -| | ... | - rate - Rate for sending packets. Type: string -| | ... | - framesize - L2 Frame Size [B]. Type: integer -| | ... | - topology_type - Topology type. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \ -| | ... | \| 3-node-IPv4 \| 0.5 \| percentage \| -| | ... -| | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type} -| | ... -| | Send traffic on tg | -1 | ${rate} | ${framesize} | ${topology_type} -| | ... | warmup_time=0 | async_call=${True} | latency=${False} -| | ${ret}= | Is DPDK performance test -| | Run Keyword If | ${ret}==${FALSE} | Clear runtime counters on all DUTs -| | Sleep | ${duration} -| | Run Keyword If | ${ret}==${FALSE} | Show runtime counters on all DUTs -| | Stop traffic on tg diff --git a/resources/libraries/robot/policer.robot b/resources/libraries/robot/policer.robot deleted file mode 100644 index 6e75a45965..0000000000 --- a/resources/libraries/robot/policer.robot +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (c) 2016 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/default.robot -| Resource | resources/libraries/robot/testing_path.robot -| Library | resources.libraries.python.Policer -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.IPv4Util -| Library | resources.libraries.python.TrafficScriptExecutor -| Library | resources.libraries.python.IPv6Util -| Library | resources.libraries.python.IPv6Setup -| Library | resources.libraries.python.IPv4Setup.Dut | ${nodes['DUT1']} -| ... | WITH NAME | dut1_v4 -| Documentation | *Policer keywords* - -*** Keywords *** -| Configure topology for IPv4 policer test -| | [Documentation] | Setup topology for IPv4 policer testing. -| | ... -| | ... | _NOTE:_ This KW sets following test case variables: -| | ... | - dut_to_tg_if1_ip - DUT first interface IP address. Type: string -| | ... | - dut_to_tg_if2_ip - DUT second interface IP address. Type: string -| | ... | - tg_to_dut_if1_ip - TG first interface IP address. Type: string -| | ... | - tg_to_dut_if2_ip - TG second interface IP address. Type: string -| | Configure path in 2-node circular topology | ${nodes['TG']} | ${nodes['DUT1']} -| | ... | ${nodes['TG']} -| | Set interfaces in 2-node circular topology up -| | Set Interface Address | ${dut_node} | ${dut_to_tg_if1} -| | ... | ${dut_to_tg_if1_ip4} | ${ip4_plen} -| | Set Interface Address | ${dut_node} | ${dut_to_tg_if2} -| | ... | ${dut_to_tg_if2_ip4} | ${ip4_plen} -| | dut1_v4.Set ARP | ${dut_to_tg_if2} | ${tg_to_dut_if2_ip4} -| | ... | ${tg_to_dut_if2_mac} -| | Set Test Variable | ${dut_to_tg_if1_ip} | ${dut_to_tg_if1_ip4} -| | Set Test Variable | ${dut_to_tg_if2_ip} | ${dut_to_tg_if2_ip4} -| | Set Test Variable | ${tg_to_dut_if1_ip} | ${tg_to_dut_if1_ip4} -| | Set Test Variable | ${tg_to_dut_if2_ip} | ${tg_to_dut_if2_ip4} - -| Configure topology for IPv6 policer test -| | [Documentation] | Setup topology for IPv6 policer testing. -| | ... -| | ... | _NOTE:_ This KW sets following test case variables: -| | ... | - dut_to_tg_if1_ip - DUT first interface IP address. Type: string -| | ... | - dut_to_tg_if2_ip - DUT second interface IP address. Type: string -| | ... | - tg_to_dut_if1_ip - TG first interface IP address. Type: string -| | ... | - tg_to_dut_if2_ip - TG second interface IP address. Type: string -| | Configure path in 2-node circular topology | ${nodes['TG']} | ${nodes['DUT1']} -| | ... | ${nodes['TG']} -| | Set interfaces in 2-node circular topology up -| | Vpp Set If IPv6 Addr | ${dut_node} | ${dut_to_tg_if1} -| | ... | ${dut_to_tg_if1_ip6} | ${ip6_plen} -| | Vpp Set If IPv6 Addr | ${dut_node} | ${dut_to_tg_if2} -| | ... | ${dut_to_tg_if2_ip6} | ${ip6_plen} -| | Add IP Neighbor | ${dut_node} | ${dut_to_tg_if2} | ${tg_to_dut_if2_ip6} -| | ... | ${tg_to_dut_if2_mac} -| | Vpp All RA Suppress Link Layer | ${nodes} -| | Set Test Variable | ${dut_to_tg_if1_ip} | ${dut_to_tg_if1_ip6} -| | Set Test Variable | ${dut_to_tg_if2_ip} | ${dut_to_tg_if2_ip6} -| | Set Test Variable | ${tg_to_dut_if1_ip} | ${tg_to_dut_if1_ip6} -| | Set Test Variable | ${tg_to_dut_if2_ip} | ${tg_to_dut_if2_ip6} - -| Send packet and verify marking -| | [Documentation] | Send packet and verify DSCP of the received packet. -| | ... -| | ... | *Arguments:* -| | ... | - node - TG node. Type: dictionary -| | ... | - tx_if - TG transmit interface. Type: string -| | ... | - rx_if - TG receive interface. Type: string -| | ... | - src_mac - Packet source MAC. Type: string -| | ... | - dst_mac - Packet destination MAC. Type: string -| | ... | - src_ip - Packet source IP address. Type: string -| | ... | - dst_ip - Packet destination IP address. Type: string -| | ... | - dscp - DSCP value to verify. Type: enum -| | ... -| | ... | *Example:* -| | ... | \| ${dscp}= \| DSCP AF22 \| -| | ... | \| Send packet and verify marking \| ${nodes['TG']} \| eth1 \| eth2 \ -| | ... | \| 08:00:27:87:4d:f7 \| 52:54:00:d4:d8:22 \| 192.168.122.2 \ -| | ... | \| 192.168.122.1 \| ${dscp} \| -| | [Arguments] | ${node} | ${tx_if} | ${rx_if} | ${src_mac} | ${dst_mac} -| | ... | ${src_ip} | ${dst_ip} | ${dscp} -| | ${tx_if_name}= | Get Interface Name | ${node} | ${tx_if} -| | ${rx_if_name}= | Get Interface Name | ${node} | ${rx_if} -| | ${args}= | Traffic Script Gen Arg | ${rx_if_name} | ${tx_if_name} -| | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} -| | ${dscp_num}= | Get DSCP Num Value | ${dscp} -| | ${args}= | Set Variable | ${args} --dscp ${dscp_num} -| | Run Traffic Script On Node | policer.py | ${node} | ${args} diff --git a/resources/libraries/robot/qemu.robot b/resources/libraries/robot/qemu.robot deleted file mode 100644 index 097f3cb1a8..0000000000 --- a/resources/libraries/robot/qemu.robot +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (c) 2016 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.QemuUtils -| Library | resources.libraries.python.ssh.SSH - -*** Keywords *** - -| QEMU build list should exist -| | [Documentation] | Return TRUE if variable QEMU_BUILD exist, otherwise FALSE -| | ${ret} | ${tmp}= | Run Keyword And Ignore Error -| | ... | Variable Should Exist | @{QEMU_BUILD} -| | Return From Keyword If | "${ret}" == "PASS" | ${TRUE} -| | Return From Keyword | ${FALSE} - -| Is QEMU ready on node -| | [Documentation] | Check if QEMU was built on the node before -| | [Arguments] | ${node} -| | ${ret}= | QEMU build list should exist -| | Return From Keyword If | ${ret} == ${FALSE} | ${FALSE} -| | ${ret} | ${tmp}= | Run Keyword And Ignore Error -| | ... | Should Contain | ${QEMU_BUILD} | ${node['host']} -| | Return From Keyword If | "${ret}" == "PASS" | ${TRUE} -| | Return From Keyword | ${FALSE} - -| Add node to QEMU build list -| | [Documentation] | Add node to the list of nodes with builded QEMU (global -| | ... | variable QEMU_BUILD) -| | [Arguments] | ${node} -| | ${ret}= | QEMU build list should exist -| | Run Keyword If | ${ret} == ${TRUE} -| | ... | Append To List | ${QEMU_BUILD} | ${node['host']} -| | ... | ELSE | Set Global Variable | @{QEMU_BUILD} | ${node['host']} - -| Build QEMU on node -| | [Documentation] | Build QEMU from sources on the Node. Nodes with successful -| | ... | QEMU build are stored in global variable list QEMU_BUILD -| | ... -| | ... | *Arguments:* -| | ... | - node - Node on which to build qemu. Type: dictionary -| | ... | - force_install - If True, then remove previous build. Type: bool -| | ... | - apply_patch - If True, then apply patches from qemu_patches dir. -| | ... | Type: bool -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Build QEMU on node \| ${node['DUT1']} \| False \| False \| -| | ... -| | [Arguments] | ${node} | ${force_install}=${False} | ${apply_patch}=${False} -| | ${ready}= | Is QEMU ready on node | ${node} -| | Return From Keyword If | ${ready} == ${TRUE} -| | Build QEMU | ${node} -| | Add node to QEMU build list | ${node} - -| Build QEMU on all DUTs -| | [Documentation] | Build QEMU from sources on all DUTs. Nodes with successful -| | ... | QEMU build are stored in global variable list QEMU_BUILD -| | ... -| | ... | *Arguments:* -| | ... | - force_install - If True, then remove previous build. Type: bool -| | ... | - apply_patch - If True, then apply patches from qemu_patches dir. -| | ... | Type: bool -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Build QEMU on all DUTs \| False \| False \| -| | ... -| | [Arguments] | ${force_install}=${False} | ${apply_patch}=${False} -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Build QEMU on node | ${nodes['${dut}']} | ${force_install} | -| | | ... | ${apply_patch} - -| Stop and clear QEMU -| | [Documentation] | Stop QEMU, clear used sockets and close SSH connection -| | ... | running on ${dut}, ${vm} is VM node info dictionary -| | ... | returned by qemu_start or None. -| | [Arguments] | ${dut} | ${vm} -| | Qemu Set Node | ${dut} -| | Qemu Kill -| | Qemu Clear Socks -| | Run Keyword If | ${vm} is not None | Disconnect | ${vm} - -| Kill Qemu on all DUTs -| | [Documentation] | Kill QEMU processes on all DUTs. -| | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} -| | | Qemu Set Node | ${nodes['${dut}']} -| | | Qemu Kill diff --git a/resources/libraries/robot/shared/counters.robot b/resources/libraries/robot/shared/counters.robot new file mode 100644 index 0000000000..3591dd5fe7 --- /dev/null +++ b/resources/libraries/robot/shared/counters.robot @@ -0,0 +1,91 @@ +# Copyright (c) 2016 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 | VPP counters keywords +| Library | resources/libraries/python/VppCounters.py + +*** Keywords *** +| Clear interface counters on all vpp nodes in topology +| | [Documentation] | Clear interface counters on all VPP nodes in topology +| | [Arguments] | ${nodes} +| | Vpp Nodes Clear Interface Counters | ${nodes} + +| Get interface statistics +| | [Documentation] | Dump stats table on VPP node +| | [Arguments] | ${node} +| | Vpp Dump Stats Table | ${node} + +| Get interface ipv6 counter +| | [Documentation] | Return IPv6 statistics for node interface +| | [Arguments] | ${node} | ${interface} +| | ${ipv6_counter}= | Vpp Get Ipv6 Interface Counter | ${node} | ${interface} +| | [Return] | ${ipv6_counter} + +| Check ipv4 interface counter +| | [Documentation] | Check that ipv4 interface counter has right value +| | [Arguments] | ${node} | ${interface} | ${value} +| | ${ipv4_counter}= | Vpp get ipv4 interface counter | ${node} | ${interface} +| | Should Be Equal | ${ipv4_counter} | ${value} + +| Show statistics on all DUTs +| | [Documentation] | Show VPP statistics on all DUTs +| | Sleep | 10 | Waiting for statistics to be collected +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Show vpp statistics | ${nodes['${dut}']} + +| Show vpp statistics +| | [Documentation] | Show [error, hardware, interface] stats +| | [Arguments] | ${node} +| | Vpp Show Errors | ${node} +| | Vpp Show Hardware Detail | ${node} +| | Vpp Show Runtime | ${node} + +| Clear all counters on all DUTs +| | [Documentation] | Clear runtime, interface, hardware and error counters +| | ... | on all DUTs with VPP instance +| | Clear runtime counters on all DUTs +| | Clear interface counters on all DUTs +| | Clear hardware counters on all DUTs +| | Clear error counters on all DUTs + +| Clear runtime counters on all DUTs +| | [Documentation] | Clear VPP runtime counters on all DUTs +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Vpp clear runtime | ${nodes['${dut}']} + +| Clear interface counters on all DUTs +| | [Documentation] | Clear VPP interface counters on all DUTs +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Vpp clear interface counters | ${nodes['${dut}']} + +| Clear hardware counters on all DUTs +| | [Documentation] | Clear VPP hardware counters on all DUTs +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Vpp clear hardware counters | ${nodes['${dut}']} + +| Clear error counters on all DUTs +| | [Documentation] | Clear VPP errors counters on all DUTs +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Vpp clear errors counters | ${nodes['${dut}']} + +| Show runtime counters on all DUTs +| | [Documentation] | Show VPP runtime counters on all DUTs +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Vpp show runtime | ${nodes['${dut}']} diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot new file mode 100644 index 0000000000..96bdd5344e --- /dev/null +++ b/resources/libraries/robot/shared/default.robot @@ -0,0 +1,357 @@ +# Copyright (c) 2016 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/vm/qemu.robot +| Variables | resources/libraries/python/topology.py +| Variables | resources/libraries/python/VatHistory.py +| Library | resources.libraries.python.topology.Topology +| Library | resources.libraries.python.VatHistory +| Library | resources.libraries.python.CpuUtils +| Library | resources.libraries.python.DUTSetup +| Library | resources.libraries.python.SchedUtils +| Library | resources.libraries.python.TGSetup +| Library | resources.libraries.python.L2Util +| Library | resources.libraries.python.Tap +| Library | resources/libraries/python/VppConfigGenerator.py +| Library | resources/libraries/python/VppCounters.py +| Library | Collections + +*** Keywords *** +| Configure all DUTs before test +| | [Documentation] | Setup all DUTs in topology before test execution. +| | ... +| | Setup All DUTs | ${nodes} + +| Configure all TGs for traffic script +| | [Documentation] | Prepare all TGs before traffic scripts execution. +| | ... +| | All TGs Set Interface Default Driver | ${nodes} + +| Show VPP version on all DUTs +| | [Documentation] | Show VPP version verbose on all DUTs. +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Vpp show version verbose | ${nodes['${dut}']} + +| Show Vpp Errors On All DUTs +| | [Documentation] | Show VPP errors verbose on all DUTs. +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Vpp Show Errors | ${nodes['${dut}']} + +| Show VPP trace dump on all DUTs +| | [Documentation] | Save API trace and dump output on all DUTs. +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Vpp api trace save | ${nodes['${dut}']} +| | | Vpp api trace dump | ${nodes['${dut}']} + +| Show VPP vhost on all DUTs +| | [Documentation] | Show Vhost User on all DUTs. +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Vpp Show Vhost | ${nodes['${dut}']} + +| Show Bridge Domain Data On All DUTs +| | [Documentation] | Show Bridge Domain data on all DUTs. +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Vpp Get Bridge Domain Data | ${nodes['${dut}']} + +| Setup Scheduler Policy for Vpp On All DUTs +| | [Documentation] | Set realtime scheduling policy (SCHED_RR) with priority 1 +| | ... | on all VPP worker threads on all DUTs. +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Set VPP Scheduling rr | ${nodes['${dut}']} + +| Configure crypto device on all DUTs +| | [Documentation] | Verify if Crypto QAT device virtual functions are +| | ... | initialized on all DUTs. If parameter force_init is set to True, then +| | ... | try to initialize. +| | ... +| | ... | *Arguments:* +| | ... | - ${force_init} - Try to initialize. Type: boolean +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure crypto device on all DUTs \| ${True} \| +| | ... +| | [Arguments] | ${force_init}=${False} +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Crypto Device Verify | ${nodes['${dut}']} | force_init=${force_init} + +| Configure kernel module on all DUTs +| | [Documentation] | Verify if specific kernel module is loaded on all DUTs. +| | ... | If parameter force_load is set to True, then try to initialize. +| | ... +| | ... | *Arguments:* +| | ... | - ${module} - Module to verify. Type: string +| | ... | - ${force_load} - Try to load module. Type: boolean +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure kernel module on all DUTs \| ${True} \| +| | ... +| | [Arguments] | ${module} | ${force_load}=${False} +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Kernel Module Verify | ${nodes['${dut}']} | ${module} +| | | ... | force_load=${force_load} + +| Create base startup configuration of VPP on all DUTs +| | [Documentation] | Create base startup configuration of VPP to all DUTs. +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Import Library | resources.libraries.python.VppConfigGenerator +| | | ... | WITH NAME | ${dut} +| | | Run keyword | ${dut}.Set Node | ${nodes['${dut}']} +| | | Run keyword | ${dut}.Add Unix Log +| | | Run keyword | ${dut}.Add Unix CLI Listen +| | | Run keyword | ${dut}.Add Unix Nodaemon +| | | Run keyword | ${dut}.Add DPDK Socketmem | "1024,1024" +| | | Run keyword | ${dut}.Add Heapsize | "3G" +| | | Run keyword | ${dut}.Add IP6 Hash Buckets | "2000000" +| | | Run keyword | ${dut}.Add IP6 Heap Size | "3G" + +| Add '${m}' worker threads and '${n}' rxqueues in 3-node single-link circular topology +| | [Documentation] | Setup M worker threads and N rxqueues in vpp startup\ +| | ... | configuration on all DUTs in 3-node single-link topology. +| | ... +| | ${m_int}= | Convert To Integer | ${m} +| | ${dut1_numa}= | Get interfaces numa node | ${dut1} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${dut2_numa}= | Get interfaces numa node | ${dut2} +| | ... | ${dut2_if1} | ${dut2_if2} +| | ${dut1_cpu_main}= | Cpu list per node str | ${dut1} | ${dut1_numa} +| | ... | skip_cnt=${1} | cpu_cnt=${1} +| | ${dut1_cpu_w}= | Cpu list per node str | ${dut1} | ${dut1_numa} +| | ... | skip_cnt=${2} | cpu_cnt=${m_int} +| | ${dut2_cpu_main}= | Cpu list per node str | ${dut2} | ${dut2_numa} +| | ... | skip_cnt=${1} | cpu_cnt=${1} +| | ${dut2_cpu_w}= | Cpu list per node str | ${dut2} | ${dut2_numa} +| | ... | skip_cnt=${2} | cpu_cnt=${m_int} +| | Run keyword | DUT1.Add CPU Main Core | ${dut1_cpu_main} +| | Run keyword | DUT2.Add CPU Main Core | ${dut2_cpu_main} +| | Run keyword | DUT1.Add CPU Corelist Workers | ${dut1_cpu_w} +| | Run keyword | DUT2.Add CPU Corelist Workers | ${dut2_cpu_w} +| | Run keyword | DUT1.Add DPDK Dev Default RXQ | ${n} +| | Run keyword | DUT2.Add DPDK Dev Default RXQ | ${n} + +| Add '${m}' worker threads and '${n}' rxqueues in 2-node single-link circular topology +| | [Documentation] | Setup M worker threads and N rxqueues in vpp startup\ +| | ... | configuration on all DUTs in 2-node single-link topology. +| | ... +| | ${m_int}= | Convert To Integer | ${m} +| | ${dut1_numa}= | Get interfaces numa node | ${dut1} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${dut1_cpu_main}= | Cpu list per node str | ${dut1} | ${dut1_numa} +| | ... | skip_cnt=${1} | cpu_cnt=${1} +| | ${dut1_cpu_w}= | Cpu list per node str | ${dut1} | ${dut1_numa} +| | ... | skip_cnt=${2} | cpu_cnt=${m_int} +| | Run keyword | DUT1.Add CPU Main Core | ${dut1_cpu_main} +| | Run keyword | DUT1.Add CPU Corelist Workers | ${dut1_cpu_w} +| | Run keyword | DUT1.Add DPDK Dev Default RXQ | ${n} + +| Add '${m}' worker threads using SMT and '${n}' rxqueues in 3-node single-link circular topology +| | [Documentation] | Setup M worker threads using SMT and N rxqueues in vpp\ +| | ... | startup configuration on all DUTs in 3-node single-link topology. +| | ... +| | ${m_int}= | Convert To Integer | ${m} +| | ${dut1_numa}= | Get interfaces numa node | ${dut1} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${dut2_numa}= | Get interfaces numa node | ${dut2} +| | ... | ${dut2_if1} | ${dut2_if2} +| | ${dut1_cpu_main}= | Cpu list per node str | ${dut1} | ${dut1_numa} +| | ... | skip_cnt=${1} | cpu_cnt=${1} | smt_used=${True} +| | ${dut1_cpu_w}= | Cpu list per node str | ${dut1} | ${dut1_numa} +| | ... | skip_cnt=${2} | cpu_cnt=${m_int} | smt_used=${True} +| | ${dut2_cpu_main}= | Cpu list per node str | ${dut2} | ${dut2_numa} +| | ... | skip_cnt=${1} | cpu_cnt=${1} | smt_used=${True} +| | ${dut2_cpu_w}= | Cpu list per node str | ${dut2} | ${dut2_numa} +| | ... | skip_cnt=${2} | cpu_cnt=${m_int} | smt_used=${True} +| | Run keyword | DUT1.Add CPU Main Core | ${dut1_cpu_main} +| | Run keyword | DUT2.Add CPU Main Core | ${dut2_cpu_main} +| | Run keyword | DUT1.Add CPU Corelist Workers | ${dut1_cpu_w} +| | Run keyword | DUT2.Add CPU Corelist Workers | ${dut2_cpu_w} +| | Run keyword | DUT1.Add DPDK Dev Default RXQ | ${n} +| | Run keyword | DUT2.Add DPDK Dev Default RXQ | ${n} + +| Add '${m}' worker threads using SMT and '${n}' rxqueues in 2-node single-link circular topology +| | [Documentation] | Setup M worker threads and N rxqueues in vpp startup\ +| | ... | configuration on all DUTs in 2-node single-link topology. +| | ... +| | ${m_int}= | Convert To Integer | ${m} +| | ${dut1_numa}= | Get interfaces numa node | ${dut1} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${dut1_cpu_main}= | Cpu list per node str | ${dut1} | ${dut1_numa} +| | ... | skip_cnt=${1} | cpu_cnt=${1} | smt_used=${True} +| | ${dut1_cpu_w}= | Cpu list per node str | ${dut1} | ${dut1_numa} +| | ... | skip_cnt=${2} | cpu_cnt=${m_int} | smt_used=${True} +| | Run keyword | DUT1.Add CPU Main Core | ${dut1_cpu_main} +| | Run keyword | DUT1.Add CPU Corelist Workers | ${dut1_cpu_w} +| | Run keyword | DUT1.Add DPDK Dev Default RXQ | ${n} + +| Add no multi seg to all DUTs +| | [Documentation] | Add No Multi Seg to VPP startup configuration to all DUTs. +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Run keyword | ${dut}.Add DPDK No Multi Seg + +| Add SNAT to all DUTs +| | [Documentation] | Add SNAT configuration to all DUTs. +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Run keyword | ${dut}.Add SNAT + +| Add cryptodev to all DUTs +| | [Documentation] | Add Cryptodev to VPP startup configuration to all DUTs. +| | ... +| | ... | *Arguments:* +| | ... | - ${count} - Number of QAT devices. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Add cryptodev to all DUTs \| ${4} \| +| | ... +| | [Arguments] | ${count} +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Run keyword | ${dut}.Add DPDK Cryptodev | ${count} + +| Apply startup configuration on all VPP DUTs +| | [Documentation] | Write startup configuration and restart VPP on all DUTs. +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Run keyword | ${dut}.Apply Config +| | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${TRUE} + +| Save VPP PIDs +| | [Documentation] | Get PIDs of VPP processes from all DUTs in topology and\ +| | ... | set it as a test variable. The PIDs are stored as dictionary items\ +| | ... | where the key is the host and the value is the PID. +| | ... +| | ${setup_vpp_pids}= | Get VPP PIDs | ${nodes} +| | ${keys}= | Get Dictionary Keys | ${setup_vpp_pids} +| | :FOR | ${key} | IN | @{keys} +| | | ${pid}= | Get From Dictionary | ${setup_vpp_pids} | ${key} +| | | Run Keyword If | $pid is None | FAIL | No VPP PID found on node ${key} +| | | Run Keyword If | ',' in '${pid}' +| | | ... | FAIL | More then one VPP PID found on node ${key}: ${pid} +| | Set Test Variable | ${setup_vpp_pids} + +| Verify VPP PID in Teardown +| | [Documentation] | Check if the VPP PIDs on all DUTs are the same at the end\ +| | ... | of test as they were at the begining. If they are not, only a message\ +| | ... | is printed on console and to log. The test will not fail. +| | ... +| | ${teardown_vpp_pids}= | Get VPP PIDs | ${nodes} +| | ${err_msg}= | Catenate | ${SUITE NAME} - ${TEST NAME} +| | ... | \nThe VPP PIDs are not equal!\nTest Setup VPP PIDs: +| | ... | ${setup_vpp_pids}\nTest Teardown VPP PIDs: ${teardown_vpp_pids} +| | ${rc} | ${msg}= | Run keyword and ignore error +| | ... | Dictionaries Should Be Equal +| | ... | ${setup_vpp_pids} | ${teardown_vpp_pids} +| | Run Keyword And Return If | '${rc}'=='FAIL' | Log | ${err_msg} +| | ... | console=yes | level=WARN + +| Set up functional test +| | [Documentation] | Common test setup for functional tests. +| | ... +| | Configure all DUTs before test +| | Save VPP PIDs +| | Configure all TGs for traffic script +| | Update All Interface Data On All Nodes | ${nodes} +| | Reset VAT History On All DUTs | ${nodes} + +| Tear down functional test +| | [Documentation] | Common test teardown for functional tests. +| | ... +| | Show Packet Trace on All DUTs | ${nodes} +| | Show VAT History On All DUTs | ${nodes} +| | Vpp Show Errors On All DUTs | ${nodes} +| | Verify VPP PID in Teardown + +| Tear down LISP functional test +| | [Documentation] | Common test teardown for functional tests with LISP. +| | ... +| | Show Packet Trace on All DUTs | ${nodes} +| | Show VAT History On All DUTs | ${nodes} +| | Show Vpp Settings | ${nodes['DUT1']} +| | Show Vpp Settings | ${nodes['DUT2']} +| | Vpp Show Errors On All DUTs | ${nodes} +| | Verify VPP PID in Teardown + +| Tear down LISP functional test with QEMU +| | [Documentation] | Common test teardown for functional tests with LISP and\ +| | ... | QEMU. +| | ... +| | ... | *Arguments:* +| | ... | - vm_node - VM to stop. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Tear down LISP functional test with QEMU \| ${vm_node} \| +| | ... +| | [Arguments] | ${vm_node} +| | ... +| | Show Packet Trace on All DUTs | ${nodes} +| | Show VAT History On All DUTs | ${nodes} +| | Show Vpp Settings | ${nodes['DUT1']} +| | Show Vpp Settings | ${nodes['DUT2']} +| | Vpp Show Errors On All DUTs | ${nodes} +| | Stop and clear QEMU | ${nodes['DUT1']} | ${vm_node} +| | Verify VPP PID in Teardown + +| Set up TAP functional test +| | [Documentation] | Common test setup for functional tests with TAP. +| | ... +| | Set up functional test +| | Clean Up Namespaces | ${nodes['DUT1']} + +| Tear down TAP functional test +| | [Documentation] | Common test teardown for functional tests with TAP. +| | ... +| | Tear down functional test +| | Clean Up Namespaces | ${nodes['DUT1']} + +| Tear down TAP functional test with Linux bridge +| | [Documentation] | Common test teardown for functional tests with TAP and +| | ... | a Linux bridge. +| | ... +| | ... | *Arguments:* +| | ... | - bid_TAP - Bridge name. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Tear down TAP functional test with Linux bridge \| ${bid_TAP} \| +| | ... +| | [Arguments] | ${bid_TAP} +| | ... +| | Tear down functional test +| | Linux Del Bridge | ${nodes['DUT1']} | ${bid_TAP} +| | Clean Up Namespaces | ${nodes['DUT1']} diff --git a/resources/libraries/robot/shared/interfaces.robot b/resources/libraries/robot/shared/interfaces.robot new file mode 100644 index 0000000000..c2b897d6a0 --- /dev/null +++ b/resources/libraries/robot/shared/interfaces.robot @@ -0,0 +1,35 @@ +# Copyright (c) 2016 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.NodePath +| Library | resources.libraries.python.VatExecutor + +*** Keywords *** +| VPP reports interfaces through VAT on '${node}' +| | Execute Script | dump_interfaces.vat | ${node} +| | Script Should Have Passed + +| Configure MTU on TG based on MTU on DUT +| | [Documentation] | Type of the tg_node must be TG and dut_node must be DUT +| | [Arguments] | ${tg_node} | ${dut_node} +| | Append Nodes | ${tg_node} | ${dut_node} +| | Compute Path +| | ${tg_port} | ${tg_node}= | First Interface +| | ${dut_port} | ${dut_node}= | Last Interface +| | # get physical layer MTU (max. size of Ethernet frame) +| | ${mtu}= | Get Interface MTU | ${dut_node} | ${dut_port} +| | # Ethernet MTU is physical layer MTU minus size of Ethernet header and FCS +| | ${eth_mtu}= | Evaluate | ${mtu} - 14 - 4 +| | Set Interface Ethernet MTU | ${tg_node} | ${tg_port} | ${eth_mtu} + diff --git a/resources/libraries/robot/shared/lxc.robot b/resources/libraries/robot/shared/lxc.robot new file mode 100644 index 0000000000..83bd5c1837 --- /dev/null +++ b/resources/libraries/robot/shared/lxc.robot @@ -0,0 +1,257 @@ +# Copyright (c) 2017 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 linux container (LXC) +| Library | resources.libraries.python.LXCUtils +| Library | resources.libraries.python.CpuUtils +| Library | resources.libraries.python.topology.Topology + +*** Keywords *** +| Create LXC container on DUT node +| | [Documentation] | Setup lxc container on DUT node. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - lxc_name - Name of LXC container. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create LXC container on DUT node \| ${nodes['DUT1']} \ +| | ... | \| DUT1_slave_1 \| +| | ... +| | [Arguments] | ${dut_node} | ${lxc_name} +| | ... +| | Import Library | resources.libraries.python.LXCUtils +| | ... | container_name=${lxc_name} | WITH NAME | ${lxc_name} +| | Run keyword | ${lxc_name}.Set node | ${dut_node} +| | Run keyword | ${lxc_name}.Create container | force_create=${TRUE} +| | Run keyword | ${lxc_name}.Mount host dir in container + +| Create LXC container on DUT node with cpuset +| | [Documentation] | Create LXC container on DUT node with cpuset. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - lxc_name - Name of LXC container. Type: dictionary +| | ... | - skip - number of cpus which will be skipped. Type: integer +| | ... | - count - number of cpus which will be allocated for lxc. Type: +| | ... | integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create LXC container on DUT node with cpuset \ +| | ... | \| ${nodes['DUT1']} \| DUT1_slave_1 \| 6 \| 1 \| +| | ... +| | [Arguments] | ${dut_node} | ${lxc_name} | ${skip}=${6} | ${count}=${1} +| | ... +| | Import Library | resources.libraries.python.LXCUtils +| | ... | container_name=${lxc_name} | WITH NAME | ${lxc_name} +| | ${dut_numa}= | Get interfaces numa node | ${dut_node} +| | ... | ${dut1_if1} | ${dut1_if2} +| | ${lxc_cpus}= | CPU list per node str | ${dut_node} | ${dut_numa} +| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${False} +| | Set Suite Variable | ${lxc_cpus} +| | Run keyword | ${lxc_name}.Set node | ${dut_node} +| | Run keyword | ${lxc_name}.Create container | force_create=${TRUE} +| | Run keyword | ${lxc_name}.Mount host dir in container +| | Run keyword | ${lxc_name}.Container cpuset cpus | 0,${lxc_cpus} + +| Create '${nr}' LXC containers on '${dut}' node +| | [Documentation] | Create and start multiple lxc containers on DUT node. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create 5 LXC containers on DUT1 node \| +| | ... +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | Create LXC container on DUT node | ${nodes['${dut}']} +| | | ... | ${dut}_${lxc_base_name}_${number} + +| Create '${nr}' LXC containers on all DUT nodes +| | [Documentation] | Create and start multiple LXC containers on all DUT nodes. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create 5 LXC containers on all DUT nodes \| +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Create '${nr}' LXC containers on '${dut}' node + +| Create '${nr}' LXC containers on '${dut}' node with '${count}' cpus +| | [Documentation] | Create and start multiple LXC containers on DUT node. +| | ... | Set the cpuset.cpus cgroup profile for pin of cpus. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create 5 LXC containers on DUT1 node with 2 cpus \| +| | ... +| | ${skip_cpus}= | Evaluate | ${vpp_cpus}+${system_cpus} +| | ${count_int}= | Convert To Integer | ${count} +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | ${skip}= | Evaluate | ${skip_cpus} + (${nr} - 1) * ${count} +| | | Create LXC container on DUT node with cpuset | ${nodes['${dut}']} +| | | ... | ${dut}_${lxc_base_name}_${number} | ${skip} | ${count_int} + +| Create '${nr}' LXC containers on all DUT nodes with '${count}' cpus +| | [Documentation] | Create and start multiple LXC containers on all DUT nodes. +| | ... | Set the cpuset.cpus cgroup profile for pin of cpus. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create 5 LXC containers on all DUT nodes with 2 cpus \| +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Create '${nr}' LXC containers on '${dut}' node with '${count}' cpus + +| Destroy LXC container on DUT node +| | [Documentation] | Stop and destroy LXC container on DUT node. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - lxc_name - Name of LXC container. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Destroy LXC container on DUT node \| ${nodes['DUT1']} \ +| | ... | \| DUT1_slave_1 \| +| | ... +| | [Arguments] | ${dut_node} | ${lxc_name} +| | ... +| | Import Library | resources.libraries.python.LXCUtils +| | ... | container_name=${lxc_name} | WITH NAME | ${lxc_name} +| | Run keyword | ${lxc_name}.Set node | ${dut_node} +| | Run keyword | ${lxc_name}.Destroy container + +| Destroy '${nr}' LXC containers on '${dut}' node +| | [Documentation] | Stop and destroy multiple LXC containers on DUT node. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Destroy 5 LXC containers on DUT1 node \| +| | ... +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | Destroy LXC container on DUT node | ${nodes['${dut}']} +| | | ... | ${dut}_${lxc_base_name}_${number} + +| Destroy '${nr}' LXC containers on all DUT nodes +| | [Documentation] | Stop and destroy multiple LXC containers on all DUT nodes. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Destroy 5 LXC containers on all DUT nodes \| +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Destroy '${nr}' LXC containers on '${dut}' node + +| Install VPP on LXC container on DUT node +| | [Documentation] | Install vpp on LXC container on DUT node. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - lxc_name - Name of LXC container. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Install VPP on LXC container on DUT node \| ${nodes['DUT1']} \ +| | ... | \| DUT1_slave_1 \| +| | ... +| | [Arguments] | ${dut_node} | ${lxc_name} +| | ... +| | Import Library | resources.libraries.python.LXCUtils +| | ... | container_name=${lxc_name} | WITH NAME | ${lxc_name} +| | Run keyword | ${lxc_name}.Set node | ${dut_node} +| | Run keyword | ${lxc_name}.Install VPP in container + +| Install VPP on '${nr}' LXC containers on '${dut}' node +| | [Documentation] | Install VPP on multiple LXC containers on DUT node. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Install VPP on 5 LXC containers on DUT1 node \| +| | ... +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | Install VPP on LXC container on DUT node | ${nodes['${dut}']} +| | | ... | ${dut}_${lxc_base_name}_${number} + +| Install VPP on '${nr}' LXC containers on all DUT nodes +| | [Documentation] | Install VPP on multiple LXC containers on all DUT nodes. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Install VPP on 5 LXC containers on all DUT nodes \| +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Install VPP on '${nr}' LXC containers on '${dut}' node + +| Create startup configuration of VPP on LXC container on DUT node +| | [Documentation] | Create base startup configuration of VPP on LXC container +| | ... | on DUT node. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | - dut_node - DUT node. Type: dictionary +| | ... | - lxc_name - Name of LXC container. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create startup configuration of VPP on LXC container on DUT node \ +| | ... | \| ${nodes['DUT1']} \| DUT1_slave_1 \| +| | ... +| | [Arguments] | ${dut_node} | ${lxc_name} +| | ... +| | Import Library | resources.libraries.python.VppConfigGenerator +| | ... | WITH NAME | ${lxc_name}_conf +| | Run keyword | ${lxc_name}_conf.Set node | ${dut_node} +| | Run keyword | ${lxc_name}_conf.Add unix CLI listen +| | Run keyword | ${lxc_name}_conf.Add unix nodaemon +| | Run keyword | ${lxc_name}_conf.Add unix exec | "/tmp/running.exec" +| | Run keyword | ${lxc_name}_conf.Add CPU main core | "0" +| | Run keyword | ${lxc_name}_conf.Add CPU corelist workers | ${lxc_cpus} +| | Run keyword | ${lxc_name}_conf.Add plugin disable | "dpdk_plugin.so" +| | Run Keyword | ${lxc_name}_conf.Apply config LXC | ${lxc_name} + +| Create startup configuration of VPP on '${nr}' LXC containers on '${dut}' node +| | [Documentation] | Create base startup configuration of VPP on multiple LXC +| | ... | container on DUT node. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create startup configuration of VPP on 1 LXC containers on DUT1 \ +| | ... | node \| +| | ... +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | Create startup configuration of VPP on LXC container on DUT node +| | | ... | ${nodes['${dut}']} | ${dut}_${lxc_base_name}_${number} + +| Create startup configuration of VPP on '${nr}' LXC containers on all DUT nodes +| | [Documentation] | Create base startup configuration of VPP on multiple LXC +| | ... | container on all DUT nodes. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create startup configuration of VPP on 1 LXC containers on all \ +| | ... | DUT nodes \| +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Create startup configuration of VPP on '${nr}' LXC containers on '${dut}' node diff --git a/resources/libraries/robot/shared/testing_path.robot b/resources/libraries/robot/shared/testing_path.robot new file mode 100644 index 0000000000..b7543e1c4d --- /dev/null +++ b/resources/libraries/robot/shared/testing_path.robot @@ -0,0 +1,353 @@ +# Copyright (c) 2016 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.NodePath + +*** Keywords *** +| Configure path in 2-node circular topology +| | [Documentation] | Compute path for testing on two given nodes in circular +| | ... | topology and set corresponding test case variables. +| | ... +| | ... | *Arguments:* +| | ... | - ${tg_node} - TG node. Type: dictionary +| | ... | - ${dut_node} - DUT node. Type: dictionary +| | ... | - ${tg2_node} - Node where the path ends. Must be the same as TG node +| | ... | parameter in circular topology. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | _NOTE:_ This KW sets following test case variables: +| | ... | - ${tg_node} - TG node. +| | ... | - ${tg_to_dut_if1} - 1st TG interface towards DUT. +| | ... | - ${tg_to_dut_if2} - 2nd TG interface towards DUT. +| | ... | - ${dut_node} - DUT node. +| | ... | - ${dut_to_tg_if1} - 1st DUT interface towards TG. +| | ... | - ${dut_to_tg_if2} - 2nd DUT interface towards TG. +| | ... | - ${tg_to_dut_if1_mac} +| | ... | - ${tg_to_dut_if2_mac} +| | ... | - ${dut_to_tg_if1_mac} +| | ... | - ${dut_to_tg_if2_mac} +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Given Configure path in 2-node circular topology \| ${nodes['TG']} \ +| | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \| +| | ... +| | [Arguments] | ${tg_node} | ${dut_node} | ${tg2_node} +| | Should Be Equal | ${tg_node} | ${tg2_node} +| | Append Nodes | ${tg_node} | ${dut_node} | ${tg_node} +| | Compute Path | always_same_link=${FALSE} +| | ${tg_to_dut_if1} | ${tmp}= | First Interface +| | ${tg_to_dut_if2} | ${tmp}= | Last Interface +| | ${dut_to_tg_if1} | ${tmp}= | First Ingress Interface +| | ${dut_to_tg_if2} | ${tmp}= | Last Egress Interface +| | ${tg_to_dut_if1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut_if1} +| | ${tg_to_dut_if2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut_if2} +| | ${dut_to_tg_if1_mac}= | Get interface mac | ${dut_node} | ${dut_to_tg_if1} +| | ${dut_to_tg_if2_mac}= | Get interface mac | ${dut_node} | ${dut_to_tg_if2} +| | Set Test Variable | ${tg_to_dut_if1} +| | Set Test Variable | ${tg_to_dut_if2} +| | Set Test Variable | ${dut_to_tg_if1} +| | Set Test Variable | ${dut_to_tg_if2} +| | Set Test Variable | ${tg_to_dut_if1_mac} +| | Set Test Variable | ${tg_to_dut_if2_mac} +| | Set Test Variable | ${dut_to_tg_if1_mac} +| | Set Test Variable | ${dut_to_tg_if2_mac} +| | Set Test Variable | ${tg_node} +| | Set Test Variable | ${dut_node} + +| Set interfaces in 2-node circular topology up +| | [Documentation] | Set UP state on interfaces in 2-node path on nodes and +| | ... | wait for all interfaces are ready. Requires more than +| | ... | one link between nodes. +| | ... +| | ... | *Arguments:* +| | ... | - No arguments. +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | _NOTE:_ This KW uses test variables sets in +| | ... | "Configure path in 2-node circular topology" KW. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Given Configure path in 2-node circular topology \| ${nodes['TG']} \ +| | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \| +| | ... | \| And Set interfaces in 2-node circular topology up \| +| | ... +| | Set Interface State | ${tg_node} | ${tg_to_dut_if1} | up +| | Set Interface State | ${tg_node} | ${tg_to_dut_if2} | up +| | Set Interface State | ${dut_node} | ${dut_to_tg_if1} | up +| | Set Interface State | ${dut_node} | ${dut_to_tg_if2} | up +| | Vpp Node Interfaces Ready Wait | ${dut_node} + +| Configure path in 3-node circular topology +| | [Documentation] | Compute path for testing on three given nodes in circular +| | ... | topology and set corresponding test case variables. +| | ... +| | ... | *Arguments:* +| | ... | - ${tg_node} - TG node. Type: dictionary +| | ... | - ${dut1_node} - DUT1 node. Type: dictionary +| | ... | - ${dut2_node} - DUT2 node. Type: dictionary +| | ... | - ${tg2_node} - Node where the path ends. Must be the same as TG node +| | ... | parameter in circular topology. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... | +| | ... | _NOTE:_ This KW sets following test case variables: +| | ... | - ${tg_node} - TG node. +| | ... | - ${tg_to_dut1} - TG interface towards DUT1. +| | ... | - ${tg_to_dut2} - TG interface towards DUT2. +| | ... | - ${dut1_node} - DUT1 node. +| | ... | - ${dut1_to_tg} - DUT1 interface towards TG. +| | ... | - ${dut1_to_dut2} - DUT1 interface towards DUT2. +| | ... | - ${dut2_node} - DUT2 node. +| | ... | - ${dut2_to_tg} - DUT2 interface towards TG. +| | ... | - ${dut2_to_dut1} - DUT2 interface towards DUT1. +| | ... | - ${tg_to_dut1_mac} +| | ... | - ${tg_to_dut2_mac} +| | ... | - ${dut1_to_tg_mac} +| | ... | - ${dut1_to_dut2_mac} +| | ... | - ${dut2_to_tg_mac} +| | ... | - ${dut2_to_dut1_mac} +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Given Configure path in 3-node circular topology \| ${nodes['TG']} \ +| | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \| ${nodes['TG']} \| +| | ... +| | [Arguments] | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg2_node} +| | Should Be Equal | ${tg_node} | ${tg2_node} +| | Append Nodes | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg_node} +| | Compute Path +| | ${tg_to_dut1} | ${tmp}= | Next Interface +| | ${dut1_to_tg} | ${tmp}= | Next Interface +| | ${dut1_to_dut2} | ${tmp}= | Next Interface +| | ${dut2_to_dut1} | ${tmp}= | Next Interface +| | ${dut2_to_tg} | ${tmp}= | Next Interface +| | ${tg_to_dut2} | ${tmp}= | Next Interface +| | ${tg_to_dut1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut1} +| | ${tg_to_dut2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut2} +| | ${dut1_to_tg_mac}= | Get interface mac | ${dut1_node} | ${dut1_to_tg} +| | ${dut1_to_dut2_mac}= | Get interface mac | ${dut1_node} | ${dut1_to_dut2} +| | ${dut2_to_tg_mac}= | Get interface mac | ${dut2_node} | ${dut2_to_tg} +| | ${dut2_to_dut1_mac}= | Get interface mac | ${dut2_node} | ${dut2_to_dut1} +| | Set Test Variable | ${tg_to_dut1} +| | Set Test Variable | ${dut1_to_tg} +| | Set Test Variable | ${tg_to_dut2} +| | Set Test Variable | ${dut2_to_tg} +| | Set Test Variable | ${dut1_to_dut2} +| | Set Test Variable | ${dut2_to_dut1} +| | Set Test Variable | ${tg_to_dut1_mac} +| | Set Test Variable | ${tg_to_dut2_mac} +| | Set Test Variable | ${dut1_to_tg_mac} +| | Set Test Variable | ${dut1_to_dut2_mac} +| | Set Test Variable | ${dut2_to_tg_mac} +| | Set Test Variable | ${dut2_to_dut1_mac} +| | Set Test Variable | ${tg_node} +| | Set Test Variable | ${dut1_node} +| | Set Test Variable | ${dut2_node} + +| Set interfaces in 3-node circular topology up +| | [Documentation] +| | ... | Set UP state on interfaces in 3-node path on nodes and \ +| | ... | wait until all interfaces are ready. +| | ... +| | ... | *Arguments:* +| | ... | - No arguments. +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | _NOTE:_ This KW uses test variables sets in +| | ... | "Configure path in 3-node circular topology" KW. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Given Configure path in 3-node circular topology \| ${nodes['TG']} \ +| | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \| +| | ... | \| And Set interfaces in 3-node circular topology up \| +| | ... +| | Set Interface State | ${tg_node} | ${tg_to_dut1} | up +| | Set Interface State | ${tg_node} | ${tg_to_dut2} | up +| | Set Interface State | ${dut1_node} | ${dut1_to_tg} | up +| | Set Interface State | ${dut1_node} | ${dut1_to_dut2} | up +| | Set Interface State | ${dut2_node} | ${dut2_to_tg} | up +| | Set Interface State | ${dut2_node} | ${dut2_to_dut1} | up +| | Vpp Node Interfaces Ready Wait | ${dut1_node} +| | Vpp Node Interfaces Ready Wait | ${dut2_node} + +| Configure path in double-link 3-node circular topology +| | [Documentation] +| | ... | Compute path for testing on three given nodes in circular \ +| | ... | topology with double link and set corresponding \ +| | ... | test case variables. +| | ... +| | ... | *Arguments:* +| | ... | - ${tg_node} - TG node. Type: dictionary +| | ... | - ${dut1_node} - DUT1 node. Type: dictionary +| | ... | - ${dut2_node} - DUT2 node. Type: dictionary +| | ... | - ${tg2_node} - Node where the path ends. Must be the same as TG node +| | ... | parameter in circular topology. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... | +| | ... | _NOTE:_ This KW sets following test case variables: +| | ... | - ${tg_node} - TG node. +| | ... | - ${tg_to_dut1_if1} - TG interface towards DUT1 interface 1. +| | ... | - ${tg_to_dut1_if2} - TG interface towards DUT1 interface 2. +| | ... | - ${tg_to_dut1_mac_if1} - TG towards DUT1 MAC address interface 1. +| | ... | - ${tg_to_dut1_mac_if2} - TG towards DUT1 MAC address interface 2. +| | ... | - ${tg_to_dut2_if1} - TG interface towards DUT2 interface 1. +| | ... | - ${tg_to_dut2_if2} - TG interface towards DUT2 interface 2. +| | ... | - ${tg_to_dut2_mac_if1} - TG towards DUT2 MAC address interface 1. +| | ... | - ${tg_to_dut2_mac_if2} - TG towards DUT2 MAC address interface 2. +| | ... | - ${dut1_node} - DUT1 node. +| | ... | - ${dut1_to_tg_if1} - DUT1 interface towards TG interface 1. +| | ... | - ${dut1_to_tg_if2} - DUT1 interface towards TG interface 2. +| | ... | - ${dut1_to_tg_mac_if1} - DUT1 towards TG MAC address interface 1. +| | ... | - ${dut1_to_tg_mac_if2} - DUT1 towards TG MAC address interface 2. +| | ... | - ${dut1_to_dut2_if1} - DUT1 interface towards DUT2 interface 1. +| | ... | - ${dut1_to_dut2_if2} - DUT1 interface towards DUT2 interface 2. +| | ... | - ${dut1_to_dut2_mac_if1} - DUT1 towards DUT2 MAC address interface 1. +| | ... | - ${dut1_to_dut2_mac_if2} - DUT1 towards DUT2 MAC address interface 2. +| | ... | - ${dut2_node} - DUT2 node. +| | ... | - ${dut2_to_tg_if1} - DUT2 interface towards TG interface 1. +| | ... | - ${dut2_to_tg_if2} - DUT2 interface towards TG interface 2. +| | ... | - ${dut2_to_tg_mac_if1} - DUT2 towards TG MAC address interface 1. +| | ... | - ${dut2_to_tg_mac_if2} - DUT2 towards TG MAC address interface 2. +| | ... | - ${dut2_to_dut1_if1} - DUT2 interface towards DUT1 interface 1. +| | ... | - ${dut2_to_dut1_if2} - DUT2 interface towards DUT1 interface 2. +| | ... | - ${dut2_to_dut1_mac_if1} - DUT2 towards DUT1 MAC address interface 1. +| | ... | - ${dut2_to_dut1_mac_if2} - DUT2 towards DUT1 MAC address interface 2. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure path in double-link 3-node circular topology \| ${nodes['TG']} \ +| | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \| ${nodes['TG']} \| +| | ... +| | [Arguments] | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg2_node} +| | Should Be Equal | ${tg_node} | ${tg2_node} +| | # Compute path TG - DUT1 with two links in between +| | Append Nodes | ${tg_node} | ${dut1_node} | ${tg_node} +| | Compute Path | always_same_link=${FALSE} +| | ${tg_to_dut1_if1} | ${tmp}= | First Interface +| | ${tg_to_dut1_if2} | ${tmp}= | Last Interface +| | ${dut1_to_tg_if1} | ${tmp}= | First Ingress Interface +| | ${dut1_to_tg_if2} | ${tmp}= | Last Egress Interface +| | # Compute path TG - DUT2 with two links in between +| | Clear Path +| | Append Nodes | ${tg_node} | ${dut2_node} | ${tg_node} +| | Compute Path | always_same_link=${FALSE} +| | ${tg_to_dut2_if1} | ${tmp}= | First Interface +| | ${tg_to_dut2_if2} | ${tmp}= | Last Interface +| | ${dut2_to_tg_if1} | ${tmp}= | First Ingress Interface +| | ${dut2_to_tg_if2} | ${tmp}= | Last Egress Interface +| | # Compute path DUT1 - DUT2 with one link in between +| | Clear Path +| | Append Nodes | ${dut1_node} | ${dut2_node} | ${dut1_node} +| | Compute Path | always_same_link=${FALSE} +| | ${dut1_to_dut2_if1} | ${tmp}= | First Interface +| | ${dut1_to_dut2_if2} | ${tmp}= | Last Interface +| | ${dut2_to_dut1_if1} | ${tmp}= | First Ingress Interface +| | ${dut2_to_dut1_if2} | ${tmp}= | Last Egress Interface +| | # Set test variables +| | Set Test Variable | ${tg_to_dut1_if1} +| | Set Test Variable | ${tg_to_dut1_if2} +| | Set Test Variable | ${tg_to_dut2_if1} +| | Set Test Variable | ${tg_to_dut2_if2} +| | Set Test Variable | ${dut1_to_tg_if1} +| | Set Test Variable | ${dut1_to_tg_if2} +| | Set Test Variable | ${dut2_to_tg_if1} +| | Set Test Variable | ${dut2_to_tg_if2} +| | Set Test Variable | ${dut1_to_dut2_if1} +| | Set Test Variable | ${dut1_to_dut2_if2} +| | Set Test Variable | ${dut2_to_dut1_if1} +| | Set Test Variable | ${dut2_to_dut1_if2} +| | Set Test Variable | ${tg_node} +| | Set Test Variable | ${dut1_node} +| | Set Test Variable | ${dut2_node} +| | # Set Mac Addresses +| | ${tg_to_dut1_if1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut1_if1} +| | ${tg_to_dut1_if2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut1_if2} +| | ${tg_to_dut2_if1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut2_if1} +| | ${tg_to_dut2_if2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut2_if2} +| | ${dut1_to_tg_if1_mac}= | Get interface mac | ${dut1_node} +| | ... | ${dut1_to_tg_if1} +| | ${dut1_to_tg_if2_mac}= | Get interface mac | ${dut1_node} +| | ... | ${dut1_to_tg_if2} +| | ${dut1_to_dut2_if1_mac}= | Get interface mac | ${dut1_node} +| | ... | ${dut1_to_dut2_if1} +| | ${dut1_to_dut2_if2_mac}= | Get interface mac | ${dut1_node} +| | ... | ${dut1_to_dut2_if2} +| | ${dut2_to_tg_if1_mac}= | Get interface mac | ${dut2_node} +| | ... | ${dut2_to_tg_if1} +| | ${dut2_to_tg_if2_mac}= | Get interface mac | ${dut2_node} +| | ... | ${dut2_to_tg_if2} +| | ${dut2_to_dut1_if1_mac}= | Get interface mac | ${dut2_node} +| | ... | ${dut2_to_dut1_if1} +| | ${dut2_to_dut1_if2_mac}= | Get interface mac | ${dut2_node} +| | ... | ${dut2_to_dut1_if2} +| | Set Test Variable | ${tg_to_dut1_if1_mac} +| | Set Test Variable | ${tg_to_dut1_if2_mac} +| | Set Test Variable | ${tg_to_dut2_if1_mac} +| | Set Test Variable | ${tg_to_dut2_if2_mac} +| | Set Test Variable | ${dut1_to_tg_if1_mac} +| | Set Test Variable | ${dut1_to_tg_if2_mac} +| | Set Test Variable | ${dut1_to_dut2_if1_mac} +| | Set Test Variable | ${dut1_to_dut2_if2_mac} +| | Set Test Variable | ${dut2_to_tg_if1_mac} +| | Set Test Variable | ${dut2_to_tg_if2_mac} +| | Set Test Variable | ${dut2_to_dut1_if1_mac} +| | Set Test Variable | ${dut2_to_dut1_if2_mac} + +| Set interfaces in double-link 3-node circular topology up +| | [Documentation] +| | ... | Set UP state on interfaces in 3-node double link path \ +| | ... | wait until all interfaces are ready. +| | ... +| | ... | *Arguments:* +| | ... | - No arguments. +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | _NOTE:_ This KW uses test variables sets in +| | ... | "Configure path in double-link 3-node circular topology" KW. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure path in double-link 3-node circular topology \| ${nodes['TG']} \ +| | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \| +| | ... | \| Interfaces in Double-Link 3-node testing are UP \| +| | ... +| | Set Interface State | ${tg_node} | ${tg_to_dut1_if1} | up +| | Set Interface State | ${tg_node} | ${tg_to_dut1_if2} | up +| | Set Interface State | ${tg_node} | ${tg_to_dut2_if1} | up +| | Set Interface State | ${tg_node} | ${tg_to_dut2_if2} | up +| | Set Interface State | ${dut1_node} | ${dut1_to_tg_if1} | up +| | Set Interface State | ${dut1_node} | ${dut1_to_tg_if2} | up +| | Set Interface State | ${dut2_node} | ${dut2_to_tg_if1} | up +| | Set Interface State | ${dut2_node} | ${dut2_to_tg_if2} | up +| | Set Interface State | ${dut1_node} | ${dut1_to_dut2_if1} | up +| | Set Interface State | ${dut1_node} | ${dut1_to_dut2_if2} | up +| | Set Interface State | ${dut2_node} | ${dut2_to_dut1_if1} | up +| | Set Interface State | ${dut2_node} | ${dut2_to_dut1_if2} | up +| | Vpp Node Interfaces Ready Wait | ${dut1_node} +| | Vpp Node Interfaces Ready Wait | ${dut2_node} \ No newline at end of file diff --git a/resources/libraries/robot/shared/traffic.robot b/resources/libraries/robot/shared/traffic.robot new file mode 100644 index 0000000000..3a5cacee50 --- /dev/null +++ b/resources/libraries/robot/shared/traffic.robot @@ -0,0 +1,459 @@ +# Copyright (c) 2016 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. + +"""Traffic keywords""" + +*** Settings *** +| Library | resources.libraries.python.IPv6Util +| Library | resources.libraries.python.IPv6Setup +| Library | resources.libraries.python.TrafficScriptExecutor +| Library | resources.libraries.python.NodePath +| Library | resources.libraries.python.Routing +| Library | resources.libraries.python.InterfaceUtil +| Library | resources.libraries.python.topology.Topology +| Resource | resources/libraries/robot/shared/default.robot +| Resource | resources/libraries/robot/shared/counters.robot +| Documentation | Traffic keywords + +*** Keywords *** +| Send packet and verify headers +| | [Documentation] | Sends packet from IP (with source mac) to IP +| | ... | (with dest mac). There has to be 4 MAC addresses +| | ... | when using 2 node + +| | ... | xconnect (one for each eth). +| | ... +| | ... | *Arguments:* +| | ... +| | ... | _NOTE:_ Arguments are based on topology: +| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) +| | ... +| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary +| | ... | - src_ip - IP of source interface (TG-if1). Type: string +| | ... | - dst_ip - IP of destination interface (TG-if2). Type: string +| | ... | - tx_src_port - Interface of TG-if1. Type: string +| | ... | - tx_src_mac - MAC address of TG-if1. Type: string +| | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string +| | ... | - rx_port - Interface of TG-if1. Type: string +| | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string +| | ... | - rx_dst_mac - MAC address of TG-if2. Type: string +| | ... | - encaps_tx - Expected encapsulation on TX side: Dot1q or Dot1ad +| | ... | (Optional). Type: string +| | ... | - vlan_tx - VLAN (inner) tag on TX side (Optional). Type: integer +| | ... | - vlan_outer_tx - .1AD VLAN (outer) tag on TX side (Optional). +| | ... | Type: integer +| | ... | - encaps_rx - Expected encapsulation on RX side: Dot1q or Dot1ad +| | ... | (Optional). Type: string +| | ... | - vlan_rx - VLAN (inner) tag on RX side (Optional). Type: integer +| | ... | - vlan_outer_rx - .1AD VLAN (outer) tag on RX side (Optional). +| | ... | Type: integer +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send packet and verify headers \| ${nodes['TG']} \| 10.0.0.1 \ +| | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \ +| | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \| +| | ... +| | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port} | +| | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac} +| | ... | ${rx_dst_mac} +| | ... | ${encaps_tx}=${EMPTY} | ${vlan_tx}=${EMPTY} | ${vlan_outer_tx}=${EMPTY} +| | ... | ${encaps_rx}=${EMPTY} | ${vlan_rx}=${EMPTY} | ${vlan_outer_rx}=${EMPTY} +| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port} +| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port} +| | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac | +| | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac | +| | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip} | +| | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name} +| | ${args}= | Run Keyword If | '${encaps_tx}' == '${EMPTY}' +| | | ... | Set Variable | ${args} +| | ... | ELSE | Catenate +| | ... | ${args} | --encaps_tx ${encaps_tx} | --vlan_tx ${vlan_tx} +| | ${args}= | Run Keyword If | '${encaps_rx}' == '${EMPTY}' +| | | ... | Set Variable | ${args} +| | ... | ELSE | Catenate +| | ... | ${args} | --encaps_rx ${encaps_rx} | --vlan_rx ${vlan_rx} +| | ${args}= | Run Keyword If | '${vlan_outer_tx}' == '${EMPTY}' +| | | ... | Set Variable | ${args} +| | ... | ELSE | Catenate | ${args} | --vlan_outer_tx ${vlan_outer_tx} +| | ${args}= | Run Keyword If | '${vlan_outer_rx}' == '${EMPTY}' +| | | ... | Set Variable | ${args} +| | ... | ELSE | Catenate | ${args} | --vlan_outer_rx ${vlan_outer_rx} +| | Run Traffic Script On Node | send_icmp_check_headers.py | ${tg_node} | +| | ... | ${args} + +| Packet transmission from port to port should fail +| | [Documentation] | Sends packet from ip (with specified mac) to ip +| | ... | (with dest mac). Using keyword : Send packet And Check +| | ... | Headers and subsequently checks the return value +| | ... +| | ... | *Arguments:* +| | ... +| | ... | _NOTE:_ Arguments are based on topology: +| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) +| | ... +| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary +| | ... | - src_ip - IP of source interface (TG-if1). Type: string +| | ... | - dst_ip - IP of destination interface (TG-if2). Type: string +| | ... | - tx_src_port - Interface of TG-if1. Type: string +| | ... | - tx_src_mac - MAC address of TG-if1. Type: string +| | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string +| | ... | - rx_port - Interface of TG-if1. Type: string +| | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string +| | ... | - rx_dst_mac - MAC address of TG-if2. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Packet transmission from port to port should fail \| ${nodes['TG']} \ +| | ... | \| 10.0.0.1 \ \| 32.0.0.1 \| eth2 \| 08:00:27:ee:fd:b3 \ +| | ... | \| 08:00:27:a2:52:5b \| eth3 \| 08:00:27:4d:ca:7a \ +| | ... | \| 08:00:27:7d:fd:10 \| +| | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port} | +| | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac} | +| | ... | ${rx_dst_mac} +| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port} +| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port} +| | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac | +| | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac | +| | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip} | +| | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name} +| | Run Keyword And Expect Error | ICMP echo Rx timeout | +| | ... | Run Traffic Script On Node | send_icmp_check_headers.py +| | ... | ${tg_node} | ${args} + +| Send packet and verify ARP request +| | [Documentation] | Send IP packet from tx_port and check if ARP Request\ +| | ... | packet is received on rx_port. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | _NOTE:_ Arguments are based on topology: +| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) +| | ... +| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary +| | ... | - tx_src_ip - Source IP address of transferred packet (TG-if1). +| | ... | Type: string +| | ... | - tx_dst_ip - Destination IP address of transferred packet (TG-if2). +| | ... | Type: string +| | ... | - tx_port - Interface from which the IP packet is sent (TG-if1). +| | ... | Type: string +| | ... | - tx_dst_mac - Destination MAC address of IP packet (DUT-if1). +| | ... | Type: string +| | ... | - rx_port - Interface where the IP packet is received (TG-if2). +| | ... | Type: string +| | ... | - rx_src_mac - Source MAC address of ARP packet (DUT-if2). +| | ... | Type: string +| | ... | - rx_arp_src_ip - Source IP address of ARP packet (DUT-if2). +| | ... | Type: string +| | ... | - rx_arp_dst_ip - Destination IP address of ARP packet. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send Packet And Check ARP Packet \| ${nodes['TG']} \| 16.0.0.1 \ +| | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \ +| | ... | \| eth4 \| 08:00:27:5b:49:dd \| 192.168.2.1 \| 192.168.2.2 \| +| | ... +| | [Arguments] | ${tg_node} | ${tx_src_ip} | ${tx_dst_ip} | ${tx_port} +| | ... | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac} | ${rx_arp_src_ip} +| | ... | ${rx_arp_dst_ip} +| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port} +| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port} +| | ${args}= | Catenate +| | ... | --tx_dst_mac | ${tx_dst_mac} | --rx_src_mac | ${rx_src_mac} +| | ... | --tx_src_ip | ${tx_src_ip} | --tx_dst_ip | ${tx_dst_ip} +| | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name} +| | ... | --rx_arp_src_ip ${rx_arp_src_ip} | --rx_arp_dst_ip ${rx_arp_dst_ip} +| | Run Traffic Script On Node | send_icmp_check_arp.py | ${tg_node} | ${args} + +| Send TCP or UDP packet and verify received packet +| | [Documentation] | Sends TCP or UDP packet with specified source +| | ... | and destination port. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | _NOTE:_ Arguments are based on topology: +| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) +| | ... +| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary +| | ... | - src_ip - IP of source interface (TG-if1). Type: integer +| | ... | - dst_ip - IP of destination interface (TG-if2). Type: integer +| | ... | - tx_port - Source interface (TG-if1). Type: string +| | ... | - tx_mac - MAC address of source interface (TG-if1). Type: string +| | ... | - rx_port - Destionation interface (TG-if1). Type: string +| | ... | - rx_mac - MAC address of destination interface (TG-if1). Type: string +| | ... | - protocol - Type of protocol. Type: string +| | ... | - source_port - Source TCP/UDP port. Type: string or integer +| | ... | - destination_port - Destination TCP/UDP port. Type: string or integer +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send TCP or UDP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| 16.0.0.1 \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \ +| | ... | \| eth4 \| 08:00:27:c9:6a:d5 \| TCP \| 20 \| 80 \| +| | ... +| | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_port} | +| | ... | ${tx_mac} | ${rx_port} | ${rx_mac} | ${protocol} | ${source_port} +| | ... | ${destination_port} +| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port} +| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port} +| | ${args}= | Catenate | --tx_mac | ${tx_mac} +| | ... | --rx_mac | ${rx_mac} +| | ... | --src_ip | ${src_ip} +| | ... | --dst_ip | ${dst_ip} +| | ... | --tx_if | ${tx_port_name} +| | ... | --rx_if | ${rx_port_name} +| | ... | --protocol | ${protocol} +| | ... | --source_port | ${source_port} +| | ... | --destination_port | ${destination_port} +| | Run Traffic Script On Node | send_tcp_udp.py +| | ... | ${tg_node} | ${args} + +| TCP or UDP packet transmission should fail +| | [Documentation] | Sends TCP or UDP packet with specified source +| | ... | and destination port. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | _NOTE:_ Arguments are based on topology: +| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) +| | ... +| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary +| | ... | - src_ip - IP of source interface (TG-if1). Type: integer +| | ... | - dst_ip - IP of destination interface (TG-if2). Type: integer +| | ... | - tx_port - Source interface (TG-if1). Type: string +| | ... | - tx_mac - MAC address of source interface (TG-if1). Type: string +| | ... | - rx_port - Destionation interface (TG-if1). Type: string +| | ... | - rx_mac - MAC address of destination interface (TG-if1). Type: string +| | ... | - protocol - Type of protocol. Type: string +| | ... | - source_port - Source TCP/UDP port. Type: string or integer +| | ... | - destination_port - Destination TCP/UDP port. Type: string or integer +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| TCP or UDP packet transmission should fail \| ${nodes['TG']} \ +| | ... | \| 16.0.0.1 \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \ +| | ... | \| eth4 \| 08:00:27:c9:6a:d5 \| TCP \| 20 \| 80 \| +| | ... +| | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_port} | +| | ... | ${tx_mac} | ${rx_port} | ${rx_mac} | ${protocol} | ${source_port} +| | ... | ${destination_port} +| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port} +| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port} +| | ${args}= | Catenate | --tx_mac | ${tx_mac} +| | ... | --rx_mac | ${rx_mac} +| | ... | --src_ip | ${src_ip} +| | ... | --dst_ip | ${dst_ip} +| | ... | --tx_if | ${tx_port_name} +| | ... | --rx_if | ${rx_port_name} +| | ... | --protocol | ${protocol} +| | ... | --source_port | ${source_port} +| | ... | --destination_port | ${destination_port} +| | Run Keyword And Expect Error | TCP/UDP Rx timeout +| | ... | Run Traffic Script On Node | send_tcp_udp.py +| | ... | ${tg_node} | ${args} + +| Receive and verify router advertisement packet +| | [Documentation] | Wait until RA packet is received and then verify\ +| | ... | specific fields of received RA packet. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | - node - Node where to check for RA packet. Type: dictionary +| | ... | - rx_port - Interface where the packet is received. Type: string +| | ... | - src_mac - MAC address of source interface from which the link-local\ +| | ... | IPv6 address is constructed and checked. Type: string +| | ... | - interval - Configured retransmit interval. Optional. Type: integer +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Receive and verify router advertisement packet \ +| | ... | \| ${nodes['DUT1']} \| eth2 \| 08:00:27:cc:4f:54 \| +| | ... +| | [Arguments] | ${node} | ${rx_port} | ${src_mac} | ${interval}=${0} +| | ${rx_port_name}= | Get interface name | ${node} | ${rx_port} +| | ${args}= | Catenate +| | ... | --rx_if ${rx_port_name} +| | ... | --src_mac ${src_mac} +| | ... | --interval ${interval} +| | Run Traffic Script On Node | check_ra_packet.py | ${node} | ${args} + +| Send router solicitation and verify response +| | [Documentation] | Send RS packet, wait for response and then verify\ +| | ... | specific fields of received RA packet. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | - tg_node - TG node to send RS packet from. Type: dictionary +| | ... | - dut_node - DUT node to send RS packet to. Type: dictionary +| | ... | - rx_port - Interface where the packet is sent from. Type: string +| | ... | - tx_port - Interface where the packet is sent to. Type: string +| | ... | - src_ip - Source IP address of RS packet. Optional. If not provided,\ +| | ... | link local address will be used. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send router solicitation and verify response \ +| | ... | \| ${nodes['TG']} \| ${nodes['DUT1']} \| eth2 \ +| | ... | \| GigabitEthernet0/8/0 \| 10::10 \| +| | ... +| | [Arguments] | ${tg_node} | ${dut_node} | ${tx_port} | ${rx_port} +| | ... | ${src_ip}='' +| | ${src_mac}= | Get Interface Mac | ${tg_node} | ${tx_port} +| | ${dst_mac}= | Get Interface Mac | ${dut_node} | ${rx_port} +| | ${src_int_name}= | Get interface name | ${tg_node} | ${tx_port} +| | ${dst_int_name}= | Get interface name | ${dut_node} | ${rx_port} +| | ${args}= | catenate +| | ... | --rx_if ${dst_int_name} --tx_if ${src_int_name} +| | ... | --src_mac ${src_mac} | --dst_mac ${dst_mac} +| | ... | --src_ip ${src_ip} +| | Run Traffic Script On Node | send_rs_check_ra.py +| | ... | ${tg_node} | ${args} + +| Send ARP Request +| | [Documentation] | Send ARP Request and check if the ARP Response is received. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | _NOTE:_ Arguments are based on topology: +| | ... | TG(if1)<->(if1)DUT +| | ... +| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary +| | ... | - tx_port - Interface from which the ARP packet is sent (TG-if1). +| | ... | Type: string +| | ... | - src_mac - Source MAC address of ARP packet (TG-if1). +| | ... | Type: string +| | ... | - tgt_mac - Target MAC address which is expected in the response +| | ... | (DUT-if1). Type: string +| | ... | - src_ip - Source IP address of ARP packet (TG-if1). +| | ... | Type: string +| | ... | - tgt_ip - Target IP address of ARP packet (DUT-if1). +| | ... | Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send ARP Request \| ${nodes['TG']} \| eth3 \ +| | ... | \| 08:00:27:cc:4f:54 \| 08:00:27:c9:6a:d5 \ +| | ... | \| 10.0.0.100 \| 192.168.1.5 \| +| | ... +| | [Arguments] | ${tg_node} | ${tx_port} +| | ... | ${src_mac} | ${tgt_mac} +| | ... | ${src_ip} | ${tgt_ip} +| | ${args}= | Catenate | --tx_if | ${tx_port} +| | ... | --src_mac | ${src_mac} | --dst_mac | ${tgt_mac} +| | ... | --src_ip | ${src_ip} | --dst_ip | ${tgt_ip} +| | Run Traffic Script On Node | arp_request.py | ${tg_node} | ${args} + +| ARP request should fail +| | [Documentation] | Send ARP Request and +| | ... | the ARP Response should not be received. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | _NOTE:_ Arguments are based on topology: +| | ... | TG(if1)<->(if1)DUT +| | ... +| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary +| | ... | - tx_port - Interface from which the ARP packet is sent (TG-if1). +| | ... | Type: string +| | ... | - src_mac - Source MAC address of ARP packet (TG-if1). +| | ... | Type: string +| | ... | - tgt_mac - Target MAC address which is expected in the response +| | ... | (DUT-if1). Type: string +| | ... | - src_ip - Source IP address of ARP packet (TG-if1). +| | ... | Type: string +| | ... | - tgt_ip - Target IP address of ARP packet (DUT-if1). +| | ... | Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| ARP request should fail \| ${nodes['TG']} \| eth3 \ +| | ... | \| 08:00:27:cc:4f:54 \| 08:00:27:c9:6a:d5 \ +| | ... | \| 10.0.0.100 \| 192.168.1.5 \| +| | ... +| | [Arguments] | ${tg_node} | ${tx_port} +| | ... | ${src_mac} | ${tgt_mac} +| | ... | ${src_ip} | ${tgt_ip} +| | ${args}= | Catenate | --tx_if | ${tx_port} +| | ... | --src_mac | ${src_mac} | --dst_mac | ${tgt_mac} +| | ... | --src_ip | ${src_ip} | --dst_ip | ${tgt_ip} +| | Run Keyword And Expect Error | ARP reply timeout +| | ... | Run Traffic Script On Node | arp_request.py | ${tg_node} | ${args} + +| Send packets and verify multipath routing +| | [Documentation] | Send 100 IP ICMP packets traffic and check if it is\ +| | ... | divided into two paths. +| | ... +| | ... | *Arguments:* +| | ... +| | ... | _NOTE:_ Arguments are based on topology: +| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) +| | ... +| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary +| | ... | - src_port - Interface of TG-if1. Type: string +| | ... | - dst_port - Interface of TG-if2. Type: string +| | ... | - src_ip - IP of source interface (TG-if1). Type: string +| | ... | - dst_ip - IP of destination interface (TG-if2). Type: string +| | ... | - tx_src_mac - MAC address of TG-if1. Type: string +| | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string +| | ... | - rx_src_mac - MAC address of DUT-if2. Type: string +| | ... | - rx_dst_mac_1 - MAC address of interface for path 1. Type: string +| | ... | - rx_dst_mac_2 - MAC address of interface for path 2. Type: string +| | ... +| | ... | *Return:* +| | ... | - No value returned +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Send Packet And Check Multipath Routing \| ${nodes['TG']} \ +| | ... | \| eth2 \| eth3 \| 16.0.0.1 \| 32.0.0.1 \ +| | ... | \| 08:00:27:cc:4f:54 \| 08:00:27:c9:6a:d5 \| 08:00:27:54:59:f9 \ +| | ... | \| 02:00:00:00:00:02 \| 02:00:00:00:00:03 \| +| | ... +| | [Arguments] | ${tg_node} | ${src_port} | ${dst_port} | ${src_ip} | ${dst_ip} +| | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_src_mac} +| | ... | ${rx_dst_mac_1} | ${rx_dst_mac_2} +| | ${src_port_name}= | Get interface name | ${tg_node} | ${src_port} +| | ${dst_port_name}= | Get interface name | ${tg_node} | ${dst_port} +| | ${args}= | Catenate | --tx_if | ${src_port_name} +| | ... | --rx_if | ${dst_port_name} | --src_ip | ${src_ip} +| | ... | --dst_ip | ${dst_ip} | --tg_if1_mac | ${tx_src_mac} +| | ... | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac | ${rx_src_mac} +| | ... | --path_1_mac | ${rx_dst_mac_1} | --path_2_mac | ${rx_dst_mac_2} +| | Run Traffic Script On Node | send_icmp_check_multipath.py | ${tg_node} +| | ... | ${args} diff --git a/resources/libraries/robot/snat.robot b/resources/libraries/robot/snat.robot deleted file mode 100644 index 610a9150ee..0000000000 --- a/resources/libraries/robot/snat.robot +++ /dev/null @@ -1,150 +0,0 @@ -# Copyright (c) 2017 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.SNATUtil -| Library | resources.libraries.python.NAT.NATUtil -| Documentation | Keywords for SNAT feature in VPP. - -*** Keywords *** -| Configure inside and outside interfaces -| | [Documentation] | Configure inside and outside interfaces for SNAT. -| | ... -| | ... | *Arguments:* -| | ... | - node - DUT node to set SNAT interfaces on. Type: dictionary -| | ... | - int_in - Inside interface. Type: string -| | ... | - int_out - Outside interface. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure inside and outside interfaces \| ${nodes['DUT1']} \ -| | ... | \| FortyGigabitEtherneta/0/0 \| FortyGigabitEtherneta/0/1 \| -| | ... -| | [Arguments] | ${node} | ${int_in} | ${int_out} -| | ... -| | ${int_in_name}= | Set variable | ${node['interfaces']['${int_in}']['name']} -| | ${int_out_name}= | Set variable | ${node['interfaces']['${int_out}']['name']} -| | Set SNAT Interfaces | ${node} | ${int_in_name} | ${int_out_name} - -| Configure deterministic mode for SNAT -| | [Documentation] | Set deterministic behaviour of SNAT. -| | ... -| | ... | *Arguments:* -| | ... | - node - DUT node to set deterministic mode for SNAT on. -| | ... | Type: dictionary -| | ... | - ip_in - Inside IP. Type: string -| | ... | - subnet_in - Inside IP subnet. Type: string -| | ... | - ip_out - Outside IP. Type: string -| | ... | - subnet_out - Outside IP subnet. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure deterministic mode for SNAT \| ${nodes['DUT1']} \ -| | ... | \| 100.0.0.0 \| 12 \| 12.1.1.0 \| 24 \| -| | ... -| | [Arguments] | ${node} | ${ip_in} | ${subnet_in} | ${ip_out} | ${subnet_out} -| | ... -| | Set SNAT deterministic | ${node} | ${ip_in} | ${subnet_in} | ${ip_out} -| | ... | ${subnet_out} - -| Configure workers for SNAT -| | [Documentation] | Configure workers for SNAT. -| | ... -| | ... | *Arguments:* -| | ... | - node - DUT node to set SNAT workers on. Type: dictionary -| | ... | - lcores - list of cores, format: range e.g. 1-5 or list of ranges \ -| | ... | e.g.: 1-5,18-22. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure workers for SNAT \| ${nodes['DUT1']} \| 12-23,36-47 \| -| | ... -| | [Arguments] | ${node} | ${lcores} -| | ... -| | Set SNAT workers | ${node} | ${lcores} - -| Show SNAT verbose -| | [Documentation] | Get the SNAT settings on the node. -| | ... -| | ... | *Arguments:* -| | ... | - node - DUT node to show SNAT. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Show SNAT verbose \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${node} -| | ... -| | Show SNAT | ${node} - -| Get SNAT deterministic forward -| | [Documentation] | Show forward IP address and port(s). -| | ... -| | ... | *Arguments:* -| | ... | - node - DUT node to get SNAT deterministic forward on. -| | ... | Type: dictionary -| | ... | - ip - IP address. Type: string -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Get SNAT deterministic forward \| ${nodes['DUT1']} \| 10.0.0.2 \| -| | ... -| | [Arguments] | ${node} | ${ip} -| | ... -| | Show SNAT deterministic forward | ${node} | ${ip} - -| Get SNAT deterministic reverse -| | [Documentation] | Show reverse IP address. -| | ... -| | ... | *Arguments:* -| | ... | - node - DUT node to get SNAT deterministic reverse on. -| | ... | Type: dictionary -| | ... | - ip - IP address. Type: string -| | ... | - port - Port. Type: string or integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Get SNAT deterministic reverse \| ${nodes['DUT1']} \| 10.0.0.2 \ -| | ... | \| 1025 \| -| | ... -| | [Arguments] | ${node} | ${ip} | ${port} -| | ... -| | Show SNAT deterministic reverse | ${node} | ${ip} | ${port} - -| Get NAT interfaces -| | [Documentation] | Get list of interfaces configured with NAT from VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - node - DUT node to get SNAT interfaces on. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Get NAT interfaces \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${node} -| | ... -| | VPP get NAT interfaces | ${node} - -| Get NAT static mappings -| | [Documentation] | Get NAT static mappings from VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - node - DUT node to get SNAT static mappings on. Type: dictionary -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Get NAT static mappings \| ${nodes['DUT1']} \| -| | ... -| | [Arguments] | ${node} -| | ... -| | VPP get NAT static mappings | ${node} diff --git a/resources/libraries/robot/tagging.robot b/resources/libraries/robot/tagging.robot deleted file mode 100644 index 431812b3ab..0000000000 --- a/resources/libraries/robot/tagging.robot +++ /dev/null @@ -1,219 +0,0 @@ -# Copyright (c) 2016 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 for VLAN tests -| Resource | resources/libraries/robot/default.robot -| Resource | resources/libraries/robot/l2_xconnect.robot -| Library | resources.libraries.python.L2Util -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.NodePath - -*** Keywords *** - -| Initialize VLAN sub-interfaces in 3-node circular topology -| | [Arguments] | ${DUT1} | ${INT1} | ${DUT2} | ${INT2} | ${SUB_ID} -| | ... | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID} | ${TYPE_SUBIF} -| | [Documentation] | *Create two subinterfaces on DUTs.* -| | ... -| | ... | *Arguments:* -| | ... | - DUT1 - Node to add sub-interface. -| | ... | - INT1 - Interface name on which create sub-interface. -| | ... | - DUT2 - Node to add sub-interface. -| | ... | - INT2 - Interface name on which create sub-interface. -| | ... | - SUB_ID - ID of the sub-interface to be created. -| | ... | - OUTER_VLAN_ID - Outer VLAN ID. -| | ... | - INNER_VLAN_ID - Inner VLAN ID. -| | ... | - TYPE_SUBIF - Type of sub-interface. -| | ... -| | ... | _Set testcase variables with name and index of created interfaces:_ -| | ... | - subif_name_1 -| | ... | - subif_index_1 -| | ... | - subif_name_2 -| | ... | - subif_index_2 -| | ... -| | ${INT1_name}= | Get interface name | ${DUT1} | ${INT1} -| | ${subif_name_1} | ${subif_index_1}= | Create subinterface | ${DUT1} -| | ... | ${INT1_name} | ${SUB_ID} -| | ... | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID} -| | ... | ${TYPE_SUBIF} -| | ${INT2_name}= | Get interface name | ${DUT2} | ${INT2} -| | ${subif_name_2} | ${subif_index_2}= | Create subinterface | ${DUT2} -| | ... | ${INT2_name} | ${SUB_ID} -| | ... | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID} -| | ... | ${TYPE_SUBIF} -| | Set Interface State | ${DUT1} | ${subif_index_1} | up -| | Set Interface State | ${DUT2} | ${subif_index_2} | up -| | Set Test Variable | ${subif_name_1} -| | Set Test Variable | ${subif_index_1} -| | Set Test Variable | ${subif_name_2} -| | Set Test Variable | ${subif_index_2} - -| Initialize VLAN dot1q sub-interfaces in 3-node circular topology -| | [Arguments] | ${DUT1} | ${INT1} | ${DUT2} | ${INT2} | ${SUB_ID} -| | [Documentation] | *Create two dot1q subinterfaces on DUTs.* -| | ... -| | ... | *Arguments:* -| | ... | - DUT1 - Node to add sub-interface. -| | ... | - INT1 - Interface name on which create VLAN sub-interface. -| | ... | - DUT2 - Node to add sub-interface. -| | ... | - INT2 - Interface name on which create VLAN sub-interface. -| | ... | - SUB_ID - ID of the sub-interface to be created. -| | ... -| | ... | _Set testcase variables with name and index of created interfaces:_ -| | ... | - subif_name_1 -| | ... | - subif_index_1 -| | ... | - subif_name_2 -| | ... | - subif_index_2 -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Initialize VLAN dot1q sub-interfaces in 3-node circular topology \ -| | ... | \| ${nodes['DUT1']} \| ${dut1_if2} \| ${nodes['DUT2']} \ -| | ... | \| ${dut1_if2} \| 10 \| -| | ... -| | ${INT1_NAME}= | Get interface name | ${DUT1} | ${INT1} -| | ${INT2_NAME}= | Get interface name | ${DUT2} | ${INT2} -| | ${subif_name_1} | ${subif_index_1}= | Create Vlan Subinterface -| | | ... | ${DUT1} | ${INT1_NAME} | ${SUB_ID} -| | ${subif_name_2} | ${subif_index_2}= | Create Vlan Subinterface -| | | ... | ${DUT2} | ${INT2_NAME} | ${SUB_ID} -| | Set Interface State | ${DUT1} | ${subif_index_1} | up -| | Set Interface State | ${DUT2} | ${subif_index_2} | up -| | Set Test Variable | ${subif_name_1} -| | Set Test Variable | ${subif_index_1} -| | Set Test Variable | ${subif_name_2} -| | Set Test Variable | ${subif_index_2} - -| Configure L2 tag rewrite method on interfaces -| | [Arguments] | ${DUT1} | ${SUB_INT1} | ${DUT2} | ${SUB_INT2} -| | ... | ${TAG_REWRITE_METHOD} -| | [Documentation] | *Setup tag rewrite on sub-interfaces on DUTs.* -| | ... -| | ... | *Arguments:* -| | ... | - DUT1 - Node to rewrite tags. -| | ... | - SUB_INT1 - Interface on which rewrite tags. -| | ... | - DUT2 - Node to rewrite tags. -| | ... | - SUB_INT2 - Interface on which rewrite tags. -| | ... | - TAG_REWRITE_METHOD - Method of tag rewrite. -| | ... -| | L2 Vlan tag rewrite | ${DUT1} | ${SUB_INT1} | ${TAG_REWRITE_METHOD} -| | L2 Vlan tag rewrite | ${DUT2} | ${SUB_INT2} | ${TAG_REWRITE_METHOD} - -| Connect interfaces and VLAN sub-interfaces using L2XC -| | [Arguments] | ${DUT1} | ${INT1} | ${SUB_INT1} -| | ... | ${DUT2} | ${INT2} | ${SUB_INT2} -| | [Documentation] | *Add interface and subinterface to bidirectional -| | ... | L2-xconnect on DUTs.* -| | ... -| | ... | *Arguments:* -| | ... | - DUT1 - Node to add bidirectional cross-connect. -| | ... | - INT1 - Interface to add to the cross-connect. -| | ... | - SUB_INT1 - Sub-interface to add to the cross-connect. -| | ... | - DUT2 - Node to add bidirectional cross-connect. -| | ... | - INT2 - Interface to add to the cross-connect. -| | ... | - SUB_INT2 - Sub-interface to add to the cross-connect. -| | ... -| | Configure L2XC | ${DUT1} | ${INT1} | ${SUB_INT1} -| | Configure L2XC | ${DUT2} | ${INT2} | ${SUB_INT2} - -| Create vlan sub-interface -| | [Documentation] | Create VLAN sub-interface on DUT and set admin status up. -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - Node to add VLAN sub-intreface. Type: dictionary -| | ... | - interface - Interface to create VLAN sub-interface. Type: string -| | ... | - vlan_id - VLAN ID. Type: integer -| | ... -| | ... | *Return:* -| | ... | - vlan_name - VLAN sub-interface name. Type: string -| | ... | - vlan_index - VLAN sub-interface SW index. Type: integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create vlan sub-interface \| ${nodes['DUT1']} \| port3 \| 100 \| -| | ... -| | [Arguments] | ${dut_node} | ${interface} | ${vlan_id} -| | [Return] | ${vlan_name} | ${vlan_index} -| | ${interface_name}= | Get interface name | ${dut_node} | ${interface} -| | ${vlan_name} | ${vlan_index}= | Create Vlan Subinterface -| | ... | ${dut_node} | ${interface_name} | ${vlan_id} -| | Set Interface State | ${dut_node} | ${vlan_index} | up - -| Create tagged sub-interface -| | [Documentation] | Create tagged sub-interface on DUT. Type of tagged \ -| | ... | sub-intreface depends on type_subif value: -| | ... | - one_tag -> VLAN -| | ... | - two_tags -> QinQ VLAN -| | ... | - two_tags dot1ad - DOT1AD -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - Node to add VLAN sub-intreface. Type: dictionary -| | ... | - interface - Interface to create tagged sub-interface. Type: string -| | ... | - subif_id - Sub-interface ID. Type: integer -| | ... | - outer_vlan_id - VLAN (outer) ID (Optional). Type: integer -| | ... | - inner_vlan_id - VLAN inner ID (Optional). Type: integer -| | ... | - type_subif - Sub-interface type (Optional). Type: string -| | ... -| | ... | *Return:* -| | ... | - subif_name - Sub-interface name. Type: string -| | ... | - subif_index - Sub-interface SW index. Type: integer -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Create tagged sub-interface \| ${nodes['DUT1']} \| port1 \| 10 \ -| | ... | \| outer_vlan_id=100 \| inner_vlan_id=200 \ -| | ... | \| type_subif=two_tags dot1ad \| -| | ... -| | [Arguments] | ${dut_node} | ${interface} | ${subif_id} -| | ... | ${outer_vlan_id}=${None} | ${inner_vlan_id}=${None} -| | ... | ${type_subif}=${None} -| | [Return] | ${subif_name} | ${subif_index} -| | ${interface_name}= | Get interface name | ${dut_node} | ${interface} -| | ${subif_name} | ${subif_index}= | Create Subinterface -| | ... | ${dut_node} | ${interface_name} | ${subif_id} -| | ... | outer_vlan_id=${outer_vlan_id} | inner_vlan_id=${inner_vlan_id} -| | ... | type_subif=${type_subif} - -| Configure L2 tag rewrite method on interface -| | [Documentation] | Set L2 tag rewrite on (sub-)interface on DUT -| | ... -| | ... | *Arguments:* -| | ... | - dut_node - Node to set L2 tag rewrite method. Type: dictionary -| | ... | - interface - (Sub-)interface name or SW index to set L2 tag rewrite -| | ... | method. Type: string or integer -| | ... | - tag_rewrite_method - Tag rewrite method. Type: string -| | ... | - push_dot1q - True to push tags as Dot1q, False to push tags as -| | ... | Dot1ad (Optional). Type: boolean -| | ... | - tag1_id - VLAN tag1 ID (Optional). Type: integer -| | ... | - tag2_id - VLAN tag2 ID (Optional). Type: integer -| | ... -| | ... | *Return:* -| | ... -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure L2 tag rewrite method on interface \| ${nodes['DUT1']} \ -| | ... | \| 9 \| pop-1 \| -| | ... | \| Configure L2 tag rewrite method on interface \| ${nodes['DUT2']} \ -| | ... | \| 10 \| translate-1-2 \| push_dot1q=${False} \| tag1_id=10 \ -| | ... | \| tag1_id=20 \| -| | ... -| | [Arguments] | ${dut_node} | ${interface} | ${tag_rewrite_method} -| | ... | ${push_dot1q}=${True} | ${tag1_id}=${None} | ${tag2_id}=${None} -| | ${result}= | Evaluate | isinstance($interface, int) -| | ${interface_name}= | Run Keyword If | ${result} | Set Variable | ${interface} -| | ... | ELSE | Get interface name | ${dut_node} | ${interface} -| | L2 Vlan Tag Rewrite | ${dut_node} | ${interface_name} | ${tag_rewrite_method} -| | ... | push_dot1q=${push_dot1q} | tag1_id=${tag1_id} | tag2_id=${tag2_id} diff --git a/resources/libraries/robot/telemetry/ipfix.robot b/resources/libraries/robot/telemetry/ipfix.robot index 5248964f29..b7d8ac74f9 100644 --- a/resources/libraries/robot/telemetry/ipfix.robot +++ b/resources/libraries/robot/telemetry/ipfix.robot @@ -16,7 +16,7 @@ *** Settings *** | Library | resources.libraries.python.TrafficScriptExecutor | Library | resources.libraries.python.InterfaceUtil -| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/shared/default.robot | Documentation | Traffic keywords *** Keywords *** diff --git a/resources/libraries/robot/testing_path.robot b/resources/libraries/robot/testing_path.robot deleted file mode 100644 index b7543e1c4d..0000000000 --- a/resources/libraries/robot/testing_path.robot +++ /dev/null @@ -1,353 +0,0 @@ -# Copyright (c) 2016 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.NodePath - -*** Keywords *** -| Configure path in 2-node circular topology -| | [Documentation] | Compute path for testing on two given nodes in circular -| | ... | topology and set corresponding test case variables. -| | ... -| | ... | *Arguments:* -| | ... | - ${tg_node} - TG node. Type: dictionary -| | ... | - ${dut_node} - DUT node. Type: dictionary -| | ... | - ${tg2_node} - Node where the path ends. Must be the same as TG node -| | ... | parameter in circular topology. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | _NOTE:_ This KW sets following test case variables: -| | ... | - ${tg_node} - TG node. -| | ... | - ${tg_to_dut_if1} - 1st TG interface towards DUT. -| | ... | - ${tg_to_dut_if2} - 2nd TG interface towards DUT. -| | ... | - ${dut_node} - DUT node. -| | ... | - ${dut_to_tg_if1} - 1st DUT interface towards TG. -| | ... | - ${dut_to_tg_if2} - 2nd DUT interface towards TG. -| | ... | - ${tg_to_dut_if1_mac} -| | ... | - ${tg_to_dut_if2_mac} -| | ... | - ${dut_to_tg_if1_mac} -| | ... | - ${dut_to_tg_if2_mac} -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Given Configure path in 2-node circular topology \| ${nodes['TG']} \ -| | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \| -| | ... -| | [Arguments] | ${tg_node} | ${dut_node} | ${tg2_node} -| | Should Be Equal | ${tg_node} | ${tg2_node} -| | Append Nodes | ${tg_node} | ${dut_node} | ${tg_node} -| | Compute Path | always_same_link=${FALSE} -| | ${tg_to_dut_if1} | ${tmp}= | First Interface -| | ${tg_to_dut_if2} | ${tmp}= | Last Interface -| | ${dut_to_tg_if1} | ${tmp}= | First Ingress Interface -| | ${dut_to_tg_if2} | ${tmp}= | Last Egress Interface -| | ${tg_to_dut_if1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut_if1} -| | ${tg_to_dut_if2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut_if2} -| | ${dut_to_tg_if1_mac}= | Get interface mac | ${dut_node} | ${dut_to_tg_if1} -| | ${dut_to_tg_if2_mac}= | Get interface mac | ${dut_node} | ${dut_to_tg_if2} -| | Set Test Variable | ${tg_to_dut_if1} -| | Set Test Variable | ${tg_to_dut_if2} -| | Set Test Variable | ${dut_to_tg_if1} -| | Set Test Variable | ${dut_to_tg_if2} -| | Set Test Variable | ${tg_to_dut_if1_mac} -| | Set Test Variable | ${tg_to_dut_if2_mac} -| | Set Test Variable | ${dut_to_tg_if1_mac} -| | Set Test Variable | ${dut_to_tg_if2_mac} -| | Set Test Variable | ${tg_node} -| | Set Test Variable | ${dut_node} - -| Set interfaces in 2-node circular topology up -| | [Documentation] | Set UP state on interfaces in 2-node path on nodes and -| | ... | wait for all interfaces are ready. Requires more than -| | ... | one link between nodes. -| | ... -| | ... | *Arguments:* -| | ... | - No arguments. -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | _NOTE:_ This KW uses test variables sets in -| | ... | "Configure path in 2-node circular topology" KW. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Given Configure path in 2-node circular topology \| ${nodes['TG']} \ -| | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \| -| | ... | \| And Set interfaces in 2-node circular topology up \| -| | ... -| | Set Interface State | ${tg_node} | ${tg_to_dut_if1} | up -| | Set Interface State | ${tg_node} | ${tg_to_dut_if2} | up -| | Set Interface State | ${dut_node} | ${dut_to_tg_if1} | up -| | Set Interface State | ${dut_node} | ${dut_to_tg_if2} | up -| | Vpp Node Interfaces Ready Wait | ${dut_node} - -| Configure path in 3-node circular topology -| | [Documentation] | Compute path for testing on three given nodes in circular -| | ... | topology and set corresponding test case variables. -| | ... -| | ... | *Arguments:* -| | ... | - ${tg_node} - TG node. Type: dictionary -| | ... | - ${dut1_node} - DUT1 node. Type: dictionary -| | ... | - ${dut2_node} - DUT2 node. Type: dictionary -| | ... | - ${tg2_node} - Node where the path ends. Must be the same as TG node -| | ... | parameter in circular topology. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... | -| | ... | _NOTE:_ This KW sets following test case variables: -| | ... | - ${tg_node} - TG node. -| | ... | - ${tg_to_dut1} - TG interface towards DUT1. -| | ... | - ${tg_to_dut2} - TG interface towards DUT2. -| | ... | - ${dut1_node} - DUT1 node. -| | ... | - ${dut1_to_tg} - DUT1 interface towards TG. -| | ... | - ${dut1_to_dut2} - DUT1 interface towards DUT2. -| | ... | - ${dut2_node} - DUT2 node. -| | ... | - ${dut2_to_tg} - DUT2 interface towards TG. -| | ... | - ${dut2_to_dut1} - DUT2 interface towards DUT1. -| | ... | - ${tg_to_dut1_mac} -| | ... | - ${tg_to_dut2_mac} -| | ... | - ${dut1_to_tg_mac} -| | ... | - ${dut1_to_dut2_mac} -| | ... | - ${dut2_to_tg_mac} -| | ... | - ${dut2_to_dut1_mac} -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Given Configure path in 3-node circular topology \| ${nodes['TG']} \ -| | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \| ${nodes['TG']} \| -| | ... -| | [Arguments] | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg2_node} -| | Should Be Equal | ${tg_node} | ${tg2_node} -| | Append Nodes | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg_node} -| | Compute Path -| | ${tg_to_dut1} | ${tmp}= | Next Interface -| | ${dut1_to_tg} | ${tmp}= | Next Interface -| | ${dut1_to_dut2} | ${tmp}= | Next Interface -| | ${dut2_to_dut1} | ${tmp}= | Next Interface -| | ${dut2_to_tg} | ${tmp}= | Next Interface -| | ${tg_to_dut2} | ${tmp}= | Next Interface -| | ${tg_to_dut1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut1} -| | ${tg_to_dut2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut2} -| | ${dut1_to_tg_mac}= | Get interface mac | ${dut1_node} | ${dut1_to_tg} -| | ${dut1_to_dut2_mac}= | Get interface mac | ${dut1_node} | ${dut1_to_dut2} -| | ${dut2_to_tg_mac}= | Get interface mac | ${dut2_node} | ${dut2_to_tg} -| | ${dut2_to_dut1_mac}= | Get interface mac | ${dut2_node} | ${dut2_to_dut1} -| | Set Test Variable | ${tg_to_dut1} -| | Set Test Variable | ${dut1_to_tg} -| | Set Test Variable | ${tg_to_dut2} -| | Set Test Variable | ${dut2_to_tg} -| | Set Test Variable | ${dut1_to_dut2} -| | Set Test Variable | ${dut2_to_dut1} -| | Set Test Variable | ${tg_to_dut1_mac} -| | Set Test Variable | ${tg_to_dut2_mac} -| | Set Test Variable | ${dut1_to_tg_mac} -| | Set Test Variable | ${dut1_to_dut2_mac} -| | Set Test Variable | ${dut2_to_tg_mac} -| | Set Test Variable | ${dut2_to_dut1_mac} -| | Set Test Variable | ${tg_node} -| | Set Test Variable | ${dut1_node} -| | Set Test Variable | ${dut2_node} - -| Set interfaces in 3-node circular topology up -| | [Documentation] -| | ... | Set UP state on interfaces in 3-node path on nodes and \ -| | ... | wait until all interfaces are ready. -| | ... -| | ... | *Arguments:* -| | ... | - No arguments. -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | _NOTE:_ This KW uses test variables sets in -| | ... | "Configure path in 3-node circular topology" KW. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Given Configure path in 3-node circular topology \| ${nodes['TG']} \ -| | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \| -| | ... | \| And Set interfaces in 3-node circular topology up \| -| | ... -| | Set Interface State | ${tg_node} | ${tg_to_dut1} | up -| | Set Interface State | ${tg_node} | ${tg_to_dut2} | up -| | Set Interface State | ${dut1_node} | ${dut1_to_tg} | up -| | Set Interface State | ${dut1_node} | ${dut1_to_dut2} | up -| | Set Interface State | ${dut2_node} | ${dut2_to_tg} | up -| | Set Interface State | ${dut2_node} | ${dut2_to_dut1} | up -| | Vpp Node Interfaces Ready Wait | ${dut1_node} -| | Vpp Node Interfaces Ready Wait | ${dut2_node} - -| Configure path in double-link 3-node circular topology -| | [Documentation] -| | ... | Compute path for testing on three given nodes in circular \ -| | ... | topology with double link and set corresponding \ -| | ... | test case variables. -| | ... -| | ... | *Arguments:* -| | ... | - ${tg_node} - TG node. Type: dictionary -| | ... | - ${dut1_node} - DUT1 node. Type: dictionary -| | ... | - ${dut2_node} - DUT2 node. Type: dictionary -| | ... | - ${tg2_node} - Node where the path ends. Must be the same as TG node -| | ... | parameter in circular topology. Type: dictionary -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... | -| | ... | _NOTE:_ This KW sets following test case variables: -| | ... | - ${tg_node} - TG node. -| | ... | - ${tg_to_dut1_if1} - TG interface towards DUT1 interface 1. -| | ... | - ${tg_to_dut1_if2} - TG interface towards DUT1 interface 2. -| | ... | - ${tg_to_dut1_mac_if1} - TG towards DUT1 MAC address interface 1. -| | ... | - ${tg_to_dut1_mac_if2} - TG towards DUT1 MAC address interface 2. -| | ... | - ${tg_to_dut2_if1} - TG interface towards DUT2 interface 1. -| | ... | - ${tg_to_dut2_if2} - TG interface towards DUT2 interface 2. -| | ... | - ${tg_to_dut2_mac_if1} - TG towards DUT2 MAC address interface 1. -| | ... | - ${tg_to_dut2_mac_if2} - TG towards DUT2 MAC address interface 2. -| | ... | - ${dut1_node} - DUT1 node. -| | ... | - ${dut1_to_tg_if1} - DUT1 interface towards TG interface 1. -| | ... | - ${dut1_to_tg_if2} - DUT1 interface towards TG interface 2. -| | ... | - ${dut1_to_tg_mac_if1} - DUT1 towards TG MAC address interface 1. -| | ... | - ${dut1_to_tg_mac_if2} - DUT1 towards TG MAC address interface 2. -| | ... | - ${dut1_to_dut2_if1} - DUT1 interface towards DUT2 interface 1. -| | ... | - ${dut1_to_dut2_if2} - DUT1 interface towards DUT2 interface 2. -| | ... | - ${dut1_to_dut2_mac_if1} - DUT1 towards DUT2 MAC address interface 1. -| | ... | - ${dut1_to_dut2_mac_if2} - DUT1 towards DUT2 MAC address interface 2. -| | ... | - ${dut2_node} - DUT2 node. -| | ... | - ${dut2_to_tg_if1} - DUT2 interface towards TG interface 1. -| | ... | - ${dut2_to_tg_if2} - DUT2 interface towards TG interface 2. -| | ... | - ${dut2_to_tg_mac_if1} - DUT2 towards TG MAC address interface 1. -| | ... | - ${dut2_to_tg_mac_if2} - DUT2 towards TG MAC address interface 2. -| | ... | - ${dut2_to_dut1_if1} - DUT2 interface towards DUT1 interface 1. -| | ... | - ${dut2_to_dut1_if2} - DUT2 interface towards DUT1 interface 2. -| | ... | - ${dut2_to_dut1_mac_if1} - DUT2 towards DUT1 MAC address interface 1. -| | ... | - ${dut2_to_dut1_mac_if2} - DUT2 towards DUT1 MAC address interface 2. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure path in double-link 3-node circular topology \| ${nodes['TG']} \ -| | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \| ${nodes['TG']} \| -| | ... -| | [Arguments] | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg2_node} -| | Should Be Equal | ${tg_node} | ${tg2_node} -| | # Compute path TG - DUT1 with two links in between -| | Append Nodes | ${tg_node} | ${dut1_node} | ${tg_node} -| | Compute Path | always_same_link=${FALSE} -| | ${tg_to_dut1_if1} | ${tmp}= | First Interface -| | ${tg_to_dut1_if2} | ${tmp}= | Last Interface -| | ${dut1_to_tg_if1} | ${tmp}= | First Ingress Interface -| | ${dut1_to_tg_if2} | ${tmp}= | Last Egress Interface -| | # Compute path TG - DUT2 with two links in between -| | Clear Path -| | Append Nodes | ${tg_node} | ${dut2_node} | ${tg_node} -| | Compute Path | always_same_link=${FALSE} -| | ${tg_to_dut2_if1} | ${tmp}= | First Interface -| | ${tg_to_dut2_if2} | ${tmp}= | Last Interface -| | ${dut2_to_tg_if1} | ${tmp}= | First Ingress Interface -| | ${dut2_to_tg_if2} | ${tmp}= | Last Egress Interface -| | # Compute path DUT1 - DUT2 with one link in between -| | Clear Path -| | Append Nodes | ${dut1_node} | ${dut2_node} | ${dut1_node} -| | Compute Path | always_same_link=${FALSE} -| | ${dut1_to_dut2_if1} | ${tmp}= | First Interface -| | ${dut1_to_dut2_if2} | ${tmp}= | Last Interface -| | ${dut2_to_dut1_if1} | ${tmp}= | First Ingress Interface -| | ${dut2_to_dut1_if2} | ${tmp}= | Last Egress Interface -| | # Set test variables -| | Set Test Variable | ${tg_to_dut1_if1} -| | Set Test Variable | ${tg_to_dut1_if2} -| | Set Test Variable | ${tg_to_dut2_if1} -| | Set Test Variable | ${tg_to_dut2_if2} -| | Set Test Variable | ${dut1_to_tg_if1} -| | Set Test Variable | ${dut1_to_tg_if2} -| | Set Test Variable | ${dut2_to_tg_if1} -| | Set Test Variable | ${dut2_to_tg_if2} -| | Set Test Variable | ${dut1_to_dut2_if1} -| | Set Test Variable | ${dut1_to_dut2_if2} -| | Set Test Variable | ${dut2_to_dut1_if1} -| | Set Test Variable | ${dut2_to_dut1_if2} -| | Set Test Variable | ${tg_node} -| | Set Test Variable | ${dut1_node} -| | Set Test Variable | ${dut2_node} -| | # Set Mac Addresses -| | ${tg_to_dut1_if1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut1_if1} -| | ${tg_to_dut1_if2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut1_if2} -| | ${tg_to_dut2_if1_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut2_if1} -| | ${tg_to_dut2_if2_mac}= | Get interface mac | ${tg_node} | ${tg_to_dut2_if2} -| | ${dut1_to_tg_if1_mac}= | Get interface mac | ${dut1_node} -| | ... | ${dut1_to_tg_if1} -| | ${dut1_to_tg_if2_mac}= | Get interface mac | ${dut1_node} -| | ... | ${dut1_to_tg_if2} -| | ${dut1_to_dut2_if1_mac}= | Get interface mac | ${dut1_node} -| | ... | ${dut1_to_dut2_if1} -| | ${dut1_to_dut2_if2_mac}= | Get interface mac | ${dut1_node} -| | ... | ${dut1_to_dut2_if2} -| | ${dut2_to_tg_if1_mac}= | Get interface mac | ${dut2_node} -| | ... | ${dut2_to_tg_if1} -| | ${dut2_to_tg_if2_mac}= | Get interface mac | ${dut2_node} -| | ... | ${dut2_to_tg_if2} -| | ${dut2_to_dut1_if1_mac}= | Get interface mac | ${dut2_node} -| | ... | ${dut2_to_dut1_if1} -| | ${dut2_to_dut1_if2_mac}= | Get interface mac | ${dut2_node} -| | ... | ${dut2_to_dut1_if2} -| | Set Test Variable | ${tg_to_dut1_if1_mac} -| | Set Test Variable | ${tg_to_dut1_if2_mac} -| | Set Test Variable | ${tg_to_dut2_if1_mac} -| | Set Test Variable | ${tg_to_dut2_if2_mac} -| | Set Test Variable | ${dut1_to_tg_if1_mac} -| | Set Test Variable | ${dut1_to_tg_if2_mac} -| | Set Test Variable | ${dut1_to_dut2_if1_mac} -| | Set Test Variable | ${dut1_to_dut2_if2_mac} -| | Set Test Variable | ${dut2_to_tg_if1_mac} -| | Set Test Variable | ${dut2_to_tg_if2_mac} -| | Set Test Variable | ${dut2_to_dut1_if1_mac} -| | Set Test Variable | ${dut2_to_dut1_if2_mac} - -| Set interfaces in double-link 3-node circular topology up -| | [Documentation] -| | ... | Set UP state on interfaces in 3-node double link path \ -| | ... | wait until all interfaces are ready. -| | ... -| | ... | *Arguments:* -| | ... | - No arguments. -| | ... -| | ... | *Return:* -| | ... | - No value returned. -| | ... -| | ... | _NOTE:_ This KW uses test variables sets in -| | ... | "Configure path in double-link 3-node circular topology" KW. -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Configure path in double-link 3-node circular topology \| ${nodes['TG']} \ -| | ... | \| ${nodes['DUT1']} \| ${nodes['TG']} \| -| | ... | \| Interfaces in Double-Link 3-node testing are UP \| -| | ... -| | Set Interface State | ${tg_node} | ${tg_to_dut1_if1} | up -| | Set Interface State | ${tg_node} | ${tg_to_dut1_if2} | up -| | Set Interface State | ${tg_node} | ${tg_to_dut2_if1} | up -| | Set Interface State | ${tg_node} | ${tg_to_dut2_if2} | up -| | Set Interface State | ${dut1_node} | ${dut1_to_tg_if1} | up -| | Set Interface State | ${dut1_node} | ${dut1_to_tg_if2} | up -| | Set Interface State | ${dut2_node} | ${dut2_to_tg_if1} | up -| | Set Interface State | ${dut2_node} | ${dut2_to_tg_if2} | up -| | Set Interface State | ${dut1_node} | ${dut1_to_dut2_if1} | up -| | Set Interface State | ${dut1_node} | ${dut1_to_dut2_if2} | up -| | Set Interface State | ${dut2_node} | ${dut2_to_dut1_if1} | up -| | Set Interface State | ${dut2_node} | ${dut2_to_dut1_if2} | up -| | Vpp Node Interfaces Ready Wait | ${dut1_node} -| | Vpp Node Interfaces Ready Wait | ${dut2_node} \ No newline at end of file diff --git a/resources/libraries/robot/tldk/tldk_utils.robot b/resources/libraries/robot/tldk/tldk_utils.robot new file mode 100644 index 0000000000..75e982252c --- /dev/null +++ b/resources/libraries/robot/tldk/tldk_utils.robot @@ -0,0 +1,80 @@ +# Copyright (c) 2017 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.NodePath +| Documentation | *Utilities for the path computing, pcap reading* +| ... +| ... | Utilities for the path computing, pcap file reading and also the port +| ... | selection. + +*** Keywords *** +| Path for 2-node testing is set +| | [Documentation] | Compute the path for the 2 node testing. +| | ... +| | ... | *Arguments:* +| | ... | - tg_node - TG node. Type: dictionary +| | ... | - dut_node - DUT node. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Path for 2-node testing is set \| ${nodes['TG']} \ +| | ... | \| ${nodes['DUT1'] \| +| | ... +| | [Arguments] | ${tg_node} | ${dut_node} +| | Append Nodes | ${tg_node} | ${dut_node} +| | Compute Path + +| Pick out the port used to execute test +| | [Documentation] | Pick out the port used to execute the test. +| | ... +| | ... | *Arguments:* +| | ... | - No arguments. +| | ... +| | ... | *Return:* +| | ... | - No value returned. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Pick out the port used to execute test \| +| | ... +| | ${tg_port} | ${tg_node}= | First Interface +| | ${dut_port} | ${dut_node}= | Last Interface +| | set suite variable | ${tg_node} +| | set suite variable | ${dut_node} +| | set suite variable | ${tg_port} +| | set suite variable | ${dut_port} + +| Get the pcap data +| | [Documentation] | Get the pcap file detailed data. +| | ... +| | ... | *Arguments:* +| | ... | - file_prefix - file prefix. Type: dictionary +| | ... +| | ... | *Return:* +| | ... | - packet_num, dest_ip, is_ipv4 - a tuple of packet_num +| | ... | dest_ip, is_ipv4. Type: tuple(int, str, bool) +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Get the pcap data \| ${tc01_file_prefix} \| +| | ... +| | [Arguments] | ${file_prefix} +| | ${packet_num} | ${dest_ip} | ${is_ipv4}= | Get Pcap Info +| | ... | ${file_prefix} +| | set suite variable | ${packet_num} +| | set suite variable | ${dest_ip} +| | set suite variable | ${is_ipv4} diff --git a/resources/libraries/robot/traffic.robot b/resources/libraries/robot/traffic.robot deleted file mode 100644 index d39784666f..0000000000 --- a/resources/libraries/robot/traffic.robot +++ /dev/null @@ -1,459 +0,0 @@ -# Copyright (c) 2016 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. - -"""Traffic keywords""" - -*** Settings *** -| Library | resources.libraries.python.IPv6Util -| Library | resources.libraries.python.IPv6Setup -| Library | resources.libraries.python.TrafficScriptExecutor -| Library | resources.libraries.python.NodePath -| Library | resources.libraries.python.Routing -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.topology.Topology -| Resource | resources/libraries/robot/default.robot -| Resource | resources/libraries/robot/counters.robot -| Documentation | Traffic keywords - -*** Keywords *** -| Send packet and verify headers -| | [Documentation] | Sends packet from IP (with source mac) to IP -| | ... | (with dest mac). There has to be 4 MAC addresses -| | ... | when using 2 node + -| | ... | xconnect (one for each eth). -| | ... -| | ... | *Arguments:* -| | ... -| | ... | _NOTE:_ Arguments are based on topology: -| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) -| | ... -| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary -| | ... | - src_ip - IP of source interface (TG-if1). Type: string -| | ... | - dst_ip - IP of destination interface (TG-if2). Type: string -| | ... | - tx_src_port - Interface of TG-if1. Type: string -| | ... | - tx_src_mac - MAC address of TG-if1. Type: string -| | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string -| | ... | - rx_port - Interface of TG-if1. Type: string -| | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string -| | ... | - rx_dst_mac - MAC address of TG-if2. Type: string -| | ... | - encaps_tx - Expected encapsulation on TX side: Dot1q or Dot1ad -| | ... | (Optional). Type: string -| | ... | - vlan_tx - VLAN (inner) tag on TX side (Optional). Type: integer -| | ... | - vlan_outer_tx - .1AD VLAN (outer) tag on TX side (Optional). -| | ... | Type: integer -| | ... | - encaps_rx - Expected encapsulation on RX side: Dot1q or Dot1ad -| | ... | (Optional). Type: string -| | ... | - vlan_rx - VLAN (inner) tag on RX side (Optional). Type: integer -| | ... | - vlan_outer_rx - .1AD VLAN (outer) tag on RX side (Optional). -| | ... | Type: integer -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send packet and verify headers \| ${nodes['TG']} \| 10.0.0.1 \ -| | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \ -| | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \| -| | ... -| | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port} | -| | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac} -| | ... | ${rx_dst_mac} -| | ... | ${encaps_tx}=${EMPTY} | ${vlan_tx}=${EMPTY} | ${vlan_outer_tx}=${EMPTY} -| | ... | ${encaps_rx}=${EMPTY} | ${vlan_rx}=${EMPTY} | ${vlan_outer_rx}=${EMPTY} -| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port} -| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port} -| | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac | -| | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac | -| | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip} | -| | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name} -| | ${args}= | Run Keyword If | '${encaps_tx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate -| | ... | ${args} | --encaps_tx ${encaps_tx} | --vlan_tx ${vlan_tx} -| | ${args}= | Run Keyword If | '${encaps_rx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate -| | ... | ${args} | --encaps_rx ${encaps_rx} | --vlan_rx ${vlan_rx} -| | ${args}= | Run Keyword If | '${vlan_outer_tx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --vlan_outer_tx ${vlan_outer_tx} -| | ${args}= | Run Keyword If | '${vlan_outer_rx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --vlan_outer_rx ${vlan_outer_rx} -| | Run Traffic Script On Node | send_icmp_check_headers.py | ${tg_node} | -| | ... | ${args} - -| Packet transmission from port to port should fail -| | [Documentation] | Sends packet from ip (with specified mac) to ip -| | ... | (with dest mac). Using keyword : Send packet And Check -| | ... | Headers and subsequently checks the return value -| | ... -| | ... | *Arguments:* -| | ... -| | ... | _NOTE:_ Arguments are based on topology: -| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) -| | ... -| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary -| | ... | - src_ip - IP of source interface (TG-if1). Type: string -| | ... | - dst_ip - IP of destination interface (TG-if2). Type: string -| | ... | - tx_src_port - Interface of TG-if1. Type: string -| | ... | - tx_src_mac - MAC address of TG-if1. Type: string -| | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string -| | ... | - rx_port - Interface of TG-if1. Type: string -| | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string -| | ... | - rx_dst_mac - MAC address of TG-if2. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Packet transmission from port to port should fail \| ${nodes['TG']} \ -| | ... | \| 10.0.0.1 \ \| 32.0.0.1 \| eth2 \| 08:00:27:ee:fd:b3 \ -| | ... | \| 08:00:27:a2:52:5b \| eth3 \| 08:00:27:4d:ca:7a \ -| | ... | \| 08:00:27:7d:fd:10 \| -| | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port} | -| | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac} | -| | ... | ${rx_dst_mac} -| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port} -| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port} -| | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac | -| | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac | -| | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip} | -| | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name} -| | Run Keyword And Expect Error | ICMP echo Rx timeout | -| | ... | Run Traffic Script On Node | send_icmp_check_headers.py -| | ... | ${tg_node} | ${args} - -| Send packet and verify ARP request -| | [Documentation] | Send IP packet from tx_port and check if ARP Request\ -| | ... | packet is received on rx_port. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | _NOTE:_ Arguments are based on topology: -| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) -| | ... -| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary -| | ... | - tx_src_ip - Source IP address of transferred packet (TG-if1). -| | ... | Type: string -| | ... | - tx_dst_ip - Destination IP address of transferred packet (TG-if2). -| | ... | Type: string -| | ... | - tx_port - Interface from which the IP packet is sent (TG-if1). -| | ... | Type: string -| | ... | - tx_dst_mac - Destination MAC address of IP packet (DUT-if1). -| | ... | Type: string -| | ... | - rx_port - Interface where the IP packet is received (TG-if2). -| | ... | Type: string -| | ... | - rx_src_mac - Source MAC address of ARP packet (DUT-if2). -| | ... | Type: string -| | ... | - rx_arp_src_ip - Source IP address of ARP packet (DUT-if2). -| | ... | Type: string -| | ... | - rx_arp_dst_ip - Destination IP address of ARP packet. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send Packet And Check ARP Packet \| ${nodes['TG']} \| 16.0.0.1 \ -| | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \ -| | ... | \| eth4 \| 08:00:27:5b:49:dd \| 192.168.2.1 \| 192.168.2.2 \| -| | ... -| | [Arguments] | ${tg_node} | ${tx_src_ip} | ${tx_dst_ip} | ${tx_port} -| | ... | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac} | ${rx_arp_src_ip} -| | ... | ${rx_arp_dst_ip} -| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port} -| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port} -| | ${args}= | Catenate -| | ... | --tx_dst_mac | ${tx_dst_mac} | --rx_src_mac | ${rx_src_mac} -| | ... | --tx_src_ip | ${tx_src_ip} | --tx_dst_ip | ${tx_dst_ip} -| | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name} -| | ... | --rx_arp_src_ip ${rx_arp_src_ip} | --rx_arp_dst_ip ${rx_arp_dst_ip} -| | Run Traffic Script On Node | send_icmp_check_arp.py | ${tg_node} | ${args} - -| Send TCP or UDP packet and verify received packet -| | [Documentation] | Sends TCP or UDP packet with specified source -| | ... | and destination port. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | _NOTE:_ Arguments are based on topology: -| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) -| | ... -| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary -| | ... | - src_ip - IP of source interface (TG-if1). Type: integer -| | ... | - dst_ip - IP of destination interface (TG-if2). Type: integer -| | ... | - tx_port - Source interface (TG-if1). Type: string -| | ... | - tx_mac - MAC address of source interface (TG-if1). Type: string -| | ... | - rx_port - Destionation interface (TG-if1). Type: string -| | ... | - rx_mac - MAC address of destination interface (TG-if1). Type: string -| | ... | - protocol - Type of protocol. Type: string -| | ... | - source_port - Source TCP/UDP port. Type: string or integer -| | ... | - destination_port - Destination TCP/UDP port. Type: string or integer -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send TCP or UDP packet and verify received packet \| ${nodes['TG']} \ -| | ... | \| 16.0.0.1 \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \ -| | ... | \| eth4 \| 08:00:27:c9:6a:d5 \| TCP \| 20 \| 80 \| -| | ... -| | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_port} | -| | ... | ${tx_mac} | ${rx_port} | ${rx_mac} | ${protocol} | ${source_port} -| | ... | ${destination_port} -| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port} -| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port} -| | ${args}= | Catenate | --tx_mac | ${tx_mac} -| | ... | --rx_mac | ${rx_mac} -| | ... | --src_ip | ${src_ip} -| | ... | --dst_ip | ${dst_ip} -| | ... | --tx_if | ${tx_port_name} -| | ... | --rx_if | ${rx_port_name} -| | ... | --protocol | ${protocol} -| | ... | --source_port | ${source_port} -| | ... | --destination_port | ${destination_port} -| | Run Traffic Script On Node | send_tcp_udp.py -| | ... | ${tg_node} | ${args} - -| TCP or UDP packet transmission should fail -| | [Documentation] | Sends TCP or UDP packet with specified source -| | ... | and destination port. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | _NOTE:_ Arguments are based on topology: -| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) -| | ... -| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary -| | ... | - src_ip - IP of source interface (TG-if1). Type: integer -| | ... | - dst_ip - IP of destination interface (TG-if2). Type: integer -| | ... | - tx_port - Source interface (TG-if1). Type: string -| | ... | - tx_mac - MAC address of source interface (TG-if1). Type: string -| | ... | - rx_port - Destionation interface (TG-if1). Type: string -| | ... | - rx_mac - MAC address of destination interface (TG-if1). Type: string -| | ... | - protocol - Type of protocol. Type: string -| | ... | - source_port - Source TCP/UDP port. Type: string or integer -| | ... | - destination_port - Destination TCP/UDP port. Type: string or integer -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| TCP or UDP packet transmission should fail \| ${nodes['TG']} \ -| | ... | \| 16.0.0.1 \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \ -| | ... | \| eth4 \| 08:00:27:c9:6a:d5 \| TCP \| 20 \| 80 \| -| | ... -| | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_port} | -| | ... | ${tx_mac} | ${rx_port} | ${rx_mac} | ${protocol} | ${source_port} -| | ... | ${destination_port} -| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port} -| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port} -| | ${args}= | Catenate | --tx_mac | ${tx_mac} -| | ... | --rx_mac | ${rx_mac} -| | ... | --src_ip | ${src_ip} -| | ... | --dst_ip | ${dst_ip} -| | ... | --tx_if | ${tx_port_name} -| | ... | --rx_if | ${rx_port_name} -| | ... | --protocol | ${protocol} -| | ... | --source_port | ${source_port} -| | ... | --destination_port | ${destination_port} -| | Run Keyword And Expect Error | TCP/UDP Rx timeout -| | ... | Run Traffic Script On Node | send_tcp_udp.py -| | ... | ${tg_node} | ${args} - -| Receive and verify router advertisement packet -| | [Documentation] | Wait until RA packet is received and then verify\ -| | ... | specific fields of received RA packet. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | - node - Node where to check for RA packet. Type: dictionary -| | ... | - rx_port - Interface where the packet is received. Type: string -| | ... | - src_mac - MAC address of source interface from which the link-local\ -| | ... | IPv6 address is constructed and checked. Type: string -| | ... | - interval - Configured retransmit interval. Optional. Type: integer -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Receive and verify router advertisement packet \ -| | ... | \| ${nodes['DUT1']} \| eth2 \| 08:00:27:cc:4f:54 \| -| | ... -| | [Arguments] | ${node} | ${rx_port} | ${src_mac} | ${interval}=${0} -| | ${rx_port_name}= | Get interface name | ${node} | ${rx_port} -| | ${args}= | Catenate -| | ... | --rx_if ${rx_port_name} -| | ... | --src_mac ${src_mac} -| | ... | --interval ${interval} -| | Run Traffic Script On Node | check_ra_packet.py | ${node} | ${args} - -| Send router solicitation and verify response -| | [Documentation] | Send RS packet, wait for response and then verify\ -| | ... | specific fields of received RA packet. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | - tg_node - TG node to send RS packet from. Type: dictionary -| | ... | - dut_node - DUT node to send RS packet to. Type: dictionary -| | ... | - rx_port - Interface where the packet is sent from. Type: string -| | ... | - tx_port - Interface where the packet is sent to. Type: string -| | ... | - src_ip - Source IP address of RS packet. Optional. If not provided,\ -| | ... | link local address will be used. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send router solicitation and verify response \ -| | ... | \| ${nodes['TG']} \| ${nodes['DUT1']} \| eth2 \ -| | ... | \| GigabitEthernet0/8/0 \| 10::10 \| -| | ... -| | [Arguments] | ${tg_node} | ${dut_node} | ${tx_port} | ${rx_port} -| | ... | ${src_ip}='' -| | ${src_mac}= | Get Interface Mac | ${tg_node} | ${tx_port} -| | ${dst_mac}= | Get Interface Mac | ${dut_node} | ${rx_port} -| | ${src_int_name}= | Get interface name | ${tg_node} | ${tx_port} -| | ${dst_int_name}= | Get interface name | ${dut_node} | ${rx_port} -| | ${args}= | catenate -| | ... | --rx_if ${dst_int_name} --tx_if ${src_int_name} -| | ... | --src_mac ${src_mac} | --dst_mac ${dst_mac} -| | ... | --src_ip ${src_ip} -| | Run Traffic Script On Node | send_rs_check_ra.py -| | ... | ${tg_node} | ${args} - -| Send ARP Request -| | [Documentation] | Send ARP Request and check if the ARP Response is received. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | _NOTE:_ Arguments are based on topology: -| | ... | TG(if1)<->(if1)DUT -| | ... -| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary -| | ... | - tx_port - Interface from which the ARP packet is sent (TG-if1). -| | ... | Type: string -| | ... | - src_mac - Source MAC address of ARP packet (TG-if1). -| | ... | Type: string -| | ... | - tgt_mac - Target MAC address which is expected in the response -| | ... | (DUT-if1). Type: string -| | ... | - src_ip - Source IP address of ARP packet (TG-if1). -| | ... | Type: string -| | ... | - tgt_ip - Target IP address of ARP packet (DUT-if1). -| | ... | Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send ARP Request \| ${nodes['TG']} \| eth3 \ -| | ... | \| 08:00:27:cc:4f:54 \| 08:00:27:c9:6a:d5 \ -| | ... | \| 10.0.0.100 \| 192.168.1.5 \| -| | ... -| | [Arguments] | ${tg_node} | ${tx_port} -| | ... | ${src_mac} | ${tgt_mac} -| | ... | ${src_ip} | ${tgt_ip} -| | ${args}= | Catenate | --tx_if | ${tx_port} -| | ... | --src_mac | ${src_mac} | --dst_mac | ${tgt_mac} -| | ... | --src_ip | ${src_ip} | --dst_ip | ${tgt_ip} -| | Run Traffic Script On Node | arp_request.py | ${tg_node} | ${args} - -| ARP request should fail -| | [Documentation] | Send ARP Request and -| | ... | the ARP Response should not be received. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | _NOTE:_ Arguments are based on topology: -| | ... | TG(if1)<->(if1)DUT -| | ... -| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary -| | ... | - tx_port - Interface from which the ARP packet is sent (TG-if1). -| | ... | Type: string -| | ... | - src_mac - Source MAC address of ARP packet (TG-if1). -| | ... | Type: string -| | ... | - tgt_mac - Target MAC address which is expected in the response -| | ... | (DUT-if1). Type: string -| | ... | - src_ip - Source IP address of ARP packet (TG-if1). -| | ... | Type: string -| | ... | - tgt_ip - Target IP address of ARP packet (DUT-if1). -| | ... | Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| ARP request should fail \| ${nodes['TG']} \| eth3 \ -| | ... | \| 08:00:27:cc:4f:54 \| 08:00:27:c9:6a:d5 \ -| | ... | \| 10.0.0.100 \| 192.168.1.5 \| -| | ... -| | [Arguments] | ${tg_node} | ${tx_port} -| | ... | ${src_mac} | ${tgt_mac} -| | ... | ${src_ip} | ${tgt_ip} -| | ${args}= | Catenate | --tx_if | ${tx_port} -| | ... | --src_mac | ${src_mac} | --dst_mac | ${tgt_mac} -| | ... | --src_ip | ${src_ip} | --dst_ip | ${tgt_ip} -| | Run Keyword And Expect Error | ARP reply timeout -| | ... | Run Traffic Script On Node | arp_request.py | ${tg_node} | ${args} - -| Send packets and verify multipath routing -| | [Documentation] | Send 100 IP ICMP packets traffic and check if it is\ -| | ... | divided into two paths. -| | ... -| | ... | *Arguments:* -| | ... -| | ... | _NOTE:_ Arguments are based on topology: -| | ... | TG(if1)->(if1)DUT(if2)->TG(if2) -| | ... -| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary -| | ... | - src_port - Interface of TG-if1. Type: string -| | ... | - dst_port - Interface of TG-if2. Type: string -| | ... | - src_ip - IP of source interface (TG-if1). Type: string -| | ... | - dst_ip - IP of destination interface (TG-if2). Type: string -| | ... | - tx_src_mac - MAC address of TG-if1. Type: string -| | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string -| | ... | - rx_src_mac - MAC address of DUT-if2. Type: string -| | ... | - rx_dst_mac_1 - MAC address of interface for path 1. Type: string -| | ... | - rx_dst_mac_2 - MAC address of interface for path 2. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send Packet And Check Multipath Routing \| ${nodes['TG']} \ -| | ... | \| eth2 \| eth3 \| 16.0.0.1 \| 32.0.0.1 \ -| | ... | \| 08:00:27:cc:4f:54 \| 08:00:27:c9:6a:d5 \| 08:00:27:54:59:f9 \ -| | ... | \| 02:00:00:00:00:02 \| 02:00:00:00:00:03 \| -| | ... -| | [Arguments] | ${tg_node} | ${src_port} | ${dst_port} | ${src_ip} | ${dst_ip} -| | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_src_mac} -| | ... | ${rx_dst_mac_1} | ${rx_dst_mac_2} -| | ${src_port_name}= | Get interface name | ${tg_node} | ${src_port} -| | ${dst_port_name}= | Get interface name | ${tg_node} | ${dst_port} -| | ${args}= | Catenate | --tx_if | ${src_port_name} -| | ... | --rx_if | ${dst_port_name} | --src_ip | ${src_ip} -| | ... | --dst_ip | ${dst_ip} | --tg_if1_mac | ${tx_src_mac} -| | ... | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac | ${rx_src_mac} -| | ... | --path_1_mac | ${rx_dst_mac_1} | --path_2_mac | ${rx_dst_mac_2} -| | Run Traffic Script On Node | send_icmp_check_multipath.py | ${tg_node} -| | ... | ${args} diff --git a/resources/libraries/robot/vm/double_qemu_setup.robot b/resources/libraries/robot/vm/double_qemu_setup.robot new file mode 100644 index 0000000000..377e222804 --- /dev/null +++ b/resources/libraries/robot/vm/double_qemu_setup.robot @@ -0,0 +1,95 @@ +# Copyright (c) 2016 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.IPUtil + +*** Keywords *** +| Configure QEMU vhost and run it +| | [Documentation] | Setup Qemu with 4 vhost-user interfaces and 4 namespaces. +| | ... | Each call will be different object instance. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - Node where to setup qemu. Type: dict +| | ... | - sock1 - Socket path for first Vhost-User interface. Type: string +| | ... | - sock2 - Socket path for second Vhost-User interface. Type: string +| | ... | - sock3 - Socket path for third Vhost-User interface. Type: string +| | ... | - sock4 - Socket path for forth Vhost-User interface. Type: string +| | ... | - ip1 - IP address for namespace 1. Type: string +| | ... | - ip2 - IP address for namespace 2. Type: string +| | ... | - ip3 - IP address for namespace 3. Type: string +| | ... | - ip4 - IP address for namespace 4. Type: string +| | ... | - prefix_length - IP prefix length. Type: int +| | ... | - qemu_name - Qemu instance name by which the object will be accessed. +| | ... | Type: string +| | ... | - mac_ID - MAC address ID used to differentiate qemu instances and +| | ... | namespaces assigned to them. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Setup QEMU Vhost And Run\| {nodes['DUT1']} \| /tmp/sock1 \ +| | ... | \| /tmp/sock2 \| /tmp/sock3 \| /tmp/sock4 \| 16.0.0.1 \| 16.0.0.2 \ +| | ... | \| 16.0.0.3 \| 16.0.0.4 \| 24 \| qemu_instance_1 \| 06 \| +| | ... +| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${sock3} | ${sock4} +| | ... | ${ip1} | ${ip2} | ${ip3} | ${ip4} | ${prefix_length} +| | ... | ${qemu_name} | ${mac_ID} +| | Import Library | resources.libraries.python.QemuUtils \ +| | ... | WITH NAME | ${qemu_name} +| | ${qemu_add_vhost}= | Replace Variables | ${qemu_name}.Qemu Add Vhost User If +| | ${qemu_set_node}= | Replace Variables | ${qemu_name}.Qemu Set Node +| | ${qemu_start}= | Replace Variables | ${qemu_name}.Qemu Start +| | Run keyword | ${qemu_add_vhost} | ${sock1} | mac=52:54:00:00:${mac_ID}:01 +| | Run keyword | ${qemu_add_vhost} | ${sock2} | mac=52:54:00:00:${mac_ID}:02 +| | Run keyword | ${qemu_add_vhost} | ${sock3} | mac=52:54:00:00:${mac_ID}:03 +| | Run keyword | ${qemu_add_vhost} | ${sock4} | mac=52:54:00:00:${mac_ID}:04 +| | Run keyword | ${qemu_set_node} | ${dut_node} +| | ${vm}= | Run keyword | ${qemu_start} +| | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1} +| | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2} +| | ${vhost3}= | Get Vhost User If Name By Sock | ${vm} | ${sock3} +| | ${vhost4}= | Get Vhost User If Name By Sock | ${vm} | ${sock4} +| | Set Interface State | ${vm} | ${vhost1} | up | if_type=name +| | Set Interface State | ${vm} | ${vhost2} | up | if_type=name +| | Set Interface State | ${vm} | ${vhost3} | up | if_type=name +| | Set Interface State | ${vm} | ${vhost4} | up | if_type=name +| | Setup Network Namespace +| | ... | ${vm} | nmspace1 | ${vhost1} | ${ip1} | ${prefix_length} +| | Setup Network Namespace +| | ... | ${vm} | nmspace2 | ${vhost2} | ${ip2} | ${prefix_length} +| | Setup Network Namespace +| | ... | ${vm} | nmspace3 | ${vhost3} | ${ip3} | ${prefix_length} +| | Setup Network Namespace +| | ... | ${vm} | nmspace4 | ${vhost4} | ${ip4} | ${prefix_length} +| | Set Test Variable | ${${qemu_name}} | ${vm} + +| Tear down QEMU +| | [Documentation] | Stop specific qemu instance +| | ... | running on ${dut_node}, ${vm} is VM node info dictionary +| | ... | returned by qemu_start or None. +| | ... | *Arguments:* +| | ... | - dut_node - Node where to clean qemu. Type: dict +| | ... | - vm - VM node info dictionary. Type: string +| | ... | - qemu_name - Qemu instance by name. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Tear down QEMU \| ${node['DUT1']} \| ${vm} \| qemu_node_1 \| +| | ... +| | [Arguments] | ${dut_node} | ${vm} | ${qemu_name} +| | ${set_node}= | Replace Variables | ${qemu_name}.Qemu Set Node +| | ${kill}= | Replace Variables | ${qemu_name}.Qemu Kill +| | ${clear_socks}= | Replace Variables | ${qemu_name}.Qemu Clear Socks +| | Run Keyword | ${set_node} | ${dut_node} +| | Run Keyword | ${kill} +| | Run Keyword | ${clear_socks} +| | Run Keyword If | ${vm} is not None | Disconnect | ${vm} diff --git a/resources/libraries/robot/vm/qemu.robot b/resources/libraries/robot/vm/qemu.robot new file mode 100644 index 0000000000..097f3cb1a8 --- /dev/null +++ b/resources/libraries/robot/vm/qemu.robot @@ -0,0 +1,99 @@ +# Copyright (c) 2016 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.QemuUtils +| Library | resources.libraries.python.ssh.SSH + +*** Keywords *** + +| QEMU build list should exist +| | [Documentation] | Return TRUE if variable QEMU_BUILD exist, otherwise FALSE +| | ${ret} | ${tmp}= | Run Keyword And Ignore Error +| | ... | Variable Should Exist | @{QEMU_BUILD} +| | Return From Keyword If | "${ret}" == "PASS" | ${TRUE} +| | Return From Keyword | ${FALSE} + +| Is QEMU ready on node +| | [Documentation] | Check if QEMU was built on the node before +| | [Arguments] | ${node} +| | ${ret}= | QEMU build list should exist +| | Return From Keyword If | ${ret} == ${FALSE} | ${FALSE} +| | ${ret} | ${tmp}= | Run Keyword And Ignore Error +| | ... | Should Contain | ${QEMU_BUILD} | ${node['host']} +| | Return From Keyword If | "${ret}" == "PASS" | ${TRUE} +| | Return From Keyword | ${FALSE} + +| Add node to QEMU build list +| | [Documentation] | Add node to the list of nodes with builded QEMU (global +| | ... | variable QEMU_BUILD) +| | [Arguments] | ${node} +| | ${ret}= | QEMU build list should exist +| | Run Keyword If | ${ret} == ${TRUE} +| | ... | Append To List | ${QEMU_BUILD} | ${node['host']} +| | ... | ELSE | Set Global Variable | @{QEMU_BUILD} | ${node['host']} + +| Build QEMU on node +| | [Documentation] | Build QEMU from sources on the Node. Nodes with successful +| | ... | QEMU build are stored in global variable list QEMU_BUILD +| | ... +| | ... | *Arguments:* +| | ... | - node - Node on which to build qemu. Type: dictionary +| | ... | - force_install - If True, then remove previous build. Type: bool +| | ... | - apply_patch - If True, then apply patches from qemu_patches dir. +| | ... | Type: bool +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Build QEMU on node \| ${node['DUT1']} \| False \| False \| +| | ... +| | [Arguments] | ${node} | ${force_install}=${False} | ${apply_patch}=${False} +| | ${ready}= | Is QEMU ready on node | ${node} +| | Return From Keyword If | ${ready} == ${TRUE} +| | Build QEMU | ${node} +| | Add node to QEMU build list | ${node} + +| Build QEMU on all DUTs +| | [Documentation] | Build QEMU from sources on all DUTs. Nodes with successful +| | ... | QEMU build are stored in global variable list QEMU_BUILD +| | ... +| | ... | *Arguments:* +| | ... | - force_install - If True, then remove previous build. Type: bool +| | ... | - apply_patch - If True, then apply patches from qemu_patches dir. +| | ... | Type: bool +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Build QEMU on all DUTs \| False \| False \| +| | ... +| | [Arguments] | ${force_install}=${False} | ${apply_patch}=${False} +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Build QEMU on node | ${nodes['${dut}']} | ${force_install} | +| | | ... | ${apply_patch} + +| Stop and clear QEMU +| | [Documentation] | Stop QEMU, clear used sockets and close SSH connection +| | ... | running on ${dut}, ${vm} is VM node info dictionary +| | ... | returned by qemu_start or None. +| | [Arguments] | ${dut} | ${vm} +| | Qemu Set Node | ${dut} +| | Qemu Kill +| | Qemu Clear Socks +| | Run Keyword If | ${vm} is not None | Disconnect | ${vm} + +| Kill Qemu on all DUTs +| | [Documentation] | Kill QEMU processes on all DUTs. +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Qemu Set Node | ${nodes['${dut}']} +| | | Qemu Kill diff --git a/resources/libraries/robot/vxlan.robot b/resources/libraries/robot/vxlan.robot deleted file mode 100644 index d867189a15..0000000000 --- a/resources/libraries/robot/vxlan.robot +++ /dev/null @@ -1,135 +0,0 @@ -# Copyright (c) 2016 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 | Collections -| Resource | resources/libraries/robot/default.robot -| Resource | resources/libraries/robot/interfaces.robot -| Resource | resources/libraries/robot/bridge_domain.robot -| Resource | resources/libraries/robot/l2_xconnect.robot -| Library | resources.libraries.python.L2Util -| Library | resources.libraries.python.IPUtil -| Library | resources.libraries.python.IPv4Util -| Library | resources.libraries.python.IPv6Util -| Library | resources.libraries.python.IPv4Setup -| Library | resources.libraries.python.NodePath - -*** Keywords *** -| Configure IP addresses and neighbors on interfaces -| | [Documentation] | *Set IPv4 addresses on interfaces on DUTs.* -| | ... | If interface index is None then is determines with Get Interface Sw Index -| | ... | in this case it is required the interface to be present in topology dict. -| | ... | It also executes VPP IP Probe to determine MACs to IPs on DUTs -| | ... -| | ... | _Set testcase variables with IP addresses and prefix length:_ -| | ... | - ${dut1s_ip_address} -| | ... | - ${dut2s_ip_address} -| | ... | - ${duts_ip_address_prefix} -| | ... -| | [Arguments] | ${DUT1} | ${DUT1_INT_NAME} | ${DUT1_INT_INDEX} -| | ... | ${DUT2} | ${DUT2_INT_NAME} | ${DUT2_INT_INDEX} -| | Set Test Variable | ${dut1s_ip_address} | 172.16.0.1 -| | Set Test Variable | ${dut2s_ip_address} | 172.16.0.2 -| | Set Test Variable | ${duts_ip_address_prefix} | 24 -| | ${DUT1_INT_KEY}= | Run Keyword If | ${DUT1_INT_INDEX} is None -| | | ... | Get Interface by name | ${DUT1} | ${DUT1_INT_NAME} -| | ${DUT2_INT_KEY}= | Run Keyword If | ${DUT2_INT_INDEX} is None -| | | ... | Get Interface by name | ${DUT2} | ${DUT2_INT_NAME} -| | ${DUT1_INT_INDEX}= | Run Keyword If | ${DUT1_INT_INDEX} is None -| | | ... | Get Interface Sw Index | ${DUT1} | ${DUT1_INT_KEY} -| | | ... | ELSE | Set Variable | ${DUT1_INT_INDEX} -| | ${DUT2_INT_INDEX}= | Run Keyword If | ${DUT2_INT_INDEX} is None -| | | ... | Get Interface Sw Index | ${DUT2} | ${DUT2_INT_KEY} -| | | ... | ELSE | Set Variable | ${DUT2_INT_INDEX} -| | ${DUT1_INT_MAC}= | Vpp Get Interface Mac | ${DUT1} | ${DUT1_INT_INDEX} -| | ${DUT2_INT_MAC}= | Vpp Get Interface Mac | ${DUT2} | ${DUT2_INT_INDEX} -| | Set Interface Address | ${DUT1} | ${DUT1_INT_INDEX} -| | ... | ${dut1s_ip_address} | ${duts_ip_address_prefix} -| | Set Interface Address | ${DUT2} | ${DUT2_INT_INDEX} -| | ... | ${dut2s_ip_address} | ${duts_ip_address_prefix} -| | Add IP Neighbor | ${DUT1} | ${DUT1_INT_INDEX} | ${dut2s_ip_address} | ${DUT2_INT_MAC} -| | Add IP Neighbor | ${DUT2} | ${DUT2_INT_INDEX} | ${dut1s_ip_address} | ${DUT1_INT_MAC} - -| Add interfaces to L2BD -| | [Arguments] | ${DUT} | ${BID} | ${INTERFACE_1} | ${INTERFACE_2} -| | Vpp Add L2 Bridge Domain | ${DUT} | ${BID} | ${INTERFACE_1} | ${INTERFACE_2} - -| Create vlan interfaces for VXLAN -| | [Documentation] | *Create VLAN subinterface on interfaces on DUTs with given VLAN ID.* -| | ... -| | ... | _Set testcase variables with name and index of created interfaces:_ -| | ... | - ${dut1s_vlan_name} -| | ... | - ${dut1s_vlan_index} -| | ... | - ${dut2s_vlan_name} -| | ... | - ${dut2s_vlan_index} -| | ... -| | [Arguments] | ${VLAN} | ${DUT1} | ${INT1} | ${DUT2} | ${INT2} -| | ${INT1_NAME}= | Get interface name | ${DUT1} | ${INT1} -| | ${INT2_NAME}= | Get interface name | ${DUT2} | ${INT2} -| | ${dut1s_vlan_name} | ${dut1s_vlan_index}= | Create Vlan Subinterface -| | | ... | ${DUT1} | ${INT1_NAME} | ${VLAN} -| | ${dut2s_vlan_name} | ${dut2s_vlan_index}= | Create Vlan Subinterface -| | | ... | ${DUT2} | ${INT2_NAME} | ${VLAN} -| | Set Interface State | ${DUT1} | ${dut1s_vlan_index} | up -| | Set Interface State | ${DUT2} | ${dut2s_vlan_index} | up -| | Set Test Variable | ${dut1s_vlan_name} -| | Set Test Variable | ${dut1s_vlan_index} -| | Set Test Variable | ${dut2s_vlan_name} -| | Set Test Variable | ${dut2s_vlan_index} - -| Send VXLAN encapsulated packet and verify received packet -| | [Documentation] | Send VXLAN encapsulated Ethernet frame and check \ -| | ... | received one. -| | ... -| | ... | *Arguments:* -| | ... | - tg_node - Node where to run traffic script. Type: dictionary -| | ... | - tx_if - Interface from where send VXLAN packet. Type: string -| | ... | - rx_if - Interface where receive VXLAN packet. Type: string -| | ... | - tx_src_mac - Source MAC address of sent packet. Type: string -| | ... | - tx_dst_mac - Destination MAC address of sent packet. Type: string -| | ... | - tx_src_ip - Source IP address of sent VXLAN packet. Type: string -| | ... | - tx_dst_ip - Destination IP address of sent VXLAN packet. -| | ... | Type: string -| | ... | - tx_vni - VNI of sent VXLAN packet. Type: string -| | ... | - rx_src_ip - Source IP address of received VXLAN packet. Type: string -| | ... | - rx_dst_ip - Destination IP address of received VXLAN packet. -| | ... | Type: string -| | ... | - rx_vni - VNI of received VXLAN packet. Type: string -| | ... -| | ... | *Return:* -| | ... | - No value returned -| | ... -| | ... | *Example:* -| | ... -| | ... | \| Send VXLAN encapsulated packet and verify received packet \| ${tg_node} \| port4 \| port4 \ -| | ... | \| fa:16:3e:6d:f9:c5 \| fa:16:3e:e6:6d:9a \| 192.168.0.1 \ -| | ... | \| 192.168.0.2 \| ${101} \| 192.168.0.2 \| 192.168.0.1 \| ${102} \| -| | ... -| | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if} -| | ... | ${tx_src_mac} | ${tx_dst_mac} -| | ... | ${tx_src_ip} | ${tx_dst_ip} | ${tx_vni} -| | ... | ${rx_src_ip} | ${rx_dst_ip} | ${rx_vni} -| | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if} -| | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if} -| | ${args}= | Catenate -| | ... | --tx_if ${tx_if_name} -| | ... | --rx_if ${rx_if_name} -| | ... | --tx_src_mac ${tx_src_mac} -| | ... | --tx_dst_mac ${tx_dst_mac} -| | ... | --tx_src_ip ${tx_src_ip} -| | ... | --tx_dst_ip ${tx_dst_ip} -| | ... | --tx_vni ${tx_vni} -| | ... | --rx_src_ip ${rx_src_ip} -| | ... | --rx_dst_ip ${rx_dst_ip} -| | ... | --rx_vni ${rx_vni} -| | Run Traffic Script On Node | send_vxlan_check_vxlan.py | ${tg_node} | ${args} -- cgit 1.2.3-korg