The base class for all PySys testcases.
BaseTest is the parent class of all PySys system testcases. The class
provides utility functions for cross-platform process management and
manipulation, test timing, and test validation. Any PySys testcase should
inherit from the base test and provide an implementation of the abstract
execute method defined in this class. Child classes can
also overide the setup, cleanup and validate methods of the class to provide custom setup
and cleanup actions for a particual test, and to perform all validation
steps in a single method should this prove logically more simple.
|
__init__(self,
descriptor,
outsubdir,
runner)
Create an instance of the BaseTest class. |
source code
|
|
|
|
|
setup(self)
Setup method which may optionally be overridden to perform custom
setup operations prior to test execution. |
source code
|
|
|
execute(self)
Execute method which must be overridden to perform the test execution
steps. |
source code
|
|
|
validate(self)
Validate method which may optionally be overridden to group all
validation steps. |
source code
|
|
|
cleanup(self)
Cleanup method which performs cleanup actions after execution and
validation of the test. |
source code
|
|
|
addResource(self,
resource)
Add a resource which is owned by the test and is therefore cleaned up
(deleted) when the test is cleaned up. |
source code
|
|
handle
|
startProcessMonitor(self,
process,
interval,
file,
**kwargs)
Start a separate thread to log process statistics to logfile, and
return a handle to the process monitor. |
source code
|
|
|
|
|
|
|
stopManualTester(self)
Stop the manual tester if running. |
source code
|
|
|
waitManualTester(self,
timeout=1800)
Wait for the manual tester to be stopped via user interaction. |
source code
|
|
|
|
|
|
|
assertTrue(self,
expr,
**xargs)
Perform a validation assert on the supplied expression evaluating to
true. |
source code
|
|
|
assertFalse(self,
expr,
**xargs)
Perform a validation assert on the supplied expression evaluating to
false. |
source code
|
|
|
assertDiff(self,
file1,
file2,
filedir1=None,
filedir2=None,
ignores=[ ] ,
sort=False,
replace=[ ] ,
includes=[ ] ,
**xargs)
Perform a validation assert on the comparison of two input text
files. |
source code
|
|
|
assertGrep(self,
file,
filedir=None,
expr='
' ,
contains=True,
ignores=None,
literal=False,
**xargs)
Perform a validation assert on a regular expression occurring in a
text file. |
source code
|
|
|
assertLastGrep(self,
file,
filedir=None,
expr='
' ,
contains=True,
ignores=[ ] ,
includes=[ ] ,
**xargs)
Perform a validation assert on a regular expression occurring in the
last line of a text file. |
source code
|
|
|
assertOrderedGrep(self,
file,
filedir=None,
exprList=[ ] ,
contains=True,
**xargs)
Perform a validation assert on a list of regular expressions
occurring in specified order in a text file. |
source code
|
|
|
assertLineCount(self,
file,
filedir=None,
expr='
' ,
condition=' >=1 ' ,
ignores=None,
**xargs)
Perform a validation assert on the number of lines in a text file
matching a specific regular expression. |
source code
|
|
|
__assertMsg(self,
xargs,
default)
Return an assert statement requested to override the default value. |
source code
|
|
|
|
Inherited from process.user.ProcessUser :
__getattr__ ,
abort ,
addCleanupFunction ,
addOutcome ,
allocateUniqueStdOutErr ,
getInstanceCount ,
getNextAvailableTCPPort ,
getOutcome ,
getOutcomeReason ,
logFileContents ,
signalProcess ,
startProcess ,
stopProcess ,
waitForFile ,
waitForSignal ,
waitForSocket ,
waitProcess ,
writeProcess
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|