From b58c0265063ef078bf281596ade751f5284e0fbd Mon Sep 17 00:00:00 2001 From: Jamo Luhrsen Date: Wed, 8 Apr 2015 16:36:29 -0700 Subject: [PATCH] Cbench test enhancements - logging average results to .csv file to hopefully use in jenkins plot plugin - SSHLibrary is now updated so "File Should Exist" keyword is now available Change-Id: I4033f9ee58491b35160aff9292e12b3049ab79b4 Signed-off-by: Jamo Luhrsen --- test/csit/libraries/KarafKeywords.txt | 6 ++++-- .../suites/openflowplugin/Performance/010_Cbench.txt | 11 ++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/test/csit/libraries/KarafKeywords.txt b/test/csit/libraries/KarafKeywords.txt index 5fd51e53..178f0d9a 100644 --- a/test/csit/libraries/KarafKeywords.txt +++ b/test/csit/libraries/KarafKeywords.txt @@ -12,14 +12,16 @@ ${karaf_password} karaf Verify Feature Is Installed [Documentation] Will Succeed if the given ${feature_name} is found in the output of "feature:list -i" [Arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${karaf_shell_port} - ${output}= Issue Command On Karaf Console feature:list -i ${controller} ${karaf_port} + ${output}= Issue Command On Karaf Console feature:list -i | grep ${feature_name} ${controller} ${karaf_port} Should Contain ${output} ${feature_name} + [Return] ${output} Verify Feature Is Not Installed [Documentation] Will Succeed if the given ${feature_name} is NOT found in the output of "feature:list -i" [Arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${karaf_shell_port} - ${output}= Issue Command On Karaf Console feature:list -i ${controller} ${karaf_port} + ${output}= Issue Command On Karaf Console feature:list -i | grep ${feature_name} ${controller} ${karaf_port} Should Not Contain ${output} ${feature_name} + [Return] ${output} Issue Command On Karaf Console [Documentation] Will execute the given ${cmd} by ssh'ing to the karaf console running on ${CONTROLLER} diff --git a/test/csit/suites/openflowplugin/Performance/010_Cbench.txt b/test/csit/suites/openflowplugin/Performance/010_Cbench.txt index 390bef13..08c36db8 100644 --- a/test/csit/suites/openflowplugin/Performance/010_Cbench.txt +++ b/test/csit/suites/openflowplugin/Performance/010_Cbench.txt @@ -28,7 +28,7 @@ Cbench Throughput Test [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} + Run Cbench And Log Results -t -m ${duration_in_ms} -M ${num_of_unique_macs} -s ${switch_count} -l ${loops} ${throughput_threshold} throughput.csv Cbench Latency Test [Documentation] cbench executed in default latency mode. Test parameters have defaults, but can be overridden @@ -36,11 +36,11 @@ Cbench Latency Test [Tags] latency [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 -m ${duration_in_ms} -M ${num_of_unique_macs} -s ${switch_count} -l ${loops} ${latency_threshold} + Run Cbench And Log Results -m ${duration_in_ms} -M ${num_of_unique_macs} -s ${switch_count} -l ${loops} ${latency_threshold} latency.csv *** Keywords *** Run Cbench And Log Results - [Arguments] ${cbench_args} ${average_threshold} + [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} Log ${output} Should Contain ${output} RESULT @@ -59,7 +59,8 @@ 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} - Should Be True ${average} > ${average_threshold} Flow mod per/sec threshold was not met + Append To File ${output_filename} ${average} + Should Be True ${average} > ${average_threshold} ${average} flow_mods per/sec did not exceed threshold of ${average_threshold} Cbench Suite Setup ${duration_in_ms} Evaluate ${duration_in_secs} * 1000 @@ -67,7 +68,7 @@ Cbench Suite Setup ##Setting the test timeout dynamically in case larger values on command line override default ${test_timeout} Evaluate (${loops} * ${duration_in_secs}) * 1.5 Set Suite Variable ${test_timeout} - #Verify File Exists On Remote System ${cbench_system} ${cbench_executable} + Verify File Exists On Remote System ${cbench_system} ${cbench_executable} 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 -- 2.36.6