Cluster Library consolidation 1
[integration/test.git] / csit / suites / openflowplugin / Clustering / 010__Cluster_HA_Owner_Failover.robot
1 *** Settings ***
2 Documentation     Test suite for Cluster HA - Device Owner failover
3 Suite Setup       ClusterManagement Setup
4 Suite Teardown    Delete All Sessions
5 Library           RequestsLibrary
6 Resource          ../../../libraries/ClusterOpenFlow.robot
7 Resource          ../../../libraries/MininetKeywords.robot
8 Resource          ../../../libraries/ClusterManagement.robot
9 Variables         ../../../variables/Variables.py
10
11 *** Test Cases ***
12 Check Shards Status Before Fail
13     [Documentation]    Check Status for all shards in OpenFlow application.
14     ClusterOpenFlow.Check OpenFlow Shards Status
15
16 Start Mininet Multiple Connections
17     [Documentation]    Start mininet tree,2 with connection to all cluster instances.
18     ${mininet_conn_id}=    MininetKeywords.Start Mininet Multiple Controllers    ${TOOLS_SYSTEM_IP}    ${ClusterManagement__member_index_list}    --topo tree,2 --switch ovsk,protocols=OpenFlow13
19     Set Suite Variable    ${mininet_conn_id}
20
21 Check Entity Owner Status And Find Owner and Candidate Before Fail
22     [Documentation]    Check Entity Owner Status and identify owner and candidate for first switch s1.
23     ${original_owner}    ${original_candidate_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1    1
24     ${original_candidate}=    Get From List    ${original_candidate_list}    0
25     Set Suite Variable    ${original_owner}
26     Set Suite Variable    ${original_candidate_list}
27     Set Suite Variable    ${original_candidate}
28
29 Reconnect Extra Switches To Candidate And Check Entity Owner
30     [Documentation]    Connect switches s2 and s3 to candidate instance.
31     OVSDB.Set Controller In OVS Bridge    ${TOOLS_SYSTEM_IP}    s2    tcp:${ODL_SYSTEM_${original_candidate}_IP}:6633
32     OVSDB.Set Controller In OVS Bridge    ${TOOLS_SYSTEM_IP}    s3    tcp:${ODL_SYSTEM_${original_candidate}_IP}:6633
33     ${owner_list}=    Create List    ${original_candidate}
34     ${owner}    ${candidate_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:2    1    ${owner_list}
35     Should Be Equal    ${owner}    ${original_candidate}
36     ${owner}    ${candidate_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:3    1    ${owner_list}
37     Should Be Equal    ${owner}    ${original_candidate}
38
39 Check Network Operational Information Before Fail
40     [Documentation]    Check devices in operational inventory and topology in all cluster instances.
41     ClusterOpenFlow.Check OpenFlow Network Operational Information For Sample Topology
42
43 Add Configuration In Owner and Verify Before Fail
44     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
45     ClusterOpenFlow.Add Sample Flow and Verify    ${original_owner}
46
47 Modify Configuration In Owner and Verify Before Fail
48     [Documentation]    Modify Flow in Owner and verify it gets applied from all instances.
49     ClusterOpenFlow.Modify Sample Flow and Verify    ${original_owner}
50
51 Delete Configuration In Owner and Verify Before Fail
52     [Documentation]    Delete Flow in Owner and verify it gets applied from all instances.
53     ClusterOpenFlow.Delete Sample Flow and Verify    ${original_owner}
54
55 Add Configuration In Candidate and Verify Before Fail
56     [Documentation]    Add Flow in Candidate and verify it gets applied from all instances.
57     ClusterOpenFlow.Add Sample Flow and Verify    ${original_candidate}
58
59 Modify Configuration In Candidate and Verify Before Fail
60     [Documentation]    Modify Flow in candidate and verify it gets applied from all instances.
61     ClusterOpenFlow.Modify Sample Flow and Verify    ${original_candidate}
62
63 Delete Configuration In Candidate and Verify Before Fail
64     [Documentation]    Delete Flow in Candidate and verify it gets removed from all instances.
65     ClusterOpenFlow.Delete Sample Flow and Verify    ${original_candidate}
66
67 Send RPC Add to Owner and Verify Before Fail
68     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
69     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${original_owner}
70
71 Send RPC Delete to Owner and Verify Before Fail
72     [Documentation]    Delete Flow in Owner and verify it gets removed from all instances.
73     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${original_owner}
74
75 Send RPC Add to Candidate and Verify Before Fail
76     [Documentation]    Add Flow in Candidate and verify it gets applied from all instances.
77     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${original_candidate}
78
79 Send RPC Delete to Candidate and Verify Before Fail
80     [Documentation]    Delete Flow in Candidate and verify it gets removed from all instances.
81     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${original_candidate}
82
83 Modify Network And Verify Before Fail
84     [Documentation]    Take a link down and verify port status in all instances.
85     ClusterOpenFlow.Take OpenFlow Device Link Down and Verify
86
87 Restore Network And Verify Before Fail
88     [Documentation]    Take the link up and verify port status in all instances.
89     ClusterOpenFlow.Take OpenFlow Device Link Up and Verify
90
91 Kill Owner Instance
92     [Documentation]    Kill Owner Instance and verify it is dead
93     ClusterManagement.Kill Single Member    ${original_owner}
94     Set Suite Variable    ${new_cluster_list}    ${original_candidate_list}
95
96 Check Shards Status After Fail
97     [Documentation]    Create original cluster list and check Status for all shards in OpenFlow application.
98     ClusterOpenFlow.Check OpenFlow Shards Status After Cluster Event    ${new_cluster_list}
99
100 Check Entity Owner Status And Find Owner and Candidate After Fail
101     [Documentation]    Check Entity Owner Status and identify owner and candidate.
102     ${first_member}=    Get From List    ${new_cluster_list}    0
103     ${new_owner}    ${new_candidate_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1    ${first_member}    ${new_cluster_list}
104     ${new_candidate}=    Get From List    ${new_candidate_list}    0
105     Set Suite Variable    ${new_owner}
106     Set Suite Variable    ${new_candidate}
107
108 Check Network Operational Information After Fail
109     [Documentation]    Check devices in operational inventory and topology in all cluster instances.
110     ClusterOpenFlow.Check OpenFlow Network Operational Information For Sample Topology    ${new_cluster_list}
111
112 Add Configuration In Owner and Verify After Fail
113     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
114     ClusterOpenFlow.Add Sample Flow and Verify    ${new_owner}    ${new_cluster_list}
115
116 Modify Configuration In Owner and Verify After Fail
117     [Documentation]    Modify Flow in Owner and verify it gets applied from all instances.
118     ClusterOpenFlow.Modify Sample Flow and Verify    ${new_owner}    ${new_cluster_list}
119
120 Delete Configuration In Owner and Verify After Fail
121     [Documentation]    Delete Flow in Owner and verify it gets applied from all instances.
122     ClusterOpenFlow.Delete Sample Flow and Verify    ${new_owner}    ${new_cluster_list}
123
124 Add Configuration In Candidate and Verify After Fail
125     [Documentation]    Add Flow in Candidate and verify it gets applied from all instances.
126     ClusterOpenFlow.Add Sample Flow and Verify    ${new_candidate}    ${new_cluster_list}
127
128 Modify Configuration In Candidate and Verify After Fail
129     [Documentation]    Modify Flow in Candidate and verify it gets applied from all instances.
130     ClusterOpenFlow.Modify Sample Flow and Verify    ${new_candidate}    ${new_cluster_list}
131
132 Delete Configuration In Candidate and Verify After Fail
133     [Documentation]    Delete Flow in Candidate and verify it gets applied from all instances.
134     ClusterOpenFlow.Delete Sample Flow and Verify    ${new_candidate}    ${new_cluster_list}
135
136 Send RPC Add to Owner and Verify After Fail
137     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
138     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${new_owner}    ${new_cluster_list}
139
140 Send RPC Delete to Owner and Verify After Fail
141     [Documentation]    Delete Flow in Owner and verify it gets removed from all instances.
142     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${new_owner}    ${new_cluster_list}
143
144 Send RPC Add to Candidate and Verify After Fail
145     [Documentation]    Add Flow in Candidate and verify it gets applied from all instances.
146     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${new_candidate}    ${new_cluster_list}
147
148 Send RPC Delete to Candidate and Verify After Fail
149     [Documentation]    Delete Flow in Candidate and verify it gets removed from all instances.
150     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${new_candidate}    ${new_cluster_list}
151
152 Modify Network and Verify After Fail
153     [Documentation]    Take a link down and verify port status in all instances.
154     ClusterOpenFlow.Take OpenFlow Device Link Down and Verify    ${new_cluster_list}
155
156 Restore Network and Verify After Fail
157     [Documentation]    Take the link up and verify port status in all instances.
158     ClusterOpenFlow.Take OpenFlow Device Link Up and Verify    ${new_cluster_list}
159
160 Start Old Owner Instance
161     [Documentation]    Start old Owner Instance and verify it is up
162     ClusterManagement.Start Single Member    ${original_owner}
163
164 Check Shards Status After Recover
165     [Documentation]    Create original cluster list and check Status for all shards in OpenFlow application.
166     ClusterOpenFlow.Check OpenFlow Shards Status After Cluster Event
167
168 Check Entity Owner Status After Recover
169     [Documentation]    Check Entity Owner Status and identify owner and candidate.
170     ${new_owner}    ${new_candidates_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1    1
171     Set Suite Variable    ${new_owner}
172
173 Check Network Operational Information After Recover
174     [Documentation]    Check devices in operational inventory and topology in all cluster instances.
175     ClusterOpenFlow.Check OpenFlow Network Operational Information For Sample Topology
176
177 Add Configuration In Owner and Verify After Recover
178     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
179     ClusterOpenFlow.Add Sample Flow and Verify    ${new_owner}
180
181 Modify Configuration In Owner and Verify After Recover
182     [Documentation]    Modify Flow in Owner and verify it gets applied from all instances.
183     ClusterOpenFlow.Modify Sample Flow and Verify    ${new_owner}
184
185 Delete Configuration In Owner and Verify After Recover
186     [Documentation]    Delete Flow in Owner and verify it gets applied from all instances.
187     ClusterOpenFlow.Delete Sample Flow and Verify    ${new_owner}
188
189 Add Configuration In Old Owner and Verify After Recover
190     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
191     ClusterOpenFlow.Add Sample Flow and Verify    ${original_owner}
192
193 Modify Configuration In Old Owner and Verify After Recover
194     [Documentation]    Modify Flow in Owner and verify it gets applied from all instances.
195     ClusterOpenFlow.Modify Sample Flow and Verify    ${original_owner}
196
197 Delete Configuration In Old Owner and Verify After Recover
198     [Documentation]    Delete Flow in Owner and verify it gets applied from all instances.
199     ClusterOpenFlow.Delete Sample Flow and Verify    ${original_owner}
200
201 Send RPC Add to Owner and Verify After Recover
202     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
203     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${new_owner}
204
205 Send RPC Delete to Owner and Verify After Recover
206     [Documentation]    Delete Flow in Owner and verify it gets removed from all instances.
207     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${new_owner}
208
209 Send RPC Add to Old Owner and Verify After Recover
210     [Documentation]    Add Flow in Owner and verify it gets applied from all instances.
211     ClusterOpenFlow.Send RPC Add Sample Flow and Verify    ${original_owner}
212
213 Send RPC Delete to Old Owner and Verify After Recover
214     [Documentation]    Delete Flow in Owner and verify it gets removed from all instances.
215     ClusterOpenFlow.Send RPC Delete Sample Flow and Verify    ${original_owner}
216
217 Modify Network and Verify After Recover
218     [Documentation]    Take a link down and verify port status in all instances.
219     ClusterOpenFlow.Take OpenFlow Device Link Down and Verify
220
221 Restore Network and Verify After Recover
222     [Documentation]    Take the link up and verify port status in all instances.
223     ClusterOpenFlow.Take OpenFlow Device Link Up and Verify
224
225 Stop Mininet and Exit
226     [Documentation]    Stop mininet and exit connection.
227     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
228     Utils.Clean Mininet System
229
230 Check No Network Operational Information
231     [Documentation]    Check device is not in operational inventory or topology in all cluster instances.
232     ClusterOpenFlow.Check No OpenFlow Network Operational Information