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