Library scope: | GLOBAL |
---|
General Utils library. This library has broad scope, it can be used by any robot system tests.
Put data to a URI and verify the HTTP response
Put data from a file to a URI
Shorthand for PUTting data from file and expecting status code 500. Consider opening a Bug against ODL, as in most test cases, 400 is the http code to expect.
Shorthand for PUTting data from file and expecting status code 400.
Put data from a file to a URI and verify the HTTP response
GET http://${ip_address}:${RESTCONFPORT}/diagstatus and return the response. ${check_status} and ${expected_status_code} can be used to ignore the status code, or validate any status code value. By default, this keyword will pass if the status code returned is 200, and fail otherwise.
A GET is made at the supplied ${URI} and every item in the list of ${elements} is verified to exist in the response
A GET is made at the supplied ${uri} and every item in the list of ${elements} is verified to NOT exist in the response. If ${check_for_null} is True return of 404 is treated as empty list. From Neon onwards, an empty list is always returned as null, giving 404 on rest call.
A GET is made to the specified ${URI} and the specific count of a given element is done (as supplied by ${element} and ${expected_count})
Check string for occurrences of items expressed in a list of dictionaries {item=occurrences}. 0 occurences means item is not present.
Fails if the provided ${message} is found in the karaf.log file. Uses grep to search. The karaf.log file can be overridden with ${log_file} to be any file on the given system @ ${ip}
A GET on the /node/${node} API is made and specific flow stat strings are checked for existence.
Cleans up the OVS instance and remove any existing common known bridges.
Catenate the two non-string objects and return as String
Convert a Robot time string to an integer expressing the time in minutes, rounded up This is a wrapper around DateTime.Convert_Time which does not provide this functionality directly nor is even able to produce an integer directly. It is needed for RestPerfClient which cannot accept floats for its --timeout parameter and interprets the value supplied in this parameter in minutes.
Will take the given response content and return the value at the given index as a string
Issue a Get On Session and return the data obtained or on error log the error and fail. Issues a Get On Session for ${uri} in ${session} using headers from ${headers}. If the request returns a HTTP error, fails. Otherwise returns the data obtained by the request.
Get the Epoc time from MM/DD/YYYY HH:MM:SS
Extract index for the dictionary in a list that contains a key-value pair. Returns -1 if key-value is not found.
Get the name of the suite sanitized to be usable as a part of filename. These names are used to constructs names of the log files produced by the testing tools so two suites using a tool wont overwrite the log files if they happen to run in one job.
Uses ps to find a process that matches the supplied regex. Returns the PID of that process The ${regex_string_to_match_on} should produce a unique process otherwise the PID returned may not be the expected PID
Executes the ps command to retrieve the lightweight process (aka thread) count.
Issue a Get On Session and verify a successfull HTTP return. Issues a Get On Session for ${uri} in ${session} using headers from ${headers}.
Store current connection index, open new connection to ip_address. Run command to get sysstat results from script, which is running on all children nodes. Returns cpu, network, memory usage statistics from the node for each 10 minutes that node was running. Used for debug purposes. Returns whole output of sysstat.
Keyword to install packages for testing to Ubuntu Mininet VM
Parse given file content into json (dictionary)
Parse given plain string into json (dictionary)
Wrapper keyword to run iptables with any given ${iptables_rule} string on the remote system given by ${remote_system_ip}. The iptables listing will be output before and after the command is run
Issue a Get On Session and return on error 404 (No content) or will fail and log the content. Issues a Get On Session for ${uri} in ${session} using headers from ${headers}. If the request returns a HTTP error, fails. Otherwise returns the data obtained by the request.
Perform a POST rest operation, using the URL and data provided
Post body to ${uri}, log response content, and check status
Delete all elements from an URI if the configuration was not empty
Remove the empty space from given string.count is optional,if its given that many occurence of space will be removed from left
Report that a test failed due to a known Bugzilla bug whose number is provided as an argument. Not FAILED (incl. SKIPPED) test are not reported. This keyword must be used in the [Teardown] setting of the affected test or as the first line of the test if FastFail module is not being used. It reports the URL of the bug on console and also puts it into the Robot log file.
Report that a test failed and point to linked Bugzilla bug(s). Linked bugs must contain the ${reference} inside comments (workaround becasue of currently missing suitable field for external references and not correctly working the CONTENT MATCHES filter). Not FAILED (incl. SKIPPED) test are not reported. This keyword must be used in the [Teardown] setting of the affected test or as the first line of the test if FastFail module is not being used. It reports the URL of the bug on console and also puts it into the Robot log file.
Call Run Comand On Remote System, but with default values suitable for Controller machine.
Switch to and run command on an already existing SSH connection and switch back
Call Run Comand On Remote System, but with default values suitable for Mininet machine.
Reduces the common work of running a command on a remote system to a single higher level robot keyword, taking care to log in with a public key and. The command given is written and the return value depends on the passed argument values of return_stdout (default: True) and return_stderr (default: False). At least one should be True, or the keyword will exit and FAIL. If both are True, the resulting return value will be a two element list containing both. Otherwise the resulting return value is a string. No test conditions are checked.
Reduces the common work of running a command on a remote system to a single higher level robot keyword, taking care to log in with a public key and. The command given is written and the output returned. No test conditions are checked.
Execute an OS command, log STDOUT and STDERR output and check exit code to be 0
Set a default value for an user configurable variable. This keyword is needed if your default value is calculated using a complex expression which needs BuiltIn.Evaluate or even more complex keywords. It sets the variable ${name} (the name of the variable MUST be specified WITHOUT the ${} syntactic sugar due to limitations of Robot Framework) to ${value} but only if the variable ${name} was not set previously. This keyword is intended for user configurable variables which are supposed to be set only with pybot -v; calling this keyword on a variable that was already set by another keyword will silently turn the call into a NOP and thus is a bug in the suite or resource trying to call this keyword.
Split the String based on given splitter and return as list
Basic setup/cleanup work that can be done safely before any system is run.
Cleanup/Shutdown work that should be done at the completion of all tests
Will strip ALL quotes from given string and return the new string
Will execute any tests to verify the controller is not having any null pointer eceptions.
Will execute any tests to verify the controller is not having any runtime eceptions.
Will execute any tests to verify the controller is not dead. Some checks are Out Of Memory Execptions.
Will create connection with public key and will PASS if the given ${file} exists, otherwise will FAIL
quick wrapper for Write and Read Until Prompt Keywords to make test cases more readable
quick wrapper for Write and Read Until Prompt Keywords to make test cases more readable