spinnaker_testbase package¶
Submodules¶
spinnaker_testbase.ping module¶
- class spinnaker_testbase.ping.Ping[source]¶
Bases:
object
Platform-independent ping support.
- static host_is_reachable(ip_address)[source]¶
Test if a host is unreachable via ICMP ECHO.
Note
This information may be cached in various ways. Transient failures are not necessarily detected or recovered from.
spinnaker_testbase.root_test_case module¶
- class spinnaker_testbase.root_test_case.RootTestCase(methodName='runTest')[source]¶
Bases:
TestCase
This holds the code shared by the all test and script checkers
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- static assert_not_spin_three()[source]¶
Will raise a SkipTest if run on a none virtual 4 chip board
- Raises:
SkipTest – If we’re on the wrong sort of board
- error_file()[source]¶
The file any error where reported to before a second run attempt
- Returns:
Path to (possibly non existent) error file
spinnaker_testbase.test_no_job_destroy module¶
- class spinnaker_testbase.test_no_job_destroy.TestNoJobDestory(methodName='runTest')[source]¶
Bases:
BaseTestCase
Used by Jenkins to check if a job was destroyed.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- test_no_destory_file()[source]¶
Checks for the error file and prints it out if found
- Raises:
AssertionError – if the error file exists
Module contents¶
This Repository hold classes and script used for unit and integration tests
There is need to use this repository unless you want to run some or all tests locally
- class spinnaker_testbase.BaseTestCase(methodName='runTest')[source]¶
Bases:
RootTestCase
This extends unittest.TestCase to offer extra functions as needed.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- assert_logs_messages(log_records, sub_message, log_level='ERROR', count=1, allow_more=False)[source]¶
Tool to assert the log messages contain the sub-message.
- Parameters:
log_records – list of log message
sub_message – text to look for
log_level – level to look for
count – number of times this message should be found
allow_more – If True, OK to have more than count repeats
- class spinnaker_testbase.RootScriptBuilder[source]¶
Bases:
object
Looks for example scripts that can be made into integration tests.
- add_script(test_file, name, local_path, skip_imports)[source]¶
- Parameters:
test_file (io.TextIOBase)
name (str)
local_path (str)
- create_test_scripts(dirs, too_long=None, exceptions=None, skip_exceptions=None)[source]¶
- Parameters:
dirs (str or list(str)) – List of dirs to find scripts in. These are relative paths to the repository
too_long (dict(str, str) or None) – Dict of files that take too long to run and how long. These are just the file name including the .py. They are mapped to a skip reason. These are only skip tests if asked to be (currently not done).
exceptions (dict(str, str) or None) – Dict of files that should be skipped. These are just the file name including the .py. They are mapped to a skip reason. These are always skipped.
skip_exceptions (dict(str,list(str))) –
Dict of files and exceptions to skip on. These are just the file name including the .py. They are mapped to a list of INDIVIUAL import statements in the:
from xyz import Abc
format.
- class spinnaker_testbase.ScriptChecker(methodName='runTest')[source]¶
Bases:
RootTestCase
Will run a script. Typically as part of Integration Tests.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.