Fix bgpcep-1node-userfeatures tests
[integration/test.git] / csit / libraries / BGPSpeaker.robot
index 9a76470a1e60cc371934a738f297442115428786..ef2cfa5f1adf5af5ac9129be57cd82cc42d7ded9 100644 (file)
@@ -1,24 +1,24 @@
 *** Settings ***
 Documentation     Robot keyword library (Resource) for handling the BGP speaker Python utilities.
-...           
+...
 ...               Copyright (c) 2015,2017 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 Python BGP speaker should be run.
 ...               It also assumes that the current working directory on that connection is the
 ...               directory where the speaker tool was deployed as there are no paths to neither
 ...               the play.py nor the log files in the commands.
-...           
+...
 ...               Aside BGP Speaker utility, there is also BGP Manager starting utilities in parallel.
 ...               For purpose of dumping logs and killing, Manager behaves the same as Speaker.
-...           
+...
 ...               TODO: RemoteBash.robot contains logic which could be reused here.
-...           
+...
 ...               TODO: Update the following TODOs, as SSHKeywords.robot was introduced.
 ...               TODO: The Utils.robot library has a "Run Command On Remote System" if we didn't
 ...               want to make the assumption that an SSH connection was already open.
@@ -30,7 +30,6 @@ Resource          ../variables/Variables.robot
 
 *** Variables ***
 ${BGPSpeaker__OUTPUT_LOG}    play.py.out
-${PEER_URL}       restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/peer/bgp:%2F%2F
 
 *** Keywords ***
 Start_BGP_Speaker
@@ -39,7 +38,7 @@ Start_BGP_Speaker
     ...    so it can be dumped into the logs later, when stopping it. This also avoids polluting the
     ...    output seen by "Read Until Prompt" with false propmpts so it won't stop prematurely
     ...    leading to a spurious test failure, messy log content or other misbehavior.
-    ${command} =    BuiltIn.Set_Variable    python play.py ${arguments} &> ${BGPSpeaker__OUTPUT_LOG}
+    ${command} =    BuiltIn.Set_Variable    python3 play.py ${arguments} &> ${BGPSpeaker__OUTPUT_LOG}
     BuiltIn.Log    ${command}
     ${output} =    SSHLibrary.Write    ${command}
 
@@ -56,7 +55,7 @@ Verify_BGP_Speaker_Connection
     [Arguments]    ${session}    ${ip}    ${connected}=${True}
     [Documentation]    Verifies peer's presence in bgp rib.
     ${exp_status_code}    BuiltIn.Set_Variable_If    ${connected}    ${200}    ${404}
-    ${url}    BuiltIn.Set_Variable    ${PEER_URL}${ip}
+    ${url}=    BuiltIn.Set_Variable    ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F${ip}?content=nonconfig
     ${response}    RequestsLibrary.Get_Request    ${session}    ${url}
     BuiltIn.Should_Be_Equal_As_Numbers    ${exp_status_code}    ${response.status_code}
     [Return]    ${response.content}
@@ -64,7 +63,7 @@ Verify_BGP_Speaker_Connection
 Start_BGP_Manager
     [Arguments]    ${arguments}
     [Documentation]    Start the BGP manager python utility. Redirect its error output to a log file.
-    ${command}=    BuiltIn.Set_Variable    python play.py ${arguments} &> ${BGPSpeaker__OUTPUT_LOG}
+    ${command}=    BuiltIn.Set_Variable    python3 play.py ${arguments} &> ${BGPSpeaker__OUTPUT_LOG}
     BuiltIn.Log    ${command}
     ${output}=    SSHLibrary.Write    ${command}