blob: b598e1ce32219db1e2983cbb81457c51707c06ab [file] [log] [blame]
apwde1503a2006-10-10 08:34:21 +00001"""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
mbligh61a6c1a2006-12-25 01:26:38 +000044 def run_abort(self):
45 """A run within this job is aborting. It all went wrong"""
46 pass
47
48
49 def run_complete(self):
apwde1503a2006-10-10 08:34:21 +000050 """A run within this job is completing (all done)"""
51 pass
52
53
54 def test_status(self, status):
55 """A test within this job is completing"""
56 pass
57
58
59def select(which, job):
60 if which:
61 exec "import harness_%s" % (which)
62 exec "myharness = harness_%s.harness_%s(job)" % (which, which)
63 else:
64 myharness = harness(job)
65
apwde1503a2006-10-10 08:34:21 +000066 return myharness