9be3f974e323ec352721af7685eed85251f84f40
[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 (Optional, default value:
86 | | ... | encap). Type: string
87 | | ... | - sid_list - SID list. Type: list
88 | | ...
89 | | ... | *Example:*
90 | | ...
91 | | ... | \| Configure SR Policy on DUT \| ${nodes['DUT2']} \| D:: \
92 | | ... | \| mode=insert \| E::\| F:: \|
93 | | ...
94 | | [Arguments] | ${dut_node} | ${bsid} | ${mode}=encap | @{sid_list}
95 | | ...
96 | | Configure SR Policy | ${dut_node} | ${bsid} | @{sid_list} | mode=${mode}
97
98 | Delete SR Policy on DUT
99 | | [Documentation] | Delete SRv6 policy on the given DUT node.
100 | | ...
101 | | ... | *Arguments:*
102 | | ... | - dut_node - DUT node where to delete SRv6 policy on. Type: dictionary
103 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
104 | | ...
105 | | ... | *Example:*
106 | | ...
107 | | ... | \| Delete SR Policy on DUT \| ${nodes['DUT1']} \| A:: \|
108 | | ...
109 | | [Arguments] | ${dut_node} | ${bsid}
110 | | ...
111 | | Delete SR Policy | ${dut_node} | ${bsid}
112
113 | Show SR Policies on DUT
114 | | [Documentation] | Show SRv6 policies on the given DUT node.
115 | | ...
116 | | ... | *Arguments:*
117 | | ... | - dut_node - DUT node where to show SR policies on. Type: dictionary
118 | | ...
119 | | ... | *Example:*
120 | | ...
121 | | ... | \| Show SR Policies on DUT \| ${nodes['DUT1']} \|
122 | | ...
123 | | [Arguments] | ${dut_node}
124 | | ...
125 | | Show SR Policies | ${dut_node}
126
127 | Configure SR Steer on DUT
128 | | [Documentation] | Create SRv6 steering policy on the given DUT node.
129 | | ...
130 | | ... | *Arguments:*
131 | | ... | - dut_node - DUT node where to create SR steering policy on.
132 | | ... | Type: dictionary
133 | | ... | - mode - Mode of operation - L2 or L3. Type: string
134 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
135 | | ... | - interface - Interface name (Optional, default value: None; required
136 | | ... | in case of L2 mode). Type: string
137 | | ... | - ip_addr - IPv4/IPv6 address (Optional, default value: None; required
138 | | ... | in case of L3 mode). Type: string
139 | | ... | - prefix - IP address prefix (Optional, default value: None; required
140 | | ... | for L3 mode). Type: integer
141 | | ...
142 | | ... | *Example:*
143 | | ...
144 | | ... | \| Configure SR Steer on DUT \| ${nodes['DUT1']} \| L2 \| B:: \
145 | | ... | \| interface=GigabitEthernet0/10/0 \|
146 | | ... | \| Configure SR Steer on DUT \| ${nodes['DUT1']} \| L3 \| C:: \
147 | | ... | \| ip_address=2001::1 \| prefix=64 \|
148 | | ...
149 | | [Arguments] | ${dut_node} | ${mode} | ${bsid}
150 | | ... | ${interface}=${None} | ${ip_addr}=${None} | ${prefix}=${None}
151 | | ...
152 | | Configure SR Steer | ${dut_node} | ${mode} | ${bsid}
153 | | ... | interface=${interface} | ip_addr=${ip_addr} | prefix=${prefix}
154
155 | Delete SR Steer on DUT
156 | | [Documentation] | Delete SRv6 steering policy on the given DUT node.
157 | | ...
158 | | ... | *Arguments:*
159 | | ... | - dut_node - DUT node where to delete SR steering policy on.
160 | | ... | Type: dictionary
161 | | ... | - mode - Mode of operation - L2 or L3. Type: string
162 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
163 | | ... | - interface - Interface name (Optional, default value: None; required
164 | | ... | in case of L2 mode). Type: string
165 | | ... | - ip_addr - IPv4/IPv6 address (Optional, default value: None; required
166 | | ... | in case of L3 mode). Type: string
167 | | ... | - prefix - IP address prefix (Optional, default value: None; required
168 | | ... | for L3 mode). Type: integer
169 | | ...
170 | | ... | *Example:*
171 | | ...
172 | | ... | \| Delete SR Steer on DUT \| ${nodes['DUT1']} \| L2 \| B:: \
173 | | ... | \| interface=GigabitEthernet0/10/0 \|
174 | | ... | \| Delete SR Steer on DUT \| ${nodes['DUT1']} \| L3 \| C:: \
175 | | ... | \| ip_address=2001::1 \| prefix=64 \|
176 | | ...
177 | | [Arguments] | ${dut_node} | ${mode} | ${bsid}
178 | | ... | ${interface}=${None} | ${ip_addr}=${None} | ${prefix}=${None}
179 | | ...
180 | | Delete SR Steer | ${dut_node} | ${mode} | ${bsid}
181 | | ... | interface=${interface} | ip_addr=${ip_addr} | prefix=${prefix}
182
183 | Show SR Steering Policies on DUT
184 | | [Documentation] | Show SRv6 steering policies on the given DUT node.
185 | | ...
186 | | ... | *Arguments:*
187 | | ... | - dut_node - DUT node where to show SR steering policies on.
188 | | ... | Type: dictionary
189 | | ...
190 | | ... | *Example:*
191 | | ...
192 | | ... | \| Show SR Steering Policies on DUT \| ${nodes['DUT1']} \|
193 | | ...
194 | | [Arguments] | ${dut_node}
195 | | ...
196 | | Show SR Steering Policies | ${dut_node}
197
198 | Set SR Encaps Source Address on DUT
199 | | [Documentation] | Set SRv6 encapsulation source address on the given DUT
200 | | ... | node.
201 | | ...
202 | | ... | *Arguments:*
203 | | ... | - dut_node - DUT node where to set SRv6 encapsulation source address
204 | | ... | on. Type: dictionary
205 | | ... | - ip6_addr - Local SID IPv6 address. Type: string
206 | | ...
207 | | ... | *Example:*
208 | | ...
209 | | ... | \| Set SR Encaps Source Address on DUT \| ${nodes['DUT1']} \| B:: \|
210 | | ...
211 | | [Arguments] | ${dut_node} | ${ip6_addr}
212 | | ...
213 | | Set SR Encaps Source Address | ${dut_node} | ip6_addr=${ip6_addr}