blob: 22fefd5da820e82a55c4672ff8be11625fa50a95 [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 """
apw4726b092007-03-12 20:35:05 +000024 self.setup(job)
25
26
27 def setup(self, job):
28 """
29 job
30 The job object for this job
31 """
apwde1503a2006-10-10 08:34:21 +000032 self.job = job
33
34
35 def run_start(self):
36 """A run within this job is starting"""
37 pass
38
39
40 def run_pause(self):
41 """A run within this job is completing (expect continue)"""
42 pass
43
44
45 def run_reboot(self):
46 """A run within this job is performing a reboot
47 (expect continue following reboot)
48 """
49 pass
50
51
mbligh61a6c1a2006-12-25 01:26:38 +000052 def run_abort(self):
53 """A run within this job is aborting. It all went wrong"""
54 pass
55
56
57 def run_complete(self):
apwde1503a2006-10-10 08:34:21 +000058 """A run within this job is completing (all done)"""
59 pass
60
61
62 def test_status(self, status):
63 """A test within this job is completing"""
64 pass
65
66
67def select(which, job):
68 if which:
69 exec "import harness_%s" % (which)
70 exec "myharness = harness_%s.harness_%s(job)" % (which, which)
71 else:
72 myharness = harness(job)
73
apwde1503a2006-10-10 08:34:21 +000074 return myharness