TestModule Class Reference

Inheritance diagram for TestModule:

TestConfigurationContainer ArpscanTest DbTest DigTest DsniffTest EttercapTest ExploitTest FingerTest FirewalkTest FudpTest HpingTest HydraTest IcmpqueryTest IrpasTest MetasploitTest MountTest NetcatTest NmapTest OpentearTest ProtosTest PscanTest RprobeTest RusersTest RwhoTest SegTest ShowmountTest SiphonTest SippTest SiprogueTest SipsakTest SmurfTest SnmpsetTest SnmpwalkTest SynkTest TcpdumpTest TftpbruteTest TracerouteTest TsharkTest XscanTest

List of all members.


Detailed Description

This abstract class is the parent class for all test modules.

It provides basic functionalities which can be used by a test module. This includes

To implement a test module specialize this class overwrite the method 'run()' containing all the functionallity which should be provided. It is neccessary to call the method 'teardown()' at the end of 'run()'.

Author:
Enrico Hartung <enrico@iptel.org>
License:
GPL

Definition at line 39 of file TestModule.py.


Public Member Functions

def __init__
 Constructor.
def initTestModule
 This function is expected to be overridden by the child class.
def set
 Generic setter for the test modules protected(!) attributes.
def get
 Generic getter for the test modules protected(!) attributes.
def run
 Test module's 'main' method.

Private Member Functions

def _storeResult
 Store result of this test in result of whole test case.

Private Attributes

 _name
 _timeout
 _logFilename
 _logPath
 _server

Static Private Attributes

string _name = ""
int _timeout = 0
 _caller = None
string _logFilename = ""
string _logPath = ""
tuple _server = ('localhost', None)
 _expectedResult = None

Member Function Documentation

def __init__ (   self,
  name,
  timeout,
  caller,
  server = ('localhost', None,
  expectedResult = None 
)

Constructor.

Parameters:
name name of this process (string)
timeout the timeout after which the process is terminated (int)
caller a reference to the object that called this one for callback (testenv.core.TestCase)

Definition at line 71 of file TestModule.py.

def initTestModule (   self  ) 

def _storeResult (   self,
  name,
  resultCode,
  terminationType 
) [private]

Store result of this test in result of whole test case.

Parameters:
name name of this test (string)
resultCode result code of this test (string)
terminationType type of termination ('timed out' or 'terminated') (string)
Returns:
test result object (testenv.core.TestResult)

Definition at line 105 of file TestModule.py.

def set (   self,
  name,
  value 
)

Generic setter for the test modules protected(!) attributes.

Parameters:
name name of attribute without '_' (string)
value value the attribute should be set to (void)

Definition at line 133 of file TestModule.py.

def get (   self,
  name 
)

Generic getter for the test modules protected(!) attributes.

Parameters:
name name of attribute without '_' (string)
Returns:
value of attribute (void)

Definition at line 144 of file TestModule.py.

def run (   self  ) 


Member Data Documentation

string _name = "" [static, private]

Definition at line 42 of file TestModule.py.

int _timeout = 0 [static, private]

Definition at line 45 of file TestModule.py.

_caller = None [static, private]

Definition at line 48 of file TestModule.py.

string _logFilename = "" [static, private]

Definition at line 51 of file TestModule.py.

string _logPath = "" [static, private]

Definition at line 54 of file TestModule.py.

tuple _server = ('localhost', None) [static, private]

Definition at line 57 of file TestModule.py.

_expectedResult = None [static, private]

Definition at line 60 of file TestModule.py.

_name [private]

Definition at line 74 of file TestModule.py.

_timeout [private]

Definition at line 75 of file TestModule.py.

_logFilename [private]

Definition at line 79 of file TestModule.py.

_logPath [private]

Definition at line 80 of file TestModule.py.

_server [private]

Definition at line 81 of file TestModule.py.


The documentation for this class was generated from the following file:

Generated on Mon Aug 11 17:28:33 2008 for TestEnv by  doxygen 1.5.5