Add missing timeout to the test tool device performance test 42/36542/4
authorJozef Behran <jbehran@cisco.com>
Tue, 22 Mar 2016 09:55:39 +0000 (10:55 +0100)
committerJozef Behran <jbehran@cisco.com>
Tue, 22 Mar 2016 16:21:32 +0000 (17:21 +0100)
The RestPerfClient on testtool device test suite was missing
a timeout setting. This would lead to suite hangs when this
scenario would trigger a "poor Netconf connector performance"
bug (see bug 5581 for an example) or spurious successes.

Change-Id: Ibf1c1843a86de12e11a4012c4209a36c0f0997e6
Signed-off-by: Jozef Behran <jbehran@cisco.com>
csit/suites/netconf/restperfclient/performance.robot

index 5fc2c01ee21e5bc2cf43b69577180a8192f1e89d..7c24c8ddf5c817a7153cb26ef55cd84357346392 100644 (file)
@@ -59,6 +59,7 @@ Create_Device_Data
 
 Deploy_And_Run_RestPerfClient
     [Documentation]    Deploy and execute restperfclient, asking it to send the specified amount of requests to the netconf connector of the device.
 
 Deploy_And_Run_RestPerfClient
     [Documentation]    Deploy and execute restperfclient, asking it to send the specified amount of requests to the netconf connector of the device.
+    [Timeout]    ${TESTTOOL_DEVICE_TIMEOUT_FOR_TESTCASE}
     SSHLibrary.Switch_Connection    ${restperfclient}
     SSHLibrary.Put_File    ${CURDIR}/../../../variables/netconf/RestPerfClient/request1.json
     ${filename}=    NexusKeywords.Deploy_Test_Tool    netconf    netconf-testtool    rest-perf-client
     SSHLibrary.Switch_Connection    ${restperfclient}
     SSHLibrary.Put_File    ${CURDIR}/../../../variables/netconf/RestPerfClient/request1.json
     ${filename}=    NexusKeywords.Deploy_Test_Tool    netconf    netconf-testtool    rest-perf-client
@@ -82,6 +83,8 @@ Check_For_Failed_Requests
     ...    This is a separate test case to distinguish between restperfclient
     ...    failure and failed requests. Failed requests are rejected because
     ...    we don't want to test performance of ODL rejecting our requests.
     ...    This is a separate test case to distinguish between restperfclient
     ...    failure and failed requests. Failed requests are rejected because
     ...    we don't want to test performance of ODL rejecting our requests.
+    ${result}=    SSHLibrary.Execute_Command    grep "thread timed out" ${restperfclientlog}
+    BuiltIn.Should_Be_Equal    '${result}'    ''
     ${result}=    SSHLibrary.Execute_Command    grep "Request failed" ${restperfclientlog}
     BuiltIn.Should_Be_Equal    '${result}'    ''
     ${result}=    SSHLibrary.Execute_Command    grep "Status code" ${restperfclientlog}
     ${result}=    SSHLibrary.Execute_Command    grep "Request failed" ${restperfclientlog}
     BuiltIn.Should_Be_Equal    '${result}'    ''
     ${result}=    SSHLibrary.Execute_Command    grep "Status code" ${restperfclientlog}
@@ -95,6 +98,11 @@ Deconfigure_Device_From_Netconf
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup everything needed for the test cases.
 *** Keywords ***
 Setup_Everything
     [Documentation]    Setup everything needed for the test cases.
+    # 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
+    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
     NetconfKeywords.Setup_Netconf_Keywords
     # Setup resources used by the suite.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     NetconfKeywords.Setup_Netconf_Keywords