2 Documentation Beta Version of the Longevity Test. Currently:
3 ... 1. runs one iteration of the switch scale test based on ${NUM_SWITCHES}
4 ... 2. runs one iteration of the link scale test based on ${NUM_LINKS}
5 ... Steps 1 and 2 are run in a psuedo infinite loop and before each loop is
6 ... run, a time check is made against the ${TEST_LENGTH}. If the test duration
7 ... has expired, the loop is exited and the test is marked PASS
9 ... If either of steps 1 or 2 fail to reach their configured value of ${NUM_SWITCHES}
10 ... or ${NUM_LINKS} the test will exit immediately and not continue.
11 Suite Setup Longevity Suite Setup
12 Suite Teardown Longevity Suite Teardown
13 Library RequestsLibrary
15 Variables ../../../variables/Variables.py
16 Resource ../../../libraries/Scalability.robot
21 ${TEST_LENGTH} 2 hours
25 [Documentation] Uses switch and link scale test functionality in a loop for given period of time
26 # This loop is not infinite, so going "sufficiently large" for now.
27 : FOR ${i} IN RANGE 1 65536
28 \ ${expiration_flag}= Check If There Is A Reason To Exit Test Or If Duration Has Expired
29 \ Exit For Loop If "${expiration_flag}" == "True"
30 \ ${switch_count}= Find Max Switches ${NUM_SWITCHES} ${NUM_SWITCHES} ${NUM_SWITCHES}
31 \ Check If There Is A Reason To Exit Test Or If Duration Has Expired ${switch_count} ${NUM_SWITCHES} Switch count not correct
32 \ ${link_count}= Find Max Links ${NUM_LINKS} ${NUM_LINKS} ${NUM_LINKS}
33 \ Check If There Is A Reason To Exit Test Or If Duration Has Expired ${link_count} ${NUM_LINKS} Link count not correct
36 Check If There Is A Reason To Exit Test Or If Duration Has Expired
37 [Arguments] ${comparator1}=1 ${comparator2}=1 ${comparator_failure_message}=null
38 [Documentation] In order to simplify the main test case, this keyword will make all the neccessary checks
39 ... to determine if the test should FAIL and quit because of some problem. It will also return a bool to
40 ... indicate if the requested duration of the longevity test has elapsed. The caller does not have to use
41 ... that return value.
42 Should Be Equal ${comparator1} ${comparator2} ${comparator_failure_message}
43 Verify Controller Is Not Dead ${ODL_SYSTEM_IP}
44 ${is_expired}= Check If Test Duration Is Expired
45 [Return] ${is_expired}
47 Check If Test Duration Is Expired
48 [Documentation] Compares the current time with that of the suite variable ${end_time} to determine if the
49 ... test duration has expired.
50 ${test_is_expired}= Set Variable False
51 ${current_time}= Get Current Date
52 ${current_time}= Convert Date ${current_time} epoch
53 ${test_is_expired}= Set Variable If "${current_time}" > "${end_time}" True
54 [Return] ${test_is_expired}
57 [Documentation] In addtion to opening the REST session to the controller, the ${end_time} that this
58 ... test should not exceed is calculated and made in to a suite wide variable.
59 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
60 ${mininet_conn_id}= Open Connection ${TOOLS_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT}
61 Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
62 Log Copying ${CREATE_FULLYMESH_TOPOLOGY_FILE_PATH} file to Mininet VM
63 Put File ${CURDIR}/../../../${CREATE_FULLYMESH_TOPOLOGY_FILE_PATH}
65 ${start_time}= Get Current Date
66 ${end_time}= Add Time To Date ${start_time} ${TEST_LENGTH}
67 ${end_time}= Convert Date ${end_time} epoch
68 Set Suite Variable ${end_time}
70 Longevity Suite Teardown
71 [Documentation] Any cleanup neccessary to allow this test to be run in a static environment should go here
72 ... Currently, the same steps needed for the scalability suites should suffice.
73 Scalability Suite Teardown