Update Robot Framework format - step 12
[integration/test.git] / csit / suites / openflowplugin / Maximum_Switches / 010__finding_max_switches.robot
1 *** Settings ***
2 Documentation       Test suite for finding out max number of switches
3
4 Library             OperatingSystem
5 Resource            ../../../variables/Variables.robot
6 Resource            ../../../libraries/WorkflowsOpenFlow.robot
7 Resource            ../../../libraries/KarafKeywords.robot
8
9 Suite Setup         Workflow Setup
10 Suite Teardown      Workflow Teardown
11
12
13 *** Variables ***
14 ${MIN_SWITCHES}             100
15 ${MAX_SWITCHES}             800
16 ${STEP_SWITCHES}            100
17 ${SWITCHES_RESULT_FILE}     switches.csv
18 ${TIME_RESULT_FILE}         time.csv
19
20
21 *** Test Cases ***
22 Find Max Switches
23     [Documentation]    Find max number of switches starting from ${MIN_SWITCHES} till reaching ${MAX_SWITCHES} in steps of ${STEP_SWITCHES}
24     ${error_message}=    Set Variable    Fail initializing suite
25     ${maximum_switches}=    Set Variable    ${0}
26     ${discover_time}=    Set Variable    0
27     ${start}=    Convert to Integer    ${MIN_SWITCHES}
28     ${stop}=    Convert to Integer    ${MAX_SWITCHES}
29     ${step}=    Convert to Integer    ${STEP_SWITCHES}
30     FOR    ${switches}    IN RANGE    ${start}    ${stop+1}    ${step}
31         ${status}    ${error_message}    ${topology_discover_time}=    WorkflowsOpenFlow.Workflow Linear Topology
32         ...    ${switches}
33         IF    '${status}' == 'FAIL'            BREAK
34         ${maximum_switches}=    Set variable    ${switches}
35         ${discover_time}=    Set Variable    ${topology_discover_time}
36     END
37     Log to console    ${\n}
38     Log To Console    Execution stopped because: ${error_message}
39     Log To Console    Max Switches: ${maximum_switches}
40     OperatingSystem.Append To File    ${SWITCHES_RESULT_FILE}    Max Switches\n
41     OperatingSystem.Append To File    ${SWITCHES_RESULT_FILE}    ${maximum_switches}\n
42     OperatingSystem.Append To File    ${TIME_RESULT_FILE}    Discover Time\n
43     OperatingSystem.Append To File    ${TIME_RESULT_FILE}    ${discover_time}\n