Resource ClusterManagement.robot
Resource ../variables/daexim/DaeximVariables.robot
Resource ../variables/Variables.robot
-Resource Utils.robot
+Resource SSHKeywords.robot
*** Keywords ***
Verify Export Files
Builtin.Log ${opr}
Builtin.Should Match Regexp ${opr} .*${EXP_OPER_FILE}
+Verify Export Files Not Present
+ [Arguments] ${host_index}
+ [Documentation] Verify if the backedup files are not present in the controller
+ ${host_index} Builtin.Convert To Integer ${host_index}
+ ${cfg} ClusterManagement.Run Bash Command On Member ls -lart ${WORKSPACE}/${BUNDLEFOLDER}/daexim/${EXP_DATA_FILE} ${host_index}
+ Builtin.Log ${cfg}
+ Builtin.Should Not Match Regexp ${cfg} .*${EXP_DATA_FILE}
+ ${mdl} ClusterManagement.Run Bash Command On Member ls -lart ${WORKSPACE}/${BUNDLEFOLDER}/daexim/${MODELS_FILE} ${host_index}
+ Builtin.Log ${mdl}
+ Builtin.Should Not Match Regexp ${mdl} .*${MODELS_FILE}
+ ${opr} ClusterManagement.Run Bash Command On Member ls -lart ${WORKSPACE}/${BUNDLEFOLDER}/daexim/${EXP_OPER_FILE} ${host_index}
+ Builtin.Log ${opr}
+ Builtin.Should Not Match Regexp ${opr} .*${EXP_OPER_FILE}
+
Cleanup The Export Files
[Arguments] ${host_index}
[Documentation] Verify if the export directory exists and delete the files if needed
${host_index} Builtin.Convert To Integer ${host_index}
Builtin.Run Keyword And Ignore Error ClusterManagement.Delete_And_Check_Member_List_Or_All ${TOPOLOGY_URL} ${host_index}
${output1} Builtin.Run Keyword and IgnoreError ClusterManagement.Run Bash Command On Member sudo rm -rf ${WORKSPACE}/${BUNDLEFOLDER}/daexim;clear ${host_index}
- # Executing the deletion without sudo prevents "sudo: no tty present and no askpass program specified" errors
${output2} Builtin.Run Keyword and IgnoreError ClusterManagement.Run Bash Command On Member rm -rf ${WORKSPACE}/${BUNDLEFOLDER}/daexim;clear ${host_index}
${output} ClusterManagement.Run Bash Command On Member ls -lart ${WORKSPACE}/${BUNDLEFOLDER} ${host_index}
Builtin.Log ${output}
[Arguments] ${status} ${output}
[Documentation] Verify export restconf response message is as expected
Builtin.Should Match Regexp ${output} "status": "${status}"
- Builtin.Run Keyword If "${status}" == "initial" or "${status}" == "scheduled" Verify Json Files Not Present ${output}
+ Builtin.Run Keyword If "${status}" == "initial" or "${status}" == "scheduled" or "${status}" == "skipped" Verify Json Files Not Present ${output}
... ELSE Verify Json Files Present ${output}
Verify Json Files Present
Builtin.Log Did not Find all Json Files
Schedule Export
- [Arguments] ${controller_index} ${TIME}=500 ${exclude}=${FALSE} ${MODULE}=${EMPTY} ${STORE}=${EMPTY}
+ [Arguments] ${controller_index} ${TIME}=500 ${exclude}=${FALSE} ${MODULE}=${EMPTY} ${STORE}=${EMPTY} ${FLAG}=false
[Documentation] Schedule Export job
${file} Builtin.Set Variable If ${exclude} ${EXPORT_EXCLUDE_FILE} ${EXPORT_FILE}
${JSON1} OperatingSystem.Get File ${file}
[Arguments] ${system}=${ODL_SYSTEM_IP} ${prompt}=${DEFAULT_LINUX_PROMPT} ${prompt_timeout}=${DEFAULT_TIMEOUT} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD}
[Documentation] Returns the connection of any host. Defaults to controller
${conn_id} SSHLibrary.Open Connection ${system} prompt=${prompt} timeout=${prompt_timeout}
- Utils.Flexible SSH Login ${user} ${password}
+ SSHKeywords.Flexible SSH Login ${user} ${password}
[Return] ${conn_id}
Cleanup Directory
Builtin.Log ${resp}
Builtin.Should Match Regexp ${resp} .*"result": ${result}
Builtin.Run Keyword If "${reason}" != "${EMPTY}" Builtin.Should Match Regexp ${response_json} .*"reason":"${reason}
+
+Cleanup Cluster Export Files
+ [Arguments] ${member_index_list}=${EMPTY}
+ [Documentation] This keyword cleansup export files of a cluster
+ ${index_list} = List_Indices_Or_All given_list=${member_index_list}
+ : FOR ${index} IN @{index_list} # usually: 1, 2, 3.
+ \ DaeximKeywords.Cleanup The Export Files ${index}