HC Test: Fix expected error when ACL table should be empty
[csit.git] / resources / libraries / robot / honeycomb / bgp.robot
1 # Copyright (c) 2017 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.honeycomb.BGP.BGPKeywords
16 | Library | resources.libraries.python.honeycomb.HcAPIKwInterfaces.InterfaceKeywords
17
18 *** Keywords ***
19 | No BGP peers should be configured
20 | | [Documentation] | Uses Honeycomb API to read BGP configuration and checks
21 | | ... | if there ary BGP peers conffigured.
22 | | ...
23 | | ... | *Arguments:*
24 | | ... | - node - information about a DUT node. Type: dictionary
25 | | ...
26 | | ... | *Example:*
27 | | ...
28 | | ... | \| No BGP peers should be configured \| ${nodes['DUT1']} \|
29 | | ...
30 | | [Arguments] | ${node}
31 | | ...
32 | | ${oper_data}= | Get Full BGP Configuration | ${node}
33 | | Should be Empty | ${oper_data['bgp-openconfig-extensions:bgp']['neighbors']}
34
35 | Honeycomb adds BGP peer
36 | | [Documentation] | Uses Honeycomb API to add a BGP peer.
37 | | ...
38 | | ... | *Arguments:*
39 | | ... | - node - Information about a DUT node. Type: dictionary
40 | | ... | - address - IP address of the peer. Type: string
41 | | ... | - data - Peer configuration data. Type: dictionary
42 | | ...
43 | | ... | *Example:*
44 | | ...
45 | | ... | \| Honeycomb adds BGP peer \| ${nodes['DUT1']} \| 192.168.0.1 \
46 | | ... | \| ${data} \|
47 | | ...
48 | | [Arguments] | ${node} | ${address} | ${data}
49 | | ...
50 | | Add BGP Peer | ${node} | ${address} | ${data}
51
52 | BGP Peer From Honeycomb Should be
53 | | [Documentation] | Uses Honeycomb API to verify BGP peer operational data.
54 | | ...
55 | | ... | *Arguments:*
56 | | ... | - node - Information about a DUT node. Type: dictionary
57 | | ... | - address - IP address of the peer. Type: string
58 | | ... | - data - Peer configuration data. Type: dictionary
59 | | ...
60 | | ... | *Example:*
61 | | ...
62 | | ... | \| BGP Peer From Honeycomb Should be \
63 | | ... | \| ${nodes['DUT1']} \| 192.168.0.1 \| ${data} \|
64 | | ...
65 | | [Arguments] | ${node} | ${address} | ${data}
66 | | ...
67 | | ${oper_data}= | Get BGP Peer | ${node} | ${address}
68 | | Compare Data Structures | ${oper_data} | ${data}
69
70 | Honeycomb removes BGP peer
71 | | [Documentation] | Uses Honeycomb API to add a BGP peer.
72 | | ...
73 | | ... | *Arguments:*
74 | | ... | - node - Information about a DUT node. Type: dictionary
75 | | ... | - address - IP address of the peer. Type: string
76 | | ...
77 | | ... | *Example:*
78 | | ...
79 | | ... | \| Honeycomb adds BGP peer \| ${nodes['DUT1']} \| 192.168.0.1 \|
80 | | ...
81 | | [Arguments] | ${node} | ${address}
82 | | ...
83 | | Remove BGP Peer | ${node} | ${address}
84
85 | Honeycomb configures BGP route
86 | | [Documentation] | Uses Honeycomb API to add a BGP route\
87 | | ... | to the specified peer.
88 | | ...
89 | | ... | *Arguments:*
90 | | ... | - node - Information about a DUT node. Type: dictionary
91 | | ... | - peer_address - IP address of the peer. Type: string
92 | | ... | - data - Peer configuration data. Type: dictionary
93 | | ... | - route_address - IP address of the route. Type: string
94 | | ... | - route_index - Numeric index of the route under the peer.\
95 | | ... | Type: integer
96 | | ... | - ip_version - IP protocol version, ipv4 or ipv6. Type: string
97 | | ...
98 | | ... | *Example:*
99 | | ...
100 | | ... | \| Honeycomb adds BGP peer \| ${nodes['DUT1']} \| 192.168.0.1 \
101 | | ... | \| ${data} \| 192.168.0.2 \| ${0} \| ipv4 \|
102 | | ...
103 | | [Arguments] | ${node} | ${peer_address} | ${data}
104 | | ... | ${route_address} | ${route_index} | ${ip_version}
105 | | ...
106 | | Configure BGP Route | ${node} | ${peer_address} | ${data}
107 | | ... | ${route_address} | ${route_index} | ${ip_version}
108
109 | BGP Route From Honeycomb Should be
110 | | [Documentation] | Uses Honeycomb API to verify BGP route operational data.
111 | | ...
112 | | ... | *Arguments:*
113 | | ... | - node - Information about a DUT node. Type: dictionary
114 | | ... | - peer_address - IP address of the peer. Type: string
115 | | ... | - data - Peer configuration data. Type: dictionary
116 | | ... | - route_address - IP address of the route. Type: string
117 | | ... | - route_index - Numeric index of the route under the peer.\
118 | | ... | Type: integer
119 | | ... | - ip_version - IP protocol version, ipv4 or ipv6. Type: string
120 | | ...
121 | | ... | *Example:*
122 | | ...
123 | | ... | \| BGP Peers From Honeycomb Should Include \
124 | | ... | \| ${nodes['DUT1']} \| ${data} \|
125 | | ...
126 | | [Arguments] | ${node} | ${peer_address} | ${data}
127 | | ... | ${route_address} | ${route_index} | ${ip_version}
128 | | ...
129 | | ${oper_data}= | Get BGP Route | ${node} | ${peer_address}
130 | | ... | ${route_address} | ${route_index} | ${ip_version}
131 | | Compare Data Structures | ${oper_data} | ${data}
132
133 | Honeycomb removes BGP route
134 | | [Documentation] | Uses Honeycomb API to remove a BGP route.
135 | | ...
136 | | ... | *Arguments:*
137 | | ... | - node - Information about a DUT node. Type: dictionary
138 | | ... | - peer_address - IP address of the peer. Type: string
139 | | ... | - route_address - IP address of the route. Type: string
140 | | ... | - route_index - Numeric index of the route under the peer.\
141 | | ... | Type: integer
142 | | ... | - ip_version - IP protocol version, ipv4 or ipv6. Type: string
143 | | ...
144 | | ... | *Example:*
145 | | ...
146 | | ... | \| Honeycomb removes BGP route \| ${nodes['DUT1']} \| 192.168.0.1 \
147 | | ... | \| 192.168.0.2 \| ${0} \| ipv4 \|
148 | | ...
149 | | [Arguments] | ${node} | ${peer_address} | ${route_address}
150 | | ... | ${route_index} | ${ip_version}
151 | | ...
152 | | Remove BGP Route | ${node} | ${peer_address} | ${route_address}
153 | | ... | ${route_index} | ${ip_version}
154
155 | No BGP routes should be configured
156 | | [Documentation] | Uses Honeycomb API to verify that no BGP routes\
157 | | ... | are configured under the specified peer.
158 | | ...
159 | | ... | *Arguments:*
160 | | ... | - node - Information about a DUT node. Type: dictionary
161 | | ... | - peer_address - IP address of the peer. Type: string
162 | | ... | - ip_version - IP protocol version, ipv4 or ipv6. Type: string
163 | | ...
164 | | ... | *Example:*
165 | | ...
166 | | ... | \| No BGP routes should be configured \| ${nodes['DUT1']} \
167 | | ... | \| 192.168.0.1 \| ipv4 \|
168 | | ...
169 | | [Arguments] | ${node} | ${peer_address} | ${ip_version}
170 | | ...
171 | | ${oper_data}= | Get All Peer Routes
172 | | ... | ${node} | ${peer_address} | ${ip_version}
173 | | Should be Empty | ${oper_data['bgp-inet:${ip_version}-routes']}