Configure timeout in RestPerfClient 44/36544/18
authorJozef Behran <jbehran@cisco.com>
Tue, 22 Mar 2016 09:46:23 +0000 (10:46 +0100)
committerJozef Behran <jbehran@cisco.com>
Wed, 23 Mar 2016 15:38:34 +0000 (16:38 +0100)
Add --timeout argument setting the timeout for the
RestPerfClient threads issuing requests to the timeouts
calculated in the suites instead of the default 5 minutes.
Do that change for all three RestPerfClient performance
tests.

Change-Id: I7497eb4284b3dde5909d1fab68783d03ce7a5e1a
Signed-off-by: Jozef Behran <jbehran@cisco.com>
csit/libraries/RestPerfClient.robot
csit/libraries/Utils.robot
csit/suites/netconf/restperfclient/mdsal.robot
csit/suites/netconf/restperfclient/performance.robot

index 5a1ca5878ebb85a306bbdca003ee5b371444f3a5..7ff0e1704b3646e0dbe09797e296059c80faf2c9 100644 (file)
@@ -57,7 +57,8 @@ Invoke_Restperfclient
     ${options}=    BuiltIn.Set_Variable    --ip ${ip} --port ${port} --edits ${count}
     ${options}=    BuiltIn.Set_Variable    ${options} --edit-content request1.json --async-requests ${async}
     ${options}=    BuiltIn.Set_Variable    ${options} --auth ${user} ${password}
-    ${options}=    BuiltIn.Set_Variable    ${options} --destination ${url}
+    ${timeout_in_minutes}=    Utils.Convert_To_Minutes    ${timeout}
+    ${options}=    BuiltIn.Set_Variable    ${options} --timeout ${timeout_in_minutes} --destination ${url}
     ${command}=    BuiltIn.Set_Variable    ${RestPerfClient__restperfclient_invocation_command_prefix} ${options}
     BuiltIn.Log    Running restperfclient: ${command}
     SSHLibrary.Switch_Connection    ${RestPerfClient__restperfclient}
index 0f0ce259cd5ac98607849ee5a29d126919f38daa..c48a39605d2dff1bd429dea872dd80d37077c6fe 100644 (file)
@@ -468,3 +468,15 @@ Set_User_Configurable_Variable_Default
     #    "pybot -v".
     ${value}=    BuiltIn.Get_Variable_Value    \${${name}}    ${value}
     BuiltIn.Set_Suite_Variable    \${${name}}    ${value}
+
+Convert_To_Minutes
+    [Arguments]    ${time}
+    [Documentation]    Convert a Robot time string to an integer expressing the time in minutes, rounded up
+    ...    This is a wrapper around DateTime.Convert_Time which does not
+    ...    provide this functionality directly nor is even able to produce
+    ...    an integer directly. It is needed for RestPerfClient which
+    ...    cannot accept floats for its --timeout parameter and interprets
+    ...    the value supplied in this parameter in minutes.
+    ${seconds}=    DateTime.Convert_Time    ${time}    result_format=number
+    ${minutes}=    BuiltIn.Evaluate    int(math.ceil(${seconds}/60.0))    modules=math
+    [Return]    ${minutes}
index 284877c5cfeafd50a494157471d18628d14fad54..72e1714f5ea5c6870f3d66a1f11c795009929ff8 100644 (file)
@@ -119,11 +119,11 @@ Setup_Everything
     # Calculate timeouts
     ${value}=    BuiltIn.Evaluate    ${REQUEST_COUNT}/50+10
     Utils.Set_User_Configurable_Variable_Default    DIRECT_MDSAL_TIMEOUT    ${value} s
-    ${value}=    DateTime.Add_Time_To_Time    ${DIRECT_MDSAL_TIMEOUT}    60s    result_format=compact
+    ${value}=    DateTime.Add_Time_To_Time    ${DIRECT_MDSAL_TIMEOUT}    2m    result_format=compact
     Utils.Set_User_Configurable_Variable_Default    DIRECT_MDSAL_TIMEOUT_FOR_TESTCASE    ${value}
     ${value}=    BuiltIn.Evaluate    ${REQUEST_COUNT}/10+10
     Utils.Set_User_Configurable_Variable_Default    NETCONF_CONNECTOR_MDSAL_TIMEOUT    ${value} s
-    ${value}=    DateTime.Add_Time_To_Time    ${NETCONF_CONNECTOR_MDSAL_TIMEOUT}    60s    result_format=compact
+    ${value}=    DateTime.Add_Time_To_Time    ${NETCONF_CONNECTOR_MDSAL_TIMEOUT}    2m    result_format=compact
     Utils.Set_User_Configurable_Variable_Default    NETCONF_CONNECTOR_MDSAL_TIMEOUT_FOR_TESTCASE    ${value}
 
 Teardown_Everything
index 9e423416964385233d57d557ee1b183707876a9a..7bf765403592cab657e9f7c1dfd98df1b335bf94 100644 (file)
@@ -89,7 +89,7 @@ Setup_Everything
     # Calculate and set the value of the timeout
     ${value}=    BuiltIn.Evaluate    ${REQUEST_COUNT}/50+10
     Utils.Set_User_Configurable_Variable_Default    TESTTOOL_DEVICE_TIMEOUT    ${value} s
-    ${value}=    DateTime.Add_Time_To_Time    ${TESTTOOL_DEVICE_TIMEOUT}    60s    result_format=compact
+    ${value}=    DateTime.Add_Time_To_Time    ${TESTTOOL_DEVICE_TIMEOUT}    2m    result_format=compact
     Utils.Set_User_Configurable_Variable_Default    TESTTOOL_DEVICE_TIMEOUT_FOR_TESTCASE    ${value}
     # Setup resources used by the suite.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown