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