CSIT-562 HC Test: Persistence suite rework, part1
[csit.git] / resources / libraries / robot / traffic.robot
index 2522444..18db071 100644 (file)
 | | ... | - 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
 | | [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}
 
 | | ...                 | --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 Check 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}