2 Documentation Beta Version of the Longevity Test. Currently it does a single test:
3 ... 1. runs one iteration of the switch scale test based on ${NUM_SWITCHES}
4 ... Step 1 runs in a psuedo infinite loop and before each loop is
5 ... run, a time check is made against the ${TEST_LENGTH}. If the test duration
6 ... has expired, the loop is exited and the test is marked PASS
8 ... If step 1 fails to reach their configured value of ${NUM_SWITCHES}
9 ... the test will exit immediately and not continue.
10 Suite Setup Longevity Suite Setup
11 Suite Teardown Longevity Suite Teardown
12 Library RequestsLibrary
14 Variables ../../../variables/Variables.py
15 Resource ../../../libraries/Scalability.robot
19 ${TEST_LENGTH} 2 hours
23 [Documentation] Uses switch scalability test functionality in a loop for given period of time
24 # This loop is not infinite, so going "sufficiently large" for now.
25 : FOR ${i} IN RANGE 1 65536
26 \ ${expiration_flag}= Check If There Is A Reason To Exit Test Or If Duration Has Expired
27 \ Exit For Loop If "${expiration_flag}" == "True"
28 \ ${switch_count}= Find Max Switches ${NUM_SWITCHES} ${NUM_SWITCHES} ${NUM_SWITCHES}
29 \ Check If There Is A Reason To Exit Test Or If Duration Has Expired ${switch_count} ${NUM_SWITCHES} Switch count not correct
32 Check If There Is A Reason To Exit Test Or If Duration Has Expired
33 [Arguments] ${comparator1}=1 ${comparator2}=1 ${comparator_failure_message}=null
34 [Documentation] In order to simplify the main test case, this keyword will make all the neccessary checks
35 ... to determine if the test should FAIL and quit because of some problem. It will also return a bool to
36 ... indicate if the requested duration of the longevity test has elapsed. The caller does not have to use
37 ... that return value.
38 Should Be Equal ${comparator1} ${comparator2} ${comparator_failure_message}
39 Verify Controller Is Not Dead ${ODL_SYSTEM_IP}
40 Verify Controller Has No Null Pointer Exceptions ${ODL_SYSTEM_IP}
41 ${is_expired}= Check If Test Duration Is Expired
42 [Return] ${is_expired}
44 Check If Test Duration Is Expired
45 [Documentation] Compares the current time with that of the suite variable ${end_time} to determine if the
46 ... test duration has expired.
47 ${test_is_expired}= Set Variable False
48 ${current_time}= Get Current Date
49 ${current_time}= Convert Date ${current_time} epoch
50 ${test_is_expired}= Set Variable If "${current_time}" > "${end_time}" True
51 [Return] ${test_is_expired}
54 [Documentation] In addtion to opening the REST session to the controller, the ${end_time} that this
55 ... test should not exceed is calculated and made in to a suite wide variable.
56 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
57 ${start_time}= Get Current Date
58 ${end_time}= Add Time To Date ${start_time} ${TEST_LENGTH}
59 ${end_time}= Convert Date ${end_time} epoch
60 Set Suite Variable ${end_time}
62 Longevity Suite Teardown
63 [Documentation] Any cleanup neccessary to allow this test to be run in a static environment should go here
64 ... Currently, the same steps needed for the scalability suites should suffice.
65 Scalability Suite Teardown