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