Replace deprecated variables in suites/openflowplugin (2).
[integration/test.git] / csit / suites / openflowplugin / Performance_Flow_Config / 010_Rest_Config_Flows.robot
1 *** Settings ***
2 Documentation     Test suite with connection of multiple switches
3 Suite Setup       Start Suite
4 Suite Teardown    Stop Suite
5 Library           OperatingSystem
6 Library           Collections
7 Library           XML
8 Library           Process
9 Variables         ../../../variables/Variables.py
10 Library           RequestsLibrary
11 Library           ../../../libraries/Common.py
12 Library           SSHLibrary
13
14 *** Variables ***
15 ${switches}       25
16 ${flows}          2000
17 ${threads}        5
18 ${start}          sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo linear,${switches},1 --switch ovsk,protocols=OpenFlow13
19 ${PERFSCRIPT}     ${CURDIR}/../../../../tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_add_delete_test.py
20 ${PARSESCRIPT}    ${CURDIR}/../../../../tools/odl-mdsal-clustering-tests/clustering-performance-test/create_plot_data_files.py
21
22 *** Test Cases ***
23 Are Switches Connected
24     [Documentation]    Checks wheather switches are connected to controller
25     [Setup]    Start Http Session
26     ${resp}=    Get    tcsession    /restconf/operational/network-topology:network-topology/topology/flow:1    headers=${ACCEPT_XML}
27     Log    ${resp.content}
28     ${count}=    Get Element Count    ${resp.content}    xpath=node
29     Should Be Equal As Numbers    ${count}    ${switches}
30     [Teardown]    Stop Http Session
31
32 Configure And Deconfigure Flows
33     ${result}=    Run Process    ${PERFSCRIPT}    --host    ${ODL_SYSTEM_IP}    --flows    ${flows}
34     ...    --threads    ${threads}    --auth    shell=yes
35     Log    ${result.stdout}
36     Create File    out.log.txt    content=${result.stdout}
37     Log    ${result.stderr}
38     Should Be Equal As Integers    ${result.rc}    0
39     ${result}=    Run Process    python    ${PARSESCRIPT}
40
41 *** Keywords ***
42 Start Suite
43     [Documentation]    Basic setup/cleanup work that can be done safely before any system
44     ...    is run.
45     Log    Start the test on the base edition
46     ${mininet_conn_id}=    Open Connection    ${TOOLS_SYSTEM_IP}    prompt=>    timeout=600s
47     Set Suite Variable    ${mininet_conn_id}
48     Login With Public Key    ${TOOLS_SYSTEM_USER}    ${USER_HOME}/.ssh/${SSH_KEY}    any
49     Write    sudo ovs-vsctl set-manager ptcp:6644
50     Read Until    >
51     Write    sudo mn -c
52     Read Until    >
53     Read Until    >
54     Read Until    >
55     Write    ${start}
56     Read Until    mininet>
57     Sleep    6
58
59 Stop Suite
60     [Documentation]    Cleanup/Shutdown work that should be done at the completion of all
61     ...    tests
62     Log    Stop the test on the base edition
63     Switch Connection    ${mininet_conn_id}
64     Read
65     Write    exit
66     Read Until    >
67     Close Connection
68
69 Start Http Session
70     [Documentation]    Starts http session
71     Log    http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
72     Create Session    tcsession    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
73
74 Stop Http Session
75     [Documentation]    Stops http session
76     Delete All Sessions