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