new statistic manager tests
[integration/test.git] / test / csit / suites / openflowplugin / Performance_Flow_Config / 020_Stats_Collection_Gauss.robot
1 *** Settings ***
2 Documentation     Suite checks if StatMngr is able to collect flows with gaussian spread over the switches and gaussian spread over tables within the switch
3 Suite Setup       Connect Switches
4 Suite Teardown    Stop Switches
5 Library           OperatingSystem
6 Library           Collections
7 Library           XML
8 Library           SSHLibrary
9 Variables         ../../../../csit/variables/Variables.py
10 Library           ../../../../csit/libraries/RequestsLibrary.py
11 Library           ../../../../csit/libraries/Common.py
12 Library           ../../../../csit/libraries/ScaleClient.py
13
14 *** Variables ***
15 ${swnr}           17
16 ${flnr}           17000
17 ${swspread}       gauss
18 ${tabspread}      gauss
19 ${topourl}        /restconf/operational/network-topology:network-topology/topology/flow:1
20 ${invurl}         /restconf/operational/opendaylight-inventory:nodes
21 @{cntls}          ${CONTROLLER}
22 ${linux_prompt}   >
23
24 *** Test Cases ***
25 Configure Flows
26     ${flows}    ${notes}=    Generate New Flow Details    flows=${flnr}    switches=${swnr}    swspread=${swspread}    tabspread=${tabspread}
27     Log    ${notes}
28     ${res}=    Configure Flows    flow_details=${flows}    controllers=@{cntls}    nrthreads=5
29     Log    ${res}
30     Set Suite Variable    ${flows}
31
32 Check Configured Are Operational
33     Wait Until Keyword Succeeds    110s    20s    Check Flows Inventory    ${flows}    ${CONTROLLER}
34
35 Deconfigure Flows
36     ${res}=    Deconfigure Flows    flow_details=${flows}    controllers=@{cntls}    nrthreads=5
37     Log    ${res}
38
39 Check No Flows In Operational
40     ${noflows}=    Create List
41     Wait Until Keyword Succeeds    110s    20s    Check Flows Inventory    ${noflows}    ${CONTROLLER}
42
43 *** Keywords ***
44 Connect Switches
45     [Documentation]    Starts mininet with requested number of switches (${swnr})
46     Log    Starting mininet with ${swnr} switches
47     Open Connection    ${MININET}    prompt=${linux_prompt}    timeout=600
48     Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
49     Write    sudo ovs-vsctl set-manager ptcp:6644
50     Write    sudo mn -c
51     Read Until    ${linux_prompt}
52     Write    sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
53     Read Until    mininet>
54     Sleep    10s
55     Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
56     Are Switches Connected Topo
57
58 Stop Switches
59     [Documentation]    Stops mininet
60     Log    Stopping mininet
61     Delete All Sessions
62     Read
63     Write    exit
64     Read Until    ${linux_prompt}
65     Close Connection
66
67 Are Switches Connected Topo
68     [Documentation]    Checks wheather switches are connected to controller
69     ${resp}=    Get    session    /restconf/operational/network-topology:network-topology/topology/flow:1    headers=${ACCEPT_XML}
70     Log    ${resp.content}
71     ${count}=    Get Element Count    ${resp.content}    xpath=node
72     Should Be Equal As Numbers    ${count}    ${swnr}
73
74 Check Flows Inventory
75     [Arguments]    ${fldets}    ${cntl}
76     ${res}=    Flow Stats Collected    flow_details=${fldets}    controller=${cntl}
77     Should Be True    ${res}