Modify Longevity test to include only switch scalability test
authorLuis Gomez <ecelgp@gmail.com>
Thu, 9 Jul 2015 03:51:19 +0000 (20:51 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Sun, 12 Jul 2015 02:20:47 +0000 (02:20 +0000)
host scalability involves l2switch (not openflowplugin)

link scalability test is not stable yet

Change-Id: Ib55ff63aad1fe7d6c1cf73fa0974f458b27fe412
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
(cherry picked from commit 94f790d2334fa0cc56f12b876fc9b62278c40efa)

Change-Id: I9b014830bf49cd9731926d478c842c575f60caf7
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
test/csit/suites/openflowplugin/Longevity/010__longevity_switches.robot [new file with mode: 0644]
test/csit/suites/openflowplugin/Longevity/020__longevity_switches_links.robot [moved from test/csit/suites/openflowplugin/Longevity/010__longevity.txt with 81% similarity]
test/csit/testplans/openflowplugin-longevity.txt

diff --git a/test/csit/suites/openflowplugin/Longevity/010__longevity_switches.robot b/test/csit/suites/openflowplugin/Longevity/010__longevity_switches.robot
new file mode 100644 (file)
index 0000000..ea87cf6
--- /dev/null
@@ -0,0 +1,65 @@
+*** Settings ***
+Documentation     Beta Version of the Longevity Test.  Currently it does a single test:
+...               1.  runs one iteration of the switch scale test based on ${NUM_SWITCHES}
+...               Step 1 runs in a psuedo infinite loop and before each loop is
+...               run, a time check is made against the ${TEST_LENGTH}. If the test duration
+...               has expired, the loop is exited and the test is marked PASS
+...
+...               If step 1 fails to reach their configured value of ${NUM_SWITCHES}
+...               the test will exit immediately and not continue.
+Suite Setup       Longevity Suite Setup
+Suite Teardown    Longevity Suite Teardown
+Library           RequestsLibrary
+Library           DateTime
+Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Scalability.txt
+
+*** Variables ***
+${NUM_SWITCHES}           200
+${TEST_LENGTH}            2 hours
+
+
+*** Test Cases ***
+Longevity Test
+    [Documentation]    Uses switch scalability test functionality in a loop for given period of time
+    #  This loop is not infinite, so going "sufficiently large" for now.
+    : FOR  ${i}  IN RANGE    1    65536
+    \    ${expiration_flag}=    Check If There Is A Reason To Exit Test Or If Duration Has Expired
+    \    Exit For Loop If    "${expiration_flag}" == "True"
+    \    ${switch_count}=    Find Max Switches    ${NUM_SWITCHES}     ${NUM_SWITCHES}     ${NUM_SWITCHES}
+    \    Check If There Is A Reason To Exit Test Or If Duration Has Expired    ${switch_count}    ${NUM_SWITCHES}    Switch count not correct
+
+*** Keywords ***
+Check If There Is A Reason To Exit Test Or If Duration Has Expired
+    [Documentation]    In order to simplify the main test case, this keyword will make all the neccessary checks
+    ...    to determine if the test should FAIL and quit because of some problem.  It will also return a bool to
+    ...    indicate if the requested duration of the longevity test has elapsed.  The caller does not have to use
+    ...    that return value.
+    [Arguments]    ${comparator1}=1    ${comparator2}=1    ${comparator_failure_message}=null
+    Should Be Equal    ${comparator1}    ${comparator2}    ${comparator_failure_message}
+    Verify Controller Is Not Dead    ${CONTROLLER}
+    ${is_expired}=    Check If Test Duration Is Expired
+    [Return]    ${is_expired}
+
+Check If Test Duration Is Expired
+    [Documentation]    Compares the current time with that of the suite variable ${end_time} to determine if the
+    ...    test duration has expired.
+    ${test_is_expired}=  Set Variable    False
+    ${current_time}=    Get Current Date
+    ${current_time}=    Convert Date    ${current_time}    epoch
+    ${test_is_expired}=    Set Variable If    "${current_time}" > "${end_time}"    True
+    [Return]    ${test_is_expired}
+
+Longevity Suite Setup
+    [Documentation]    In addtion to opening the REST session to the controller, the ${end_time} that this
+    ...    test should not exceed is calculated and made in to a suite wide variable.
+    Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+    ${start_time}=    Get Current Date
+    ${end_time}=    Add Time To Date    ${start_time}    ${TEST_LENGTH}
+    ${end_time}=    Convert Date    ${end_time}    epoch
+    Set Suite Variable    ${end_time}
+
+Longevity Suite Teardown
+    [Documentation]    Any cleanup neccessary to allow this test to be run in a static environment should go here
+    ...    Currently, the same steps needed for the scalability suites should suffice.
+    Scalability Suite Teardown
similarity index 81%
rename from test/csit/suites/openflowplugin/Longevity/010__longevity.txt
rename to test/csit/suites/openflowplugin/Longevity/020__longevity_switches_links.robot
index 204b9b445414b66fb26035ecd013d38580ee5895..199bb8ec7801e30afeaf8e08b0e41eb9013e9ff1 100644 (file)
@@ -1,13 +1,13 @@
 *** Settings ***
 Documentation     Beta Version of the Longevity Test.  Currently:
 ...               1.  runs one iteration of the switch scale test based on ${NUM_SWITCHES}
 *** Settings ***
 Documentation     Beta Version of the Longevity Test.  Currently:
 ...               1.  runs one iteration of the switch scale test based on ${NUM_SWITCHES}
-...               2.  runs one iteration of the host scale test based on ${NUM_HOSTS}
+...               2.  runs one iteration of the link scale test based on ${NUM_LINKS}
 ...               Steps 1 and 2 are run in a psuedo infinite loop and before each loop is
 ...               run, a time check is made against the ${TEST_LENGTH}. If the test duration
 ...               has expired, the loop is exited and the test is marked PASS
 ...
 ...               If either of steps 1 or 2 fail to reach their configured value of ${NUM_SWITCHES}
 ...               Steps 1 and 2 are run in a psuedo infinite loop and before each loop is
 ...               run, a time check is made against the ${TEST_LENGTH}. If the test duration
 ...               has expired, the loop is exited and the test is marked PASS
 ...
 ...               If either of steps 1 or 2 fail to reach their configured value of ${NUM_SWITCHES}
-...               or ${NUM_HOSTS} the test will exit immediately and not continue.
+...               or ${NUM_LINKS} the test will exit immediately and not continue.
 Suite Setup       Longevity Suite Setup
 Suite Teardown    Longevity Suite Teardown
 Library           RequestsLibrary
 Suite Setup       Longevity Suite Setup
 Suite Teardown    Longevity Suite Teardown
 Library           RequestsLibrary
@@ -16,21 +16,22 @@ Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Scalability.txt
 
 *** Variables ***
 Resource          ../../../libraries/Scalability.txt
 
 *** Variables ***
-${NUM_SWITCHES}           50
-${NUM_HOSTS}              200
+${NUM_SWITCHES}           200
+${NUM_LINKS}              20
 ${TEST_LENGTH}            2 hours
 
 ${TEST_LENGTH}            2 hours
 
+
 *** Test Cases ***
 Longevity Test
 *** Test Cases ***
 Longevity Test
-    [Documentation]    Uses switch and host scale test functionality in a loop for given period of time
+    [Documentation]    Uses switch and link scale test functionality in a loop for given period of time
     #  This loop is not infinite, so going "sufficiently large" for now.
     : FOR  ${i}  IN RANGE    1    65536
     \    ${expiration_flag}=    Check If There Is A Reason To Exit Test Or If Duration Has Expired
     \    Exit For Loop If    "${expiration_flag}" == "True"
     \    ${switch_count}=    Find Max Switches    ${NUM_SWITCHES}     ${NUM_SWITCHES}     ${NUM_SWITCHES}
     \    Check If There Is A Reason To Exit Test Or If Duration Has Expired    ${switch_count}    ${NUM_SWITCHES}    Switch count not correct
     #  This loop is not infinite, so going "sufficiently large" for now.
     : FOR  ${i}  IN RANGE    1    65536
     \    ${expiration_flag}=    Check If There Is A Reason To Exit Test Or If Duration Has Expired
     \    Exit For Loop If    "${expiration_flag}" == "True"
     \    ${switch_count}=    Find Max Switches    ${NUM_SWITCHES}     ${NUM_SWITCHES}     ${NUM_SWITCHES}
     \    Check If There Is A Reason To Exit Test Or If Duration Has Expired    ${switch_count}    ${NUM_SWITCHES}    Switch count not correct
-    \    ${host_count}=    Find Max Hosts    ${NUM_HOSTS}    ${NUM_HOSTS}    ${NUM_HOSTS}
-    \    Check If There Is A Reason To Exit Test Or If Duration Has Expired    ${host_count}    ${NUM_HOSTS}    Host count not correct
+    \    ${link_count}=    Find Max Links    ${NUM_LINKS}    ${NUM_LINKS}    ${NUM_LINKS}
+    \    Check If There Is A Reason To Exit Test Or If Duration Has Expired    ${link_count}    ${NUM_LINKS}    Link count not correct
 
 *** Keywords ***
 Check If There Is A Reason To Exit Test Or If Duration Has Expired
 
 *** Keywords ***
 Check If There Is A Reason To Exit Test Or If Duration Has Expired
@@ -57,6 +58,11 @@ Longevity Suite Setup
     [Documentation]    In addtion to opening the REST session to the controller, the ${end_time} that this
     ...    test should not exceed is calculated and made in to a suite wide variable.
     Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
     [Documentation]    In addtion to opening the REST session to the controller, the ${end_time} that this
     ...    test should not exceed is calculated and made in to a suite wide variable.
     Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+    ${mininet_conn_id}=    Open Connection    ${MININET}    prompt=${linux_prompt}
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
+    Log     Copying ${CREATE_FULLYMESH_TOPOLOGY_FILE_PATH} file to Mininet VM
+    Put File  ${CURDIR}/../../../${CREATE_FULLYMESH_TOPOLOGY_FILE_PATH}
+    Close Connection
     ${start_time}=    Get Current Date
     ${end_time}=    Add Time To Date    ${start_time}    ${TEST_LENGTH}
     ${end_time}=    Convert Date    ${end_time}    epoch
     ${start_time}=    Get Current Date
     ${end_time}=    Add Time To Date    ${start_time}    ${TEST_LENGTH}
     ${end_time}=    Convert Date    ${end_time}    epoch
@@ -65,4 +71,4 @@ Longevity Suite Setup
 Longevity Suite Teardown
     [Documentation]    Any cleanup neccessary to allow this test to be run in a static environment should go here
     ...    Currently, the same steps needed for the scalability suites should suffice.
 Longevity Suite Teardown
     [Documentation]    Any cleanup neccessary to allow this test to be run in a static environment should go here
     ...    Currently, the same steps needed for the scalability suites should suffice.
-    Scalability Suite Teardown
\ No newline at end of file
+    Scalability Suite Teardown
index 8e1101b56ccf7b92149198ce05ad54c0c76505fa..d96444157809537f8f4db14f1f199e8ce4dcb4df 100644 (file)
@@ -1,2 +1,2 @@
 # Place the suites in run order:
 # Place the suites in run order:
-integration/test/csit/suites/openflowplugin/Longevity
+integration/test/csit/suites/openflowplugin/Longevity/010__longevity_switches.robot