aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/robot/features
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2020-02-21 22:09:02 +0000
committerPeter Mikus <pmikus@cisco.com>2020-04-06 08:27:39 +0000
commit14a71b74b414df7616ccb5ada3d50ecb90d96bae (patch)
treebfee617c9a4b20ce4c6467ffbbe6c0a15199ba52 /resources/libraries/robot/features
parent8e601d0f37f715ca4ce55dded8bc27cadfe175c2 (diff)
Improve pf layer
+ Merge single/double link + Introduce _pf{n}[0] variables so we can access physical function same way as virtual function + Cleanup code by moving complex logic to python + Prepare code for multiple vf functions Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: Ic2e74a38bfa146441357de8f0916aeb638941c49
Diffstat (limited to 'resources/libraries/robot/features')
-rw-r--r--resources/libraries/robot/features/acl.robot27
-rw-r--r--resources/libraries/robot/features/gbp.robot11
-rw-r--r--resources/libraries/robot/features/policer.robot16
3 files changed, 27 insertions, 27 deletions
diff --git a/resources/libraries/robot/features/acl.robot b/resources/libraries/robot/features/acl.robot
index ae613e1812..8621562b22 100644
--- a/resources/libraries/robot/features/acl.robot
+++ b/resources/libraries/robot/features/acl.robot
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 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:
@@ -259,40 +259,41 @@
| | ... | Set Variable | ${dut2}
| | ... | ELSE | Set Variable | ${dut1}
| | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
-| | ... | Set Variable | ${dut2_if2}
-| | ... | ELSE | Set Variable | ${dut1_if2}
+| | ... | Set Variable | ${DUT2_${int}2}[0]
+| | ... | ELSE | Set Variable | ${DUT1_${int}2}[0]
| |
| | Set interfaces in path up
| |
| | FOR | ${number} | IN RANGE | 2 | ${ip_nr}+2
| | | VPP Add IP Neighbor
-| | | ... | ${dut1} | ${dut1_if1} | 10.10.10.${number} | ${tg_if1_mac}
+| | | ... | ${dut1} | ${DUT1_${int}1}[0] | 10.10.10.${number} | ${TG_pf1_mac}[0]
| | | VPP Add IP Neighbor
-| | | ... | ${dut} | ${dut_if2} | 20.20.20.${number} | ${tg_if2_mac}
+| | | ... | ${dut} | ${dut_if2} | 20.20.20.${number} | ${TG_pf2_mac}[0]
| | END
| | Run Keyword If | '${dut2_status}' == 'PASS'
| | ... | VPP Add IP Neighbor
-| | ... | ${dut1} | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
+| | ... | ${dut1} | ${DUT1_${int}2}[0] | 1.1.1.2 | ${DUT2_${int}1_mac}[0]
| | Run Keyword If | '${dut2_status}' == 'PASS'
| | ... | VPP Add IP Neighbor
-| | ... | ${dut2} | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
+| | ... | ${dut2} | ${DUT2_${int}1}[0] | 1.1.1.1 | ${DUT1_${int}2_mac}[0]
| |
| | VPP Interface Set IP Address
-| | ... | ${dut1} | ${dut1_if1} | 10.10.10.1 | 24
+| | ... | ${dut1} | ${DUT1_${int}1}[0] | 10.10.10.1 | 24
| | VPP Interface Set IP Address
| | ... | ${dut} | ${dut_if2} | 20.20.20.1 | 24
| | Run Keyword If | '${dut2_status}' == 'PASS'
| | ... | VPP Interface Set IP Address
-| | ... | ${dut1} | ${dut1_if2} | 1.1.1.1 | 30
+| | ... | ${dut1} | ${DUT1_${int}2}[0] | 1.1.1.1 | 30
| | Run Keyword If | '${dut2_status}' == 'PASS'
| | ... | VPP Interface Set IP Address
-| | ... | ${dut2} | ${dut2_if1} | 1.1.1.2 | 30
+| | ... | ${dut2} | ${DUT2_${int}1}[0] | 1.1.1.2 | 30
| |
| | Run Keyword If | '${dut2_status}' == 'PASS'
| | ... | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=1.1.1.2
-| | ... | interface=${dut1_if2}
+| | ... | interface=${DUT1_${int}2}[0]
| | Run Keyword If | '${dut2_status}' == 'PASS'
| | ... | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1
-| | ... | interface=${dut2_if1}
+| | ... | interface=${DUT2_${int}1}[0]
| |
-| | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
+| | Configure IPv4 ACLs
+| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0]
diff --git a/resources/libraries/robot/features/gbp.robot b/resources/libraries/robot/features/gbp.robot
index 57ddf6dd1a..fc1c9faba4 100644
--- a/resources/libraries/robot/features/gbp.robot
+++ b/resources/libraries/robot/features/gbp.robot
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 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:
@@ -31,7 +31,6 @@
| |
| | [Arguments] | ${dut} | ${count}=${1}
| |
-| | ${dut_str}= | Convert To Lowercase | ${dut}
| | FOR | ${id} | IN RANGE | 1 | ${count} + 1
| | | ${hexa_id}= | Convert To Hex | ${id} | length=2 | lowercase=yes
| | | ${dut_lo}= | VPP Create Loopback | ${nodes['${dut}']}
@@ -57,11 +56,11 @@
| | | GBP Ext Itf Add Del
| | | ... | ${nodes['${dut}']} | ${dut_lo} | bd_id=${id} | rd_id=${id}
| | | GBP Endpoint Add
-| | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1} | 1.1.1.100
-| | | ... | ${tg_if1_mac} | ${100}
+| | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_${id}}[0]
+| | | ... | 1.1.1.100 | ${TG_pf1_mac}[0] | ${100}
| | | GBP Endpoint Add
-| | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2} | 1.1.1.200
-| | | ... | ${tg_if2_mac} | ${100}
+| | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_${id}}[0]
+| | | ... | 1.1.1.200 | ${TG_pf2_mac}[0] | ${100}
| | | VPP Route Add
| | | ... | ${nodes['${dut}']} | 10.10.10.0 | 24 | gateway=1.1.1.100
| | | ... | interface=${dut_lo} | vrf=${1}
diff --git a/resources/libraries/robot/features/policer.robot b/resources/libraries/robot/features/policer.robot
index bbabdd7632..a9394d6c9f 100644
--- a/resources/libraries/robot/features/policer.robot
+++ b/resources/libraries/robot/features/policer.robot
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 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:
@@ -33,7 +33,8 @@
| | Vpp Configures Classify Session L3 | ${dut1} | permit | ${table_idx}
| | ... | ${skip_n} | ${match_n} | ip4 | dst | 20.20.20.2
| | ... | hit_next_index=${policer_index} | opaque_index=${pre_color}
-| | Policer Classify Set Interface | ${dut1} | ${dut1_if1}
+| | Policer Classify Set Interface
+| | ... | ${dut1} | ${DUT1_${int}1}[0]
| | ... | ip4_table_index=${table_idx}
| |
| | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
@@ -42,8 +43,8 @@
| | ... | Set Variable | ${dut2}
| | ... | ELSE | Set Variable | ${dut1}
| | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
-| | ... | Set Variable | ${dut2_if2}
-| | ... | ELSE | Set Variable | ${dut1_if2}
+| | ... | Set Variable | ${DUT2_${int}2}[0]
+| | ... | ELSE | Set Variable | ${DUT1_${int}2}[0]
| |
| | ${policer_index}= | Run Keyword If | '${dut2_status}' == 'PASS'
| | ... | Policer Set Configuration | ${dut} | policer2 | ${cir}
@@ -75,7 +76,7 @@
| | Vpp Configures Classify Session L3 | ${dut1} | permit | ${table_idx}
| | ... | ${skip_n} | ${match_n} | ip6 | dst | 2001:2::2
| | ... | hit_next_index=${policer_index} | opaque_index=${pre_color}
-| | Policer Classify Set Interface | ${dut1} | ${dut1_if1}
+| | Policer Classify Set Interface | ${dut1} | ${DUT1_${int}1}[0]
| | ... | ip6_table_index=${table_idx}
| |
| | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
@@ -84,8 +85,8 @@
| | ... | Set Variable | ${dut2}
| | ... | ELSE | Set Variable | ${dut1}
| | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
-| | ... | Set Variable | ${dut2_if2}
-| | ... | ELSE | Set Variable | ${dut1_if2}
+| | ... | Set Variable | ${DUT2_${int}2}[0]
+| | ... | ELSE | Set Variable | ${DUT1_${int}2}[0]
| |
| | ${policer_index}= | Run Keyword If | '${dut2_status}' == 'PASS'
| | ... | Policer Set Configuration | ${dut} | policer2 | ${cir}
@@ -115,7 +116,6 @@
| |
| | [Arguments] | ${nodes}
| |
-| | ${duts}= | Get Matches | ${nodes} | DUT*
| | FOR | ${dut} | IN | @{duts}
| | | Show Classify Tables Verbose | ${nodes['${dut}']}
| | END