X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fip%2Fip4.robot;h=bb0ae5be4cdfded0a1f91227e33b8b22ae8264ef;hb=refs%2Fchanges%2F60%2F18360%2F67;hp=02025156e2cc59dfb512eb46c2a52eed7e28944e;hpb=f9041bcdc886ba08800fe11c32e218d98ef6ed33;p=csit.git diff --git a/resources/libraries/robot/ip/ip4.robot b/resources/libraries/robot/ip/ip4.robot index 02025156e2..bb0ae5be4c 100644 --- a/resources/libraries/robot/ip/ip4.robot +++ b/resources/libraries/robot/ip/ip4.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Cisco and/or its affiliates. +# Copyright (c) 2019 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -40,6 +40,20 @@ | | :FOR | ${interface} | IN | @{interfaces} | | | Set Interface State | @{interface} | up | if_type=name +| Get interface Ipv4 addresses +| | [Documentation] | Get IPv4 address for the given interface of the node. +| | ... +| | ... | *Arguments:* +| | ... | - node - DUT node data. Type: dictionary +| | ... | - interface - Name of the interface on the VPP node. Type: string +| | ... +| | [Arguments] | ${node} | ${interface} +| | ... +| | [Return] | ${ip_data} +| | ... +| | ${ip_data}= | VPP get interface ip addresses +| | ... | ${node} | ${interface} | ipv4 + | Configure routes for IPv4 test | | [Documentation] | Setup routing on all VPP nodes required for IPv4 tests | | [Arguments] | ${nodes} | ${nodes_addr} @@ -55,13 +69,13 @@ | | :FOR | ${link} | IN | @{tg_dut1_links} | | | ${net}= | Get Link Address | ${link} | ${nodes_addr} | | | ${prefix}= | Get Link Prefix | ${link} | ${nodes_addr} -| | | Vpp Route Add | ${dut2} | ${net} | ${prefix} | ${dut1_if_addr} -| | | ... | ${dut2_if} +| | | Vpp Route Add | ${dut2} | ${net} | ${prefix} +| | | ... | gateway=${dut1_if_addr} | interface=${dut2_if} | | :FOR | ${link} | IN | @{tg_dut2_links} | | | ${net}= | Get Link Address | ${link} | ${nodes_addr} | | | ${prefix}= | Get Link Prefix | ${link} | ${nodes_addr} -| | | Vpp Route Add | ${dut1} | ${net} | ${prefix} | ${dut2_if_addr} -| | | ... | ${dut1_if} +| | | Vpp Route Add | ${dut1} | ${net} | ${prefix} +| | | ... | gateway=${dut2_if_addr} | interface=${dut1_if} | Configure DUT nodes for IPv4 testing | | Configure IPv4 addresses on all DUTs | ${nodes} | ${nodes_ipv4_addr} @@ -175,7 +189,7 @@ | | Run Traffic Script On Node | send_icmp_wait_for_reply.py | | ... | ${tg_node} | ${args} -| Initialize IPv4 forwarding in circular topology +| Configure IPv4 forwarding in circular topology | | [Documentation] | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node | | ... | circular topology. Get the interface MAC addresses and setup ARP on @@ -203,16 +217,16 @@ | | ... | | ... | *Example:* | | ... -| | ... | \| Initialize IPv4 forwarding in circular topology \ +| | ... | \| Configure IPv4 forwarding in circular topology \ | | ... | \| 10.10.10.2 \| 20.20.20.2 \| 10.10.10.1 \| 20.20.20.1 \| -| | ... | \| Initialize IPv4 forwarding in circular topology \ +| | ... | \| Configure IPv4 forwarding in circular topology \ | | ... | \| 10.10.10.2 \| 20.20.20.2 \| 10.10.10.1 \| 20.20.20.1 \ | | ... | \| remote_host1_ip4=192.168.0.1 \| remote_host2_ip4=192.168.0.2 \ | | ... | \| remote_host_ip4_prefix=32 \| -| | ... | \| Initialize IPv4 forwarding in circular topology \ +| | ... | \| Configure IPv4 forwarding in circular topology \ | | ... | \| 10.10.10.2 \| 20.20.20.2 \| 10.10.10.1 \| 1.1.1.1 \| 1.1.1.2 \ | | ... | \| 20.20.20.1 \| -| | ... | \| Initialize IPv4 forwarding in circular topology \ +| | ... | \| Configure IPv4 forwarding in circular topology \ | | ... | \| 10.10.10.2 \| 20.20.20.2 \| 10.10.10.1 \| 1.1.1.1 \| 1.1.1.2 \ | | ... | \| 20.20.20.1 \| remote_host1_ip4=192.168.0.1 \ | | ... | \| remote_host2_ip4=192.168.0.2 \| remote_host_ip4_prefix=32 \| @@ -222,24 +236,24 @@ | | ... | ${remote_host1_ip4}=${NONE} | ${remote_host2_ip4}=${NONE} | | ... | ${remote_host_ip4_prefix}=${NONE} | | ... -| | Set interfaces in path up +| | Configure interfaces in path up | | ... | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error | | ... | Variable Should Exist | ${dut2_node} | | ... | | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Initialize IPv4 forwarding in 3-node circular topology +| | ... | Configure IPv4 forwarding in 3-node circular topology | | ... | ${tg_if1_ip4} | ${tg_if2_ip4} | ${dut1_if1_ip4} | ${dut1_if2_ip4} | | ... | ${dut2_if1_ip4} | ${dut2_if2_ip4} | ${remote_host1_ip4} | | ... | ${remote_host2_ip4} | ${remote_host_ip4_prefix} | | ... | ELSE -| | ... | Initialize IPv4 forwarding in 2-node circular topology +| | ... | Configure IPv4 forwarding in 2-node circular topology | | ... | ${tg_if1_ip4} | ${tg_if2_ip4} | ${dut1_if1_ip4} | ${dut1_if2_ip4} | | ... | remote_host1_ip4=${remote_host1_ip4} | | ... | remote_host2_ip4=${remote_host2_ip4} | | ... | remote_host_ip4_prefix=${remote_host_ip4_prefix} -| Initialize IPv4 forwarding in 2-node circular topology +| Configure IPv4 forwarding in 2-node circular topology | | [Documentation] | | ... | Set UP state on VPP interfaces on DUT node in 2-node circular | | ... | topology. Get the interface MAC addresses and setup ARP on @@ -261,9 +275,9 @@ | | ... | | ... | *Example:* | | ... -| | ... | \| Initialize IPv4 forwarding in circular topology \ +| | ... | \| Configure IPv4 forwarding in circular topology \ | | ... | \| 10.10.10.2 \| 20.20.20.2 \| 10.10.10.1 \| 20.20.20.1 \| -| | ... | \| Initialize IPv4 forwarding in circular topology \ +| | ... | \| Configure IPv4 forwarding in circular topology \ | | ... | \| 10.10.10.2 \| 20.20.20.2 \| 10.10.10.1 \| 20.20.20.1 \ | | ... | \| 192.168.0.1 \| 192.168.0.2 \| 32 \| | | ... @@ -285,12 +299,14 @@ | | ... | | Run Keyword Unless | '${remote_host1_ip4}' == '${NONE}' | | ... | Vpp Route Add | ${dut_node} | ${remote_host1_ip4} -| | ... | ${remote_host_ip4_prefix} | ${tg_if1_ip4} | ${dut_to_tg_if1} +| | ... | ${remote_host_ip4_prefix} | gateway=${tg_if1_ip4} +| | ... | interface=${dut_to_tg_if1} | | Run Keyword Unless | '${remote_host2_ip4}' == '${NONE}' | | ... | Vpp Route Add | ${dut_node} | ${remote_host2_ip4} -| | ... | ${remote_host_ip4_prefix} | ${tg_if2_ip4} | ${dut_to_tg_if2} +| | ... | ${remote_host_ip4_prefix} | gateway=${tg_if2_ip4} +| | ... | interface=${dut_to_tg_if2} -| Initialize IPv4 forwarding in 3-node circular topology +| Configure IPv4 forwarding in 3-node circular topology | | [Documentation] | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP @@ -316,10 +332,10 @@ | | ... | | ... | *Example:* | | ... -| | ... | \| Initialize IPv4 forwarding in circular topology \ +| | ... | \| Configure IPv4 forwarding in circular topology \ | | ... | \| 10.10.10.2 \| 20.20.20.2 \| 10.10.10.1 \| 1.1.1.1 \| 1.1.1.2 \ | | ... | \| 20.20.20.1 \| -| | ... | \| Initialize IPv4 forwarding in circular topology \ +| | ... | \| Configure IPv4 forwarding in circular topology \ | | ... | \| 10.10.10.2 \| 20.20.20.2 \| 10.10.10.1 \| 1.1.1.1 \| 1.1.1.2 \ | | ... | \| 20.20.20.1 \| 192.168.0.1 \| 192.168.0.2 \| 32 \| | | ... @@ -350,19 +366,23 @@ | | ... | ${dut2_if2_ip4} | ${dut_tg_ip4_prefix} | | ... | | Vpp Route Add | ${dut1_node} | ${tg_if2_ip4} | ${dut_tg_ip4_prefix} -| | ... | ${dut2_if1_ip4} | ${dut1_to_dut2} +| | ... | gateway=${dut2_if1_ip4} | interface=${dut1_to_dut2} | | Vpp Route Add | ${dut2_node} | ${tg_if1_ip4} | ${dut_tg_ip4_prefix} -| | ... | ${dut1_if2_ip4} | ${dut2_to_dut1} +| | ... | gateway=${dut1_if2_ip4} | interface=${dut2_to_dut1} | | ... | | Run Keyword Unless | '${remote_host1_ip4}' == '${NONE}' | | ... | Vpp Route Add | ${dut1_node} | ${remote_host1_ip4} -| | ... | ${remote_host_ip4_prefix} | ${tg_if1_ip4} | ${dut1_to_tg} +| | ... | ${remote_host_ip4_prefix} | gateway=${tg_if1_ip4} +| | ... | interface=${dut1_to_tg} | | Run Keyword Unless | '${remote_host2_ip4}' == '${NONE}' | | ... | Vpp Route Add | ${dut1_node} | ${remote_host2_ip4} -| | ... | ${remote_host_ip4_prefix} | ${dut2_if1_ip4} | ${dut1_to_dut2} +| | ... | ${remote_host_ip4_prefix} | gateway=${dut2_if1_ip4} +| | ... | interface=${dut1_to_dut2} | | Run Keyword Unless | '${remote_host1_ip4}' == '${NONE}' | | ... | Vpp Route Add | ${dut2_node} | ${remote_host1_ip4} -| | ... | ${remote_host_ip4_prefix} | ${dut1_if2_ip4} | ${dut2_to_dut1} +| | ... | ${remote_host_ip4_prefix} | gateway=${dut1_if2_ip4} +| | ... | interface=${dut2_to_dut1} | | Run Keyword Unless | '${remote_host2_ip4}' == '${NONE}' | | ... | Vpp Route Add | ${dut2_node} | ${remote_host2_ip4} -| | ... | ${remote_host_ip4_prefix} | ${tg_if2_ip4} | ${dut2_to_tg} +| | ... | ${remote_host_ip4_prefix} | gateway=${tg_if2_ip4} +| | ... | interface=${dut2_to_tg}