2 Documentation Cluster Singleton testing: Partition And Heal
4 ... Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
6 ... This program and the accompanying materials are made available under the
7 ... terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ... and is available at http://www.eclipse.org/legal/epl-v10.html
10 ... Cluster Singleton service is designed to ensure that only one instance of
11 ... an application is registered globally in the cluster.
12 ... The goal is to establish the service operates correctly in face of node
14 Suite Setup Setup_Keyword
15 Suite Teardown SSHLibrary.Close_All_Connections
16 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
17 Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
21 Library RequestsLibrary
22 Resource ${CURDIR}/../../../libraries/controller/CsCommon.robot
23 Resource ${CURDIR}/../../../libraries/ClusterManagement.robot
24 Resource ${CURDIR}/../../../libraries/MdsalLowlevel.robot
25 Resource ${CURDIR}/../../../libraries/SetupUtils.robot
26 Resource ${CURDIR}/../../../libraries/WaitForFailure.robot
29 ${STABILITY_TIMEOUT_ISOLATED} 120s
30 ${STABILITY_TIMEOUT_REJOINED} 60s
31 @{STATUS_ISOLATED} ${501}
34 Register_Singleton_Constant_On_Each_Node
35 [Documentation] Register a candidate application on each node.
36 CsCommon.Register_Singleton_Constant_On_Nodes ${cs_all_indices}
38 Verify_Singleton_Constant_On_Each_Node
39 [Documentation] Store the owner and candidates of the application and initially verify that all
40 ... odl nodes are used.
41 ${owner} ${candidates}= CsCommon.Get_And_Save_Present_CsOwner_And_CsCandidates 1
42 BuiltIn.Wait_Until_Keyword_Succeeds 15 2s CsCommon.Verify_Singleton_Constant_On_Nodes ${cs_all_indices} ${CS_CONSTANT_PREFIX}${owner}
45 [Documentation] Isolate the cluster node which is the owner. Wait until the new owner is elected and store
46 ... new values of owner and candidates.
47 CsCommon.Isolate_Owner_And_Verify_Isolated
49 Monitor_Stability_While_Isolated
50 [Documentation] Monitor the stability of the singleton application and fail the the owner is changed during the monitoring.
51 WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout ${STABILITY_TIMEOUT_ISOLATED} 3s CsCommon.Verify_Singleton_Constant_During_Isolation
54 [Documentation] Rejoin isolated node.
55 CsCommon.Rejoin_Node_And_Verify_Rejoined
57 Unregister_Singleton_Constant_On_Each_Node
58 [Documentation] Unregister the application on every node.
59 CsCommon.Unregister_Singleton_Constant_On_Nodes ${cs_all_indices}
63 [Documentation] Suite setup.
64 SetupUtils.Setup_Utils_For_Setup_And_Teardown http_timeout=125
65 CsCommon.Cluster_Singleton_Init