CSIT-675: SRv6 performance tests
[csit.git] / resources / libraries / robot / overlay / srv6.robot
1 # Copyright (c) 2018 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Library | resources.libraries.python.SRv6
16 | Documentation | Keywords for SRv6 feature in VPP.
17
18 *** Keywords ***
19 | Configure SR LocalSID on DUT
20 | | [Documentation] | Create SRv6 LocalSID and binds it to a particular\
21 | | ... | behavior on the given DUT node.
22 | | ...
23 | | ... | *Arguments:*
24 | | ... | - dut_node - DUT node where to create localSID on. Type: dictionary
25 | | ... | - local_sid - LocalSID IPv6 address. Type: string
26 | | ... | - behavior - SRv6 LocalSID function. Type: string
27 | | ... | - interface - Interface name (Optional, default value: None; required
28 | | ... | for L2/L3 xconnects). Type: string
29 | | ... | - next_hop - Next hop IPv4/IPv6 address (Optional, default value:
30 | | ... | None; required for L3 xconnects). Type: string
31 | | ... | - fib_table - FIB table for IPv4/IPv6 lookup (Optional, default value:
32 | | ... | None; required for L3 routing). Type: string
33 | | ...
34 | | ... | *Example:*
35 | | ...
36 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| B:: \| end \|
37 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| C:: \
38 | | ... | \| end.dx2 \| interface=GigabitEthernet0/10/0 \|
39 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| D:: \
40 | | ... | \| end.dx4 \| interface=GigabitEthernet0/8/0 \| next_hop=10.0.0.1 \|
41 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT2']} \| E:: \
42 | | ... | \| end.dt6 \| fib_table=2 \|
43 | | ...
44 | | [Arguments] | ${dut_node} | ${local_sid} | ${behavior}
45 | | ... | ${interface}=${None} | ${next_hop}=${None} | ${fib_table}=${None}
46 | | ...
47 | | Configure SR LocalSID | ${dut_node} | ${local_sid} | ${behavior}
48 | | ... | interface=${interface} | next_hop=${next_hop} | fib_table=${fib_table}
49
50 | Delete SR LocalSID on DUT
51 | | [Documentation] | Delete SRv6 LocalSID on the given DUT node.
52 | | ...
53 | | ... | *Arguments:*
54 | | ... | - dut_node - DUT node where to delete localSID on. Type: dictionary
55 | | ... | - local_sid - LocalSID IPv6 address. Type: string
56 | | ...
57 | | ... | *Example:*
58 | | ...
59 | | ... | \| Delete SR LocalSID on DUT \| ${nodes['DUT1']} \| B:: \|
60 | | ...
61 | | [Arguments] | ${dut_node} | ${local_sid}
62 | | ...
63 | | Delete SR LocalSID | ${dut_node} | ${local_sid}
64
65 | Show SR LocalSIDs on DUT
66 | | [Documentation] | Show SRv6 LocalSIDs on the given DUT node.
67 | | ...
68 | | ... | *Arguments:*
69 | | ... | - dut_node - DUT node where to show SR localSIDs on. Type: dictionary
70 | | ...
71 | | ... | *Example:*
72 | | ...
73 | | ... | \| Show SR LocalSIDs on DUT \| ${nodes['DUT1']} \|
74 | | ...
75 | | [Arguments] | ${dut_node}
76 | | ...
77 | | Show SR LocalSIDs | ${dut_node}
78
79 | Configure SR Policy on DUT
80 | | [Documentation] | Create SRv6 policy on the given DUT node.
81 | | ...
82 | | ... | *Arguments:*
83 | | ... | - dut_node - DUT node where to create SRv6 policy on. Type: dictionary
84 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
85 | | ... | - mode - Encapsulation / insertion mode. Type: string
86 | | ... | - sid_list - SID list. Type: list
87 | | ...
88 | | ... | *Example:*
89 | | ...
90 | | ... | \| Configure SR Policy on DUT \| ${nodes['DUT2']} \| A:: \| encap \
91 | | ... | \| B::\| C:: \|
92 | | ... | \| Configure SR Policy on DUT \| ${nodes['DUT2']} \| D:: \| insert \
93 | | ... | \| E::\| F:: \|
94 | | ...
95 | | [Arguments] | ${dut_node} | ${bsid} | ${mode} | @{sid_list}
96 | | ...
97 | | Configure SR Policy | ${dut_node} | ${bsid} | ${sid_list} | mode=${mode}
98
99 | Delete SR Policy on DUT
100 | | [Documentation] | Delete SRv6 policy on the given DUT node.
101 | | ...
102 | | ... | *Arguments:*
103 | | ... | - dut_node - DUT node where to delete SRv6 policy on. Type: dictionary
104 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
105 | | ...
106 | | ... | *Example:*
107 | | ...
108 | | ... | \| Delete SR Policy on DUT \| ${nodes['DUT1']} \| A:: \|
109 | | ...
110 | | [Arguments] | ${dut_node} | ${bsid}
111 | | ...
112 | | Delete SR Policy | ${dut_node} | ${bsid}
113
114 | Show SR Policies on DUT
115 | | [Documentation] | Show SRv6 policies on the given DUT node.
116 | | ...
117 | | ... | *Arguments:*
118 | | ... | - dut_node - DUT node where to show SR policies on. Type: dictionary
119 | | ...
120 | | ... | *Example:*
121 | | ...
122 | | ... | \| Show SR Policies on DUT \| ${nodes['DUT1']} \|
123 | | ...
124 | | [Arguments] | ${dut_node}
125 | | ...
126 | | Show SR Policies | ${dut_node}
127
128 | Configure SR Steer on DUT
129 | | [Documentation] | Create SRv6 steering policy on the given DUT node.
130 | | ...
131 | | ... | *Arguments:*
132 | | ... | - dut_node - DUT node where to create SR steering policy on.
133 | | ... | Type: dictionary
134 | | ... | - mode - Mode of operation - L2 or L3. Type: string
135 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
136 | | ... | - interface - Interface name (Optional, default value: None; required
137 | | ... | in case of L2 mode). Type: string
138 | | ... | - ip_addr - IPv4/IPv6 address (Optional, default value: None; required
139 | | ... | in case of L3 mode). Type: string
140 | | ... | - prefix - IP address prefix (Optional, default value: None; required
141 | | ... | for L3 mode). Type: integer
142 | | ...
143 | | ... | *Example:*
144 | | ...
145 | | ... | \| Configure SR Steer on DUT \| ${nodes['DUT1']} \| L2 \| B:: \
146 | | ... | \| interface=GigabitEthernet0/10/0 \|
147 | | ... | \| Configure SR Steer on DUT \| ${nodes['DUT1']} \| L3 \| C:: \
148 | | ... | \| ip_address=2001::1 \| prefix=64 \|
149 | | ...
150 | | [Arguments] | ${dut_node} | ${mode} | ${bsid}
151 | | ... | ${interface}=${None} | ${ip_addr}=${None} | ${prefix}=${None}
152 | | ...
153 | | Configure SR Steer | ${dut_node} | ${mode} | ${bsid}
154 | | ... | interface=${interface} | ip_addr=${ip_addr} | prefix=${prefix}
155
156 | Delete SR Steer on DUT
157 | | [Documentation] | Delete SRv6 steering policy on the given DUT node.
158 | | ...
159 | | ... | *Arguments:*
160 | | ... | - dut_node - DUT node where to delete SR steering policy on.
161 | | ... | Type: dictionary
162 | | ... | - mode - Mode of operation - L2 or L3. Type: string
163 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
164 | | ... | - interface - Interface name (Optional, default value: None; required
165 | | ... | in case of L2 mode). Type: string
166 | | ... | - ip_addr - IPv4/IPv6 address (Optional, default value: None; required
167 | | ... | in case of L3 mode). Type: string
168 | | ... | - prefix - IP address prefix (Optional, default value: None; required
169 | | ... | for L3 mode). Type: integer
170 | | ...
171 | | ... | *Example:*
172 | | ...
173 | | ... | \| Delete SR Steer on DUT \| ${nodes['DUT1']} \| L2 \| B:: \
174 | | ... | \| interface=GigabitEthernet0/10/0 \|
175 | | ... | \| Delete SR Steer on DUT \| ${nodes['DUT1']} \| L3 \| C:: \
176 | | ... | \| ip_address=2001::1 \| prefix=64 \|
177 | | ...
178 | | [Arguments] | ${dut_node} | ${mode} | ${bsid}
179 | | ... | ${interface}=${None} | ${ip_addr}=${None} | ${prefix}=${None}
180 | | ...
181 | | Delete SR Steer | ${dut_node} | ${mode} | ${bsid}
182 | | ... | interface=${interface} | ip_addr=${ip_addr} | prefix=${prefix}
183
184 | Show SR Steering Policies on DUT
185 | | [Documentation] | Show SRv6 steering policies on the given DUT node.
186 | | ...
187 | | ... | *Arguments:*
188 | | ... | - dut_node - DUT node where to show SR steering policies on.
189 | | ... | Type: dictionary
190 | | ...
191 | | ... | *Example:*
192 | | ...
193 | | ... | \| Show SR Steering Policies on DUT \| ${nodes['DUT1']} \|
194 | | ...
195 | | [Arguments] | ${dut_node}
196 | | ...
197 | | Show SR Steering Policies | ${dut_node}
198
199 | Set SR Encaps Source Address on DUT
200 | | [Documentation] | Set SRv6 encapsulation source address on the given DUT
201 | | ... | node.
202 | | ...
203 | | ... | *Arguments:*
204 | | ... | - dut_node - DUT node where to set SRv6 encapsulation source address
205 | | ... | on. Type: dictionary
206 | | ... | - ip6_addr - Local SID IPv6 address. Type: string
207 | | ...
208 | | ... | *Example:*
209 | | ...
210 | | ... | \| Set SR Encaps Source Address on DUT \| ${nodes['DUT1']} \| B:: \|
211 | | ...
212 | | [Arguments] | ${dut_node} | ${ip6_addr}
213 | | ...
214 | | Set SR Encaps Source Address | ${dut_node} | ip6_addr=${ip6_addr}
215
216 | Show SR Policies on all DUTs
217 | | [Documentation] | Show SRv6 policies on all DUT nodes in topology.
218 | | ...
219 | | ... | *Arguments:*
220 | | ... | - nodes - Topology. Type: dictionary
221 | | ...
222 | | ... | *Example:*
223 | | ...
224 | | ... | \| Show SR Policies on all DUTs \| ${nodes} \|
225 | | ...
226 | | [Arguments] | ${nodes}
227 | | ...
228 | | ${duts}= | Get Matches | ${nodes} | DUT*
229 | | :FOR | ${dut} | IN | @{duts}
230 | | | Show SR Policies | ${nodes['${dut}']}
231
232 | Show SR Steering Policies on all DUTs
233 | | [Documentation] | Show SRv6 steering policies on all DUT nodes in topology.
234 | | ...
235 | | ... | *Arguments:*
236 | | ... | - nodes - Topology. Type: dictionary
237 | | ...
238 | | ... | *Example:*
239 | | ...
240 | | ... | \| Show SR Steering Policies on all DUTs \| ${nodes} \|
241 | | ...
242 | | [Arguments] | ${nodes}
243 | | ...
244 | | ${duts}= | Get Matches | ${nodes} | DUT*
245 | | :FOR | ${dut} | IN | @{duts}
246 | | | Show SR Steering Policies | ${nodes['${dut}']}
247
248 | Show SR LocalSIDs on all DUTs
249 | | [Documentation] | Show SRv6 LocalSIDs on all DUT nodes in topology.
250 | | ...
251 | | ... | *Arguments:*
252 | | ... | - nodes - Topology. Type: dictionary
253 | | ...
254 | | ... | *Example:*
255 | | ...
256 | | ... | \| Show SR LocalSIDs on all DUTs \| ${nodes} \|
257 | | ...
258 | | [Arguments] | ${nodes}
259 | | ...
260 | | ${duts}= | Get Matches | ${nodes} | DUT*
261 | | :FOR | ${dut} | IN | @{duts}
262 | | | Show SR LocalSIDs | ${nodes['${dut}']}