Changing extension from .txt to .robot
[integration/test.git] / test / tools / odl-mdsal-clustering-tests / clustering-performance-test / of-perf.txt
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      ../../../../test/csit/variables/Variables.py
8 Library        ../../../../test/csit/libraries/RequestsLibrary.py
9 Library        ../../../../test/csit/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    ${CURDIR}/out.log.txt  content=${result.stdout}
28       Log           ${result.stderr}
29       Should Be Equal As Integers       ${result.rc}    0
30
31 *** Variables ***
32 ${switches}       10
33 ${flows}          1000
34 ${threads}        5
35 ${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${switches},1 --switch ovsk,protocols=OpenFlow13
36 ${PERFSCRIPT}     ${CURDIR}/flow_add_delete_test.py
37
38 *** Keywords ***
39 Start Suite
40     [Documentation]    Basic setup/cleanup work that can be done safely before any system
41     ...    is run.
42     Log    Start the test on the base edition
43     ${mininet_conn_id}=     Open Connection    ${MININET}    prompt=>    timeout=600s
44     Set Suite Variable  ${mininet_conn_id}
45     Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
46     Write    sudo ovs-vsctl set-manager ptcp:6644
47     Read Until    >
48     Write    sudo mn -c
49     Read Until    >
50     Read Until    >
51     Read Until    >
52     Write    ${start}
53     Read Until    mininet>
54     Sleep    6
55
56 Stop Suite
57     [Documentation]    Cleanup/Shutdown work that should be done at the completion of all
58     ...    tests
59     Log    Stop the test on the base edition
60     Switch Connection   ${mininet_conn_id}
61     Read
62     Write    exit
63     Read Until    >
64     Close Connection
65
66 Start Http Session
67     [Documentation]    Starts http session
68     Log   http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
69     Create Session   tcsession   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
70 Stop Http Session
71     [Documentation]    Stops http session
72     Delete All Sessions
73