Add two new keywords to BGP library. 66/79166/6
authormpany <madhusmita.p@altencalsoftlabs.com>
Thu, 3 Jan 2019 07:43:56 +0000 (13:13 +0530)
committerJamo Luhrsen <jluhrsen@redhat.com>
Tue, 8 Jan 2019 18:47:06 +0000 (18:47 +0000)
Change-Id: I989f4b735e01d9bef0e68f9016eb6082fb010bb9
Signed-off-by: mpany <madhusmita.p@altencalsoftlabs.com>
csit/libraries/BgpOperations.robot

index 782b483d94d21c69e6a83aaadb9c35f43aacfd34..97ba03c3e91052b0751968b8ac66aa608134bebd 100644 (file)
@@ -21,6 +21,7 @@ ${NEW_AS_PATH}    ${EMPTY}
 &{APP_PEER}       IP=${ODL_SYSTEM_IP}    BGP_RIB=${RIB_NAME}
 ${NEW_IPV4_ROUTES_LINE}    ${EMPTY}
 ${OLD_IPV4_ROUTES_LINE}    \n"bgp-inet:ipv4-routes": {},
+${BGP_CONFIG_SERVER_CMD}    bgp-connect -h ${ODL_SYSTEM_IP} -p 7644 add
 
 *** Keywords ***
 Start Quagga Processes On ODL
@@ -160,6 +161,26 @@ Verify BGP Neighbor Status On Quagga
     Log    ${output}
     Should Contain    ${output}    BGP state = Established
 
+Setup BGP Peering On ODL
+    [Arguments]    ${odl_ip}    ${as_id}    ${nbr_ip}
+    [Documentation]    Setup BGP peering between ODL and given neighbor IP.
+    ...    Configuring and starting BGP on ODL node with given AS number
+    ...    Adding and verifying BGP neighbor
+    KarafKeywords.Issue Command On Karaf Console    ${BGP_CONFIG_SERVER_CMD}
+    BgpOperations.Create BGP Configuration On ODL    localas=${as_id}    routerid=${odl_ip}
+    BgpOperations.AddNeighbor To BGP Configuration On ODL    remoteas=${as_id}    neighborAddr=${nbr_ip}
+    ${output} =    BgpOperations.Get BGP Configuration On ODL    session
+    BuiltIn.Should Contain    ${output}    ${nbr_ip}
+
+Setup BGP Peering On DCGW
+    [Arguments]    ${dcgw_ip}    ${as_id}    ${nbr_ip}    ${vrf_name}    ${rd}    ${loopback_ip}
+    [Documentation]    Setup BGP peering between DCGW and given neighbor IP.
+    ...    Configuring,adding neighbor on DCGW node and verifying BGP neighbor.
+    BgpOperations.Configure BGP And Add Neighbor On DCGW    ${dcgw_ip}    ${as_id}    ${dcgw_ip}    ${nbr_ip}    ${vrf_name}    ${rd}
+    ...    ${loopback_ip}
+    ${output} =    BgpOperations.Execute Show Command On Quagga    ${dcgw_ip}    ${RUN_CONFIG}
+    BuiltIn.Should Contain    ${output}    ${nbr_ip}
+
 Verify Routes On Quagga
     [Arguments]    ${dcgw_ip}    ${rd}    ${ip_list}
     [Documentation]    Verify routes on quagga