2 Documentation Basic tests for iBGP peers.
4 ... Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
6 ... This program and the accompanying materials are made available under the
7 ... terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ... and is available at http://www.eclipse.org/legal/epl-v10.html
10 ... Test suite performs basic iBGP functional test cases for
11 ... BGP peers in different roles (iBGP, iBGP RR-client):
13 ... Test Case 1: Two iBGP RR-client peers introduce prefixes
14 ... Expected result: controller forwards updates towards both peers
16 ... Test Case 2: Two iBGP peers: one RR client and one non-client introduces prefixes
17 ... Expected result: controller forwards updates towards both peers
19 ... Test Case 3: Two iBGP RR non-client peers introduce prefixes
20 ... Expected result: controller does not forward any update towards peers
22 ... For polices see: https://wiki.opendaylight.org/view/BGP_LS_PCEP:BGP
25 ... Bug 4791 - BGPSessionImpl: Failed to send message Update logged even all UPDATE mesages received by iBGP peer
26 ... Bug 4819 - No routes advertised to one of newly configured iBGP RR-client peer
27 Suite Setup Setup_Everything
28 Suite Teardown Teardown_Everything
29 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
30 Test Teardown FailFast.Start_Failing_Fast_If_This_Failed
31 Library OperatingSystem
32 Library RequestsLibrary
34 Variables ${CURDIR}/../../../variables/Variables.py
35 Variables ${CURDIR}/../../../variables/bgpuser/variables.py ${TOOLS_SYSTEM_IP} ${ODL_STREAM}
36 Resource ${CURDIR}/../../../libraries/BGPcliKeywords.robot
37 Resource ${CURDIR}/../../../libraries/BGPSpeaker.robot
38 Resource ${CURDIR}/../../../libraries/ConfigViaRestconf.robot
39 Resource ${CURDIR}/../../../libraries/FailFast.robot
40 Resource ${CURDIR}/../../../libraries/KillPythonTool.robot
41 Resource ${CURDIR}/../../../libraries/SetupUtils.robot
42 Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
43 Resource ${CURDIR}/../../../libraries/Utils.robot
44 Resource ${CURDIR}/../../../libraries/WaitForFailure.robot
47 ${BGP_VARIABLES_FOLDER} ${CURDIR}/../../../variables/bgpuser/
49 ${BGP_PEER_LOG_LEVEL} debug
50 ${CONTROLLER_LOG_LEVEL} INFO
51 ${CONTROLLER_BGP_LOG_LEVEL} DEFAULT
52 ${BGP_PEER1_IP} 127.0.0.1
53 ${BGP_PEER2_IP} 127.0.0.2
54 ${BGP_PEER1_FIRST_PREFIX_IP} 8.1.0.0
55 ${BGP_PEER2_FIRST_PREFIX_IP} 8.2.0.0
57 ${BGP_PEER1_PREFIX_LEN} ${PREFIX_LEN}
58 ${BGP_PEER2_PREFIX_LEN} ${PREFIX_LEN}
60 ${BGP_PEER1_PREFIX_COUNT} ${PREFIX_COUNT}
61 ${BGP_PEER2_PREFIX_COUNT} ${PREFIX_COUNT}
62 ${BGP_PEER1_LOG_FILE} bgp_peer1.log
63 ${BGP_PEER2_LOG_FILE} bgp_peer2.log
64 ${BGP_PEER1_COMMAND} python play.py --firstprefix ${BGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER1_PREFIX_LEN} --amount ${BGP_PEER1_PREFIX_COUNT} --myip=${BGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER1_LOG_FILE}
65 ${BGP_PEER2_COMMAND} python play.py --firstprefix ${BGP_PEER2_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER2_PREFIX_LEN} --amount ${BGP_PEER2_PREFIX_COUNT} --myip=${BGP_PEER2_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER2_LOG_FILE}
66 ${BGP_PEER1_OPTIONS} &>${BGP_PEER1_LOG_FILE}
67 ${BGP_PEER2_OPTIONS} &>${BGP_PEER2_LOG_FILE}
68 ${DEFAULT_LOG_CHECK_TIMEOUT} 20s
69 ${DEFAULT_LOG_CHECK_PERIOD} 1s
70 ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} 10s
71 ${DEFAULT_TOPOLOGY_CHECK_PERIOD} 1s
74 TC1_Configure_Two_iBGP_Route_Reflector_Client_Peers
75 [Documentation] Configure two iBGP peers as routing reflector clients.
77 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1', 'IP': '${BGP_PEER1_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}','PEER_ROLE': 'rr-client', 'INITIATE': 'false'}
78 ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
79 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer2', 'IP': '${BGP_PEER2_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}','PEER_ROLE': 'rr-client', 'INITIATE': 'false'}
80 ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
81 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1'}
82 ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
84 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer2'}
85 ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
89 [Documentation] Connect BGP peer
91 SSHLibrary.Switch Connection bgp_peer1_console
92 Start_Console_Tool ${BGP_PEER1_COMMAND} ${BGP_PEER1_OPTIONS}
93 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
96 [Documentation] Connect BGP peer
98 SSHLibrary.Switch Connection bgp_peer2_console
99 Start_Console_Tool ${BGP_PEER2_COMMAND} ${BGP_PEER2_OPTIONS}
100 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
102 TC1_BGP_Peer1_Check_Log_For_Introduced_Prefixes
103 [Documentation] Check incomming updates for new routes
105 SSHLibrary.Switch Connection bgp_peer1_console
106 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_LOG_CHECK_TIMEOUT} ${DEFAULT_LOG_CHECK_PERIOD} Check_File_For_Word_Count ${BGP_PEER1_LOG_FILE} nlri_prefix_received: ${BGP_PEER2_PREFIX_COUNT}
107 Check_File_For_Word_Count ${BGP_PEER1_LOG_FILE} nlri_prefix_received: ${BGP_PEER2_FIRST_PREFIX_IP}/${BGP_PEER2_PREFIX_LEN} 1
108 Check_File_For_Word_Count ${BGP_PEER1_LOG_FILE} withdrawn_prefix_received: 0
109 [Teardown] Report_Failure_Due_To_Bug 4819
111 TC1_BGP_Peer2_Check_Log_For_Introduced_Prefixes
112 [Documentation] Check incomming updates for new routes
114 SSHLibrary.Switch Connection bgp_peer2_console
115 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_LOG_CHECK_TIMEOUT} ${DEFAULT_LOG_CHECK_PERIOD} Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} nlri_prefix_received: ${BGP_PEER1_PREFIX_COUNT}
116 Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} nlri_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN} 1
117 Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} withdrawn_prefix_received: 0
118 [Teardown] Report_Failure_Due_To_Bug 4819
120 TC1_Disconnect_BGP_Peer1
121 [Documentation] Stop BGP peer & store logs
123 SSHLibrary.Switch Connection bgp_peer1_console
125 Store_File_To_Workspace ${BGP_PEER1_LOG_FILE} tc1_${BGP_PEER1_LOG_FILE}
127 TC1_BGP_Peer2_Check_Log_For_Withdrawn_Prefixes
128 [Documentation] Check incomming updates for withdrawn routes
130 SSHLibrary.Switch Connection bgp_peer2_console
131 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_LOG_CHECK_TIMEOUT} ${DEFAULT_LOG_CHECK_PERIOD} Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} withdrawn_prefix_received: ${BGP_PEER1_PREFIX_COUNT}
132 Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} withdrawn_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN} 1
133 [Teardown] Report_Failure_Due_To_Bug 4819
135 TC1_Disconnect_BGP_Peer2
136 [Documentation] Stop BGP peer & store logs
138 SSHLibrary.Switch Connection bgp_peer2_console
140 Store_File_To_Workspace ${BGP_PEER2_LOG_FILE} tc1_${BGP_PEER2_LOG_FILE}
142 TC_1_Check_for_Empty_IPv4_Topology
143 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} Check_Example_IPv4_Topology_Does_Not_Contain prefix
145 TC1_Delete_BGP_Peers_Configuration
146 [Documentation] Delete all previously configured BGP peers.
148 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1'}
149 ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
150 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer2'}
151 ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
153 TC2_Configure_One_iBGP_Route_Reflector_Client_And_One_iBGP_Non_Client
154 [Documentation] Configure iBGP peers: 1st one as RR client, 2nd one as RR non-client.
156 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1', 'IP': '${BGP_PEER1_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}','PEER_ROLE': 'rr-client', 'INITIATE': 'false'}
157 ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
158 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer2', 'IP': '${BGP_PEER2_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}','PEER_ROLE': 'ibgp', 'INITIATE': 'false'}
159 ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
160 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1'}
161 ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
162 BuiltIn.Log ${result}
163 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer2'}
164 ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
165 BuiltIn.Log ${result}
167 TC2_Connect_BGP_Peer1
168 [Documentation] Connect BGP peer
170 SSHLibrary.Switch Connection bgp_peer1_console
171 Start_Console_Tool ${BGP_PEER1_COMMAND} ${BGP_PEER1_OPTIONS}
172 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
174 TC2_Connect_BGP_Peer2
175 [Documentation] Connect BGP peer
177 SSHLibrary.Switch Connection bgp_peer2_console
178 Start_Console_Tool ${BGP_PEER2_COMMAND} ${BGP_PEER2_OPTIONS}
179 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
181 TC2_BGP_Peer1_Check_Log_For_Introduced_Prefixes
182 [Documentation] Check incomming updates for new routes
184 SSHLibrary.Switch Connection bgp_peer1_console
185 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_LOG_CHECK_TIMEOUT} ${DEFAULT_LOG_CHECK_PERIOD} Check_File_For_Word_Count ${BGP_PEER1_LOG_FILE} nlri_prefix_received: ${BGP_PEER2_PREFIX_COUNT}
186 Check_File_For_Word_Count ${BGP_PEER1_LOG_FILE} nlri_prefix_received: ${BGP_PEER2_FIRST_PREFIX_IP}/${BGP_PEER2_PREFIX_LEN} 1
187 Check_File_For_Word_Count ${BGP_PEER1_LOG_FILE} withdrawn_prefix_received: 0
189 TC2_BGP_Peer2_Check_Log_For_Introduced_Prefixes
190 [Documentation] Check incomming updates for new routes
192 SSHLibrary.Switch Connection bgp_peer2_console
193 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_LOG_CHECK_TIMEOUT} ${DEFAULT_LOG_CHECK_PERIOD} Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} nlri_prefix_received: ${BGP_PEER1_PREFIX_COUNT}
194 Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} nlri_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN} 1
195 Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} withdrawn_prefix_received: 0
196 [Teardown] Report_Failure_Due_To_Bug 4791
198 TC2_Disconnect_BGP_Peer1
199 [Documentation] Stop BGP peer & store logs
201 SSHLibrary.Switch Connection bgp_peer1_console
203 Store_File_To_Workspace ${BGP_PEER1_LOG_FILE} tc2_${BGP_PEER1_LOG_FILE}
205 TC2_BGP_Peer2_Check_Log_For_Withdrawn_Prefixes
206 [Documentation] Check incomming updates for withdrawn routes
208 SSHLibrary.Switch Connection bgp_peer2_console
209 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_LOG_CHECK_TIMEOUT} ${DEFAULT_LOG_CHECK_PERIOD} Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} withdrawn_prefix_received: ${BGP_PEER1_PREFIX_COUNT}
210 Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} withdrawn_prefix_received: ${BGP_PEER1_FIRST_PREFIX_IP}/${BGP_PEER1_PREFIX_LEN} 1
212 TC2_Disconnect_BGP_Peer2
213 [Documentation] Stop BGP peer & store logs
215 SSHLibrary.Switch Connection bgp_peer2_console
217 Store_File_To_Workspace ${BGP_PEER2_LOG_FILE} tc2_${BGP_PEER2_LOG_FILE}
219 TC_2_Check_for_Empty_IPv4_Topology
220 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} Check_Example_IPv4_Topology_Does_Not_Contain prefix
222 TC2_Delete_BGP_Peers_Configuration
223 [Documentation] Delete all previously configured BGP peers.
225 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1'}
226 ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
227 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer2'}
228 ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
230 TC3_Configure_Two_iBGP_Non_Client_Peers
231 [Documentation] Configure iBGP peers: 1st one as RR client, 2nd one as RR non-client.
233 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1', 'IP': '${BGP_PEER1_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}','PEER_ROLE': 'ibgp', 'INITIATE': 'false'}
234 ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
235 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer2', 'IP': '${BGP_PEER2_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}','PEER_ROLE': 'ibgp', 'INITIATE': 'false'}
236 ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
237 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1'}
238 ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
239 BuiltIn.Log ${result}
240 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer2'}
241 ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
242 BuiltIn.Log ${result}
244 TC3_Connect_BGP_Peer1
245 [Documentation] Connect BGP peer
247 SSHLibrary.Switch Connection bgp_peer1_console
248 Start_Console_Tool ${BGP_PEER1_COMMAND} ${BGP_PEER1_OPTIONS}
249 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
251 TC3_Connect_BGP_Peer2
252 [Documentation] Connect BGP peer
254 SSHLibrary.Switch Connection bgp_peer2_console
255 Start_Console_Tool ${BGP_PEER2_COMMAND} ${BGP_PEER2_OPTIONS}
256 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
258 TC3_BGP_Peer1_Check_Log_For_No_Updates
259 [Documentation] Check for no updates received by iBGP peer No. 1
261 SSHLibrary.Switch Connection bgp_peer1_console
262 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_LOG_CHECK_TIMEOUT} ${DEFAULT_LOG_CHECK_PERIOD} Check_File_For_Word_Count ${BGP_PEER1_LOG_FILE} total_received_update_message_counter: 0 2
264 TC3_Disconnect_BGP_Peer1
265 [Documentation] Stop BGP peer & store logs
267 SSHLibrary.Switch Connection bgp_peer1_console
269 Store_File_To_Workspace ${BGP_PEER1_LOG_FILE} tc3_${BGP_PEER1_LOG_FILE}
271 TC3_BGP_Peer2_Check_Log_For_No_Updates
272 [Documentation] Consequent check for no updates received by iBGP peer No. 2
274 SSHLibrary.Switch Connection bgp_peer2_console
275 ${log_check_timeout}= DateTime.Convert_Time ${DEFAULT_LOG_CHECK_TIMEOUT} result_format=number
276 BuiltIn.Wait_Until_Keyword_Succeeds ${log_check_timeout*2} ${DEFAULT_LOG_CHECK_PERIOD} Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} total_received_update_message_counter: 0 4
278 TC3_Disconnect_BGP_Peer2
279 [Documentation] Stop BGP peer & store logs
281 SSHLibrary.Switch Connection bgp_peer2_console
283 Store_File_To_Workspace ${BGP_PEER2_LOG_FILE} tc3_${BGP_PEER2_LOG_FILE}
285 TC_3_Check_for_Empty_IPv4_Topology
286 BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} Check_Example_IPv4_Topology_Does_Not_Contain prefix
288 TC3_Delete_BGP_Peers_Configuration
289 [Documentation] Delete all previously configured BGP peers.
291 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1'}
292 ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
293 ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer2'}
294 ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
298 [Documentation] Initialize SetupUtils. SSH-login to mininet machine, create HTTP session,
299 ... prepare directories for responses, put Python tool to mininet machine, setup imported resources.
300 # TODO: Choose keywords used by more than one test suite to be placed in a common place.
301 SetupUtils.Setup_Utils_For_Setup_And_Teardown
302 SSHLibrary.Set_Default_Configuration prompt=${ODL_SYSTEM_PROMPT}
303 SSHLibrary.Open_Connection ${ODL_SYSTEM_IP} alias=bgp_peer1_console
304 Utils.Flexible_Controller_Login
305 SSHLibrary.Open_Connection ${ODL_SYSTEM_IP} alias=bgp_peer2_console
306 Utils.Flexible_Controller_Login
307 SSHKeywords.Require_Python
308 SSHKeywords.Assure_Library_Ipaddr target_dir=.
309 SSHLibrary.Put_File ${CURDIR}/../../../../tools/fastbgp/play.py
310 RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_TOPO_API} auth=${AUTH}
311 ConfigViaRestconf.Setup_Config_Via_Restconf
312 KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set ${CONTROLLER_LOG_LEVEL}
313 KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set ${CONTROLLER_BGP_LOG_LEVEL} org.opendaylight.bgpcep
314 KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set ${CONTROLLER_BGP_LOG_LEVEL} org.opendaylight.protocol
317 [Documentation] Create and Log the diff between expected and actual responses, make sure Python tool was killed.
318 ... Tear down imported Resources.
319 KillPythonTool.Search_And_Kill_Remote_Python 'play\.py'
320 ConfigViaRestconf.Teardown_Config_Via_Restconf
321 RequestsLibrary.Delete_All_Sessions
322 SSHLibrary.Close_All_Connections
324 Check_Example_IPv4_Topology_Content
325 [Arguments] ${string_to_check}=${EMPTY}
326 [Documentation] Check the example-ipv4-topology content for string
327 ${response}= RequestsLibrary.Get Request operational topology/example-ipv4-topology
328 BuiltIn.Log ${response.status_code}
329 BuiltIn.Log ${response.text}
330 BuiltIn.Should_Contain ${response.text} ${string_to_check}
332 Check_Example_IPv4_Topology_Does_Not_Contain
333 [Arguments] ${string_to_check}
334 [Documentation] Check the example-ipv4-topology does not contain the string
335 ${response}= RequestsLibrary.Get Request operational topology/example-ipv4-topology
336 BuiltIn.Log ${response.status_code}
337 BuiltIn.Log ${response.text}
338 BuiltIn.Should_Not_Contain ${response.text} ${string_to_check}