X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fipv4.robot;h=9e31076772095c60388de5ee9a1c6546bbb59503;hp=4ed0181d523f6b0f6c75bca6f04afbb73a5a4bfd;hb=f48d2c859e6dd4d03e28db45d60beb182664ab16;hpb=44f173ecd1311296e347b066592163e9abbe3483 diff --git a/resources/libraries/robot/ipv4.robot b/resources/libraries/robot/ipv4.robot index 4ed0181d52..9e31076772 100644 --- a/resources/libraries/robot/ipv4.robot +++ b/resources/libraries/robot/ipv4.robot @@ -26,7 +26,9 @@ | Setup IPv4 adresses on all DUT nodes in topology | | [Documentation] | Setup IPv4 address on all DUTs in topology | | [Arguments] | ${nodes} | ${nodes_addr} -| | VPP nodes setup ipv4 addresses | ${nodes} | ${nodes_addr} +| | ${interfaces}= | VPP nodes set ipv4 addresses | ${nodes} | ${nodes_addr} +| | :FOR | ${interface} | IN | @{interfaces} +| | | Set Interface State | @{interface} | up | Routes are set up for IPv4 testing | | [Documentation] | Setup routing on all VPP nodes required for IPv4 tests @@ -68,23 +70,25 @@ | | ${args}= | Traffic Script Gen Arg | ${to_port} | ${from_port} | ${src_mac} | | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} | | ${args}= | Catenate | ${args} | --hops ${hops} | --first_hop_mac ${adj_int['mac_address']} -| | | ... | --is_dst_defined ${is_dst_tg} +| | | ... | --is_dst_tg ${is_dst_tg} | | Run Traffic Script On Node | ipv4_ping_ttl_check.py | ${from_node} | ${args} | Ipv4 icmp echo sweep | | [Documentation] | Type of the src_node must be TG and dst_node must be DUT -| | [Arguments] | ${src_node} | ${dst_node} | ${src_port} | ${dst_port} +| | [Arguments] | ${src_node} | ${dst_node} | ${start_size} | ${end_size} | ${step} +| | Append Nodes | ${src_node} | ${dst_node} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Interface | | ${src_ip}= | Get IPv4 address of node "${src_node}" interface "${src_port}" from "${nodes_ipv4_addr}" | | ${dst_ip}= | Get IPv4 address of node "${dst_node}" interface "${dst_port}" from "${nodes_ipv4_addr}" | | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port} | | ${dst_mac}= | Get Interface Mac | ${dst_node} | ${dst_port} | | ${args}= | Traffic Script Gen Arg | ${src_port} | ${src_port} | ${src_mac} | | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} -| # TODO: end_size is currently minimum MTU size for Ethernet minus IPv4 and -| # ICMP echo header size (1500 - 20 - 8), -| # MTU info is not in VAT sw_interface_dump output -| | ${args}= | Set Variable | ${args} --start_size 1 --end_size 1472 --step 1 -| | Run Traffic Script On Node | ipv4_sweep_ping.py | ${src_node} | ${args} +| | ${args}= | Set Variable +| | ... | ${args} --start_size ${start_size} --end_size ${end_size} --step ${step} +| | Run Traffic Script On Node | ipv4_sweep_ping.py | ${src_node} | ${args} | ${20} | Send ARP request and validate response | | [Arguments] | ${tg_node} | ${vpp_node} @@ -99,3 +103,25 @@ | | | ... | ${dst_mac} | ${src_ip} | ${dst_ip} | | Run Traffic Script On Node | arp_request.py | ${tg_node} | ${args} +| IP addresses are set on interfaces +| | [Documentation] | Iterates through @{args} list and Set Interface Address +| | ... | for every (${dut_node}, ${interface}, ${address}, +| | ... | ${prefix}) tuple. +| | ... +| | ... | *Arguments:* +| | ... | - ${dut_node} - Node where IP address should be set to. +| | ... | Type: dictionary +| | ... | - ${interface} - Interface name. Type: string +| | ... | - ${address} - IP address. Type: string +| | ... | - ${prefix} - Prefix length. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| IP addresses are set on interfaces \ +| | ... | \| ${dut1_node} \| ${dut1_to_dut2} \| 192.168.1.1 \| 24 \| +| | ... | \| ... \| ${dut1_node} \| ${dut1_to_tg} \| 192.168.2.1 \| 24 \| +| | ... +| | [Arguments] | @{args} +| | :FOR | ${dut_node} | ${interface} | ${address} | ${prefix} | IN | @{args} +| | | Set Interface Address | ${dut_node} | ${interface} | ${address} +| | | ... | ${prefix}