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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 | Library | resources.libraries.python.SRv6
16 | Documentation | Keywords for SRv6 feature in VPP.
19 | Configure SR LocalSID on DUT
20 | | [Documentation] | Create SRv6 LocalSID and binds it to a particular\
21 | | ... | behavior on the given DUT node.
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 | | ... | - out_if - Interface name of local interface for sending traffic
34 | | ... | towards the Service Function (Optional, default value: None;
35 | | ... | required for SRv6 endpoint to SR-unaware appliance). Type: string
36 | | ... | - in_if - Interface name of local interface receiving the traffic
37 | | ... | coming back from the Service Function (Optional, default value:
38 | | ... | None; required for SRv6 endpoint to SR-unaware appliance).
39 | | ... | Type: string
40 | | ... | - src_addr - Source address on the packets coming back on in_if
41 | | ... | interface (Optional, default value: None; required for SRv6 endpoint
42 | | ... | to SR-unaware appliance via static proxy). Type: string
43 | | ... | - sid_list - SID list (Optional, default value: []; required for SRv6
44 | | ... | endpoint to SR-unaware appliance via static proxy). Type: list
48 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| B:: \| end \|
49 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| C:: \
50 | | ... | \| end.dx2 \| interface=GigabitEthernet0/10/0 \|
51 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| D:: \
52 | | ... | \| end.dx4 \| interface=GigabitEthernet0/8/0 \| next_hop=10.0.0.1 \|
53 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT2']} \| E:: \
54 | | ... | \| end.dt6 \| fib_table=2 \|
55 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT2']} \| E:: \
56 | | ... | \| end.ad \| next_hop=10.0.0.1 \| out_if=DUT2_VHOST1 \
57 | | ... | \| in_if=DUT2_VHOST2 \|
58 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT2']} \| E:: \
59 | | ... | \| end.as \| next_hop=10.0.0.1 \| out_if=DUT2_VHOST1 \
60 | | ... | \| in_if=DUT2_VHOST2 \| src_addr=B:: \| sid_list=['C::', 'D::'] \|
62 | | [Arguments] | ${dut_node} | ${local_sid} | ${behavior}
63 | | ... | ${interface}=${None} | ${next_hop}=${None} | ${fib_table}=${None}
64 | | ... | ${out_if}=${None} | ${in_if}=${None} | ${src_addr}=${None}
67 | | Configure SR LocalSID | ${dut_node} | ${local_sid} | ${behavior}
68 | | ... | interface=${interface} | next_hop=${next_hop} | fib_table=${fib_table}
69 | | ... | out_if=${out_if} | in_if=${in_if} | src_addr=${src_addr}
70 | | ... | sid_list=${sid_list}
72 | Delete SR LocalSID on DUT
73 | | [Documentation] | Delete SRv6 LocalSID on the given DUT node.
75 | | ... | *Arguments:*
76 | | ... | - dut_node - DUT node where to delete localSID on. Type: dictionary
77 | | ... | - local_sid - LocalSID IPv6 address. Type: string
81 | | ... | \| Delete SR LocalSID on DUT \| ${nodes['DUT1']} \| B:: \|
83 | | [Arguments] | ${dut_node} | ${local_sid}
85 | | Delete SR LocalSID | ${dut_node} | ${local_sid}
87 | Show SR LocalSIDs on DUT
88 | | [Documentation] | Show SRv6 LocalSIDs on the given DUT node.
90 | | ... | *Arguments:*
91 | | ... | - dut_node - DUT node where to show SR localSIDs on. Type: dictionary
95 | | ... | \| Show SR LocalSIDs on DUT \| ${nodes['DUT1']} \|
97 | | [Arguments] | ${dut_node}
99 | | Show SR LocalSIDs | ${dut_node}
101 | Configure SR Policy on DUT
102 | | [Documentation] | Create SRv6 policy on the given DUT node.
104 | | ... | *Arguments:*
105 | | ... | - dut_node - DUT node where to create SRv6 policy on. Type: dictionary
106 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
107 | | ... | - mode - Encapsulation / insertion mode. Type: string
108 | | ... | - sid_list - SID list. Type: list
112 | | ... | \| Configure SR Policy on DUT \| ${nodes['DUT2']} \| A:: \| encap \
113 | | ... | \| B::\| C:: \|
114 | | ... | \| Configure SR Policy on DUT \| ${nodes['DUT2']} \| D:: \| insert \
115 | | ... | \| E::\| F:: \|
117 | | [Arguments] | ${dut_node} | ${bsid} | ${mode} | @{sid_list}
119 | | Configure SR Policy | ${dut_node} | ${bsid} | ${sid_list} | mode=${mode}
121 | Delete SR Policy on DUT
122 | | [Documentation] | Delete SRv6 policy on the given DUT node.
124 | | ... | *Arguments:*
125 | | ... | - dut_node - DUT node where to delete SRv6 policy on. Type: dictionary
126 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
130 | | ... | \| Delete SR Policy on DUT \| ${nodes['DUT1']} \| A:: \|
132 | | [Arguments] | ${dut_node} | ${bsid}
134 | | Delete SR Policy | ${dut_node} | ${bsid}
136 | Show SR Policies on DUT
137 | | [Documentation] | Show SRv6 policies on the given DUT node.
139 | | ... | *Arguments:*
140 | | ... | - dut_node - DUT node where to show SR policies on. Type: dictionary
144 | | ... | \| Show SR Policies on DUT \| ${nodes['DUT1']} \|
146 | | [Arguments] | ${dut_node}
148 | | Show SR Policies | ${dut_node}
150 | Configure SR Steer on DUT
151 | | [Documentation] | Create SRv6 steering policy on the given DUT node.
153 | | ... | *Arguments:*
154 | | ... | - dut_node - DUT node where to create SR steering policy on.
155 | | ... | Type: dictionary
156 | | ... | - mode - Mode of operation - L2 or L3. Type: string
157 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
158 | | ... | - interface - Interface name (Optional, default value: None; required
159 | | ... | in case of L2 mode). Type: string
160 | | ... | - ip_addr - IPv4/IPv6 address (Optional, default value: None; required
161 | | ... | in case of L3 mode). Type: string
162 | | ... | - prefix - IP address prefix (Optional, default value: None; required
163 | | ... | for L3 mode). Type: integer
167 | | ... | \| Configure SR Steer on DUT \| ${nodes['DUT1']} \| L2 \| B:: \
168 | | ... | \| interface=GigabitEthernet0/10/0 \|
169 | | ... | \| Configure SR Steer on DUT \| ${nodes['DUT1']} \| L3 \| C:: \
170 | | ... | \| ip_address=2001::1 \| prefix=64 \|
172 | | [Arguments] | ${dut_node} | ${mode} | ${bsid}
173 | | ... | ${interface}=${None} | ${ip_addr}=${None} | ${prefix}=${None}
175 | | Configure SR Steer | ${dut_node} | ${mode} | ${bsid}
176 | | ... | interface=${interface} | ip_addr=${ip_addr} | prefix=${prefix}
178 | Delete SR Steer on DUT
179 | | [Documentation] | Delete SRv6 steering policy on the given DUT node.
181 | | ... | *Arguments:*
182 | | ... | - dut_node - DUT node where to delete SR steering policy on.
183 | | ... | Type: dictionary
184 | | ... | - mode - Mode of operation - L2 or L3. Type: string
185 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
186 | | ... | - interface - Interface name (Optional, default value: None; required
187 | | ... | in case of L2 mode). Type: string
188 | | ... | - ip_addr - IPv4/IPv6 address (Optional, default value: None; required
189 | | ... | in case of L3 mode). Type: string
190 | | ... | - prefix - IP address prefix (Optional, default value: None; required
191 | | ... | for L3 mode). Type: integer
195 | | ... | \| Delete SR Steer on DUT \| ${nodes['DUT1']} \| L2 \| B:: \
196 | | ... | \| interface=GigabitEthernet0/10/0 \|
197 | | ... | \| Delete SR Steer on DUT \| ${nodes['DUT1']} \| L3 \| C:: \
198 | | ... | \| ip_address=2001::1 \| prefix=64 \|
200 | | [Arguments] | ${dut_node} | ${mode} | ${bsid}
201 | | ... | ${interface}=${None} | ${ip_addr}=${None} | ${prefix}=${None}
203 | | Delete SR Steer | ${dut_node} | ${mode} | ${bsid}
204 | | ... | interface=${interface} | ip_addr=${ip_addr} | prefix=${prefix}
206 | Show SR Steering Policies on DUT
207 | | [Documentation] | Show SRv6 steering policies on the given DUT node.
209 | | ... | *Arguments:*
210 | | ... | - dut_node - DUT node where to show SR steering policies on.
211 | | ... | Type: dictionary
215 | | ... | \| Show SR Steering Policies on DUT \| ${nodes['DUT1']} \|
217 | | [Arguments] | ${dut_node}
219 | | Show SR Steering Policies | ${dut_node}
221 | Set SR Encaps Source Address on DUT
222 | | [Documentation] | Set SRv6 encapsulation source address on the given DUT
225 | | ... | *Arguments:*
226 | | ... | - dut_node - DUT node where to set SRv6 encapsulation source address
227 | | ... | on. Type: dictionary
228 | | ... | - ip6_addr - Local SID IPv6 address. Type: string
232 | | ... | \| Set SR Encaps Source Address on DUT \| ${nodes['DUT1']} \| B:: \|
234 | | [Arguments] | ${dut_node} | ${ip6_addr}
236 | | Set SR Encaps Source Address | ${dut_node} | ip6_addr=${ip6_addr}
238 | Show SR Policies on all DUTs
239 | | [Documentation] | Show SRv6 policies on all DUT nodes in topology.
241 | | ... | *Arguments:*
242 | | ... | - nodes - Topology. Type: dictionary
246 | | ... | \| Show SR Policies on all DUTs \| ${nodes} \|
248 | | [Arguments] | ${nodes}
250 | | ${duts}= | Get Matches | ${nodes} | DUT*
251 | | :FOR | ${dut} | IN | @{duts}
252 | | | Show SR Policies | ${nodes['${dut}']}
254 | Show SR Steering Policies on all DUTs
255 | | [Documentation] | Show SRv6 steering policies on all DUT nodes in topology.
257 | | ... | *Arguments:*
258 | | ... | - nodes - Topology. Type: dictionary
262 | | ... | \| Show SR Steering Policies on all DUTs \| ${nodes} \|
264 | | [Arguments] | ${nodes}
266 | | ${duts}= | Get Matches | ${nodes} | DUT*
267 | | :FOR | ${dut} | IN | @{duts}
268 | | | Show SR Steering Policies | ${nodes['${dut}']}
270 | Show SR LocalSIDs on all DUTs
271 | | [Documentation] | Show SRv6 LocalSIDs on all DUT nodes in topology.
273 | | ... | *Arguments:*
274 | | ... | - nodes - Topology. Type: dictionary
278 | | ... | \| Show SR LocalSIDs on all DUTs \| ${nodes} \|
280 | | [Arguments] | ${nodes}
282 | | ${duts}= | Get Matches | ${nodes} | DUT*
283 | | :FOR | ${dut} | IN | @{duts}
284 | | | Show SR LocalSIDs | ${nodes['${dut}']}