Library scope: | GLOBAL |
---|
Karaf library. General utility keywords for interacting with the karaf environment, such as the karaf console, karaf.log, karaf features, and karaf config files.
This library is useful to deal with controller Karaf console for ssh sessions in cluster. Running Setup_Karaf_Keywords is necessary. If SetupUtils initialization is called, this gets initialized as well. If this gets initialized, ClusterManagement gets initialized as well.
As soon as the ${exceptions_line} is found in one of the elements of ${exceptions_white_list} this keyword will exit and give a Pass to the caller. If there is no match, this keyword will end up marking a failure. In the case that no exceptions are found, the caller could end up passing a single empty line as that is what is returned when a grep on karaf.log has no match, so we can safely return in that case as well.
Will execute the command using Issue Command On Karaf Console then check for the given elements in the command output message
Verifies that the ${message} exists in the Karaf Log Folder and checks that it appears ${count} number of times
Verifies that the ${message} exists in the Karaf Console log:display and checks that it appears ${count} number of times
Will succeed if the @{messages} are found in the output of "log:display"
Verifies that the ${message} exists specified number of times in karaf console log or Karaf Log Folder based on the arg ${use_console}.
Configure a different timeout for each Karaf console.
Send command to karaf without affecting current SSH connection. Read, log and return response.
Attemp to send command to karaf for ${member_index}, if fail then open connection and try again.
Create a failure if an Exception is found in the karaf.log that has not been whitelisted. Will work for single controller jobs as well as 3node cluster jobs
Create a failure if an Exception is found in the karaf.log. Will work for single controller jobs as well as 3node cluster jobs
Wrapper for the wrapper "Get Karaf Log Types From Test Start" so that we can easily loop over any number of controllers to analyze karaf.log for ERROR, WARN and Exception log messages
Scrapes all log messages that match regexp ${type} which fall after a point given by a log message that contains ${test_name}. This is useful if your test cases are marking karaf.log with a message indicating when that test case has started; such that you can easily pull out any extra log messsages to parse/log/etc in the test logic itself. For example, you can grab all ERRORS that occur during your test case.
Scrapes all log messages that match regexp ${type} which fall after a point given by a log message that contains ${test_name}. This is useful if your test cases are marking karaf.log with a message indicating when that test case has started; such that you can easily pull out any extra log messsages to parse/log/etc in the test logic itself. For example, you can grab all ERRORS that occur during your test case.
A wrapper keyword for "Get Karaf Log Type From Test Start" so that we can parse for multiple types of log messages. For example, we can grab all messages of type WARN and ERROR
Will Install the given ${feature_name}
Will Install the given ${feature_name} using active connection
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.
Print the list of failed exceptions and fail the test
Make sure this resource is initialized. Send a message into the controller's karaf log file on every node listed (or all). By default, failure while processing a node is silently ignored, unless ${tolerate_failure} is False.
Log suite name to karaf log, useful in suite setup.
Log test case name to karaf log, useful in test case setup.
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. Store connection index for ${member_index} and restore the previous active connection.
Open new connection to karaf console for member index with specified timeout.
Restarts bundle passed as argument. Note this operation is only for testing and not production environments
Restarts jetty bundle (to reload certificates or key/truststore information)
Restarts Karaf and polls log to detect when Karaf is up and running again
Run Issue_Command_On_Karaf_Console but restore previous connection afterwards.
Assuming OCKCOB was used, set logging level on bgpcep and protocol loggers without affecting current SSH session.
Initialize ClusterManagement. Open ssh karaf connections to each ODL.
Will UnInstall the given ${feature_name}
Local keyword to make it easier to loop through N controllers to pull Exceptions from the karaf.log file and validate with "Check Against White List"
Will succeed if the given ${bundle name} is present in the output of "bundle:list -s "
Will succeed if the given ${bundle_name} is NOT found in the output of "bundle:list -s"
Will Succeed if the given ${feature_name} is found in the output of "feature:list -i"
Read karaf logs until message appear