Replace Bierman02 with RFC8040 for OpenFlow Plugin
[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       Utils.Start Mininet
4 Suite Teardown    Utils.Stop Mininet
5 Library           OperatingSystem
6 Library           XML
7 Library           Process
8 Library           RequestsLibrary
9 Variables         ../../../variables/Variables.py
10 Resource          ../../../libraries/Utils.robot
11 Resource          ../../../variables/openflowplugin/Variables.robot
12
13 *** Variables ***
14 ${switches}       25
15 ${flows}          2000
16 ${threads}        5
17 ${start}          sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo linear,${switches},1 --switch ovsk,protocols=OpenFlow13
18 ${PERFSCRIPT}     ${CURDIR}/../../../../tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_add_delete_test.py
19 ${PARSESCRIPT}    ${CURDIR}/../../../../tools/odl-mdsal-clustering-tests/clustering-performance-test/create_plot_data_files.py
20
21 *** Test Cases ***
22 Check Switches Connected
23     [Documentation]    Checks wheather switches are connected to controller.
24     [Setup]    Start Http Session
25     Wait Until Keyword Succeeds    5    1    Are Switches Connected    ${switches}
26     [Teardown]    Stop Http Session
27
28 Configure And Deconfigure Flows
29     [Documentation]    Runs the flow peformance script and the script that parses the results to csv file.
30     ${result}=    Process.Run Process    ${PERFSCRIPT}    --host    ${ODL_SYSTEM_IP}    --flows    ${flows}
31     ...    --threads    ${threads}    --auth    shell=yes
32     Log    ${result.stdout}
33     OperatingSystem.Create File    out.log.txt    content=${result.stdout}
34     Log    ${result.stderr}
35     Should Be Equal As Integers    ${result.rc}    0
36     ${result}=    Process.Run Process    python    ${PARSESCRIPT}
37
38 *** Keywords ***
39 Start Http Session
40     [Documentation]    Starts http session.
41     Log    http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
42     RequestsLibrary.Create Session    tcsession    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
43
44 Are Switches Connected
45     [Arguments]    ${switches}
46     [Documentation]    Checks Topology Contains a fix number ${switches} of switces.
47     ${resp}=    RequestsLibrary.Get Request    tcsession    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
48     Log    ${resp.content}
49     ${count}=    XML.Get Element Count    ${resp.content}    xpath=node
50     Should Be Equal As Numbers    ${count}    ${switches}
51
52 Stop Http Session
53     [Documentation]    Stops http session.
54     RequestsLibrary.Delete All Sessions