Allow the user to disable the global timeout logic 35/31335/14
authorJozef Behran <jbehran@cisco.com>
Mon, 14 Dec 2015 16:07:45 +0000 (17:07 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 14 Jan 2016 10:54:49 +0000 (10:54 +0000)
The global timeout logic is useful to not allow a test suite
to hang around in a periodic job for 2 weeks or something
like this. However when running the test suites manually. the
global timeout logic tends to be more of a nuisance than a
help, aborting the test suite prematurely, especially when
longer than normal actions are executed in the loops guarded
by the timeout logic.

This change allows the user to redefine a Robot variable
(ENABLE_NETCONF_TEST_TIMEOUT) to tell the suite to not
evaluate any global timeouts. By setting this variable the
user assumes the responsibility of deciding when the job is
running for too long and aborting it if that happens. This
allows the user to run the test suite with the lengthy
actions into completion without messing around with the
timeouts configured in it.

There is also a "global control" Robot variable added
(ENABLE_GLOBAL_TEST_DEADLINES} which disables all global
timeouts. The abovementioned variable disables only the
global deadline for the Netconf scaling tests.

Change-Id: I636379405f335fd45f93e0311afcbea18319778e
Signed-off-by: Jozef Behran <jbehran@cisco.com>
csit/libraries/NetconfKeywords.robot
csit/variables/Variables.py

index d9a838c23772ae10508fa85302cd18b3aaef16e5..8b46af6b0b3f750759cb2b63c3cc698a125be66c 100644 (file)
@@ -25,6 +25,7 @@ ${FIRST_TESTTOOL_PORT}    17830
 ${BASE_NETCONF_DEVICE_PORT}    17830
 ${DEVICE_NAME_BASE}    netconf-scaling-device
 ${TESTTOOL_DEVICE_TIMEOUT}    60s
+${ENABLE_NETCONF_TEST_TIMEOUT}    ${ENABLE_GLOBAL_TEST_DEADLINES}
 
 *** Keywords ***
 Setup_NetconfKeywords
@@ -166,11 +167,16 @@ Stop_Testtool
     # the log file to get.
     SSHLibrary.Get_File    testtool.log
 
-NetconfKeywords__Perform_Operation_With_Checking_On_Next_Device
-    [Arguments]    ${operation}    ${deadline_Date}
+NetconfKeywords__Check_Netconf_Test_Timeout_Not_Expired
+    [Arguments]    ${deadline_Date}
+    BuiltIn.Return_From_Keyword_If    not ${ENABLE_NETCONF_TEST_TIMEOUT}
     ${current_Date}=    DateTime.Get_Current_Date
     ${ellapsed_seconds}=    DateTime.Subtract_Date_From_Date    ${deadline_Date}    ${current_Date}
     BuiltIn.Run_Keyword_If    ${ellapsed_seconds}<0    Fail    The global time out period expired
+
+NetconfKeywords__Perform_Operation_With_Checking_On_Next_Device
+    [Arguments]    ${operation}    ${deadline_Date}
+    NetconfKeywords__Check_Netconf_Test_Timeout_Not_Expired    ${deadline_Date}
     ${number}=    BuiltIn.Evaluate    ${current_port}-${BASE_NETCONF_DEVICE_PORT}+1
     BuiltIn.Run_Keyword    ${operation}    ${DEVICE_NAME_BASE}-${number}
     ${next}=    BuiltIn.Evaluate    ${current_port}+1
index 9b3f6593aba9001aae778bf634bafe429999041d..adbf6f92a40b30beaceeb0af662fb5a6af78ed1f 100644 (file)
@@ -175,6 +175,9 @@ CONTROLLER_STOP_TIMEOUT = 120  # Max number of seconds test will wait for a cont
 TOPOLOGY_URL = 'network-topology:network-topology/topology'
 SEND_ACCEPT_XML_HEADERS = {'Content-Type': 'application/xml', 'Accept': 'application/xml'}
 
+# Test deadlines global control
+ENABLE_GLOBAL_TEST_DEADLINES = True
+
 # Deprecated old variables, to be removed once all tests that need them are
 # updated to use the new names.
 CONTROLLER = ODL_SYSTEM_IP