Cleanup ovsdb cluster suites
[integration/test.git] / csit / suites / ovsdb / Southbound_Cluster / 020__Southbound_Cluster_Extension.robot
1 *** Settings ***
2 Documentation     Test suite for Ovsdb Southbound Cluster - Candidate 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     BuiltIn.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}
29
30 Create Bridge Manually and Verify Before Fail
31     [Documentation]    Create bridge with OVS command and verify it gets applied from all instances.
32     ClusterOvsdb.Create Sample Bridge Manually And Verify
33
34 Add Port Manually and Verify Before Fail
35     [Documentation]    Add port with OVS command and verify it gets applied from all instances.
36     ClusterOvsdb.Add Sample Port To The Manual Bridge And Verify
37
38 Delete the Bridge Manually and Verify Before Fail
39     [Documentation]    Delete bridge with OVS command and verify it gets deleted from all instances.
40     ClusterOvsdb.Delete Sample Bridge Manually And Verify
41
42 Create Bridge In Owner and Verify Before Fail
43     [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
44     ClusterOvsdb.Create Sample Bridge And Verify    ${original_owner}
45
46 Create Port In Owner and Verify Before Fail
47     [Documentation]    Create Port in Owner and verify it gets applied from all instances.
48     ClusterOvsdb.Create Sample Port And Verify    ${original_owner}
49
50 Modify the destination IP of Port In Owner Before Fail
51     [Documentation]    Modify the dst ip of existing port in Owner.
52     ClusterOvsdb.Modify the destination IP of Sample Port    ${original_owner}
53
54 Verify Port Is Modified Before Fail
55     [Documentation]    Verify port is modified in all instances.
56     ClusterOvsdb.Verify Sample Port Is Modified
57
58 Delete Port In Owner Before Fail
59     [Documentation]    Delete port in Owner and verify it gets deleted from all instances.
60     ClusterOvsdb.Delete Sample Port And Verify    ${original_owner}
61
62 Delete Bridge In Owner And Verify Before Fail
63     [Documentation]    Delete bridge in Owner and verify it gets deleted from all instances.
64     ClusterOvsdb.Delete Sample Bridge And Verify    ${original_owner}
65
66 Kill Candidate Instance
67     [Documentation]    Kill Owner Instance and verify it is dead
68     ${new_cluster_list} =    ClusterManagement.Kill Single Member    ${original_candidate}
69     BuiltIn.Set Suite Variable    ${new_cluster_list}
70
71 Check Shards Status After Fail
72     [Documentation]    Create original cluster list and check Status for all shards in Ovsdb application.
73     ClusterOvsdb.Check Ovsdb Shards Status After Cluster Event    ${new_cluster_list}
74
75 Check Entity Owner Status And Find Owner and Candidate After Fail
76     [Documentation]    Check Entity Owner Status and identify owner and candidate.
77     ${new_owner}    ${new_candidate_list} =    ClusterOvsdb.Get Ovsdb Entity Owner Status For One Device    ovsdb://uuid/${ovsdb_uuid}    ${original_owner}    ${new_cluster_list}
78     ${new_candidate} =    Collections.Get From List    ${new_candidate_list}    0
79     BuiltIn.Set Suite Variable    ${new_owner}
80     BuiltIn.Set Suite Variable    ${new_candidate}
81
82 Create Bridge Manually and Verify After Fail
83     [Documentation]    Create bridge with OVS command and verify it gets applied from all instances.
84     ClusterOvsdb.Create Sample Bridge Manually And Verify    controller_index_list=${new_cluster_list}
85
86 Add Port Manually and Verify After Fail
87     [Documentation]    Add port with OVS command and verify it gets applied from all instances.
88     ClusterOvsdb.Add Sample Port To The Manual Bridge And Verify    controller_index_list=${new_cluster_list}
89
90 Delete the Bridge Manually and Verify After Fail
91     [Documentation]    Delete bridge with OVS command and verify it gets deleted from all instances.
92     ClusterOvsdb.Delete Sample Bridge Manually And Verify    controller_index_list=${new_cluster_list}
93
94 Create Bridge In Owner and Verify After Fail
95     [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
96     ClusterOvsdb.Create Sample Bridge And Verify    ${new_owner}    ${new_cluster_list}
97
98 Create Port In Owner and Verify After Fail
99     [Documentation]    Create Port in Owner and verify it gets applied from all instances.
100     ClusterOvsdb.Create Sample Port And Verify    ${new_owner}    ${new_cluster_list}
101
102 Modify the destination IP of Port In Owner After Fail
103     [Documentation]    Modify the dst ip of existing port in Owner.
104     ClusterOvsdb.Modify the destination IP of Sample Port    ${new_owner}    ${new_cluster_list}
105
106 Verify Port Is Modified After Fail
107     [Documentation]    Verify port is modified in all instances.
108     ClusterOvsdb.Verify Sample Port Is Modified    ${new_cluster_list}
109
110 Start Old Candidate Instance
111     [Documentation]    Start Owner Instance and verify it is active
112     ClusterManagement.Start Single Member    ${original_candidate}
113
114 Check Shards Status After Recover
115     [Documentation]    Create original cluster list and check Status for all shards in Ovsdb application.
116     ClusterOvsdb.Check Ovsdb Shards Status After Cluster Event
117
118 Check Entity Owner Status After Recover
119     [Documentation]    Check Entity Owner Status and identify owner and candidate.
120     ${new_owner}    ${new_candidate_list} =    ClusterOvsdb.Get Ovsdb Entity Owner Status For One Device    ovsdb://uuid/${ovsdb_uuid}    1
121     BuiltIn.Set Suite Variable    ${new_owner}
122
123 Create Bridge Manually and Verify After Recover
124     [Documentation]    Create bridge with OVS command and verify it gets applied from all instances.
125     ClusterOvsdb.Create Sample Bridge Manually And Verify
126
127 Add Port Manually and Verify After Recover
128     [Documentation]    Add port with OVS command and verify it gets applied from all instances.
129     ClusterOvsdb.Add Sample Port To The Manual Bridge And Verify
130
131 Delete the Bridge Manually and Verify After Recover
132     [Documentation]    Delete bridge with OVS command and verify it gets deleted from all instances.
133     ClusterOvsdb.Delete Sample Bridge Manually And Verify
134
135 Verify Modified Port After Recover
136     [Documentation]    Verify modified port exists in all instances.
137     ClusterOvsdb.Verify Sample Port Is Modified
138
139 Delete Port In New Owner After Recover
140     [Documentation]    Delete port in Owner and verify it gets deleted from all instances.
141     ClusterOvsdb.Delete Sample Port And Verify    ${new_owner}
142
143 Delete Bridge In New Owner And Verify After Recover
144     [Documentation]    Delete bridge in Owner and verify it gets deleted from all instances.
145     ClusterOvsdb.Delete Sample Bridge And Verify    ${new_owner}
146
147 Create Bridge In Old Candidate and Verify After Recover
148     [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
149     ClusterOvsdb.Create Sample Bridge And Verify    ${original_candidate}
150
151 Create Port In Old Owner and Verify After Recover
152     [Documentation]    Create Port in Owner and verify it gets applied from all instances.
153     ClusterOvsdb.Create Sample Port And Verify    ${original_candidate}
154
155 Modify the destination IP of Port In Old Owner After Recover
156     [Documentation]    Modify the dst ip of existing port in Owner.
157     ClusterOvsdb.Modify the destination IP of Sample Port    ${original_candidate}
158
159 Verify Port Is Modified After Recover
160     [Documentation]    Verify port is modified in all instances.
161     ClusterOvsdb.Verify Sample Port Is Modified
162
163 Delete Port In Old Owner After Recover
164     [Documentation]    Delete port in Owner and verify it gets deleted from all instances.
165     ClusterOvsdb.Delete Sample Port And Verify    ${original_candidate}
166
167 Delete Bridge In Old Owner And Verify After Recover
168     [Documentation]    Delete bridge in Owner and verify it gets deleted from all instances.
169     ClusterOvsdb.Delete Sample Bridge And Verify    ${original_candidate}
170
171 Cleans Up Test Environment For Next Suite
172     [Documentation]    Cleans up test environment, close existing sessions in teardown.
173     ClusterOvsdb.Configure Exit OVSDB Connection
174
175 *** Keywords ***
176 Suite Setup
177     SetupUtils.Setup_Utils_For_Setup_And_Teardown
178     ClusterManagement.ClusterManagement Setup