Update Robot Framework format - step 3
[integration/test.git] / csit / suites / bgpcep / bgpuser / bgp_app_peer_basic.robot
1 *** Settings ***
2 Documentation       Basic tests for BGP application peer.
3 ...
4 ...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
5 ...
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
9 ...
10 ...                 Test suite performs basic BGP functional test cases for
11 ...                 BGP application peer operations and checks for IP4 topology updates
12 ...                 and updates towards BGP peer as follows:
13 ...
14 ...                 Test case 1: Initial BGP peer connection with pre-filled topology,
15 ...                 POST and simple DELETE requests used.
16 ...                 BGP_Application_Peer_Post_3_Initial_Routes,
17 ...                 Check_Example-IPv4-Topology_Is_Filled_With_3_Routes,
18 ...                 Connect_BGP_Peer,
19 ...                 BGP_Peer_Check_Incomming_Updates_For_3_Introduced_Prefixes,
20 ...                 BGP_Application_Peer_Delete_3_Initial_Routes,
21 ...                 Check_Example-IPv4-Topology_Is_Empty,
22 ...                 Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes,
23 ...                 Stop_BGP_Peer.
24 ...
25 ...                 Test case 2: PUT and DELETE all routes requests while BGP peer is connected.
26 ...                 Reconnect_BGP_Peer,
27 ...                 BGP_Application_Peer_Put_3_Routes,
28 ...                 Check_Example-IPv4-Topology_Is_Filled_With_3_Routes,
29 ...                 BGP_Peer_Check_Incomming_Updates_For_3_Introduced_Prefixes,
30 ...                 BGP_Application_Peer_Delete_All_Routes,
31 ...                 Check_Example-IPv4-Topology_Is_Empty,
32 ...                 BGP_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes,
33 ...                 Stop_BGP_Peer.
34 ...
35 ...                 Test case 3: Repeated BGP peer re-connection with pre-filled topology.
36 ...                 BGP_Application_Peer_Put_3_Routes,
37 ...                 Check_Example-IPv4-Topology_Is_Filled_With_3_Routes,
38 ...                 Reconnect_BGP_Peer_And_Check_Incomming_Updates_For_3_Introduced_Prefixes,
39 ...                 BGP_Application_Peer_Delete_All_Routes,
40 ...                 Check_Example-IPv4-Topology_Is_Empty,
41 ...                 BGP_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes,
42 ...                 Stop_BGP_Peer.
43 ...
44 ...                 Brief description how to configure BGP application peer and
45 ...                 how to use restconf application peer interface:
46 ...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Application_Peer
47 ...                 https://wiki.opendaylight.org/view/BGP_LS_PCEP:Programmer_Guide#BGP
48
49 Library             OperatingSystem
50 Library             SSHLibrary    timeout=10s
51 Library             RequestsLibrary
52 Resource            ../../../libraries/BGPcliKeywords.robot
53 Resource            ../../../libraries/FailFast.robot
54 Resource            ../../../libraries/KillPythonTool.robot
55 Resource            ../../../libraries/TemplatedRequests.robot
56 Resource            ../../../libraries/SetupUtils.robot
57 Resource            ../../../libraries/SSHKeywords.robot
58 Resource            ../../../libraries/WaitForFailure.robot
59 Resource            ../../../variables/Variables.robot
60
61 Suite Setup         Setup_Everything
62 Suite Teardown      Teardown_Everything
63 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
64 Test Teardown       FailFast.Start_Failing_Fast_If_This_Failed
65
66
67 *** Variables ***
68 ${BGP_VARIABLES_FOLDER}                 ${CURDIR}/../../../variables/bgpuser/
69 ${TOOLS_SYSTEM_PROMPT}                  ${DEFAULT_LINUX_PROMPT}
70 ${HOLDTIME}                             180
71 ${BGP_PEER_LOG_LEVEL}                   debug
72 ${BGP_APP_PEER_LOG_LEVEL}               debug
73 ${BGP_PEER_COMMAND}
74 ...                                     python3 play.py --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL}
75 ${BGP_PEER_OPTIONS}                     ${EMPTY}
76 ${BGP_APP_PEER_ID}                      ${ODL_SYSTEM_IP}
77 ${BGP_APP_PEER_POST_COMMAND}
78 ...                                     python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command post --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
79 ${BGP_APP_PEER_PUT_COMMAND}
80 ...                                     python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command put --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
81 ${BGP_APP_PEER_DELETE_COMMAND}
82 ...                                     python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
83 ${BGP_APP_PEER_DELETE_ALL_COMMAND}
84 ...                                     python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete-all --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
85 ${BGP_APP_PEER_GET_COMMAND}
86 ...                                     python3 bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command get --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
87 ${BGP_APP_PEER_OPTIONS}                 &>/dev/null
88 ${BGP_APP_PEER_TIMEOUT}                 30s
89 ${BGP_PEER_APP_NAME}                    example-bgp-peer-app
90 ${CONFIG_SESSION}                       session
91 ${RIB_INSTANCE}                         example-bgp-rib
92 ${PROTOCOL_OPENCONFIG}                  ${RIB_INSTANCE}
93 ${DEVICE_NAME}                          controller-config
94 ${BGP_PEER_NAME}                        example-bgp-peer
95 ${RIB_INSTANCE}                         example-bgp-rib
96 ${SCRIPT_URI_OPT}
97 ...                                     --uri data/bgp-rib:application-rib=${ODL_SYSTEM_IP}/tables=bgp-types%3Aipv4-address-family,bgp-types%3Aunicast-subsequent-address-family
98
99
100 *** Test Cases ***
101 Reconfigure_ODL_To_Accept_BGP_Peer_Connection
102     [Documentation]    Configure BGP peer module with initiate-connection set to false.
103     [Tags]    critical
104     &{mapping}    Create Dictionary
105     ...    DEVICE_NAME=${DEVICE_NAME}
106     ...    BGP_NAME=${BGP_PEER_NAME}
107     ...    IP=${TOOLS_SYSTEM_IP}
108     ...    HOLDTIME=${HOLDTIME}
109     ...    PEER_PORT=${BGP_TOOL_PORT}
110     ...    INITIATE=false
111     ...    BGP_RIB=${RIB_INSTANCE}
112     ...    PASSIVE_MODE=true
113     ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
114     ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
115     TemplatedRequests.Put_As_Xml_Templated
116     ...    ${BGP_VARIABLES_FOLDER}${/}bgp_peer
117     ...    mapping=${mapping}
118     ...    session=${CONFIG_SESSION}
119
120 Reconfigure_ODL_To_Accept_BGP_Application_Peer
121     [Documentation]    Configure BGP application peer module.
122     [Tags]    critical
123     &{mapping}    Create Dictionary
124     ...    DEVICE_NAME=${DEVICE_NAME}
125     ...    NAME=${BGP_PEER_APP_NAME}
126     ...    RIB_INSTANCE_NAME=${RIB_INSTANCE}
127     ...    IP=${BGP_APP_PEER_ID}
128     ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
129     TemplatedRequests.Put_As_Xml_Templated
130     ...    ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer
131     ...    mapping=${mapping}
132     ...    session=${CONFIG_SESSION}
133
134 Check_For_Empty_Example-IPv4-Topology
135     [Documentation]    Sanity check example-ipv4-topology is up but empty.
136     [Tags]    critical
137     Wait_For_Topology_To_Change_To    empty_topology    timeout=180s
138
139 TC1_BGP_Application_Peer_Post_3_Initial_Routes
140     [Documentation]    Start BGP application peer tool and give it ${BGP_APP_PEER_TIMEOUT}
141     [Tags]    critical
142     Switch_To_BGP_Application_Peer_Console
143     Start_Console_Tool    ${BGP_APP_PEER_POST_COMMAND} ${SCRIPT_URI_OPT}    ${BGP_APP_PEER_OPTIONS}
144     Wait_Until_Console_Tool_Finish    ${BGP_APP_PEER_TIMEOUT}
145     Store_File_To_Workspace    bgp_app_peer.log    bgp_app_peer_initial_post_tc1.log
146
147 TC1_Check_Example-IPv4-Topology_Is_Filled_With_3_Routes
148     [Documentation]    See new routes in example-ipv4-topology as a proof that synchronization was correct.
149     [Tags]    critical
150     Wait_For_Topology_To_Change_To    filled_topology
151
152 TC1_Connect_BGP_Peer
153     [Documentation]    Start BGP peer tool
154     [Tags]    critical
155     Switch_To_BGP_Peer_Console
156     Start_Console_Tool    ${BGP_PEER_COMMAND}    ${BGP_PEER_OPTIONS}
157     Read_And_Fail_If_Prompt_Is_Seen
158
159 TC1_BGP_Peer_Check_Incomming_Updates_For_3_Introduced_Prefixes
160     [Documentation]    Check incomming updates for new routes
161     [Tags]    critical
162     Switch_To_BGP_Peer_Console
163     BuiltIn.Wait_Until_Keyword_Succeeds
164     ...    10s
165     ...    1s
166     ...    Check_File_For_Word_Count
167     ...    bgp_peer.log
168     ...    nlri_prefix_received:
169     ...    3
170     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.0/28    1
171     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.16/28    1
172     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.32/28    1
173     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received:    0
174
175 TC1_BGP_Application_Peer_Delete_3_Initial_Routes
176     [Documentation]    Start BGP application peer tool and give him ${BGP_APP_PEER_TIMEOUT}
177     [Tags]    critical
178     Switch_To_BGP_Application_Peer_Console
179     Start_Console_Tool    ${BGP_APP_PEER_DELETE_COMMAND} ${SCRIPT_URI_OPT}    ${BGP_APP_PEER_OPTIONS}
180     Wait_Until_Console_Tool_Finish    ${BGP_APP_PEER_TIMEOUT}
181     Store_File_To_Workspace    bgp_app_peer.log    bgp_app_peer_delete_tc1.log
182
183 TC1_Check_Example-IPv4-Topology_Is_Empty
184     [Documentation]    See new routes are deleted.
185     [Tags]    critical
186     Wait_For_Topology_To_Change_To    empty_topology
187
188 TC1_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes
189     [Documentation]    Check incomming updates for new routes
190     [Tags]    critical
191     Switch_To_BGP_Peer_Console
192     BuiltIn.Wait_Until_Keyword_Succeeds
193     ...    10s
194     ...    1s
195     ...    Check_File_For_Word_Count
196     ...    bgp_peer.log
197     ...    withdrawn_prefix_received:
198     ...    3
199     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.0/28    1
200     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.16/28    1
201     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.32/28    1
202     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received:    3
203
204 TC1_Stop_BGP_Peer
205     [Documentation]    Stop BGP peer tool
206     [Tags]    critical
207     Switch_To_BGP_Peer_Console
208     Stop_Console_Tool
209     Store_File_To_Workspace    bgp_peer.log    bgp_peer_tc1.log
210
211 TC2_Reconnect_BGP_Peer
212     [Documentation]    Start BGP peer tool
213     [Tags]    critical
214     Switch_To_BGP_Peer_Console
215     Start_Console_Tool    ${BGP_PEER_COMMAND}    ${BGP_PEER_OPTIONS}
216     Read_And_Fail_If_Prompt_Is_Seen
217     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received:    0
218     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received:    0
219
220 TC2_BGP_Application_Peer_Put_3_Routes
221     [Documentation]    Start BGP application peer tool and give him ${BGP_APP_PEER_TIMEOUT}
222     [Tags]    critical
223     Switch_To_BGP_Application_Peer_Console
224     Start_Console_Tool    ${BGP_APP_PEER_PUT_COMMAND} ${SCRIPT_URI_OPT}    ${BGP_APP_PEER_OPTIONS}
225     Wait_Until_Console_Tool_Finish    ${BGP_APP_PEER_TIMEOUT}
226     Store_File_To_Workspace    bgp_app_peer.log    bgp_app_peer_put_tc2.log
227
228 TC2_Check_Example-IPv4-Topology_Is_Filled_With_3_Routes
229     [Documentation]    See new routes in example-ipv4-topology as a proof that synchronization was correct.
230     [Tags]    critical
231     Wait_For_Topology_To_Change_To    filled_topology
232
233 TC2_BGP_Peer_Check_Incomming_Updates_For_3_Introduced_Prefixes
234     [Documentation]    Check incomming updates for new routes
235     [Tags]    critical
236     Switch_To_BGP_Peer_Console
237     BuiltIn.Wait_Until_Keyword_Succeeds
238     ...    10s
239     ...    1s
240     ...    Check_File_For_Word_Count
241     ...    bgp_peer.log
242     ...    nlri_prefix_received:
243     ...    3
244     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.0/28    1
245     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.16/28    1
246     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.32/28    1
247     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received:    0
248
249 TC2_BGP_Application_Peer_Delete_All_Routes
250     [Documentation]    Start BGP application peer tool and give him ${BGP_APP_PEER_TIMEOUT}
251     [Tags]    critical
252     Switch_To_BGP_Application_Peer_Console
253     Start_Console_Tool    ${BGP_APP_PEER_DELETE_ALL_COMMAND} ${SCRIPT_URI_OPT}    ${BGP_APP_PEER_OPTIONS}
254     Wait_Until_Console_Tool_Finish    ${BGP_APP_PEER_TIMEOUT}
255     Store_File_To_Workspace    bgp_app_peer.log    bgp_app_peer_delete_all_tc2.log
256
257 TC2_Check_Example-IPv4-Topology_Is_Empty
258     [Documentation]    See new routes are deleted.
259     [Tags]    critical
260     Wait_For_Topology_To_Change_To    empty_topology
261
262 TC2_BGP_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes
263     [Documentation]    Check incomming updates for new routes
264     [Tags]    critical
265     Switch_To_BGP_Peer_Console
266     BuiltIn.Wait_Until_Keyword_Succeeds
267     ...    10s
268     ...    1s
269     ...    Check_File_For_Word_Count
270     ...    bgp_peer.log
271     ...    withdrawn_prefix_received:
272     ...    3
273     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.0/28    1
274     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.16/28    1
275     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.32/28    1
276     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received:    3
277
278 TC2_Stop_BGP_Peer
279     [Documentation]    Stop BGP peer tool
280     [Tags]    critical
281     Switch_To_BGP_Peer_Console
282     Stop_Console_Tool
283     Store_File_To_Workspace    bgp_peer.log    bgp_peer_tc2.log
284
285 TC3_BGP_Application_Peer_Put_3_Routes
286     [Documentation]    Start BGP application peer tool and give him ${BGP_APP_PEER_TIMEOUT}
287     [Tags]    critical
288     Switch_To_BGP_Application_Peer_Console
289     Start_Console_Tool    ${BGP_APP_PEER_PUT_COMMAND} ${SCRIPT_URI_OPT}    ${BGP_APP_PEER_OPTIONS}
290     Wait_Until_Console_Tool_Finish    ${BGP_APP_PEER_TIMEOUT}
291     Store_File_To_Workspace    bgp_app_peer.log    bgp_app_peer_put_tc3.log
292
293 TC3_Check_Example-IPv4-Topology_Is_Filled_With_3_Routes
294     [Documentation]    See new routes in example-ipv4-topology as a proof that synchronization was correct.
295     [Tags]    critical
296     Wait_For_Topology_To_Change_To    filled_topology
297
298 TC3_Reconnect_BGP_Peer_And_Check_Incomming_Updates_For_3_Introduced_Prefixes
299     [Documentation]    Start BGP peer tool
300     [Tags]    critical
301     Switch_To_BGP_Peer_Console
302     Start_Console_Tool    ${BGP_PEER_COMMAND}    ${BGP_PEER_OPTIONS}
303     Read_And_Fail_If_Prompt_Is_Seen
304     BuiltIn.Wait_Until_Keyword_Succeeds
305     ...    10s
306     ...    1s
307     ...    Check_File_For_Word_Count
308     ...    bgp_peer.log
309     ...    nlri_prefix_received:
310     ...    3
311     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received:    3
312     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.0/28    1
313     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.16/28    1
314     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received: 8.0.1.32/28    1
315     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received:    0
316
317 TC3_BGP_Application_Peer_Delete_All_Routes
318     [Documentation]    Start BGP application peer tool and give him ${BGP_APP_PEER_TIMEOUT}
319     [Tags]    critical
320     Switch_To_BGP_Application_Peer_Console
321     Start_Console_Tool    ${BGP_APP_PEER_DELETE_ALL_COMMAND} ${SCRIPT_URI_OPT}    ${BGP_APP_PEER_OPTIONS}
322     Wait_Until_Console_Tool_Finish    ${BGP_APP_PEER_TIMEOUT}
323     Store_File_To_Workspace    bgp_app_peer.log    bgp_app_peer_delete_all_tc3.log
324
325 TC3_Check_Example-IPv4-Topology_Is_Empty
326     [Documentation]    See new routes are deleted.
327     [Tags]    critical
328     Wait_For_Topology_To_Change_To    empty_topology
329
330 TC3_BGP_Peer_Check_Incomming_Updates_For_3_Withdrawn_Prefixes
331     [Documentation]    Check incomming updates for new routes
332     [Tags]    critical
333     Switch_To_BGP_Peer_Console
334     BuiltIn.Wait_Until_Keyword_Succeeds
335     ...    10s
336     ...    1s
337     ...    Check_File_For_Word_Count
338     ...    bgp_peer.log
339     ...    withdrawn_prefix_received:
340     ...    3
341     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.0/28    1
342     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.16/28    1
343     Check_File_For_Word_Count    bgp_peer.log    withdrawn_prefix_received: 8.0.1.32/28    1
344     Check_File_For_Word_Count    bgp_peer.log    nlri_prefix_received:    3
345
346 TC3_Stop_BGP_Peer
347     [Documentation]    Stop BGP peer tool
348     [Tags]    critical
349     Switch_To_BGP_Peer_Console
350     Stop_Console_Tool
351     Store_File_To_Workspace    bgp_peer.log    bgp_peer_tc3.log
352
353 Delete_Bgp_Peer_Configuration
354     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
355     [Tags]    critical
356     &{mapping}    BuiltIn.Create_Dictionary
357     ...    DEVICE_NAME=${DEVICE_NAME}
358     ...    BGP_NAME=${BGP_PEER_NAME}
359     ...    IP=${TOOLS_SYSTEM_IP}
360     ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
361     TemplatedRequests.Delete_Templated
362     ...    ${BGP_VARIABLES_FOLDER}${/}bgp_peer
363     ...    mapping=${mapping}
364     ...    session=${CONFIG_SESSION}
365
366 Delete_Bgp_Application_Peer_Configuration
367     [Documentation]    Revert the BGP configuration to the original state: without any configured peers.
368     [Tags]    critical
369     &{mapping}    BuiltIn.Create_Dictionary
370     ...    DEVICE_NAME=${DEVICE_NAME}
371     ...    NAME=${BGP_PEER_APP_NAME}
372     ...    IP=${ODL_SYSTEM_IP}
373     ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
374     TemplatedRequests.Delete_Templated
375     ...    ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer
376     ...    mapping=${mapping}
377     ...    session=${CONFIG_SESSION}
378
379
380 *** Keywords ***
381 Setup_Everything
382     [Documentation]    Initialize SetupUtils. SSH-login to mininet machine, create HTTP session,
383     ...    put Python tool to mininet machine, setup imported resources.
384     SetupUtils.Setup_Utils_For_Setup_And_Teardown
385     SSHLibrary.Set_Default_Configuration    prompt=${TOOLS_SYSTEM_PROMPT}
386     Open_BGP_Peer_Console
387     SSHKeywords.Require_Python
388     SSHKeywords.Assure_Library_Ipaddr    target_dir=.
389     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/play.py
390     Open_BGP_Aplication_Peer_Console
391     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/bgp_app_peer.py
392     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/ipv4-routes-template.xml*
393     RequestsLibrary.Create_Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
394
395 Teardown_Everything
396     [Documentation]    Make sure Python tool was killed.
397     ...    Tear down imported Resources.
398     KillPythonTool.Search_And_Kill_Remote_Python    'play\.py'
399     KillPythonTool.Search_And_Kill_Remote_Python    'bgp_app_peer\.py'
400     RequestsLibrary.Delete_All_Sessions
401     SSHLibrary.Close_All_Connections
402
403 Open_BGP_Peer_Console
404     [Documentation]    Create a session for BGP peer.
405     SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}    alias=bgp_peer_console
406     SSHKeywords.Flexible_Mininet_Login
407
408 Open_BGP_Aplication_Peer_Console
409     [Documentation]    Create a session for BGP peer.
410     SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}    alias=bgp_app_peer_console
411     SSHKeywords.Flexible_Mininet_Login
412
413 Switch_To_BGP_Peer_Console
414     SSHLibrary.Switch Connection    bgp_peer_console
415
416 Switch_To_BGP_Application_Peer_Console
417     SSHLibrary.Switch Connection    bgp_app_peer_console
418
419 Wait_For_Topology_To_Change_To
420     [Documentation]    Wait until Compare_Topology matches expected result.
421     [Arguments]    ${folder_name}    ${timeout}=10s    ${refresh}=1s
422     BuiltIn.Wait_Until_Keyword_Succeeds    ${timeout}    ${refresh}    Compare_Topology    ${folder_name}
423
424 Verify_That_Topology_Does_Not_Change_From
425     [Documentation]    Verify that Compare_Topology keeps passing, it will hold its last result.
426     [Arguments]    ${folder_name}    ${timeout}=10s    ${refresh}=1s
427     WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout
428     ...    ${timeout}
429     ...    ${refresh}
430     ...    Compare_Topology
431     ...    ${folder_name}
432
433 Compare_Topology
434     [Documentation]    Get current example-ipv4-topology as json, and compare it to expected result.
435     [Arguments]    ${folder_name}
436     TemplatedRequests.Get_As_Json_Templated
437     ...    ${BGP_VARIABLES_FOLDER}${/}${folder_name}
438     ...    session=${CONFIG_SESSION}
439     ...    verify=True