2 Documentation Kill nodes, delete all data created since boot, change cluster configs,
3 ... start nodes, wait for sync.
5 ... Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
7 ... This program and the accompanying materials are made available under the
8 ... terms of the Eclipse Public License v1.0 which accompanies this distribution,
9 ... and is available at http://www.eclipse.org/legal/epl-v10.html
10 Suite Setup ClusterManagement.ClusterManagement_Setup
11 Default Tags clustering critical
13 Library OperatingSystem
15 Resource ${CURDIR}/../../../libraries/ClusterManagement.robot
16 Library ${CURDIR}/../../../libraries/ConfGen.py
20 ${MODULES_FILE} modules.conf
21 ${MODULE_SHARDS_FILE} module-shards.conf
22 ${RIB_SHARD_NAME} bgp_rib
23 ${RIB_SHARD_NAMESPACE} urn:opendaylight:params:xml:ns:yang:bgp-rib
27 [Documentation] Kill every node, download karaf logs.
28 ClusterManagement.Kill_Members_From_List_Or_All
30 Store_Karaf_Log_And_Clean_All
31 [Documentation] Remove various data folders, including ${KARAF_HOME}/data/ on every node.
32 ... Start each memberand wait for sync.
33 ClusterManagement.Store_Karaf_Log_On_List_Or_All
34 ClusterManagement.Clean_Directories_On_List_Or_All
35 ClusterManagement.Run_Bash_Command_On_List_Or_All mkdir -p ${KARAF_HOME}/data/log
36 ClusterManagement.Restore_Karaf_Log_On_List_Or_All
38 Upload_Initial_Config_Files
39 [Documentation] Upload config files for non-replicated bgp_rib
40 : FOR ${idx} IN @{ClusterManagement__member_index_list}
41 \ ${idxl}= BuiltIn.Create_List ${idx}
42 \ ClusterManagement.Safe_With_Ssh_To_List_Or_All_Run_Keyword member_index_list=${idxl} keyword_name=Set_Config_Files_With_Nonreplicated_Rib index_list=${idxl}
45 [Documentation] Start each memberand wait for sync.
46 ClusterManagement.Start_Members_From_List_Or_All
47 BuiltIn.Comment Basic synch performed, but waits for specific functionality may still be needed.
48 BuiltIn.Wait_Until_Keyword_Succeeds 2m 5s Topology_Available
49 ClusterManagement.Run_Bash_Command_On_List_Or_All ps -ef | grep java
53 ${timestamp} = DateTime.Get_Current_Date time_zone=UTC result_format=%Y%m%d%H%M%S%f
54 SSHLibrary.Get_File ${WORKSPACE}${/}${BUNDLEFOLDER}${/}data${/}log${/}karaf.log karaf_${timestamp}.log
57 ${session}= ClusterManagement.Resolve_Http_Session_For_Member 1
58 TemplatedRequests.Get_As_Json_From_Uri /restconf/operational/network-topology:network-topology/topology/example-ipv4-topology session=${session}
60 Set_Config_Files_With_Nonreplicated_Rib
61 [Arguments] ${index_list}
62 ${modules_file}= SSHLibrary.Execute_Command ls ${WORKSPACE}${/}${BUNDLEFOLDER}${/}system${/}org${/}opendaylight${/}controller${/}sal-clustering-config${/}*${/}*-moduleconf.xml
63 ${module_shards_file}= SSHLibrary.Execute_Command ls ${WORKSPACE}${/}${BUNDLEFOLDER}${/}system${/}org${/}opendaylight${/}controller${/}sal-clustering-config${/}*${/}*-moduleshardconf.xml
64 SSHLibrary.Get File ${modules_file} ${CURDIR}${/}${MODULES_FILE}.tmpl
65 SSHLibrary.Get File ${module_shards_file} ${CURDIR}${/}${MODULE_SHARDS_FILE}.tmpl
66 ${modules_content}= ConfGen.Generate_Modules ${CURDIR}${/}${MODULES_FILE}.tmpl name=${RIB_SHARD_NAME} namespace=${RIB_SHARD_NAMESPACE}
67 ${ms_content}= ConfGen.Generate_Module_Shards ${CURDIR}${/}${MODULE_SHARDS_FILE}.tmpl nodes=${NUM_ODL_SYSTEM} shard_name=${RIB_SHARD_NAME} replicas=${index_list}
68 OperatingSystem.Create File ${CURDIR}${/}${MODULES_FILE} ${modules_content}
69 OperatingSystem.Create File ${CURDIR}${/}${MODULE_SHARDS_FILE} ${ms_content}
70 SSHLibrary.Put File ${CURDIR}${/}${MODULES_FILE} ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULES_FILE}
71 SSHLibrary.Put File ${CURDIR}${/}${MODULE_SHARDS_FILE} ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULE_SHARDS_FILE}
72 ${stdout} ${stderr}= SSHLibrary.Execute_Command cat ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULES_FILE} return_stderr=True
74 BuiltIn.Should_Be_Empty ${stderr}
75 ${stdout} ${stderr}= SSHLibrary.Execute_Command cat ${WORKSPACE}${/}${BUNDLEFOLDER}${/}configuration${/}initial${/}${MODULE_SHARDS_FILE} return_stderr=True
77 BuiltIn.Should_Be_Empty ${stderr}