예제 #1
0
 def __init__(self, suiteDef):
     Stateful.__init__(self)
     # name of test suite
     self.name = suiteDef.name
     # test suite definition copy
     self.suite = copy(suiteDef)
     self.suite.jobFun = None
     # date of initialization
     self.initDate = datetime.datetime.now()
     # references to slaves who are necessary for the test suite
     self.slaves = []
     # keeps the results of each stage.
     self.stagesResults = []
     # unique identifier of test suite
     self.uid = self.suite.name + "-" + self.initDate.isoformat()
     # remove special chars from uid
     self.uid = self.uid.translate(maketrans("", ""), "-:.")
     # test cases loaded to run in this session, key is testCase.uid
     self.cases = {}
     # uid of last run test case with given name
     self.caseUidByName = {}
     # if result of any stage i.a. init, test case stages or finalize
     # ended with non-zero status code
     self.failed = False
     self.failed_cases = []
     # This will be set if the session times out.
     self.timeout = False
     # Register an email notifier for this session.
     self.notifier = EmailNotifier(self.suite.alert_emails, self.suite.alert_success, self.suite.alert_failure)
예제 #2
0
 def __init__(self):
     Stateful.__init__(self)
     # Name of test suite: must be the same as the name of test suite definition
     # file
     self.name = ""
     # Name of test suite readable for humans, only for informational need
     self.descName = ""
     # Define when the test should be run (cron style). Reference: APScheduler
     # cronschedule
     self.schedule = {}
     # A list of virtual clusters needed by the test to be spawned on a hypervisor
     self.clusters = []
     # Names of machines, including the virtual machines that are needed by the
     # test
     self.machines = []
     # A URL to a shell script (starts with http://) or  a shell script (starts
     # with #!) that defines the commands that need to be run on each test slave
     # before any test case can run. If it fails then the entire test suite should
     # be considered as failed.
     self.initialize = ""
     # A URL to a shell script or a shell script that defines the clean up
     # procedures to be run after all the tests cases are completed
     self.finalize = ""
     # A list of test case names as defined below
     self.tests = []
     # Means that all cluster definitions that the cluster depends on are available
     self.defComplete = True
     # Handle to function that will be used by scheduler. Has to be kept in case of
     # unscheduling.
     self.jobFun = None
     # Reference to the job object inside the scheduler
     self.job = None
     # If machines were empty, system has to remember to reload them every time
     # cluster definition changes
     self.machinesAutoFilled = False
     # Filled automatically by load test suite defs. Holds Python objects
     # representing test cases
     self.testCases = []
     # Current state of this suite
     self.state = ""
     # A list of email addresses to alert, based on the policies below.
     self.alert_emails = []
     # Test suite success email alert policy.
     self.alert_success = ""
     # Test suite failure email alert policy.
     self.alert_failure = ""