Step 2: Move test folder to root
[integration/test.git] / csit / suites / openflowplugin / Flows_Additional_TCs / 020_Lithium_Rps_Calls_Cpqd.robot
1 *** Settings ***
2 Documentation     Test suite to test various rcp calls
3 Suite Setup       Initialization Phase
4 Suite Teardown    Final Phase
5 Library           XML
6 Library           RequestsLibrary
7 Library           SSHLibrary
8 Resource          ../../../libraries/Utils.robot
9 Variables         ../../../variables/ofplugin/RpcVariables.py
10
11 *** Variables ***
12 ${send_update_table_url}    /restconf/operations/sal-table:update-table
13 ${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch user
14
15 *** Test Cases ***
16 Sending Update Table
17     [Documentation]    Test to send table update request
18     ${resp}=    RequestsLibrary.Post    session    ${send_update_table_url}    data=${RPC_SEND_UPDATE_TABLE_DATA}    headers=${HEADERS_XML}
19     Log    ${resp.content}
20     Should Be Equal As Strings    ${resp.status_code}    200
21
22 *** Keywords ***
23 Initialization Phase
24     [Documentation]    Starts mininet and verify if topology is in operational ds
25     Start Suite
26     Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
27     Wait Until Keyword Succeeds    10s    1s    Are Switches Connected Topo
28
29 Final Phase
30     [Documentation]    Stops mininet
31     Stop Suite
32     Delete All Sessions
33
34 Are Switches Connected Topo
35     [Documentation]    Checks wheather switches are connected to controller
36     ${resp}=    RequestsLibrary.Get    session    ${OPERATIONAL_TOPO_API}/topology/flow:1    headers=${ACCEPT_XML}
37     Log    ${resp.content}
38     ${count}=    Get Element Count    ${resp.content}    xpath=node
39     Should Be Equal As Numbers    ${count}    1