Remove OVSDB ping as it is not stable.
[integration/test.git] / test / csit / suites / base / 050__OVSDB_plugin.txt
1 *** Settings ***
2 Documentation     Test suite for OVSDB plugin
3 Suite Setup       Create Session   session   http://${CONTROLLER}:8080   auth=${AUTH}   headers=${HEADERS}
4 Suite Teardown    Delete All Sessions
5 Library           SSHLibrary
6 Library           Collections
7 Library           ../../libraries/RequestsLibrary.py
8 Library           ../../libraries/Common.py
9 Library           ../../libraries/Topology.py
10 Variables         ../../variables/Variables.py
11
12 *** Variables ***
13 ${key}             node
14 ${REST_CONTEXT_CM}    /controller/nb/v2/connectionmanager
15 ${REST_CONTEXT_BD}    /controller/nb/v2/networkconfig/bridgedomain
16
17 *** Test Cases ***
18 List connections
19     [Documentation]    Get node connections and validate result
20     [Tags]    Get
21     ${topo_nodes}    Get Nodes From Topology    ${TOPO_TREE_LEVEL}
22     ${resp}    Get    session    ${REST_CONTEXT_CM}/nodes
23     Should Be Equal As Strings   ${resp.status_code}   200
24     ${result}    To JSON    ${resp.content}
25     ${nodes}    Get From Dictionary    ${result}    ${key}
26     List Should Contain Sublist   ${nodes}    ${topo_nodes}
27 Connect to mininet
28     [Documentation]    Connect to mininet, list the nodes and validate result
29     [Tags]    add
30     ${body}   Create Dictionary   type   OVS   id   MININET
31     ${resp}   Put   session   ${REST_CONTEXT_CM}/node/MININET/address/${MININET}/port/6640
32     Should Be Equal As Strings   ${resp.status_code}   200
33     ${result}    To JSON    ${resp.content}
34     Dictionaries Should Be Equal    ${result}   ${body}
35     ${resp}    Get    session    ${REST_CONTEXT_CM}/nodes
36     Should Be Equal As Strings   ${resp.status_code}   200
37     ${result}    To JSON    ${resp.content}
38     ${content}    Get From Dictionary    ${result}    ${key}
39     List Should Contain Value    ${content}    ${body}
40     Sleep   2
41 Add bridge s4
42     [Documentation]    Add bridge s4
43     [Tags]    add
44     ${resp}    Post    session    ${REST_CONTEXT_BD}/bridge/OVS/MININET/s4  data={}
45     Should Be Equal As Strings    ${resp.status_code}    201
46 Delete s1 ports
47     [Documentation]    Delete s1 connected ports
48     [Tags]    delete
49     ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth1
50     Should Be Equal As Strings    ${resp.status_code}    200
51     ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth2
52     Should Be Equal As Strings    ${resp.status_code}    200
53     ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
54     Should Be Equal As Strings    ${resp.status_code}    200
55     ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
56     Should Be Equal As Strings    ${resp.status_code}    200
57 Add s4 ports 
58     [Documentation]    Add s4 connected ports
59     [Tags]    add
60     ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth1   
61     ...   data={"type":"patch", "CUSTOM":{"peer":"s2-eth3"}}
62     Should Be Equal As Strings    ${resp.status_code}    201
63     ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth2 
64     ...   data={"type":"patch", "CUSTOM":{"peer":"s3-eth3"}}
65     Should Be Equal As Strings    ${resp.status_code}    201
66     ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
67     ...   data={"type":"patch", "CUSTOM":{"peer":"s4-eth1"}}
68     Should Be Equal As Strings    ${resp.status_code}    201
69     ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
70     ...   data={"type":"patch", "CUSTOM":{"peer":"s4-eth2"}}
71     Should Be Equal As Strings    ${resp.status_code}    201
72 Remove flows
73     [Documentation]    Remove flows generated by simple fwd
74     [Tags]   Get
75     Write   dpctl del-flows
76     Sleep   1
77     Read
78 Delete s4 ports
79     [Documentation]    Delete s4 connected ports
80     [Tags]    delete
81     ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth1
82     Should Be Equal As Strings    ${resp.status_code}    200
83     ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth2
84     Should Be Equal As Strings    ${resp.status_code}    200
85     ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
86     Should Be Equal As Strings    ${resp.status_code}    200
87     ${resp}    Delete   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
88     Should Be Equal As Strings    ${resp.status_code}    200
89 Add s1 ports 
90     [Documentation]    Add s1 connected ports
91     [Tags]    add
92     ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth1
93     ...   data={"type":"patch", "CUSTOM":{"peer":"s2-eth3"}}
94     Should Be Equal As Strings    ${resp.status_code}    201
95     ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth2
96     ...   data={"type":"patch", "CUSTOM":{"peer":"s3-eth3"}}
97     Should Be Equal As Strings    ${resp.status_code}    201
98     ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
99     ...   data={"type":"patch", "CUSTOM":{"peer":"s1-eth1"}}
100     Should Be Equal As Strings    ${resp.status_code}    201
101     ${resp}   Post   session   ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
102     ...   data={"type":"patch", "CUSTOM":{"peer":"s1-eth2"}}
103     Should Be Equal As Strings    ${resp.status_code}    201
104 Delete bridge s4
105     [Documentation]    Delete bridge s4
106     [Tags]    Delete
107     ${resp}    Delete    session    ${REST_CONTEXT_BD}/bridge/OVS/MININET/s4
108     Should Be Equal As Strings    ${resp.status_code}    200
109 Disconnect mininet
110     [Documentation]    Disconnect mininet, list the nodes and validate result
111     [Tags]    delete
112     ${body}   Create Dictionary   type   OVS   id   MININET
113     ${resp}   Delete   session   ${REST_CONTEXT_CM}/node/OVS/MININET
114     Should Be Equal As Strings   ${resp.status_code}   200
115     ${resp}    Get    session    ${REST_CONTEXT_CM}/nodes
116     Should Be Equal As Strings   ${resp.status_code}   200
117     ${result}    To JSON    ${resp.content}
118     ${content}    Get From Dictionary    ${result}    ${key}
119     List Should Not Contain Value    ${content}    ${body}