harness.py revision 357f50fbbcf6957fde8c8cb79407cb14d8407b10
1"""The harness interface
2
3The interface between the client and the server when hosted.
4"""
5
6__author__ = """Copyright Andy Whitcroft 2006"""
7
8from autotest_utils import *
9import os, sys
10
11class harness:
12	"""The NULL server harness
13
14	Properties:
15		job
16			The job object for this job
17	"""
18
19	def __init__(self, job):
20		"""
21			job
22				The job object for this job
23		"""
24		self.job = job
25
26
27	def run_start(self):
28		"""A run within this job is starting"""
29		pass
30
31
32	def run_pause(self):
33		"""A run within this job is completing (expect continue)"""
34		pass
35
36
37	def run_reboot(self):
38		"""A run within this job is performing a reboot
39		   (expect continue following reboot)
40		"""
41		pass
42
43
44	def run_complete(self, status):
45		"""A run within this job is completing (all done)"""
46		pass
47
48
49	def test_status(self, status):
50		"""A test within this job is completing"""
51		pass
52
53
54def select(which, job):
55	if which:
56		exec "import harness_%s" % (which)
57		exec "myharness = harness_%s.harness_%s(job)" % (which, which)
58	else:
59		myharness = harness(job)
60
61	return myharness
62