From 1f2723170ac74555aa505ab3cb772ded76501362 Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Thu, 11 Jul 2019 09:36:44 +0000 Subject: VPPD: Cop, iACL, Policer - Alignment with PERF Change-Id: Id7b2cb91c88e44cf9265c3376330f6aa579abf7a Signed-off-by: Peter Mikus --- resources/libraries/robot/features/policer.robot | 152 ++++++++++----------- .../performance/performance_configuration.robot | 58 -------- resources/libraries/robot/shared/default.robot | 11 +- resources/libraries/robot/shared/traffic.robot | 31 ++++- 4 files changed, 113 insertions(+), 139 deletions(-) (limited to 'resources/libraries') diff --git a/resources/libraries/robot/features/policer.robot b/resources/libraries/robot/features/policer.robot index 8fdfa39d18..111b932a4b 100644 --- a/resources/libraries/robot/features/policer.robot +++ b/resources/libraries/robot/features/policer.robot @@ -12,87 +12,87 @@ # limitations under the License. *** Settings *** -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.IPUtil -| Library | resources.libraries.python.IPv6Util | Library | resources.libraries.python.Policer -| Library | resources.libraries.python.TrafficScriptExecutor -| ... -| Resource | resources/libraries/robot/shared/default.robot -| Resource | resources/libraries/robot/shared/testing_path.robot | ... | 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 -| | VPP Interface Set IP Address | ${dut_node} | ${dut_to_tg_if1} -| | ... | ${dut_to_tg_if1_ip4} | ${ip4_plen} -| | VPP Interface Set IP Address | ${dut_node} | ${dut_to_tg_if2} -| | ... | ${dut_to_tg_if2_ip4} | ${ip4_plen} -| | VPP Add IP Neighbor | ${dut_node} | ${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. +| Initialize IPv4 policer 2r3c-${t} in circular topology +| | [Documentation] +| | ... | Setup of 2r3c color-aware or color-blind policer with dst IPv4 match +| | ... | on all DUT nodes in 2-node / 3-node circular topology. Policer is +| | ... | applied on links TG - DUTx. | | ... -| | ... | _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 Interface Set IP Address -| | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip6} | ${ip6_plen} -| | VPP Interface Set IP Address -| | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip6} | ${ip6_plen} -| | VPP 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} +| | ${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 +| | ${dut2_status} | ${value}= | Run Keyword And Ignore Error +| | ... | Variable Should Exist | ${dut2} +| | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS' +| | ... | Set Variable | ${dut2} +| | ... | ELSE | Set Variable | ${dut1} +| | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS' +| | ... | Set Variable | ${dut2_if2} +| | ... | ELSE | Set Variable | ${dut1_if2} +| | Run Keyword Unless | '${dut2_status}' == 'PASS' +| | ... | Policer Set Name | policer2 +| | Policer Set Node | ${dut} +| | Policer Classify Set Interface | ${dut_if2} +| | Policer Classify Set Match IP | 10.10.10.2 | ${False} +| | Policer Set Configuration -| 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 +| Initialize IPv6 policer 2r3c-${t} in circular topology +| | [Documentation] +| | ... | Setup of 2r3c color-aware or color-blind policer with dst IPv6 match +| | ... | on all DUT nodes in 2-node / 3-node circular topology. Policer is +| | ... | applied on links TG - DUTx. | | ... -| | ... | *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} +| | ${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 | 2001:2::2 | ${False} +| | Policer Set Configuration +| | ${dut2_status} | ${value}= | Run Keyword And Ignore Error +| | ... | Variable Should Exist | ${dut2} +| | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS' +| | ... | Set Variable | ${dut2} +| | ... | ELSE | Set Variable | ${dut1} +| | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS' +| | ... | Set Variable | ${dut2_if2} +| | ... | ELSE | Set Variable | ${dut1_if2} +| | Run Keyword Unless | '${dut2_status}' == 'PASS' +| | ... | Policer Set Name | policer2 +| | Policer Set Node | ${dut} +| | Policer Classify Set Interface | ${dut_if2} +| | Policer Classify Set Match IP | 2001:1::2 | ${False} +| | Policer Set Configuration diff --git a/resources/libraries/robot/performance/performance_configuration.robot b/resources/libraries/robot/performance/performance_configuration.robot index 2b2c505658..25a76fed37 100644 --- a/resources/libraries/robot/performance/performance_configuration.robot +++ b/resources/libraries/robot/performance/performance_configuration.robot @@ -551,46 +551,6 @@ | | Vpp Route Add | ${dut} | ${tg_if2_net} | 30 | gateway=3.3.3.1 | | ... | interface=${dut_if2} -| Initialize IPv4 policer 2r3c-${t} in circular topology -| | [Documentation] -| | ... | Setup of 2r3c color-aware or color-blind policer with dst ip match -| | ... | on all DUT nodes in 2-node / 3-node circular topology. Policer is -| | ... | applied on links TG - DUTx. -| | ... -| | ${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 -| | ${dut2_status} | ${value}= | Run Keyword And Ignore Error -| | ... | Variable Should Exist | ${dut2} -| | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Set Variable | ${dut2} -| | ... | ELSE | Set Variable | ${dut1} -| | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Set Variable | ${dut2_if2} -| | ... | ELSE | Set Variable | ${dut1_if2} -| | Run Keyword Unless | '${dut2_status}' == 'PASS' -| | ... | Policer Set Name | policer2 -| | Policer Set Node | ${dut} -| | Policer Classify Set Interface | ${dut_if2} -| | Policer Classify Set Match IP | 10.10.10.2 | ${False} -| | Policer Set Configuration - | Initialize IPv6 forwarding in circular topology | | [Documentation] | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node @@ -820,24 +780,6 @@ | | Vpp Route Add | ${dut} | ${tg_if2_net} | ${host_prefix} | | ... | gateway=2002:3::1 | interface=${dut_if2} -| 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} | 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} | ip6 | dst | 2001:1::2 -| | And Vpp Enable Input Acl Interface -| | ... | ${dut2} | ${dut2_if2} | ip6 | ${table_idx} - | Initialize IPv6 forwarding over SRv6 with encapsulation with '${n}' x SID '${prepos}' decapsulation in 3-node circular topology | | [Documentation] | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot index 57ee1797af..a25919d9d6 100644 --- a/resources/libraries/robot/shared/default.robot +++ b/resources/libraries/robot/shared/default.robot @@ -20,25 +20,28 @@ | Library | OperatingSystem | Library | String | ... -| Library | resources.libraries.python.CoreDumpUtil +| Library | resources.libraries.python.Classify.Classify | Library | resources.libraries.python.CpuUtils +| Library | resources.libraries.python.CoreDumpUtil +| Library | resources.libraries.python.Cop | Library | resources.libraries.python.DUTSetup | Library | resources.libraries.python.L2Util | Library | resources.libraries.python.Namespaces +| Library | resources.libraries.python.PapiHistory | Library | resources.libraries.python.SchedUtils | Library | resources.libraries.python.Tap | Library | resources.libraries.python.TGSetup -| Library | resources.libraries.python.PapiHistory +| Library | resources.libraries.python.topology.Topology +| Library | resources.libraries.python.Trace | Library | resources.libraries.python.VppCounters | Library | resources.libraries.python.VPPUtil -| Library | resources.libraries.python.Trace -| Library | resources.libraries.python.topology.Topology | ... | Resource | resources/libraries/robot/crypto/ipsec.robot | Resource | resources/libraries/robot/performance/performance_configuration.robot | Resource | resources/libraries/robot/performance/performance_limits.robot | Resource | resources/libraries/robot/performance/performance_utils.robot | Resource | resources/libraries/robot/shared/container.robot +| Resource | resources/libraries/robot/features/policer.robot | Resource | resources/libraries/robot/shared/qemu.robot | Resource | resources/libraries/robot/shared/suite_teardown.robot | Resource | resources/libraries/robot/shared/suite_setup.robot diff --git a/resources/libraries/robot/shared/traffic.robot b/resources/libraries/robot/shared/traffic.robot index 4ec5496e84..c930bcf92e 100644 --- a/resources/libraries/robot/shared/traffic.robot +++ b/resources/libraries/robot/shared/traffic.robot @@ -17,10 +17,10 @@ | Library | resources.libraries.python.InterfaceUtil | Library | resources.libraries.python.IPv6Util | Library | resources.libraries.python.NodePath +| Library | resources.libraries.python.Policer | Library | resources.libraries.python.topology.Topology | Library | resources.libraries.python.TrafficScriptExecutor | ... -| Resource | resources/libraries/robot/shared/default.robot | Resource | resources/libraries/robot/shared/counters.robot | ... | Documentation | Traffic keywords @@ -552,3 +552,32 @@ | | ${args}= | Catenate | ${args} | --h_num ${hops} | --src_nh_mac ${src_nh_mac} | | ... | --dst_nh_mac ${dst_nh_mac} | --is_dst_tg ${is_dst_tg} | | Run Traffic Script On Node | icmpv6_echo_req_resp.py | ${tx_node} | ${args} + +| 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 +| | ... +| | ... | *Example:* +| | ... | \| 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 \| +| | ... +| | [Arguments] | ${node} | ${tx_if} | ${rx_if} | ${src_mac} | ${dst_mac} +| | ... | ${src_ip} | ${dst_ip} +| | ... +| | ${dscp}= | DSCP AF22 +| | ${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} -- cgit 1.2.3-korg