X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fshared%2Ftraffic.robot;h=c930bcf92e81d3df6dd7395ffc26dd3c2f5696e2;hp=4ec5496e840ebe6d5f30a54c581a42c7747305ea;hb=1f2723170ac74555aa505ab3cb772ded76501362;hpb=33fb34665214bbbd0a4b3154169b21c2da01f69b 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}