X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FRestPerfClient.robot;h=fc5d6e026a6f2ac80f64b9ed390cc02a9b85c469;hb=4d7f43aaa7d447a3db5734ff8162ca118152f260;hp=ca1d892d632fce49ce3bde469ae0de661bb12466;hpb=88ced13d6ff5f2b6eee75453717b05b2e213ba9b;p=integration%2Ftest.git diff --git a/csit/libraries/RestPerfClient.robot b/csit/libraries/RestPerfClient.robot index ca1d892d63..fc5d6e026a 100644 --- a/csit/libraries/RestPerfClient.robot +++ b/csit/libraries/RestPerfClient.robot @@ -1,16 +1,19 @@ *** Settings *** Documentation RestPerfClient handling singleton resource. ... -... Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. +... Copyright (c) 2016,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 singleton manages RestPerfClient invocation, tracks the log file ... produced by the invocation, allows the test suite to easily search this ... log file and collect it once done. ... +... TODO: RemoteBash.robot contains logic which could be reused here. +... ... TODO: Currently only one RestPerfClient invocation running at a time is ... supported. Support for multiple concurrently running RestPerfClient ... invocations might be needed for example when performance testing cluster @@ -29,6 +32,7 @@ Resource ${CURDIR}/NexusKeywords.robot Resource ${CURDIR}/SetupUtils.robot Resource ${CURDIR}/SSHKeywords.robot Resource ${CURDIR}/Utils.robot +Resource ${CURDIR}/RemoteBash.robot *** Variables *** ${RestPerfClient__restperfclientlog} ${EMPTY} @@ -48,14 +52,23 @@ Setup_Restperfclient BuiltIn.Set_Suite_Variable ${RestPerfClient__restperfclient_invocation_command_prefix} ${prefix} RestPerfClient__Kill - Utils.Write_Bare_Ctrl_C + RemoteBash.Write_Bare_Ctrl_C SSHLibrary.Set_Client_Configuration timeout=5 SSHLibrary.Read_Until_Prompt +Restperfclient__Wait_For_Finish + SSHLibrary.Write ${Empty} + ${stdout}= SSHLibrary.Read_Until_Prompt + Restperfclient__Invoke_With_Timeout [Arguments] ${timeout} ${command} - [Timeout] ${timeout} - Execute_Command_Passes ${command} >${RestPerfClient__restperfclientlog} 2>&1 + ${stdout}= SSHLibrary.Read + BuiltIn.Log ${stdout} + ${cmd}= BuiltIn.Set_Variable ${command} 2>&1 | tee ${RestPerfClient__restperfclientlog} + SSHLibrary.Write ${cmd} + SSHLibrary.Set_Client_Configuration timeout=120 + BuiltIn.Wait_Until_Keyword_Succeeds ${timeout} 1s Restperfclient__Wait_For_Finish + Execute_Command_Passes cat ${RestPerfClient__restperfclientlog} Invoke_Restperfclient [Arguments] ${timeout} ${url} ${testcase}=${EMPTY} ${ip}=${ODL_SYSTEM_IP} ${port}=${RESTCONFPORT} ${count}=${REQUEST_COUNT} @@ -75,7 +88,6 @@ Invoke_Restperfclient ${command}= BuiltIn.Set_Variable ${RestPerfClient__restperfclient_invocation_command_prefix} ${options} BuiltIn.Log Running restperfclient: ${command} SSHLibrary.Switch_Connection ${RestPerfClient__restperfclient} - SSHLibrary.Set_Client_Configuration timeout=${timeout} ${keyword_timeout}= DateTime.Add_Time_To_Time ${timeout} 2m result_format=compact SetupUtils.Set_Known_Bug_Id 5413 ${restperfclient_running}= Set_Variable True