OVSDB Southbound TestSuites Updated
[integration/test.git] / test / csit / suites / ovsdb / Southbound_Domain / 010__connection_manager.robot
1 *** Settings ***
2 Documentation     Test suite for Connection Manager
3 Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
4 Suite Teardown    Delete All Sessions
5 Library           OperatingSystem
6 Library           String
7 Library           RequestsLibrary
8 Variables         ../../../variables/Variables.py
9 Resource          ../../../libraries/Utils.txt
10
11 *** Variables ***
12 ${OVSDB_PORT}     6644
13 ${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${MININET}:${OVSDB_PORT}
14 ${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
15 @{node_list}      ovsdb://${MININET}:${OVSDB_PORT}    ${MININET}    ${OVSDB_PORT}
16
17 *** Test Cases ***
18 Make the OVS instacne to listen for connection
19     [Tags]    Southbound
20     Run Command On Remote System    ${MININET}    sudo ovs-vsctl del-manager
21     Run Command On Remote System    ${MININET}    sudo ovs-vsctl set-manager ptcp:6644
22
23 Connect to OVSDB Node
24     [Documentation]    Initiate the connection to OVSDB node from controller
25     [Tags]    Southbound
26     ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
27     ${sample1}    Replace String    ${sample}    127.0.0.1    ${MININET}
28     ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
29     Log    URL is ${SOUTHBOUND_CONFIG_API}
30     ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}    data=${body}
31     Log    ${resp.content}
32     Should Be Equal As Strings    ${resp.status_code}    200
33
34 Get Config Topology
35     [Documentation]    This will fetch the configuration topology from configuration data store
36     [Tags]    Southbound
37     ${resp}    RequestsLibrary.Get    session    ${CONFIG_TOPO_API}
38     Log    ${resp.content}
39     Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
40     Should Contain    ${resp.content}    ${MININET}:${OVSDB_PORT}
41
42 Get Operational Topology
43     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
44     [Tags]    Southbound
45     Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${node_list}
46
47 Delete the OVSDB Node
48     [Documentation]    This request will delete the OVSDB node
49     [Tags]    Southbound
50     ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}
51     Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
52
53 Get Operational Topology after Deletion
54     [Documentation]    This request will fetch the operational topology after the OVSDB node is deleted
55     [Tags]    Southbound
56     Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${node_list}