Keywords (57)

Introduction

General Utils library. This library has broad scope, it can be used by any robot system tests.

Keywords

Arguments

dest_uri data headers
= ${headers}
session
= session

Documentation

Put data to a URI and verify the HTTP response

Arguments

dest_uri data_file headers
= ${headers}
session
= session

Documentation

Put data from a file to a URI

Arguments

dest_uri data_file headers
= ${headers}
session
= session

Documentation

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.

Arguments

dest_uri data_file headers
= ${headers}
session
= session

Documentation

Shorthand for PUTting data from file and expecting status code 400.

Arguments

dest_uri data_file headers
= ${headers}
session
= session

Documentation

Put data from a file to a URI and verify the HTTP response

Arguments

ip_address
= ${ODL_SYSTEM_IP}
check_status
= True
expected_status
= ${200}

Documentation

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.

Arguments

uri elements session
= session
pretty_print_json
= False

Documentation

A GET is made at the supplied ${URI} and every item in the list of ${elements} is verified to exist in the response

Arguments

uri elements session
= session
pretty_print_json
= False
check_for_null
= False

Documentation

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.

Arguments

uri element expected_count session
= session

Documentation

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})

Arguments

string dictionary_item_occurrence

Documentation

Check string for occurrences of items expressed in a list of dictionaries {item=occurrences}. 0 occurences means item is not present.

Arguments

ip message user
= ${ODL_SYSTEM_USER}
password
= ${ODL_SYSTEM_PASSWORD}
prompt
= ${ODL_SYSTEM_PROMPT}
log_file
= ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log

Documentation

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}

Arguments

node session
= session

Documentation

A GET on the /node/${node} API is made and specific flow stat strings are checked for existence.

Arguments

system
= ${TOOLS_SYSTEM_IP}

Arguments

system
= ${TOOLS_SYSTEM_IP}

Documentation

Cleans up the OVS instance and remove any existing common known bridges.

Arguments

str1 str2

Documentation

Catenate the two non-string objects and return as String

Arguments

time

Documentation

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.

Arguments

content index

Documentation

Will take the given response content and return the value at the given index as a string

Arguments

session uri headers
= ${NONE}

Documentation

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.

Arguments

time

Documentation

Get the Epoc time from MM/DD/YYYY HH:MM:SS

Arguments

dictionary_list key value

Documentation

Extract index for the dictionary in a list that contains a key-value pair. Returns -1 if key-value is not found.

Arguments

testtool testcase
= ${EMPTY}

Documentation

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.

Arguments

system regex_string_to_match_on user
= ${TOOLS_SYSTEM_USER}
password
= ${EMPTY}
prompt
= ${DEFAULT_LINUX_PROMPT}
prompt_timeout
= 30s

Documentation

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

Arguments

system pid user
= ${TOOLS_SYSTEM_USER}
password
= ${EMPTY}
prompt
= ${DEFAULT_LINUX_PROMPT}
prompt_timeout
= 30s

Documentation

Executes the ps command to retrieve the lightweight process (aka thread) count.

Arguments

uri session
= session
headers
= ${NONE}

Documentation

Issue a Get On Session and verify a successfull HTTP return. Issues a Get On Session for ${uri} in ${session} using headers from ${headers}.

Arguments

ip_address
= ${ODL_SYSTEM_IP}

Documentation

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.

Arguments

package_name system
= ${TOOLS_SYSTEM_IP}
user
= ${TOOLS_SYSTEM_USER}
password
= ${TOOLS_SYSTEM_PASSWORD}
prompt
= ${DEFAULT_LINUX_PROMPT}
prompt_timeout
= 30s

Documentation

Keyword to install packages for testing to Ubuntu Mininet VM

Arguments

json_file

Documentation

Parse given file content into json (dictionary)

Arguments

plain_string_with_json

Documentation

Parse given plain string into json (dictionary)

Arguments

resp_content

Arguments

remote_system_ip iptables_rule user
= ${ODL_SYSTEM_USER}
password
= ${ODL_SYSTEM_PASSWORD}
prompt
= ${ODL_SYSTEM_PROMPT}

Documentation

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

Arguments

session uri headers
= ${NONE}

Documentation

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.

Arguments

rest_uri data headers
= ${headers}
session
= session

Documentation

Perform a POST rest operation, using the URL and data provided

Arguments

dest_uri data_file headers
= ${headers}
session
= session

Arguments

uri body session
= session
status_codes
= 200

Documentation

Post body to ${uri}, log response content, and check status

Arguments

uri session
= session

Arguments

uri session
= session

Arguments

uri session
= session

Documentation

Delete all elements from an URI if the configuration was not empty

Arguments

str count
= -1

Documentation

Remove the empty space from given string.count is optional,if its given that many occurence of space will be removed from left

Arguments

number include_bug_in_tags
= True

Documentation

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.

Documentation

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.

Arguments

system
= ${ODL_SYSTEM_IP}
cmd
= echo
user
= ${ODL_SYSTEM_USER}
password
= ${ODL_SYSTEM_PASSWORD}
prompt
= ${ODL_SYSTEM_PROMPT}

Documentation

Call Run Comand On Remote System, but with default values suitable for Controller machine.

Arguments

conn_id
= ${EMPTY}
cmd
= echo
return_stdout
= True
return_stderr
= False

Documentation

Switch to and run command on an already existing SSH connection and switch back

Arguments

system
= ${TOOLS_SYSTEM_IP}
cmd
= echo
user
= ${TOOLS_SYSTEM_USER}
password
= ${TOOLS_SYSTEM_PASSWORD}
prompt
= ${TOOLS_SYSTEM_PROMPT}

Documentation

Call Run Comand On Remote System, but with default values suitable for Mininet machine.

Arguments

system cmd user
= ${DEFAULT_USER}
password
= ${EMPTY}
prompt
= ${DEFAULT_LINUX_PROMPT}
prompt_timeout
= ${DEFAULT_TIMEOUT}
return_stdout
= True
return_stderr
= False

Documentation

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.

Arguments

system cmd user
= ${DEFAULT_USER}
password
= ${EMPTY}
prompt
= ${DEFAULT_LINUX_PROMPT}
prompt_timeout
= ${DEFAULT_TIMEOUT}

Documentation

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.

Arguments

* proc_args

Documentation

Execute an OS command, log STDOUT and STDERR output and check exit code to be 0

Arguments

name value

Documentation

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.

Arguments

str splitter

Documentation

Split the String based on given splitter and return as list

Arguments

system
= ${TOOLS_SYSTEM_IP}
user
= ${TOOLS_SYSTEM_USER}
password
= ${TOOLS_SYSTEM_PASSWORD}
prompt
= ${TOOLS_SYSTEM_PROMPT}
timeout
= 30s

Documentation

Basic setup/cleanup work that can be done safely before any system is run.

Arguments

prompt
= ${TOOLS_SYSTEM_PROMPT}

Documentation

Cleanup/Shutdown work that should be done at the completion of all tests

Arguments

string_to_strip

Documentation

Will strip ALL quotes from given string and return the new string

Arguments

controller_ip
= ${ODL_SYSTEM_IP}

Documentation

Will execute any tests to verify the controller is not having any null pointer eceptions.

Arguments

controller_ip
= ${ODL_SYSTEM_IP}

Documentation

Will execute any tests to verify the controller is not having any runtime eceptions.

Arguments

controller_ip
= ${ODL_SYSTEM_IP}

Documentation

Will execute any tests to verify the controller is not dead. Some checks are Out Of Memory Execptions.

Arguments

system file user
= ${TOOLS_SYSTEM_USER}
password
= ${TOOLS_SYSTEM_PASSWORD}
prompt
= ${DEFAULT_LINUX_PROMPT}
prompt_timeout
= 5s

Documentation

Will create connection with public key and will PASS if the given ${file} exists, otherwise will FAIL

Arguments

cmd prompt timeout
= ${DEFAULT_TIMEOUT}

Documentation

quick wrapper for Write and Read Until Prompt Keywords to make test cases more readable

Arguments

cmd regexp timeout
= ${DEFAULT_TIMEOUT}

Documentation

quick wrapper for Write and Read Until Prompt Keywords to make test cases more readable

Utils

image/svg+xml