2 Documentation Functional test for ipv6 connection with bgp.
4 ... Copyright (c) 2020 Lumina Networks Intellectual Property. 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 ... This suite tests simple connection between one ibgp peer (goabgp) and Odl.
11 ... Peer is configured with ipv6, and gobgp connectes to odl via ipv6.
13 Library RequestsLibrary
15 Resource ../../../variables/Variables.robot
16 Resource ../../../libraries/BGPcliKeywords.robot
17 Resource ../../../libraries/GoBgpLib.robot
18 Resource ../../../libraries/SetupUtils.robot
19 Resource ../../../libraries/SSHKeywords.robot
20 Resource ../../../libraries/TemplatedRequests.robot
22 Suite Setup Start_Suite
23 Suite Teardown Stop_Suite
24 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
28 ${BGP_VAR_FOLDER} ${CURDIR}/../../../variables/bgpfunctional/ipv6
29 ${GOBGP_FOLDER} ${CURDIR}/../../../variables/bgpfunctional/gobgp
30 ${CONFIG_SESSION} config-session
31 ${GOBGP_CFG} gobgp.cfg
32 ${GOBGP_LOG} gobgp.log
34 ${RIB_INSTANCE} example-bgp-rib
35 ${GOBGP_BINARY_URL} https://github.com/osrg/gobgp/releases/download/v2.18.0/gobgp_2.18.0_linux_386.tar.gz
36 ${FILE_NAME} gobgp_2.18.0_linux_386.tar.gz
40 Reconfigure_ODL_To_Accept_Connections
41 [Documentation] Configure BGP peer modules with initiate-connection set to false with short ipv6 address.
42 &{mapping} Create Dictionary
43 ... IP=${TOOLS_SYSTEM_IP}
44 ... HOLDTIME=${HOLDTIME}
45 ... PEER_PORT=${BGP_TOOL_PORT}
47 ... BGP_RIB=${RIB_INSTANCE}
49 ... BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
50 ... RIB_INSTANCE_NAME=${RIB_INSTANCE}
51 TemplatedRequests.Put_As_Xml_Templated
52 ... ${BGP_VAR_FOLDER}/bgp_peer
53 ... mapping=${mapping}
54 ... session=${CONFIG_SESSION}
58 ${cmd} BuiltIn.Set Variable ${GOBGP_CFG} > ${GOBGP_LOG}
59 GoBgpLib.Start_GoBgp_And_Verify_Connected ${cmd} ${CONFIG_SESSION} ${TOOLS_SYSTEM_IP}
61 Delete_Bgp_Peer_Configuration
62 [Documentation] Revert the BGP configuration to the original state: without any configured peers.
63 &{mapping} Create Dictionary
64 ... IP=${TOOLS_SYSTEM_IP}
65 ... HOLDTIME=${HOLDTIME}
66 ... PEER_PORT=${BGP_TOOL_PORT}
68 ... BGP_RIB=${RIB_INSTANCE}
70 ... BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
71 ... RIB_INSTANCE_NAME=${RIB_INSTANCE}
72 TemplatedRequests.Delete_Templated ${BGP_VAR_FOLDER}/bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
75 [Documentation] Save exabgp logs as exaipv6.log, and stop exabgp with ctrl-c bash signal
76 BGPcliKeywords.Store_File_To_Workspace ${GOBGP_LOG} ${GOBGP_LOG}
82 [Documentation] Suite setup keyword.
83 SetupUtils.Setup_Utils_For_Setup_And_Teardown
84 ${tools_system_conn_id} SSHLibrary.Open_Connection
85 ... ${TOOLS_SYSTEM_IP}
86 ... prompt=${DEFAULT_LINUX_PROMPT}
88 Builtin.Set_Suite_Variable ${tools_system_conn_id}
89 SSHKeywords.Flexible_Mininet_Login ${TOOLS_SYSTEM_USER}
90 RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
95 [Documentation] Suite teardown keyword
96 SSHLibrary.Close_All_Connections
97 RequestsLibrary.Delete_All_Sessions
98 BuiltIn.Run Keyword And Ignore Error GoBgpLib.Stop_GoBgp
101 [Documentation] Uploads gobgp config files
102 SSHLibrary.Put_File ${GOBGP_FOLDER}/${GOBGP_CFG} .
103 @{cfgfiles} SSHLibrary.List_Files_In_Directory . *.cfg
104 FOR ${cfgfile} IN @{cfgfiles}
105 SSHLibrary.Execute_Command sed -i -e 's/GOBGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile}
106 SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile}
107 SSHLibrary.Execute_Command sed -i -e 's/ROUTERID/${TOOLS_SYSTEM_IP}/g' ${cfgfile}
108 SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile}
109 SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile}
110 ${stdout} SSHLibrary.Execute_Command cat ${cfgfile}
114 Download_Gobgp_Binary
115 [Documentation] Downloads gobgp binary and untar the binary zip file
116 SSHKeywords.Open_Connection_To_Tools_System ${TOOLS_SYSTEM_IP}
117 SSHLibrary.Execute Command wget ${GOBGP_BINARY_URL}
118 SSHLibrary.File Should Exist ./${FILE_NAME}
119 SSHLibrary.Execute Command tar -xzf ${FILE_NAME}