Fix bgpcep-1node-bgp-ingest tests
[integration/test.git] / csit / libraries / ExaBgpLib.robot
index 50e21960666233fc9e40229f19635e75bd15dfc8..270b0a24351d48fa736140582ea634c4177508fb 100644 (file)
@@ -1,16 +1,16 @@
 *** Settings ***
 Documentation     Robot keyword library (Resource) for handling the ExaBgp tool.
-...           
+...
 ...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
-...           
+...
 ...               This program and the accompanying materials are made available under the
 ...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
 ...               and is available at http://www.eclipse.org/legal/epl-v10.html
-...           
-...           
+...
+...
 ...               This library assumes that a SSH connection exists (and is switched to)
 ...               to a Linux machine (usualy TOOLS_SYSTEM) where the ExaBgp should be run.
-...           
+...
 ...               TODO: RemoteBash.robot contains logic which could be reused here.
 Library           SSHLibrary
 Resource          ${CURDIR}/SSHKeywords.robot
@@ -20,7 +20,7 @@ Resource          ${CURDIR}/BGPcliKeywords.robot
 *** Variables ***
 ${EXABGP_KILL_COMMAND}    ps axf | grep exabgp | grep -v grep | awk '{print \"kill -9 \" $1}' | sh
 ${CMD}            env exabgp.tcp.port=1790 exabgp --debug
-${PEER_CHECK_URL}    /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/peer/bgp:%2F%2F
+${PEER_CHECK_URL}    {$REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F
 
 *** Keywords ***
 Start_ExaBgp
@@ -57,7 +57,7 @@ Start_ExaBgp_And_Verify_Connected
         Start_ExaBgp    ${cfg_file}
         ${status}    ${value}=    BuiltIn.Run_Keyword_And_Ignore_Error    BuiltIn.Wait_Until_Keyword_Succeeds    3x    3s
         ...    Verify_ExaBgps_Connection    ${session}    ${exabgp_ip}    connected=${True}
-        BuiltIn.Run_Keyword_Unless    "${status}" == "PASS"    Stop_ExaBgp
+        BuiltIn.Run_Keyword_If    "${status}" != "PASS"    Stop_ExaBgp
         BuiltIn.Return_From_Keyword_If    "${status}" == "PASS"
     END
     BuiltIn.Fail    Unable to connect ExaBgp to ODL
@@ -66,7 +66,7 @@ Verify_ExaBgps_Connection
     [Arguments]    ${session}    ${exabgp_ip}=${TOOLS_SYSTEM_IP}    ${connected}=${True}
     [Documentation]    Checks peer presence in operational datastore
     ${exp_status_code}=    BuiltIn.Set_Variable_If    ${connected}    ${200}    ${404}
-    ${rsp}=    RequestsLibrary.Get Request    ${session}    ${PEER_CHECK_URL}${exabgp_ip}
+    ${rsp}=    RequestsLibrary.Get Request    ${session}    ${PEER_CHECK_URL}${exabgp_ip}?content=nonconfig
     BuiltIn.Log    ${rsp.content}
     BuiltIn.Should_Be_Equal_As_Numbers    ${exp_status_code}    ${rsp.status_code}