Merge "TSDR HBase and H2 DataStore Integrations Test suites and following review...
authorLuis Gomez <ecelgp@gmail.com>
Tue, 5 May 2015 18:29:12 +0000 (18:29 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 5 May 2015 18:29:12 +0000 (18:29 +0000)
test/csit/libraries/Utils.txt
test/csit/suites/openflowplugin/Maximum_Switches/010__finding_max_switches.txt
test/csit/suites/openflowplugin/Performance/010_Cbench.robot
test/csit/testplans/openflowplugin-config-performance-lithium-redesign.txt [new file with mode: 0644]

index 73517c5a80c1f105851eb5de4029dcc79c42b758..f1a80d1fc1314297ff034d625a4952e616090bc9 100644 (file)
@@ -90,6 +90,11 @@ Check For Elements Not At URI
     : FOR    ${i}    IN    @{elements}
     \    Should Not Contain    ${resp.content}    ${i}
 
+Clean Mininet System
+    [Arguments]     ${mininet_system}=${MININET}
+    Run Command On Remote System    ${mininet_system}   sudo mn -c
+    Run Command On Remote System    ${mininet_system}   sudo ps -elf | egrep 'usr/local/bin/mn' | egrep python | awk '{print "sudo kill -9",$4}' | sh
+
 Extract Value From Content
     [Arguments]    ${content}    ${index}    ${strip}=nostrip
     [Documentation]    Will take the given response content and return the value at the given index as a string
index 21c13b7b64e2955858a14c24d5e88c175c7a4539..d3d3f71be47bad7c713ffaf623239805082a2ecd 100644 (file)
@@ -1,7 +1,7 @@
 *** Settings ***
 Documentation     Test suite for finding out max number of switches
 Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
-Suite Teardown    Delete All Sessions
+Suite Teardown    Scalability Suite Teardown
 Library           OperatingSystem
 Library           ../../../libraries/RequestsLibrary.py
 Variables         ../../../variables/Variables.py
@@ -20,3 +20,8 @@ Find Max Switches
     ${max-switches}    Find Max Switches    ${MIN_SWITCHES}    ${MAX_SWITCHES}    ${STEP_SWITCHES}
     Log    ${max-switches}
     Append To File    ${SWITCHES_RESULT_FILE}    ${max-switches}\n
+
+*** Keywords ***
+Scalability Suite Teardown
+    Delete All Sessions
+    Clean Mininet System
\ No newline at end of file
index 3146390261602ddf90975cf821adca2c226b5ef2..bad5e3390cf7ad0789ed8cb241b3b37e4a4bef3c 100644 (file)
@@ -5,6 +5,7 @@ Documentation     Cbench Latency and Throughput tests can be run from an externa
 ...                 the normal openflow operations seem to break.
 ...                 BUG:  https://bugs.opendaylight.org/show_bug.cgi?id=2897
 Suite Setup       Cbench Suite Setup
+Test Teardown     Log Results As Zero If Cbench Timed Out
 Force Tags        cbench
 Library           String
 Resource          ../../../libraries/Utils.txt
@@ -24,14 +25,6 @@ ${throughput_results_file}  throughput.csv
 ${latency_results_file}     latency.csv
 
 *** Testcases ***
-Cbench Throughput Test
-    [Documentation]     cbench executed in throughput mode (-t).  Test parameters have defaults, but can be overridden
-    ...     on the pybot command line
-    [Tags]  throughput
-    [Timeout]   ${test_timeout}
-    Log    Cbench tests using ${loops} iterations of ${duration_in_secs} second tests. Switch Count: ${switch_count}. Unique MACS to cycle: ${num_of_unique_macs}
-    Run Cbench And Log Results  -t -m ${duration_in_ms} -M ${num_of_unique_macs} -s ${switch_count} -l ${loops}     ${throughput_threshold}     ${throughput_results_file}
-
 Cbench Latency Test
     [Documentation]     cbench executed in default latency mode.  Test parameters have defaults, but can be overridden
     ...     on the pybot command line
@@ -40,10 +33,22 @@ Cbench Latency Test
     Log    Cbench tests using ${loops} iterations of ${duration_in_secs} second tests. Switch Count: ${switch_count}. Unique MACS to cycle: ${num_of_unique_macs}
     Run Cbench And Log Results  -m ${duration_in_ms} -M ${num_of_unique_macs} -s ${switch_count} -l ${loops}     ${latency_threshold}     ${latency_results_file}
 
+Cbench Throughput Test
+    [Documentation]     cbench executed in throughput mode (-t).  Test parameters have defaults, but can be overridden
+    ...     on the pybot command line
+    [Tags]  throughput
+    [Timeout]   ${test_timeout}
+    Log    Cbench tests using ${loops} iterations of ${duration_in_secs} second tests. Switch Count: ${switch_count}. Unique MACS to cycle: ${num_of_unique_macs}
+    Run Cbench And Log Results  -t -m ${duration_in_ms} -M ${num_of_unique_macs} -s ${switch_count} -l ${loops}     ${throughput_threshold}     ${throughput_results_file}
+
 *** Keywords ***
 Run Cbench And Log Results
     [Arguments]    ${cbench_args}    ${average_threshold}   ${output_filename}=results.csv
-    ${output}=  Run Command On Remote System    ${cbench_system}   ${cbench_executable} -c ${CONTROLLER} ${cbench_args}  prompt_timeout=${test_timeout}
+    ##If the cbench command fails to return, the keyword to run it will time out.  The test tear
+    ##down can catch this problem and log the results as zero.  However, we need to know which
+    ##file to log to, so setting it as a suite variable here.
+    Set Suite Variable    ${output_filename}
+    ${output}=    Run Command On Remote System    ${cbench_system}   ${cbench_executable} -c ${CONTROLLER} ${cbench_args}  prompt_timeout=${test_timeout}
     Log     ${output}
     Should Contain    ${output}    RESULT
     ${result_line}=    Get Lines Containing String    ${output}    RESULT
@@ -61,8 +66,7 @@ Run Cbench And Log Results
     ${stdev}=    Set Variable    ${result_value_list[${3}]}
     ${date}=    Get Time    d,m,s
     Log    CBench Result: ${date},${cbench_args},${min},${max},${average},${stdev}
-    Append To File    ${output_filename}    ${min},${max},${average}\n
-    Should Be True    ${average} > ${average_threshold}     ${average} flow_mods per/sec did not exceed threshold of ${average_threshold}
+    Log Results And Determine Status    ${min}    ${max}    ${average}    ${average_threshold}    ${output_filename}
 
 Cbench Suite Setup
     Append To File    ${latency_results_file}    LATENCY_MIN,LATENCY_MAX,LATENCY_AVERAGE\n
@@ -76,3 +80,11 @@ Cbench Suite Setup
     Should Be True  ${loops} >= 2   If number of loops is less than 2, cbench will not run
     Verify Feature Is Installed     odl-openflowplugin-drop-test
     Issue Command On Karaf Console  dropallpacketsrpc on
+
+Log Results And Determine Status
+    [Arguments]    ${min}    ${max}    ${average}   ${threshold}    ${output_file}
+    Append To File    ${output_file}    ${min},${max},${average}\n
+    Should Be True    ${average} > ${threshold}     ${average} flow_mods per/sec did not exceed threshold of ${threshold}
+
+Log Results As Zero If Cbench Timed Out
+    Run Keyword If Timeout Occurred    Log Results And Determine Status    0    0    0    0    ${output_filename}
\ No newline at end of file
diff --git a/test/csit/testplans/openflowplugin-config-performance-lithium-redesign.txt b/test/csit/testplans/openflowplugin-config-performance-lithium-redesign.txt
new file mode 100644 (file)
index 0000000..fd9f22e
--- /dev/null
@@ -0,0 +1,2 @@
+# Place the suites in run order:
+integration/test/csit/suites/openflowplugin/Performance_Flow_Config/010_Rest_Config_Flows.robot