ClusterManagement.ClusterManagement_Setup
BuiltIn.Comment First connections to Karaf console may fail, so WUKS is used. TODO: Track as a Bug.
: FOR ${index} IN @{ClusterManagement__member_index_list}
- \ BuiltIn.Wait_Until_Keyword_Succeeds 3x 0.2s Open Controller Karaf Console On Background member_index=${index}
+ \ BuiltIn.Wait_Until_Keyword_Succeeds 10x 0.2s Open Controller Karaf Console On Background member_index=${index}
Verify Feature Is Installed
[Arguments] ${feature_name} ${controller}=${ODL_SYSTEM_IP} ${karaf_port}=${KARAF_SHELL_PORT}
[Return] ${output}
Issue Command On Karaf Console
- [Arguments] ${cmd} ${controller}=${ODL_SYSTEM_IP} ${karaf_port}=${KARAF_SHELL_PORT} ${timeout}=5 ${loglevel}=INFO
+ [Arguments] ${cmd} ${controller}=${ODL_SYSTEM_IP} ${karaf_port}=${KARAF_SHELL_PORT} ${timeout}=10 ${loglevel}=INFO
[Documentation] Will execute the given ${cmd} by ssh'ing to the karaf console running on ${controller}
... Note that this keyword will open&close new SSH connection, without switching back to previously current session.
Open Connection ${controller} port=${karaf_port} prompt=${KARAF_PROMPT} timeout=${timeout}
[Return] ${output}
Safe_Issue_Command_On_Karaf_Console
- [Arguments] ${cmd} ${controller}=${ODL_SYSTEM_IP} ${karaf_port}=${KARAF_SHELL_PORT} ${timeout}=5 ${loglevel}=INFO
+ [Arguments] ${cmd} ${controller}=${ODL_SYSTEM_IP} ${karaf_port}=${KARAF_SHELL_PORT} ${timeout}=10 ${loglevel}=INFO
[Documentation] Run Issue_Command_On_Karaf_Console but restore previous connection afterwards.
BuiltIn.Run_Keyword_And_Return SSHKeywords.Run_Keyword_Preserve_Connection Issue_Command_On_Karaf_Console ${cmd} ${controller} ${karaf_port} ${timeout}
... ${loglevel}
[Return] ${output}
Open Controller Karaf Console On Background
- [Arguments] ${member_index}=${1}
+ [Arguments] ${member_index}=${1} ${timeout}=10 ${loglevel}=INFO
[Documentation] If there is a stored ssh connection index of connection to the controller's karaf console for ${member_index},
... close the previous connection. In any case create a new connection
... to karaf console for ${member_index}, set correct prompt set and login to karaf console.
BuiltIn.Run Keyword If '${status}'=='PASS' BuiltIn.Run Keywords SSHLibrary.Switch Connection ${old_connection_index}
... AND SSHLibrary.Close Connection
${odl_ip}= ClusterManagement.Resolve_IP_Address_For_Member ${member_index}
- SSHLibrary.Open Connection ${odl_ip} port=${KARAF_SHELL_PORT} prompt=${KARAF_DETAILED_PROMPT}
+ SSHLibrary.Open Connection ${odl_ip} port=${KARAF_SHELL_PORT} prompt=${KARAF_DETAILED_PROMPT} timeout=${timeout}
${karaf_connection_object}= SSHLibrary.Get Connection
Collections.Set To Dictionary ${connection_index_dict} ${member_index} ${karaf_connection_object.index}
- SSHLibrary.Login ${KARAF_USER} ${KARAF_PASSWORD}
+ SSHLibrary.Login ${KARAF_USER} ${KARAF_PASSWORD} loglevel=${loglevel}
[Teardown] SSHKeywords.Restore Current SSH Connection From Index ${current_ssh_connection_object.index}
Open Controller Karaf Console With Timeout
Configure Timeout For Karaf Console
[Arguments] ${timeout} ${member_index_list}=${EMPTY}
[Documentation] Configure a different timeout for each Karaf console.
- ${index_list} = ClusterManagement.ClusterManagement__Given_Or_Internal_Index_List given_list=${member_index_list}
+ ${index_list} = ClusterManagement.List Indices Or All given_list=${member_index_list}
${current_connection_object}= SSHLibrary.Get Connection
: FOR ${member_index} IN @{index_list} # usually: 1, 2, 3
\ ${karaf_connection_index}= Collections.Get From Dictionary ${connection_index_dict} ${member_index}
[Return] ${message}
Log Message To Controller Karaf
- [Arguments] ${message} ${member_index_list}=${EMPTY}
+ [Arguments] ${message} ${member_index_list}=${EMPTY} ${tolerate_failure}=True
[Documentation] Make sure this resource is initialized. Send a message into the controller's karaf log file on every node listed (or all).
- ${index_list} = ClusterManagement.ClusterManagement__Given_Or_Internal_Index_List given_list=${member_index_list}
+ ... By default, failure while processing a node is silently ignored, unless ${tolerate_failure} is False.
+ ${index_list} = ClusterManagement.List Indices Or All given_list=${member_index_list}
: FOR ${index} IN @{index_list} # usually: 1, 2, 3.
- \ Execute Controller Karaf Command With Retry On Background log:log "ROBOT MESSAGE: ${message}" member_index=${index}
+ \ ${status} ${output}= BuiltIn.Run Keyword And Ignore Error Execute Controller Karaf Command With Retry On Background log:log "ROBOT MESSAGE: ${message}" member_index=${index}
+ \ BuiltIn.Run_Keyword_Unless ${tolerate_failure} or "${status}" == "PASS" BuiltIn.Fail ${output}
Log Test Suite Start To Controller Karaf
[Arguments] ${member_index_list}=${EMPTY}
[Arguments] ${bgpcep_level}=${DEFAULT_BGPCEP_LOG_LEVEL} ${protocol_level}=${DEFAULT_PROTOCOL_LOG_LEVEL} ${member_index_list}=${EMPTY}
[Documentation] Assuming OCKCOB was used, set logging level on bgpcep and protocol loggers without affecting current SSH session.
# FIXME: Move to appropriate Resource
- ${index_list} = ClusterManagement.ClusterManagement__Given_Or_Internal_Index_List given_list=${member_index_list}
+ ${index_list} = ClusterManagement.List Indices Or All given_list=${member_index_list}
: FOR ${index} IN @{index_list} # usually: 1, 2, 3.
\ Execute Controller Karaf Command On Background log:set ${bgpcep_level} org.opendaylight.bgpcep member_index=${index}
\ Execute Controller Karaf Command On Background log:set ${protocol_level} org.opendaylight.protocol member_index=${index}
Write log:tail
Read Until ${message}
Close Connection
+
+Restart Bundle
+ [Arguments] ${bundle_id}
+ [Documentation] Restarts bundle passed as argument. Note this operation is only for testing and not production environments
+ # TODO: prepare this for cluster environment and multiple controllers
+ Safe_Issue_Command_On_Karaf_Console bundle:restart -f $(bundle:id '${bundle_id}')
+
+Restart Karaf
+ [Documentation] Restarts Karaf and polls log to detect when Karaf is up and running again
+ # TODO: prepare this for cluster environment and multiple controllers
+ Safe_Issue_Command_On_Karaf_Console log:clear
+ Issue_Command_On_Karaf_Console shutdown -r -f
+ Run Keyword And Return Status Wait Until Keyword Succeeds 240s 60s Wait For Karaf Log Karaf started in
+
+Restart Jetty
+ [Documentation] Restarts jetty bundle (to reload certificates or key/truststore information)
+ Safe_Issue_Command_On_Karaf_Console log:clear
+ Restart Bundle OPS4J Pax Web - Jetty
+ Wait For Karaf Log Instantiated the Application class org.opendaylight.restconf.RestconfApplication
+ Wait For Karaf Log Instantiated the Application class org.opendaylight.netconf.sal.rest.impl.RestconfApplication
+ Wait For Karaf Log Instantiated the Application class org.opendaylight.aaa.idm.IdmLightApplication