OVSDB Southbound testsuites, Earlier vlan port command was missing
[integration/test.git] / test / csit / suites / ovsdb / Southbound_Domain / 030__configure_exit_ovsdb_node.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 ${BRIDGE}         br-s1
14 ${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${MININET}:${OVSDB_PORT}
15 ${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
16 @{node_list}      ${BRIDGE}    vx1
17
18 *** Test Cases ***
19 Create a Topology in OVSDB node
20     [Documentation]    Create topology in OVSDB and ready it for further tests
21     [Tags]    Southbound
22     Run Command On Remote System    ${MININET}    sudo ovs-vsctl del-manager
23     Run Command On Remote System    ${MININET}    sudo ovs-vsctl add-br ${BRIDGE}
24     Run Command On Remote System    ${MININET}    sudo ovs-vsctl add-port ${BRIDGE} vx1 -- set Interface vx1 type=vxlan options:remote_ip=192.168.1.11
25     Run Command On Remote System    ${MININET}    sudo ovs-vsctl set-manager ptcp:6644
26
27 Connect to OVSDB Node
28     [Documentation]    Initiate the connection to OVSDB node from controller
29     [Tags]    Southbound
30     ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
31     ${sample1}    Replace String    ${sample}    127.0.0.1    ${MININET}
32     ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
33     Log    URL is ${SOUTHBOUND_CONFIG_API}
34     ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}    data=${body}
35     Log    ${resp.content}
36     Should Be Equal As Strings    ${resp.status_code}    200
37
38 Get Operational Topology
39     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
40     [Tags]    Southbound
41     Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${node_list}
42
43 Get Config Topology without Bridge
44     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
45     [Tags]    Southbound
46     Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${CONFIG_TOPO_API}    ${node_list}
47
48 Create bridge of already added bridge
49     [Documentation]    This will add bridge to the config datastore
50     [Tags]    Southbound
51     ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_bridge.json
52     ${sample1}    Replace String    ${sample}    tcp:127.0.0.1:6633    tcp:${CONTROLLER}:6633
53     ${sample2}    Replace String    ${sample1}    127.0.0.1    ${MININET}
54     ${sample3}    Replace String    ${sample2}    br01    ${BRIDGE}
55     ${body}    Replace String    ${sample3}    61644    ${OVSDB_PORT}
56     Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
57     ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}    data=${body}
58     Log    ${resp.content}
59     Should Be Equal As Strings    ${resp.status_code}    200
60
61 Create Port of already added port in OVSDB
62     [Documentation]    This will add port/interface to the config datastore
63     [Tags]    Southbound
64     ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
65     ${sample1}    Replace String    ${sample}    vxlanport    vx1
66     ${body}    Replace String    ${sample1}    192.168.0.21    192.168.1.10
67     Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
68     ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/    data=${body}
69     Log    ${resp.content}
70     Should Be Equal As Strings    ${resp.status_code}    200
71
72 Get Config Topology with Bridge
73     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
74     [Tags]    Southbound
75     Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${CONFIG_TOPO_API}    ${node_list}
76
77 Modify the destination IP of Port
78     [Documentation]    This will modify the dst ip of existing port
79     [Tags]    Southbound
80     ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
81     ${sample1}    Replace String    ${sample}    vxlanport    vx1
82     ${body}    Replace String    ${sample1}    192.168.0.21    10.0.0.19
83     Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
84     ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/    data=${body}
85     Log    ${resp.content}
86     Should Be Equal As Strings    ${resp.status_code}    200
87
88 Create Port and attach to a Bridge
89     [Documentation]    This request will creates port/interface and attach it to the specific bridge
90     [Tags]    Southbound
91     ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
92     Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
93     ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/    data=${body}
94     Log    ${resp.content}
95     Should Be Equal As Strings    ${resp.status_code}    200
96
97 Get Operational Topology with Port
98     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
99     [Tags]    Southbound
100     @{list}    Create List    ${BRIDGE}    vxlanport    vx1    10.0.0.19
101     Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
102
103 Delete the Port1
104     [Documentation]    This request will delete the port node from the bridge node and data store.
105     [Tags]    Southbound
106     ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
107     Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
108
109 Delete the Port2
110     [Documentation]    This request will delete the port node from the bridge node and data store.
111     [Tags]    Southbound
112     ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
113     Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
114
115 Get Operational Topology after Deletion of Port
116     [Documentation]    This request will fetch the operational topology after the Port is deleted
117     [Tags]    Southbound
118     @{list}    Create List    vxlanport    vx1
119     Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
120
121 Delete the Bridge
122     [Documentation]    This request will delete the bridge node from the config data store.
123     [Tags]    Southbound
124     ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
125     Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
126
127 Get Operational Topology after Deletion of Bridge
128     [Documentation]    This request will fetch the operational topology after the Bridge is deleted
129     [Tags]    Southbound
130     @{list}    Create List    ${BRIDGE}    vxlanport    vx1
131     Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
132
133 Delete the OVSDB Node
134     [Documentation]    This request will delete the OVSDB node
135     [Tags]    Southbound
136     ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}
137     Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
138
139 Get Operational Topology after Deletion of OVSDB Node
140     [Documentation]    This request will fetch the operational topology after the OVSDB node is deleted
141     [Tags]    Southbound
142     @{list}    Create List    ovsdb://${MININET}:${OVSDB_PORT}    ${BRIDGE}    vxlanport    vx1
143     Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}