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