Rework of Restperfclient__Invoke_With_Timeout kw to avoid broken ssh session 68/49468/15
authorPeter Gubka <pgubka@cisco.com>
Fri, 16 Dec 2016 10:39:55 +0000 (11:39 +0100)
committerVratko Polák <vrpolak@cisco.com>
Thu, 5 Jan 2017 13:53:00 +0000 (13:53 +0000)
In the jobs netconf-csit-1node-periodic-scale-only-<strem> it took too long
to handle 65k requests via netconf connector and ssh session became broken.
To avoid this execute command kw was replced with write and read until kws.

Minor changes to support debugging in libraries/SSHKeywords.robot and restperfclient/mdsal.robot

Change-Id: I080edb518acfe2e955fbe249e6e7bb33d8099eda
Signed-off-by: Peter Gubka <pgubka@cisco.com>
csit/libraries/RestPerfClient.robot
csit/suites/netconf/restperfclient/mdsal.robot

index 0bb873abd06cb590dea031fe821e0225f1facdf0..1a1b6f13bfc7fb82f21453cde4757c126bc5eeb1 100644 (file)
@@ -52,10 +52,18 @@ RestPerfClient__Kill
     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
@@ -76,7 +84,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
index 00c5725a44a09e00c785e5814102e58b4f0ec294..ec0e733d75eaf292347e7ee7d6bce911522e0e2d 100644 (file)
@@ -34,7 +34,7 @@ Variables         ${CURDIR}/../../../variables/Variables.py
 *** Variables ***
 ${DIRECTORY_WITH_TEMPLATE_FOLDERS}    ${CURDIR}/../../../variables/netconf/RestPerfClient
 ${REQUEST_COUNT}    65536
-${device_type}    default
+${device_type}    full-uri-device
 ${test_device}    odl-mdsal-northbound-via-netconf-connector
 
 *** Test Cases ***
@@ -114,6 +114,8 @@ Setup_Everything
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     NetconfKeywords.Setup_Netconf_Keywords
     RestPerfClient.Setup_Restperfclient
+    ${device_type}=    BuiltIn.Set_Variable_If    ${USE_NETCONF_CONNECTOR}==${True}    default    ${device_type}
+    BuiltIn.Set_Suite_Variable    ${device_type}
     # Calculate timeouts
     ${value}=    BuiltIn.Evaluate    ${REQUEST_COUNT}/50+10
     Utils.Set_User_Configurable_Variable_Default    DIRECT_MDSAL_TIMEOUT    ${value} s