X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fshared%2Ftraffic.robot;fp=resources%2Flibraries%2Frobot%2Fshared%2Ftraffic.robot;h=af348bb12ed82cd1afe48a2b6cbd3e95a3b5192e;hp=bd8edcf75106395451ccb4b55d457336315eeb31;hb=648fa787d8ed7a045da18cf1a0761f3ca0d5b947;hpb=6f9f70d7bb1bbed37ff1495c20d11a03b82b9951 diff --git a/resources/libraries/robot/shared/traffic.robot b/resources/libraries/robot/shared/traffic.robot index bd8edcf751..af348bb12e 100644 --- a/resources/libraries/robot/shared/traffic.robot +++ b/resources/libraries/robot/shared/traffic.robot @@ -652,3 +652,58 @@ | | ... | --tun_vni ${tun_vni} | --tun_src_ip ${tun_src_ip} | | ... | --tun_dst_ip ${tun_dst_ip} | | Run Traffic Script On Node | geneve_tunnel.py | ${node} | ${args} + +| Send flow packet and verify action +| | [Documentation] | Send packet and verify the correctness of flow action. +| | +| | ... | *Arguments:* +| | +| | ... | _NOTE:_ Arguments are based on topology: +| | ... | TG(if1)->(if1)DUT +| | +| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary +| | ... | - tx_interface - TG Interface 1. Type: string +| | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string +| | ... | - flow_type - Flow packet type. Type: string +| | ... | - proto - Flow packet protocol. Type: string +| | ... | - src_ip - Source ip address. Type: string +| | ... | - dst_ip - Destination IP address. Type: string +| | ... | - src_port - Source port. Type: int +| | ... | - dst_port - Destination port. Type: int +| | ... | - value - Additional packet value. Type: integer +| | ... | - traffic_script - Traffic script that send packet. Type: string +| | ... | - action - drop, mark or redirect-to-queue. Type: string +| | ... | - action_value - action value. Type: integer +| | +| | ... | *Return:* +| | ... | - No value returned +| | +| | ... | *Example:* +| | ... | \| Send flow packet and verify actions \| ${nodes['TG']} \| eth2 \ +| | ... | \| 08:00:27:a2:52:5b \| IP4 \| UDP \ +| | ... | \| src_ip=1.1.1.1 \| dst_ip=2.2.2.2 \ +| | ... | \| src_port=${100} \| dst_port=${200} \ +| | ... | \| traffic_script=send_flow_packet \ +| | ... | \|action=mark \| action_value=${3} \| +| | +| | [Arguments] | ${tg_node} | ${tx_interface} | ${tx_dst_mac} +| | ... | ${flow_type} | ${proto} +| | ... | ${src_ip}=${None} | ${dst_ip}=${None} +| | ... | ${src_port}=${None} | ${dst_port}=${None} +| | ... | ${value}=${None} +| | ... | ${traffic_script}=send_flow_packet +| | ... | ${action}=redirect-to-queue +| | ... | ${action_value}=${3} +| | +| | ${tx_src_mac}= | Get Interface Mac | ${tg_node} | ${tx_interface} +| | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_interface} +| | ${args}= | Catenate +| | ... | --tg_if1_mac ${tx_src_mac} | --dut_if1_mac ${tx_dst_mac} +| | ... | --tx_if ${tx_if_name} | --flow_type ${flow_type} | --proto ${proto} +| | ... | --src_ip ${src_ip} | --dst_ip ${dst_ip} +| | ... | --src_port ${src_port} | --dst_port ${dst_port} +| | ... | --value ${value} +| | Run Traffic Script On Node | ${traffic_script}.py | ${tg_node} | ${args} +| | Vpp Verify Flow action | ${dut1} | ${action} | ${action_value} +| | ... | ${tx_src_mac} | ${tx_dst_mac} +| | ... | ${src_ip} | ${dst_ip}