2 Documentation Cbench Latency and Throughput tests can be run from an external
4 ... If cbench is run with a medium number of switches or higher (e.g. 32+)
5 ... the normal openflow operations seem to break.
6 ... BUG: https://bugs.opendaylight.org/show_bug.cgi?id=2897
7 Suite Setup Cbench Suite Setup
8 Test Teardown Log Results As Zero If Cbench Timed Out
12 Resource ../../../libraries/Utils.robot
13 Resource ../../../libraries/KarafKeywords.robot
17 ${throughput_threshold} 30000
18 ${latency_threshold} 10000
20 ${duration_in_secs} 10
22 ${num_of_unique_macs} 100
26 ${cbench_system} ${TOOLS_SYSTEM_IP}
27 ${cbench_executable} /usr/local/bin/cbench
28 ${throughput_results_file} throughput.csv
29 ${latency_results_file} latency.csv
33 [Documentation] cbench executed in default latency mode. Test parameters have defaults, but can be overridden
34 ... on the pybot command line
36 [Timeout] ${test_timeout}
37 Log Cbench tests using ${loops} iterations of ${duration_in_secs} second tests. Switch Count: ${switch_count}. Unique MACS to cycle: ${num_of_unique_macs}
38 Run Cbench And Log Results -m ${duration_in_ms} -M ${num_of_unique_macs} -S ${switch_count} -l ${loops} -D ${start_delay} -p ${of_port} ${latency_threshold} ${latency_results_file}
39 # We have to give some time for the controller to recover. See bug 6176.
42 Cbench Throughput Test
43 [Documentation] cbench executed in throughput mode (-t). Test parameters have defaults, but can be overridden
44 ... on the pybot command line
46 [Timeout] ${test_timeout}
47 Log Cbench tests using ${loops} iterations of ${duration_in_secs} second tests. Switch Count: ${switch_count}. Unique MACS to cycle: ${num_of_unique_macs}
48 Run Cbench And Log Results -t -m ${duration_in_ms} -M ${num_of_unique_macs} -S ${switch_count} -l ${loops} -D ${start_delay} -p ${of_port} ${throughput_threshold} ${throughput_results_file}
49 # We have to give some time for the controller to recover. See bug 6176.
52 Rerun Latency Test To Check Bug 6176
53 [Documentation] cbench executed in latency mode to see if controller is healthy
55 [Timeout] ${test_timeout}
56 Log Cbench tests using ${loops} iterations of ${duration_in_secs} second tests. Switch Count: ${switch_count}. Unique MACS to cycle: ${num_of_unique_macs}
57 Run Cbench And Log Results -m ${duration_in_ms} -M ${num_of_unique_macs} -S ${switch_count} -l ${loops} -D ${start_delay} -p ${of_port} ${latency_threshold} bug.csv
58 # We have to give some time for the controller to recover. See bug 6176.
60 [Teardown] Report_Failure_Due_To_Bug 6176
63 Run Cbench And Log Results
64 [Arguments] ${cbench_args} ${average_threshold} ${output_filename}=results.csv
65 ##If the cbench command fails to return, the keyword to run it will time out. The test tear
66 ##down can catch this problem and log the results as zero. However, we need to know which
67 ##file to log to, so setting it as a suite variable here.
68 Set Suite Variable ${output_filename}
69 ${output}= Run Keyword If "${cbench_system}" == "localhost" Run ${cbench_executable} -c ${ODL_SYSTEM_IP} ${cbench_args}
70 ... ELSE Run Command On Remote System ${cbench_system} ${cbench_executable} -c ${ODL_SYSTEM_IP} ${cbench_args} prompt_timeout=${test_timeout} return_stdout=False
71 ... return_stderr=True
73 Should Contain ${output} RESULT
74 ${result_line}= Get Lines Containing String ${output} RESULT
75 @{results_list}= Split String ${result_line}
76 Log ${results_list[5]}
77 Log ${results_list[7]}
78 @{result_name_list}= Split String ${results_list[5]} /
79 @{result_value_list}= Split String ${results_list[7]} /
80 ${num_stats}= Get Length ${result_name_list}
81 FOR ${i} IN RANGE 0 ${num_stats}
82 Log ${result_name_list[${i}]} :: ${result_value_list[${i}]}
84 ${min}= Set Variable ${result_value_list[${0}]}
85 ${max}= Set Variable ${result_value_list[${1}]}
86 ${average}= Set Variable ${result_value_list[${2}]}
87 ${stdev}= Set Variable ${result_value_list[${3}]}
88 ${date}= Get Time d,m,s
89 Log CBench Result: ${date},${cbench_args},${min},${max},${average},${stdev}
90 Log Results And Determine Status ${min} ${max} ${average} ${average_threshold} ${output_filename}
93 Wait Until Keyword Succeeds 3x 1s KarafKeywords.Issue Command On Karaf Console log:set ${log_level}
94 Append To File ${latency_results_file} LATENCY_MIN,LATENCY_MAX,LATENCY_AVERAGE\n
95 Append To File ${throughput_results_file} THROUGHPUT_MIN,THROUGHPUT_MAX,THROUGHPUT_AVERAGE\n
96 ${duration_in_ms} Evaluate ${duration_in_secs} * 1000
97 Set Suite Variable ${duration_in_ms}
98 ##Setting the test timeout dynamically in case larger values on command line override default
99 ${test_timeout} Evaluate (${loops} * ${duration_in_secs}) * 1.5
100 Set Suite Variable ${test_timeout}
101 Run Keyword If "${cbench_system}" == "localhost" OperatingSystem.File Should Exist ${cbench_executable}
102 ... ELSE Verify File Exists On Remote System ${cbench_system} ${cbench_executable}
103 Should Be True ${loops} >= 2 If number of loops is less than 2, cbench will not run
104 Verify Feature Is Installed odl-openflowplugin-drop-test
105 Issue Command On Karaf Console dropallpacketsrpc on
107 Log Results And Determine Status
108 [Arguments] ${min} ${max} ${average} ${threshold} ${output_file}
109 Append To File ${output_file} ${min},${max},${average}\n
110 Should Be True ${average} > ${threshold} ${average} flow_mods per/sec did not exceed threshold of ${threshold}
112 Log Results As Zero If Cbench Timed Out
113 Run Keyword If Timeout Occurred Log Results And Determine Status 0 0 0 0 ${output_filename}