1 """The harness interface
3 The interface between the client and the server when hosted.
6 __author__
= """Copyright Andy Whitcroft 2006"""
8 import os
, sys
, logging
11 class harness(object):
12 """The NULL server harness
16 The job object for this job
19 def __init__(self
, job
):
22 The job object for this job
30 The job object for this job
34 configd
= os
.path
.join(os
.environ
['AUTODIR'], 'configs')
35 if os
.path
.isdir(configd
):
36 (name
, dirs
, files
) = os
.walk(configd
).next()
37 job
.config_set('kernel.default_config_set',
38 [ configd
+ '/' ] + files
)
42 """A run within this job is starting"""
47 """A run within this job is completing (expect continue)"""
52 """A run within this job is performing a reboot
53 (expect continue following reboot)
59 """A run within this job is aborting. It all went wrong"""
63 def run_complete(self
):
64 """A run within this job is completing (all done)"""
68 def run_test_complete(self
):
69 """A test run by this job is complete. Note that if multiple
70 tests are run in parallel, this will only be called when all
71 of the parallel runs complete."""
75 def test_status(self
, status
, tag
):
76 """A test within this job is completing"""
80 def test_status_detail(self
, code
, subdir
, operation
, status
, tag
,
82 """A test within this job is completing (detail)"""
86 def select(which
, job
, harness_args
):
90 logging
.debug('Selected harness: %s' % which
)
92 harness_name
= 'harness_%s' % which
93 harness_module
= common
.setup_modules
.import_module(harness_name
,
94 'autotest_lib.client.bin')
95 harness_instance
= getattr(harness_module
, harness_name
)(job
, harness_args
)
97 return harness_instance