Step 2: Move test folder to root
[integration/test.git] / tools / OF_Test / robot_suites / 998__Independent_OF_Tests_ovs / 010__Connect_256_Switches.txt
1 *** Settings ***
2 Documentation     Test suite with connection of multiple switches
3 Library        OperatingSystem
4 Library        Collections
5 Library        XML
6 Library        SSHLibrary
7 Variables      ../../../../csit/variables/Variables.py
8 Library        RequestsLibrary
9 Library        ../../../../csit/libraries/Common.py
10
11 *** Test Cases ***
12 Are 256 Switches Connected
13       [Setup]      Start Mininet   256
14       [Teardown]   Stop Mininet
15       [Documentation]   Checks wheather switches are connected to controller
16       ${resp}=   RequestsLibrary.Get   session     /restconf/operational/network-topology:network-topology/topology/flow:1    headers=${ACCEPT_XML}
17       Log    ${resp.content}
18       ${count}=   Get Element Count   ${resp.content}   xpath=node
19       Should Be Equal As Numbers    ${count}    256
20
21 *** Keywords ***
22 Start Mininet   [Arguments]   ${swnr}
23       [Documentation]    Starts mininet with requested number of switches (${swnr})
24       Log    Starting mininet with ${swnr} switches
25       Open Connection   ${MININET}   prompt=>     timeout=600
26       Login With Public Key   ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any
27       Write   sudo ovs-vsctl set-manager ptcp:6644
28       Write   sudo mn -c
29       Read Until   >
30       Write    sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
31       Read Until   mininet>
32       Sleep     3s
33       Create Session   session   http://${CONTROLLER}:${PORT}   auth=${AUTH}   headers=${HEADERS_XML}
34 Stop Mininet
35     [Documentation]    Stops mininet 
36     Log    Stopping mininet
37     Delete All Sessions
38     Read
39     Write   exit
40     Read Until    >
41     Close Connection