buildtest.buildsystem.checks
Module Contents
Functions
|
Returns True if metrics value is defined, otherwise returns False |
|
Check status check of |
|
This method will return a boolean (True/False) based on runtime specified in buildspec and check with test runtime. |
|
This method will check if file exists and conduct a regular expression check using |
|
This method conducts a regular expression check using |
|
This method will perform symlink status check for |
|
This method will perform status check for |
|
This method will perform status check for |
|
This method will perform status check for |
|
This method will convert input argument |
|
Perform check on assert greater and equal when |
|
Perform check on assert less than and equal when |
|
Perform check on assert greater than when |
|
Perform check on assert less than when |
|
This method is perform Assert Equality used when |
|
This method performs Assert not Equal and is used when |
|
This method perform Contains check when |
|
This method perform Not Contains check when |
|
This method is perform Assert Range used when |
|
This method is used to perform file count check when |
Attributes
- buildtest.buildsystem.checks.logger
- buildtest.buildsystem.checks.is_metrics_defined(builder, name)[source]
Returns True if metrics value is defined, otherwise returns False
- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
name (str) – Name of metric
- buildtest.buildsystem.checks.returncode_check(builder)[source]
Check status check of
returncode
field if specified in status property.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- buildtest.buildsystem.checks.runtime_check(builder)[source]
This method will return a boolean (True/False) based on runtime specified in buildspec and check with test runtime. User can specify both min and max, or just specify min or max.
- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- buildtest.buildsystem.checks.file_regex_check(builder)[source]
This method will check if file exists and conduct a regular expression check using re.search method. This method is invoked if
file_regex
is defined instatus
field. If file doesn’t exist we return False. If file exists we read the file and apply regular expression for every file specified infile_regex
field.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
Returns True if there is a regex match otherwise returns False.
- Return type
- buildtest.buildsystem.checks.regex_check(builder)[source]
This method conducts a regular expression check using re.search with regular expression defined in Buildspec. User must specify an output stream (stdout, stderr) to select when performing regex. In buildtest, this would read the .out or .err file based on stream and run the regular expression to see if there is a match. This method will return a boolean True indicates there is a match otherwise False if
regex
object not defined orre.search
doesn’t find a match.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
Returns True if their is a regex match otherwise returns False.
- Return type
- buildtest.buildsystem.checks.is_symlink_check(builder)[source]
This method will perform symlink status check for
is_symlink
property. Each item is tested for symblolic link and returns a boolean to inform if all items are symbolic links or not.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
A boolean for is_symlink status check
- Return type
- buildtest.buildsystem.checks.exists_check(builder)[source]
This method will perform status check for
exists
property. Each value is tested for file existence and returns a boolean to inform if all files exist or not.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
A boolean for exists status check
- Return type
- buildtest.buildsystem.checks.is_file_check(builder)[source]
- This method will perform status check for
is_file
property. Each item inis_file
is checked by determining if its a file. The return is a single boolean where we perform a logical AND to determine final status check for is_file
- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
A boolean for is_file status check
- Return type
- This method will perform status check for
- buildtest.buildsystem.checks.is_dir_check(builder)[source]
- This method will perform status check for
is_dir
property. Each item inis_dir
is checked by determining if its a directory. The return is a single boolean where we perform a logical AND to determine final status check for
is_dir
- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
A boolean for
is_dir
status check- Return type
- This method will perform status check for
- buildtest.buildsystem.checks.convert_metrics(metric_value, dtype)[source]
This method will convert input argument
metric_value
andref_value
to the datatype defined bydtype
which can be int, float, or str- Parameters
metric_value – Value assigned to metric that is converted to its type defined by dtype
dtype (str) – A string value which can be ‘str’, ‘int’, ‘float’
- Returns
A tuple consisting of (metric_value, ref_value)
- Return type
Tuple
- buildtest.buildsystem.checks.assert_ge_check(builder)[source]
Perform check on assert greater and equal when
assert_ge
is specified in buildspec. The return is a boolean value that determines if the check has passed. One can specify multiple assert checks to check each metric with its reference value. When multiple items are specified, the operation is a logical AND and all checks must beTrue
.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
True or False for performance check
assert_ge
- Return type
- buildtest.buildsystem.checks.assert_le_check(builder)[source]
Perform check on assert less than and equal when
assert_le
is specified in buildspec. The return is a boolean value that determines if the check has passed. One can specify multiple assert checks to check each metric with its reference value. When multiple items are specified, the operation is a logical AND and all checks must beTrue
.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
True or False for performance check
assert_le
- Return type
- buildtest.buildsystem.checks.assert_gt_check(builder)[source]
Perform check on assert greater than when
assert_gt
is specified in buildspec. The return is a boolean value that determines if the check has passed. One can specify multiple assert checks to check each metric with its reference value. When multiple items are specified, the operation is a logical AND and all checks must beTrue
.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
True or False for performance check
assert_gt
- Return type
- buildtest.buildsystem.checks.assert_lt_check(builder)[source]
Perform check on assert less than when
assert_lt
is specified in buildspec. The return is a boolean value that determines if the check has passed. One can specify multiple assert checks to check each metric with its reference value. When multiple items are specified, the operation is a logical AND and all checks must beTrue
.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
True or False for performance check
assert_lt
- Return type
- buildtest.buildsystem.checks.assert_eq_check(builder)[source]
This method is perform Assert Equality used when
assert_eq
property is specified in status check. This method will evaluate each metric value reference value and store assertion in list. The list of assertion is logically AND which will return a True or False for the status check.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
True or False for performance check
assert_eq
- Return type
- buildtest.buildsystem.checks.assert_ne_check(builder)[source]
This method performs Assert not Equal and is used when
assert_ne
property is specified in status check. This method will evaluate each metric value reference value and store assertion in list. The list of assertion is logically AND which will return a True or False for the status check.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
True or False for performance check
assert_ne
- Return type
- buildtest.buildsystem.checks.contains_check(builder)[source]
This method perform Contains check when
contains
property is specified in status check. This method will each metric value is in list of reference values. The list of assertion is logically AND which will return a True or False for the status check.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
True or False for performance check
contains
- Return type
- buildtest.buildsystem.checks.notcontains_check(builder)[source]
This method perform Not Contains check when
not_contains
property is specified in status check. This method will each metric value is in list of reference values. The list of assertion is logically AND which will return a True or False for the status check.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
True or False for performance check
not_contains
- Return type
- buildtest.buildsystem.checks.assert_range_check(builder)[source]
This method is perform Assert Range used when
assert_range
property is specified in status check. This method will evaluate each metric value with lower and upper bound and store assertion in list. The list of assertion is logically AND which will return a True or False for the status check.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
True or False for performance check
assert_range
- Return type
- buildtest.buildsystem.checks.file_count_check(builder)[source]
This method is used to perform file count check when
file_count
property is specified in status check. This method will evaluate the number of files in a directory and compare it with the reference specified viacount
. The comparison is done using==
operator.- Parameters
builder (buildtest.builders.base.BuilderBase) – An instance of BuilderBase class used for printing the builder name
- Returns
True or False for performance check
file_count
- Return type