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/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 +++++++++++++++++++++ 6 files changed, 1552 insertions(+) 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 (limited to 'resources/libraries/robot/shared') 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} -- cgit 1.2.3-korg