0a1f4a4a9e24f075f62ffc7ee369e5f2b1a8e36f
[integration/test.git] / csit / suites / ovsdb / Southbound_Cluster / 010__Ovsdb_Southbound_Cluster.robot
1 *** Settings ***
2 Documentation       Test suite for Ovsdb Southbound Cluster - Owner failover and recover
3
4 Library             Collections
5 Library             RequestsLibrary
6 Resource            ../../../libraries/ClusterManagement.robot
7 Resource            ../../../libraries/ClusterOvsdb.robot
8 Resource            ../../../libraries/SetupUtils.robot
9 Resource            ../../../variables/Variables.robot
10
11 Suite Setup         Suite Setup
12 Suite Teardown      Delete All Sessions
13 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
14
15
16 *** Test Cases ***
17 Check Shards Status Before Fail
18     [Documentation]    Check Status for all shards in Ovsdb application.
19     ClusterOvsdb.Check Ovsdb Shards Status
20
21 Start OVS Multiple Connections
22     [Documentation]    Connect OVS to all cluster instances.
23     ${ovsdb_uuid} =    OVSDB.Add Multiple Managers to OVS
24     Set Suite Variable    ${ovsdb_uuid}
25
26 Check Entity Owner Status And Find Owner and Candidate Before Fail
27     [Documentation]    Check Entity Owner Status and identify owner and candidate.
28     ${original_owner}    ${original_candidate_list} =    ClusterOvsdb.Get Ovsdb Entity Owner Status For One Device
29     ...    ovsdb://uuid/${ovsdb_uuid}
30     ...    1
31     ${original_candidate} =    Collections.Get From List    ${original_candidate_list}    0
32     BuiltIn.Set Suite Variable    ${original_owner}
33     BuiltIn.Set Suite Variable    ${original_candidate_list}
34     BuiltIn.Set Suite Variable    ${original_candidate}
35
36 Create Bridge Manually and Verify Before Fail
37     [Documentation]    Create bridge with OVS command and verify it gets applied from all instances.
38     ClusterOvsdb.Create Sample Bridge Manually And Verify
39
40 Add Port Manually and Verify Before Fail
41     [Documentation]    Add port with OVS command and verify it gets applied from all instances.
42     ClusterOvsdb.Add Sample Port To The Manual Bridge And Verify
43
44 Create Tap Device Before Fail
45     [Documentation]    Create tap devices to add to the bridge in ovs
46     ClusterOvsdb.Create Sample Tap Device
47
48 Add Tap Device Manually and Verify Before Fail
49     [Documentation]    Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
50     ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify
51
52 Delete the Bridge Manually and Verify Before Fail
53     [Documentation]    Delete bridge with OVS command and verify it gets deleted from all instances.
54     ClusterOvsdb.Delete Sample Bridge Manually And Verify
55
56 Create Bridge In Owner and Verify Before Fail
57     [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
58     ClusterOvsdb.Create Sample Bridge And Verify    ${original_owner}
59
60 Create Port In Owner and Verify Before Fail
61     [Documentation]    Create Port in Owner and verify it gets applied from all instances.
62     ClusterOvsdb.Create Sample Port And Verify    ${original_owner}
63
64 Modify the destination IP of Port In Owner Before Fail
65     [Documentation]    Modify the dst ip of existing port in Owner.
66     ClusterOvsdb.Modify the destination IP of Sample Port    ${original_owner}
67
68 Verify Port Is Modified Before Fail
69     [Documentation]    Verify port is modified in all instances.
70     ClusterOvsdb.Verify Sample Port Is Modified
71
72 Delete Port In Owner Before Fail
73     [Documentation]    Delete port in Owner and verify it gets deleted from all instances.
74     ClusterOvsdb.Delete Sample Port And Verify    ${original_owner}
75
76 Delete Bridge In Owner And Verify Before Fail
77     [Documentation]    Delete bridge in Owner and verify it gets deleted from all instances.
78     ClusterOvsdb.Delete Sample Bridge And Verify    ${original_owner}
79
80 Kill Owner Instance
81     [Documentation]    Kill Owner Instance and verify it is dead
82     ClusterManagement.Kill Single Member    ${original_owner}
83     BuiltIn.Set Suite Variable    ${new_cluster_list}    ${original_candidate_list}
84
85 Check Shards Status After Fail
86     [Documentation]    Create original cluster list and check Status for all shards in Ovsdb application.
87     ClusterOvsdb.Check Ovsdb Shards Status After Cluster Event    ${new_cluster_list}
88
89 Check Entity Owner Status And Find Owner and Candidate After Fail
90     [Documentation]    Check Entity Owner Status and identify owner and candidate.
91     ${new_owner}    ${new_candidate_list} =    ClusterOvsdb.Get Ovsdb Entity Owner Status For One Device
92     ...    ovsdb://uuid/${ovsdb_uuid}
93     ...    ${original_candidate}
94     ...    ${new_cluster_list}
95     ${new_candidate} =    Collections.Get From List    ${new_candidate_list}    0
96     BuiltIn.Set Suite Variable    ${new_owner}
97     BuiltIn.Set Suite Variable    ${new_candidate}
98
99 Create Bridge Manually and Verify After Fail
100     [Documentation]    Create bridge with OVS command and verify it gets applied from all instances.
101     ClusterOvsdb.Create Sample Bridge Manually And Verify    controller_index_list=${new_cluster_list}
102
103 Add Port Manually and Verify After Fail
104     [Documentation]    Add port with OVS command and verify it gets applied from all instances.
105     ClusterOvsdb.Add Sample Port To The Manual Bridge And Verify    controller_index_list=${new_cluster_list}
106
107 Create Tap Device After Fail
108     [Documentation]    Create tap devices to add to the bridge in ovs
109     ClusterOvsdb.Create Sample Tap Device
110
111 Add Tap Device Manually and Verify After Fail
112     [Documentation]    Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
113     ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify    controller_index_list=${new_cluster_list}
114
115 Delete the Bridge Manually and Verify After Fail
116     [Documentation]    Delete bridge with OVS command and verify it gets deleted from all instances.
117     ClusterOvsdb.Delete Sample Bridge Manually And Verify    controller_index_list=${new_cluster_list}
118
119 Create Bridge In Owner and Verify After Fail
120     [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
121     ClusterOvsdb.Create Sample Bridge And Verify    ${new_owner}    ${new_cluster_list}
122
123 Create Port In Owner and Verify After Fail
124     [Documentation]    Create Port in Owner and verify it gets applied from all instances.
125     ClusterOvsdb.Create Sample Port And Verify    ${new_owner}    ${new_cluster_list}
126
127 Modify the destination IP of Port In Owner After Fail
128     [Documentation]    Modify the dst ip of existing port in Owner.
129     ClusterOvsdb.Modify the destination IP of Sample Port    ${new_owner}    ${new_cluster_list}
130
131 Verify Port Is Modified After Fail
132     [Documentation]    Verify port is modified in all instances.
133     ClusterOvsdb.Verify Sample Port Is Modified    ${new_cluster_list}
134
135 Start Old Owner Instance
136     [Documentation]    Start Owner Instance and verify it is active
137     ClusterManagement.Start Single Member    ${original_owner}
138
139 Check Shards Status After Recover
140     [Documentation]    Create original cluster list and check Status for all shards in Ovsdb application.
141     ClusterOvsdb.Check Ovsdb Shards Status After Cluster Event
142
143 Check Entity Owner Status After Recover
144     [Documentation]    Check Entity Owner Status and identify owner and candidate.
145     ${new_owner}    ${new_candidate_list} =    ClusterOvsdb.Get Ovsdb Entity Owner Status For One Device
146     ...    ovsdb://uuid/${ovsdb_uuid}
147     ...    1
148     BuiltIn.Set Suite Variable    ${new_owner}
149
150 Create Bridge Manually and Verify After Recover
151     [Documentation]    Create bridge with OVS command and verify it gets applied from all instances.
152     ClusterOvsdb.Create Sample Bridge Manually And Verify
153
154 Add Port Manually and Verify After Recover
155     [Documentation]    Add port with OVS command and verify it gets applied from all instances.
156     ClusterOvsdb.Add Sample Port To The Manual Bridge And Verify
157
158 Create Tap Device After Recover
159     [Documentation]    Create tap devices to add to the bridge in ovs
160     ClusterOvsdb.Create Sample Tap Device
161
162 Add Tap Device Manually and Verify After Recover
163     [Documentation]    Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
164     ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify
165
166 Delete the Bridge Manually and Verify After Recover
167     [Documentation]    Delete bridge with OVS command and verify it gets deleted from all instances.
168     ClusterOvsdb.Delete Sample Bridge Manually And Verify
169
170 Verify Modified Port After Recover
171     [Documentation]    Verify modified port exists in all instances.
172     ClusterOvsdb.Verify Sample Port Is Modified
173
174 Delete Port In New Owner After Recover
175     [Documentation]    Delete port in Owner and verify it gets deleted from all instances.
176     ClusterOvsdb.Delete Sample Port And Verify    ${new_owner}
177
178 Delete Bridge In New Owner And Verify After Recover
179     [Documentation]    Delete bridge in Owner and verify it gets deleted from all instances.
180     ClusterOvsdb.Delete Sample Bridge And Verify    ${new_owner}
181
182 Create Bridge In Old Owner and Verify After Recover
183     [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
184     ClusterOvsdb.Create Sample Bridge And Verify    ${original_owner}
185
186 Create Port In Old Owner and Verify After Recover
187     [Documentation]    Create Port in Owner and verify it gets applied from all instances.
188     ClusterOvsdb.Create Sample Port And Verify    ${original_owner}
189
190 Modify the destination IP of Port In Old Owner After Recover
191     [Documentation]    Modify the dst ip of existing port in Owner.
192     ClusterOvsdb.Modify the destination IP of Sample Port    ${original_owner}
193
194 Verify Port Is Modified After Recover
195     [Documentation]    Verify port is modified in all instances.
196     ClusterOvsdb.Verify Sample Port Is Modified
197
198 Delete Port In Old Owner After Recover
199     [Documentation]    Delete port in Owner and verify it gets deleted from all instances.
200     ClusterOvsdb.Delete Sample Port And Verify    ${original_owner}
201
202 Delete Bridge In Old Owner And Verify After Recover
203     [Documentation]    Delete bridge in Owner and verify it gets deleted from all instances.
204     ClusterOvsdb.Delete Sample Bridge And Verify    ${original_owner}
205
206 Cleans Up Test Environment For Next Suite
207     [Documentation]    Cleans up test environment, close existing sessions in teardown.
208     ClusterOvsdb.Configure Exit OVSDB Connection
209
210
211 *** Keywords ***
212 Suite Setup
213     SetupUtils.Setup_Utils_For_Setup_And_Teardown
214     ClusterManagement.ClusterManagement Setup