Can't use SSHLibrary.File Should Exist right now :(
[integration/test.git] / test / csit / suites / openflowplugin / Performance / 010_Cbench.txt
1 *** Settings ***
2 Documentation     Cbench Latency and Throughput tests can be run from an external
3 ...                 cbench.
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 Force Tags        cbench
9 Library           String
10 Resource          ../../../libraries/Utils.txt
11 Resource          ../../../libraries/KarafKeywords.txt
12
13
14 *** Variables ***
15 ${throughput_threshold}     30000
16 ${latency_threshold}        10000
17 ${switch_count}             8
18 ${duration_in_secs}         12
19 ${loops}                    10
20 ${num_of_unique_macs}       10000
21 ${cbench_system}            ${MININET}
22 ${cbench_executable}        /usr/local/bin/cbench
23
24 *** Testcases ***
25 Cbench Throughput Test
26     [Documentation]     cbench executed in throughput mode (-t).  Test parameters have defaults, but can be overridden
27     ...     on the pybot command line
28     [Tags]  throughput
29     [Timeout]   ${test_timeout}
30     Log    Cbench tests using ${loops} iterations of ${duration_in_secs} second tests. Switch Count: ${switch_count}. Unique MACS to cycle: ${num_of_unique_macs}
31     Run Cbench And Log Results  -t -m ${duration_in_ms} -M ${num_of_unique_macs} -s ${switch_count} -l ${loops}     ${throughput_threshold}
32
33 Cbench Latency Test
34     [Documentation]     cbench executed in default latency mode.  Test parameters have defaults, but can be overridden
35     ...     on the pybot command line
36     [Tags]  latency
37     [Timeout]   ${test_timeout}
38     Log    Cbench tests using ${loops} iterations of ${duration_in_secs} second tests. Switch Count: ${switch_count}. Unique MACS to cycle: ${num_of_unique_macs}
39     Run Cbench And Log Results  -m ${duration_in_ms} -M ${num_of_unique_macs} -s ${switch_count} -l ${loops}     ${latency_threshold}
40
41 *** Keywords ***
42 Run Cbench And Log Results
43     [Arguments]    ${cbench_args}    ${average_threshold}
44     ${output}=  Run Command On Remote System    ${cbench_system}   ${cbench_executable} -c ${CONTROLLER} ${cbench_args}  prompt_timeout=${test_timeout}
45     Log     ${output}
46     Should Contain    ${output}    RESULT
47     ${result_line}=    Get Lines Containing String    ${output}    RESULT
48     @{results_list}=    Split String    ${result_line}
49     Log    ${results_list[5]}
50     Log    ${results_list[7]}
51     @{result_name_list}=    Split String    ${results_list[5]}    /
52     @{result_value_list}=    Split String    ${results_list[7]}    /
53     ${num_stats}=    Get Length    ${result_name_list}
54     : FOR    ${i}    IN RANGE    0    ${num_stats}
55     \    Log    ${result_name_list[${i}]} :: ${result_value_list[${i}]}
56     ${min}=    Set Variable    ${result_value_list[${0}]}
57     ${max}=    Set Variable    ${result_value_list[${1}]}
58     ${average}=    Set Variable    ${result_value_list[${2}]}
59     ${stdev}=    Set Variable    ${result_value_list[${3}]}
60     ${date}=    Get Time    d,m,s
61     Log    CBench Result: ${date},${cbench_args},${min},${max},${average},${stdev}
62     Should Be True    ${average} > ${average_threshold}     Flow mod per/sec threshold was not met
63
64 Cbench Suite Setup
65     ${duration_in_ms}           Evaluate    ${duration_in_secs} * 1000
66     Set Suite Variable  ${duration_in_ms}
67     ##Setting the test timeout dynamically in case larger values on command line override default
68     ${test_timeout}             Evaluate    (${loops} * ${duration_in_secs}) * 1.5
69     Set Suite Variable  ${test_timeout}
70     #Verify File Exists On Remote System     ${cbench_system}    ${cbench_executable}
71     Should Be True  ${loops} >= 2   If number of loops is less than 2, cbench will not run
72     Verify Feature Is Installed     odl-openflowplugin-drop-test
73     Issue Command On Karaf Console  dropallpacketsrpc on