X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FBGPcliKeywords.robot;h=a9568b3f5989cf2eef2661c1717243ddc90d94f7;hb=2a2ea82aecb3113751eac008e076a5643b67a649;hp=6b59f7ba38c47a1f3e7c550b01a4bb9a4960d156;hpb=93238d6346d67ee97514c81c373f2678f3ed31d1;p=integration%2Ftest.git diff --git a/csit/libraries/BGPcliKeywords.robot b/csit/libraries/BGPcliKeywords.robot index 6b59f7ba38..a9568b3f59 100644 --- a/csit/libraries/BGPcliKeywords.robot +++ b/csit/libraries/BGPcliKeywords.robot @@ -1,25 +1,38 @@ *** Settings *** Documentation Robot keyword library (Resource) for handling the BGP speaker CLI tools ... -... Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. +... 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 contains keywords to handle command line tools in BGP Application -... for handling shell connections +... for handling shell connections. +... +... TODO: RemoteBash.robot contains logic which could be reused here. Library SSHLibrary timeout=10s Library RequestsLibrary Variables ${CURDIR}/../variables/Variables.py -Resource ${CURDIR}/Utils.robot +Resource ${CURDIR}/RemoteBash.robot +Resource ${CURDIR}/NexusKeywords.robot *** Keywords *** Start_Console_Tool [Arguments] ${command} ${tool_opt} [Documentation] Start the tool ${command} ${tool_opt} - BuiltIn.Log ${command} - ${output}= SSHLibrary.Write ${command} ${tool_opt} + ${start_cmd} BuiltIn.Set_Variable ${command} ${tool_opt} + BuiltIn.Log ${start_cmd} + ${output}= SSHLibrary.Write ${start_cmd} + BuiltIn.Log ${output} + +Start_Java_Tool_And_Verify_Connection + [Arguments] ${command} ${until_phrase} + ${start_cmd} NexusKeywords.Compose_Full_Java_Command ${command} + BuiltIn.Log ${start_cmd} + SSHLibrary.Set_Client_Configuration timeout=30s + SSHLibrary.Write ${start_cmd} + ${output}= SSHLibrary.Read_Until ${until_phrase} BuiltIn.Log ${output} Wait_Until_Console_Tool_Finish @@ -29,10 +42,18 @@ Wait_Until_Console_Tool_Finish Stop_Console_Tool [Documentation] Stop the tool if still running. - Utils.Write_Bare_Ctrl_C + RemoteBash.Write_Bare_Ctrl_C ${output}= SSHLibrary.Read delay=1s BuiltIn.Log ${output} +Stop_Console_Tool_And_Wait_Until_Prompt + [Documentation] Stops the tool by sending ctrl+c + ${output}= SSHLibrary.Read + BuiltIn.Log ${output} + RemoteBash.Write_Bare_Ctrl_C + ${output}= SSHLibrary.Read_Until_Prompt + BuiltIn.Log ${output} + Read_And_Fail_If_Prompt_Is_Seen [Documentation] Try to read SSH to see prompt, but expect to see no prompt within SSHLibrary's timeout. ${passed}= BuiltIn.Run_Keyword_And_Return_Status BuiltIn.Run_Keyword_And_Expect_Error No match found for '${ODL_SYSTEM_PROMPT}' in *. Read_Text_Before_Prompt