summaryrefslogtreecommitdiffstats
path: root/test/test_l2_fib.py
AgeCommit message (Collapse)AuthorFilesLines
2019-04-11Tests: Refactor tearDown show command logging, add lifecycle markers.Paul Vinciguerra1-1/+3
This change adds a consistent interface for adding test-specific show commands to log.txt. It also adds log markers for the execution of setUp[Class], tearDown[Class] in the logs. Change-Id: I7d42e396e594a59e866a7d55dac0af25548e657a Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-04-10Tests Cleanup: Fix missing calls to setUpClass/tearDownClass.Paul Vinciguerra1-0/+4
Continuation/Part 2 of https://gerrit.fd.io/r/#/c/17092/ Change-Id: Id0122d84eaf2c05d29e5be63a594d5e528ee7c9a Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-11vpp_papi_provider: Remove more wrapper functions.Ole Troan1-7/+7
Split this work up into pieces. Please don't add new wrappers to vpp_papi_provider.py. Change-Id: I0f8f2afc4cd2bba07ea70ddecea2d7319f7b2e10 Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-07Tests: Refactor payload_to_info()Paul Vinciguerra1-1/+1
All callers of payload_to_info were required to wrap payload with str(). Refactor to call scapy's payload.load for raw payloads or specify the specific fieldname. Change-Id: I1c80599d4df8dc129dbb8274733afaad406d5bcf Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-04test framework: Fix wrapper functions to match API message names.Ole Troan1-4/+4
In preparation to remove the wrappers in vpp_papi_provider.py, ensure names used in tests match the actual API message names. Change-Id: I230ca4eb75aa727ff68d702e085a2edbbc6b6d19 Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-18PAPI: Add MACAddress object wrapper for vl_api_mac_address_tOle Troan1-2/+3
Change the definition of vl_api_mac_address_t to an aliased type. Change-Id: I1434f316d0fad6a099592f39bceeb8faeaf1d134 Signed-off-by: Ole Troan <ot@cisco.com>
2018-11-23VPP-1476: L2fib failures in masterPavel Kotucek1-7/+8
Overlaping range of BDs. Change-Id: I96d2caf98b94206cd6b145961819720727f13c61 Signed-off-by: Pavel Kotucek <pavel.kotucek@pantheon.tech>
2018-03-14Improve l2_macs_events API to provide MAC move informationJohn Lo1-2/+7
Change mac_entry layout in l2_macs_event API message so the MAC entry can be either add, delete or move where the sw_if_index of an existing MAC entry changed. Also added a 8-bit flags field in mac_entry for any future expansion. Change-Id: I3bf9e1cf2556f2938202025a5d0772c2ce2fc99f Signed-off-by: John Lo <loj@cisco.com>
2017-10-09TEST,L2-FIB:refactor test-removing shared stateEyal Bari1-179/+135
and remove dependencies between tests Change-Id: I6ceacfdeb65b2d3c64811309358c3bfd47b213ef Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-10-03L2FIB,TEST:add max macs in event testeyal bari1-0/+22
Change-Id: Ied72d44f8695af524751ffc54196cc3ac1addc85 Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-10-02L2-FIB:add mac learn events testEyal Bari1-0/+18
fixes an issue where events were not sent if BD doesn't enable mac aging Change-Id: Iddc53cb5c45e560633e6c5cff2731dccfc70ad5b Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-06-19L2FWD:fix seq_num overwritten + validate l2fib entries when forwardingEyal Bari1-3/+0
l2_classify memeber table_index was overlaid over l2.l2fib_seq_num which over written when table_index gets initialized in l2_input_classify solved by overlaying both table_index and opaque_index as only one is used seperated l2fib seq num from l2_input configs for better handling of theoretical ABA issue where an entry for a deleted interface is considered valid by the ager because a different interface with same sw_if_index and seq_num was created before the ager got a chance to delete Change-Id: I7b0eeded971627406f1c80834d7e02c0ebe62136 Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-06-12L2FIB:fix crash in show with deleted subif entriesEyal Bari1-0/+3
after deleting a sub interface it's l2fib entries are left with a dangling sw_if_index (while waiting for the ager to delete them). changed "show l2fib" to reflect that state with "Deleted" as the interface name. added sleep in test_l2_fib as a workaround for packets still passing after flush will investigate... Change-Id: Id998d7d3c6a073ef5005c5f3009e1cfb7febf7db Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-05-24TEST/L2BD:fix flush testsEyal Bari1-66/+107
flush tests will now enable learning on the bridge, and send broadcast packets to add dynamic entries to the l2_fib. it will then disable learning, flush, and will verify packets are not forwarded to flushed "hosts". Change-Id: Ie6f123e59f6c89af511bdc5a02dd199420c424e9 Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-05-22Skip L2 FIB flush testsNeale Ranns1-0/+9
These tests attempt to flush static entries from a bridge-domain that has no aging configured. for both reasons it will fail. The fact thtat they occationally pass is due to the fact that the assert_nothing_cpatured does not actually capture packets, so it misses the fact that there are some. Change-Id: Ie5c98a42944e29a3d482156f7e9246511380372f Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-05-16L2FIB: add flush testEyal Bari1-103/+198
add tests for flush int/bd/all Change-Id: Ia589ec5925b9c8acbb2fc16dafbf4842aa1a6eff Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-01-11make test: improve documentation and PEP8 complianceKlement Sekera1-5/+6
Change-Id: Ib4f0353aab6112fcc3c3d8f0bcbed5bc4b567b9b Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-12-23make test: improve handling of packet capturesKlement Sekera1-7/+3
Perform accounting of expected packets based on created packet infos. Use this accounting info to automatically expect (and verify) the correct number of packets to be captured. Automatically retry the read of the capture file if scapy raises an exception while doing so to handle rare cases when capture file is read while only partially written during busy wait. Don't fail assert_nothing_captured if only junk packets arrived. Change-Id: I16ec2e9410ef510d313ec16b7e13c57d0b2a63f5 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-12-16make test: improve robustness and performanceKlement Sekera1-11/+3
Introduce an API which asserts empty capture for interface. Throw exception in old API if the capture does not exist, thus making it clear if the test expects packets to arrive or not. Improve performance by not doing sleeps after starting the packet generator, rather lazily deleting captures when needed. Fix wrong usage of packet.show() in various tests. Change-Id: I456cb23316eef99b3f35f80344fe595c4db9a21c Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-11-23CSIT-473: L2 FIB testsJan1-0/+390
- add/delete MAC entries and check the traffic Change-Id: I82b568fdd7796461b2df900c07a4bd9b87ab17c2 Signed-off-by: Jan <jgelety@cisco.com>
/* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright (c) 2018 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_setup.robot
| ...
| Force Tags | 3_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV | MRR
| ... | NIC_Intel-X520-DA2 | ETH | L2BDMACLRN | L2BDBASE | BASE | MEMIF
| ... | K8S | 1VSWITCH | 1VNF | VPP_AGENT | SFC_CONTROLLER | PARALLEL
| ...
| Suite Setup | Set up 3-node performance topology with DUT's NIC model
| ... | L2 | Intel-X520-DA2
| ...
| Test Setup | Set up performance test with Ligato Kubernetes
| ...
| Suite Teardown | Tear down 3-node performance topology
| ...
| Test Teardown | Tear down performance test with Ligato Kubernetes
| ...
| Test Template | Local Template
| ...
| Documentation | *RFC2544: Pkt throughput L2BD test cases*
| ...
| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology
| ... | with single links between nodes.
| ... | *[Enc] Packet Encapsulations:* Eth-IPv4 for L2 bridge domain.
| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with two L2
| ... | bridge domains and MAC learning enabled. DUT1 and DUT2 tested with
| ... | 2p10GE NIC X520 Niantic by Intel.
| ... | VNF Container is connected to VSWITCH container via Memif interface. All
| ... | containers is running same VPP version. Containers are deployed with
| ... | Kubernetes. Configuration is applied by vnf-agent.
| ... | *[Ver] TG verification:* In MaxReceivedRate test TG sends traffic
| ... | at line rate and reports total received/sent packets over trial period.
| ... | TG traffic profile contains two L3 flow-groups
| ... | (flow-group per direction, 254 flows per flow-group) with all packets
| ... | containing Ethernet header, IPv4 header with IP protocol=61 and static
| ... | payload. MAC addresses are matching MAC addresses of the TG node
| ... | interfaces.
| ... | *[Ref] Applicable standard specifications:* RFC2544.

*** Variables ***
# X520-DA2 bandwidth limit
| ${s_limit}= | ${10000000000}
# SFC profile
| ${sfc_profile}= | configmaps/eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral
# Traffic profile:
| ${traffic_profile}= | trex-sl-3n-ethip4-ip4src254
# CPU settings
| ${system_cpus}= | ${1}
| ${vswitch_cpus}= | ${5}
| ${vnf_cpus}= | ${2}

*** Keywords ***
| Local Template
| | [Documentation]
| | ... | [Cfg] DUT runs Container orchestrated config.
| | ... | [Ver] Measure MaxReceivedRate for ${framesize}B frames using single\
| | ... | trial throughput test.
| | ...
| | ... | *Arguments:*
| | ... | - framesize - Framesize in Bytes in integer or string (IMIX_v4_1).
| | ... | Type: integer, string
| | ... | - phy_cores - Number of physical cores. Type: integer
| | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer
| | ...
| | [Arguments] | ${framesize} | ${phy_cores} | ${rxq}=${None}
| | ...
| | ${max_rate} | ${jumbo} = | Get Max Rate And Jumbo
| | ... | ${s_limit} | ${framesize}
| | ...
| | ${dut1_if1_name}= | Get interface name | ${dut1} | ${dut1_if1}
| | ${dut1_if2_name}= | Get interface name | ${dut1} | ${dut1_if2}
| | ${dut2_if1_name}= | Get interface name | ${dut2} | ${dut2_if1}
| | ${dut2_if2_name}= | Get interface name | ${dut2} | ${dut2_if2}
| | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
| | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
| | Create Kubernetes VSWITCH startup config on all DUTs
| | ... | ${phy_cores} | ${rxq} | ${jumbo}
| | Create Kubernetes VNF'1' startup config on all DUTs
| | Create Kubernetes CM from file on all DUTs | ${nodes} | csit
| | ... | name=vswitch-vpp-cfg | vpp.conf=/tmp/vswitch.conf
| | Create Kubernetes CM from file on all DUTs | ${nodes} | csit
| | ... | name=vnf1-vpp-cfg | vpp.conf=/tmp/vnf1.conf
| | Apply Kubernetes resource on node | ${dut1}
| | ... | pods/contiv-vnf.yaml | $$VNF$$=vnf1
| | Apply Kubernetes resource on node | ${dut2}
| | ... | pods/contiv-vnf.yaml | $$VNF$$=vnf1
| | Apply Kubernetes resource on node | ${dut1}
| | ... | ${sfc_profile}.yaml | $$TEST_NAME$$=${TEST NAME}
| | ... | $$VSWITCH_IF1$$=${dut1_if1_name}
| | ... | $$VSWITCH_IF2$$=${dut1_if2_name}
| | Apply Kubernetes resource on node | ${dut2}
| | ... | ${sfc_profile}.yaml | $$TEST_NAME$$=${TEST NAME}
| | ... | $$VSWITCH_IF1$$=${dut2_if1_name}
| | ... | $$VSWITCH_IF2$$=${dut2_if2_name}
| | Wait for Kubernetes PODs on all DUTs | ${nodes} | csit
| | Set Kubernetes PODs affinity on all DUTs | ${nodes}
| | Then Traffic should pass with maximum rate
| | ... | ${max_rate}pps | ${framesize} | ${traffic_profile}

*** Test Cases ***
| tc01-64B-1c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | 64B | 1C
| | framesize=${64} | phy_cores=${1}

| tc02-64B-2c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | 64B | 2C
| | framesize=${64} | phy_cores=${2}

| tc03-64B-4c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | 64B | 4C
| | framesize=${64} | phy_cores=${4}

| tc04-1518B-1c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | 1518B | 1C
| | framesize=${1518} | phy_cores=${1}

| tc05-1518B-2c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | 1518B | 2C
| | framesize=${1518} | phy_cores=${2}

| tc06-1518B-4c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | 1518B | 4C
| | framesize=${1518} | phy_cores=${4}

| tc07-9000B-1c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | 9000B | 1C
| | framesize=${9000} | phy_cores=${1}

| tc08-9000B-2c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | 9000B | 2C
| | framesize=${9000} | phy_cores=${2}

| tc09-9000B-4c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | 9000B | 4C
| | framesize=${9000} | phy_cores=${4}

| tc10-IMIX-1c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | IMIX | 1C
| | framesize=IMIX_v4_1 | phy_cores=${1}

| tc11-IMIX-2c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | IMIX | 2C
| | framesize=IMIX_v4_1 | phy_cores=${2}

| tc12-IMIX-4c-eth-1drcl2bdbasemaclrn-eth-2memif-1drcl2xc-1paral-k8s-mrr
| | [Tags] | IMIX | 4C
| | framesize=IMIX_v4_1 | phy_cores=${4}