diff options
Diffstat (limited to 'resources/libraries/robot/ip')
-rw-r--r-- | resources/libraries/robot/ip/geneve.robot | 41 | ||||
-rw-r--r-- | resources/libraries/robot/ip/ip4.robot | 86 | ||||
-rw-r--r-- | resources/libraries/robot/ip/ip6.robot | 10 | ||||
-rw-r--r-- | resources/libraries/robot/ip/nat.robot | 15 |
4 files changed, 29 insertions, 123 deletions
diff --git a/resources/libraries/robot/ip/geneve.robot b/resources/libraries/robot/ip/geneve.robot index ffbd506f1d..5edf4f4c17 100644 --- a/resources/libraries/robot/ip/geneve.robot +++ b/resources/libraries/robot/ip/geneve.robot @@ -20,8 +20,6 @@ | Initialize GENEVE L3 mode in circular topology | | [Documentation] | Initialization of GENEVE L3 mode on DUT1. | | -| | [Arguments] | ${with_bypass}=${False} -| | | | Set interfaces in path up | | | | VPP Interface Set IP Address @@ -35,40 +33,9 @@ | | ${next_index}= | VPP Add Graph Node Next | | ... | ${dut1} | geneve4-input | ethernet-input | | -| | ${src_ip_int} = | IP To Int | ${gen_tunnel.src_ip} -| | ${dst_ip_int} = | IP To Int | ${gen_tunnel.dst_ip} -| | ${if_ip_int} = | IP To Int | ${gen_tunnel.if_ip} +| | VPP GENEVE Add Multiple Tunnels +| | ... | ${dut1} | ${gen_tunnel} | ${n_tunnels} | ${DUT1_${int}1}[0] +| | ... | ${DUT1_${int}2}[0] | ${tg_if1_ip4} | ${tg_if2_ip4} +| | ... | ${TG_pf2_mac}[0] | ${next_index} | | -| | FOR | ${nr} | IN RANGE | 0 | ${n_tunnels} -| | | ${src_ip} = | Int To IP | ${${src_ip_int} + ${nr} * 256} -| | | ${dst_ip} = | Int To IP | ${${dst_ip_int} + ${nr} * 256} -| | | ${if_ip} = | Int To IP | ${${if_ip_int} + ${nr} * 256} -| | | Vpp Route Add -| | | ... | ${dut1} | ${src_ip} | ${gen_tunnel.ip_mask} -| | | ... | gateway=${tg_if1_ip4} | interface=${DUT1_${int}1}[0] -| | | ${tunnel_sw_index}= | Add Geneve Tunnel -| | | ... | ${dut1} | ${gen_tunnel.local} | ${gen_tunnel.remote} -| | | ... | ${${gen_tunnel.vni} + ${nr}} | l3_mode=${True} -| | | ... | next_index=${next_index} -| | | ${tunnel_if_key}= | Get Interface By SW Index -| | | ... | ${dut1} | ${tunnel_sw_index} -| | | ${tunnel_if_mac}= | Get Interface MAC -| | | ... | ${dut1} | ${tunnel_if_key} -| | | VPP Interface Set IP Address -| | | ... | ${dut1} | ${tunnel_if_key} | ${if_ip} | 24 -| | | VPP Add IP Neighbor -| | | ... | ${dut1} | ${tunnel_if_key} | ${tg_if2_ip4} | ${TG_pf2_mac}[0] -| | | Vpp Route Add -| | | ... | ${dut1} | ${dst_ip} | ${gen_tunnel.ip_mask} -| | | ... | gateway=${tg_if2_ip4} | interface=${tunnel_if_key} -| | | Vpp Route Add -| | | ... | ${dut1} | ${gen_tunnel.remote} | 32 -| | | ... | gateway=${tg_if2_ip4} | interface=${DUT1_${int}2}[0] -| | | VPP Add IP Neighbor -| | | ... | ${dut1} | ${tunnel_if_key} | ${gen_tunnel.local} | ${tunnel_if_mac} -| | | Vpp Route Add -| | | ... | ${dut1} | ${gen_tunnel.local} | 32 | gateway=${if_ip} -| | | Set Interface State -| | | ... | ${dut1} | ${tunnel_if_key} | up -| | END | | All VPP Interfaces Ready Wait | ${nodes} | retries=${60} diff --git a/resources/libraries/robot/ip/ip4.robot b/resources/libraries/robot/ip/ip4.robot index 0220fe29f6..e3ebd0e289 100644 --- a/resources/libraries/robot/ip/ip4.robot +++ b/resources/libraries/robot/ip/ip4.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2023 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: @@ -12,9 +12,6 @@ # limitations under the License. *** Settings *** -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.IPUtil -| | Documentation | IPv4 keywords *** Keywords *** @@ -83,80 +80,21 @@ | | ... | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1 | | ... | interface=${DUT2_${int}1}[0] | | -| | Run Keyword Unless | '${remote_host1_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host1_ip}' != '${NONE}' | | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | ${remote_host_mask} | | ... | gateway=10.10.10.2 | interface=${DUT1_${int}1}[0] -| | Run Keyword Unless | '${remote_host2_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host2_ip}' != '${NONE}' | | ... | Vpp Route Add | ${dut} | ${remote_host2_ip} | ${remote_host_mask} | | ... | gateway=20.20.20.2 | interface=${dut_if2} -| | Run Keyword Unless | '${remote_host1_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host1_ip}' != '${NONE}' | | ... | Run Keyword If | '${dut2_status}' == 'PASS' | | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | ${remote_host_mask} | | ... | gateway=1.1.1.2 | interface=${DUT1_${int}2}[0] -| | Run Keyword Unless | '${remote_host2_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host2_ip}' != '${NONE}' | | ... | Run Keyword If | '${dut2_status}' == 'PASS' | | ... | Vpp Route Add | ${dut2} | ${remote_host2_ip} | ${remote_host_mask} | | ... | gateway=1.1.1.1 | interface=${DUT2_${int}1}[0] -| Initialize IPv4 forwarding with scaling in circular topology -| | [Documentation] -| | ... | Custom setup of IPv4 topology with scalability of ip routes on all -| | ... | DUT nodes in 2-node / 3-node circular topology -| | -| | ... | *Arguments:* -| | ... | - count - IP route count. Type: integer -| | -| | ... | *Return:* -| | ... | - No value returned -| | -| | ... | *Example:* -| | -| | ... | \| Initialize IPv4 forwarding with scaling in 3-node circular \ -| | ... | topology \| 100000 \| -| | -| | [Arguments] | ${count} -| | -| | ${dut2_status} | ${value}= | Run Keyword And Ignore Error -| | ... | Variable Should Exist | ${dut2} -| | -| | Set interfaces in path up -| | -| | VPP Add IP Neighbor -| | ... | ${dut1} | ${DUT1_${int}1}[0] | 1.1.1.1 | ${TG_pf1_mac}[0] -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | VPP Add IP Neighbor -| | ... | ${dut1} | ${DUT1_${int}2}[0] | 2.2.2.2 | ${DUT2_${int}1_mac}[0] -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | VPP Add IP Neighbor -| | ... | ${dut2} | ${DUT2_${int}1}[0] | 2.2.2.1 | ${DUT1_${int}2_mac}[0] -| | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Set Variable | ${dut2} -| | ... | ELSE | Set Variable | ${dut1} -| | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Set Variable | ${DUT2_${int}2}[0] -| | ... | ELSE | Set Variable | ${DUT1_${int}2}[0] -| | VPP Add IP Neighbor -| | ... | ${dut} | ${dut_if2} | 3.3.3.1 | ${TG_pf2_mac}[0] -| | VPP Interface Set IP Address -| | ... | ${dut1} | ${DUT1_${int}1}[0] | 1.1.1.2 | 30 -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | VPP Interface Set IP Address | ${dut1} | ${DUT1_${int}2}[0] | 2.2.2.1 -| | ... | 30 -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | VPP Interface Set IP Address | ${dut2} | ${DUT2_${int}1}[0] | 2.2.2.2 -| | ... | 30 -| | VPP Interface Set IP Address | ${dut} | ${dut_if2} | 3.3.3.2 | 30 -| | Vpp Route Add | ${dut1} | 10.0.0.0 | 32 | gateway=1.1.1.1 -| | ... | interface=${DUT1_${int}1}[0] | count=${count} -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Vpp Route Add | ${dut1} | 20.0.0.0 | 32 | gateway=2.2.2.2 -| | ... | interface=${DUT1_${int}2}[0] | count=${count} -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Vpp Route Add | ${dut2} | 10.0.0.0 | 32 | gateway=2.2.2.1 -| | ... | interface=${DUT2_${int}1}[0] | count=${count} -| | Vpp Route Add | ${dut} | 20.0.0.0 | 32 | gateway=3.3.3.1 -| | ... | interface=${dut_if2} | count=${count} - | Initialize IPv4 routing with memif pairs | | [Documentation] | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each @@ -267,7 +205,7 @@ | | | ${memif2}= | Set Variable | ${${dut}-memif-${number}-if2} | | | ${fib_table_1}= | Evaluate | ${fib_table_1} + ${1} | | | ${fib_table_2}= | Evaluate | ${fib_table_1} + ${1} -| | | Run Keyword Unless | ${number} == ${count} +| | | Run Keyword If | ${number} != ${count} | | | ... | Add Fib Table | ${nodes['${dut}']} | ${fib_table_2} | | | Assign Interface To Fib Table | ${nodes['${dut}']} | | | ... | ${memif1} | ${fib_table_1} @@ -375,10 +313,10 @@ | | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | 1.1.1.2 | 30 | | | VPP Interface Set IP Address | | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | 1.1.2.2 | 30 -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut1} | 20.0.0.0 | 8 | gateway=1.1.1.1 | | | ... | interface=${dut1-vhost-${number}-if1} | vrf=${fib_table_1} -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut1} | 10.0.0.0 | 8 | gateway=1.1.2.1 | | | ... | interface=${dut1-vhost-${number}-if2} | vrf=${fib_table_2} | | | Run Keyword If | ${testpmd_mac} @@ -494,16 +432,16 @@ | | | ... | ${dut2} | ${dut2-vhost-${number}-if1} | 1.1.1.2 | 30 | | | VPP Interface Set IP Address | | | ... | ${dut2} | ${dut2-vhost-${number}-if2} | 1.1.2.2 | 30 -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut1} | 20.0.0.0 | 8 | gateway=1.1.1.1 | | | ... | interface=${dut1-vhost-${number}-if1} | vrf=${fib_table_1} -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut1} | 10.0.0.0 | 8 | gateway=1.1.2.1 | | | ... | interface=${dut1-vhost-${number}-if2} | vrf=${fib_table_2} -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut2} | 20.0.0.0 | 8 | gateway=1.1.1.1 | | | ... | interface=${dut2-vhost-${number}-if1} | vrf=${fib_table_1} -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut2} | 10.0.0.0 | 8 | gateway=1.1.2.1 | | | ... | interface=${dut2-vhost-${number}-if2} | vrf=${fib_table_2} | | | Run Keyword If | ${testpmd_mac} diff --git a/resources/libraries/robot/ip/ip6.robot b/resources/libraries/robot/ip/ip6.robot index ec22c5511b..506e5d844a 100644 --- a/resources/libraries/robot/ip/ip6.robot +++ b/resources/libraries/robot/ip/ip6.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2022 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: @@ -84,17 +84,17 @@ | | ... | Vpp Route Add | ${dut2} | 2001:1::0 | 64 | gateway=2001:3::1 | | ... | interface=${DUT2_${int}1}[0] | | -| | Run Keyword Unless | '${remote_host1_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host1_ip}' != '${NONE}' | | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | 128 | | ... | gateway=2001:1::2 | interface=${DUT1_${int}1}[0] -| | Run Keyword Unless | '${remote_host2_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host2_ip}' != '${NONE}' | | ... | Vpp Route Add | ${dut} | ${remote_host2_ip} | 128 | | ... | gateway=2001:2::2 | interface=${dut_if2} -| | Run Keyword Unless | '${remote_host1_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host1_ip}' != '${NONE}' | | ... | Run Keyword If | '${dut2_status}' == 'PASS' | | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | 128 | | ... | gateway=2001:3::2 | interface=${DUT1_${int}2}[0] -| | Run Keyword Unless | '${remote_host2_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host2_ip}' != '${NONE}' | | ... | Run Keyword If | '${dut2_status}' == 'PASS' | | ... | Vpp Route Add | ${dut2} | ${remote_host2_ip} | 128 | | ... | gateway=2001:3::1 | interface=${DUT2_${int}1}[0] diff --git a/resources/libraries/robot/ip/nat.robot b/resources/libraries/robot/ip/nat.robot index 75b8cce7b6..c04aef0f69 100644 --- a/resources/libraries/robot/ip/nat.robot +++ b/resources/libraries/robot/ip/nat.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2022 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: @@ -51,14 +51,15 @@ | | ... | - n_sessions - Expected number of opened sessions. | | | | ${max_sessions}= | Compute Max Translations Per Thread -| | ... | ${n_sessions} | ${thr_count_int} -| | Enable NAT44 Plugin | ${dut1} | mode=${nat_mode} | sessions=${max_sessions} +| | ... | ${n_sessions} | ${dp_count_int} +| | Enable NAT44 ED Plugin | ${dut1} | mode=${nat_mode} +| | ... | sessions=${max_sessions} | | Configure inside and outside interfaces | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0] | | ${resetter} = | Set NAT44 Address Range | | ... | ${dut1} | ${out_net} | ${out_net_end} -| | ${ramp_up_duration} = | Get Ramp Up Duration -| | Return From Keyword If | ${ramp_up_duration} +| | ${ramp_up_rate} = | Get Ramp Up Rate +| | Return From Keyword If | ${ramp_up_rate} | | Set Test Variable | \${resetter} # TODO: Remove when 'ip4.Initialize IPv4 forwarding in circular topology' KW @@ -221,8 +222,8 @@ | | | | ${resetter} = | Set DET44 Mapping | | ... | ${node} | ${ip_in} | ${subnet_in} | ${ip_out} | ${subnet_out} -| | ${ramp_up_duration} = | Get Ramp Up Duration -| | Return From Keyword If | ${ramp_up_duration} +| | ${ramp_up_rate} = | Get Ramp Up Rate +| | Return From Keyword If | ${ramp_up_rate} | | Set Test Variable | \${resetter} | Initialize NAT44 deterministic mode in circular topology |