ronnie
2022-10-14 1504bb53e29d3d46222c0b3ea994fc494b48e153
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
"""The harness interface
 
The interface between the client and the server when hosted.
"""
 
# pylint: disable=missing-docstring
 
__author__ = """Copyright Andy Whitcroft 2006"""
 
import logging
 
import common
 
 
class harness(object):
    """The NULL server harness
 
    Properties:
            job
                    The job object for this job
    """
 
    def __init__(self, job):
        """
                job
                        The job object for this job
        """
        self.setup(job)
 
 
    def setup(self, job):
        """
                job
                        The job object for this job
        """
        self.job = job
 
 
    def run_start(self):
        """A run within this job is starting"""
        pass
 
 
    def run_pause(self):
        """A run within this job is completing (expect continue)"""
        pass
 
 
    def run_reboot(self):
        """A run within this job is performing a reboot
           (expect continue following reboot)
        """
        pass
 
 
    def run_abort(self):
        """A run within this job is aborting. It all went wrong"""
        pass
 
 
    def run_complete(self):
        """A run within this job is completing (all done)"""
        pass
 
 
    def run_test_complete(self):
        """A test run by this job is complete. Note that if multiple
        tests are run in parallel, this will only be called when all
        of the parallel runs complete."""
        pass
 
 
    def test_status(self, status, tag):
        """A test within this job is completing"""
        pass
 
 
    def test_status_detail(self, code, subdir, operation, status, tag,
                           optional_fields):
        """A test within this job is completing (detail)"""
        pass
 
 
def select(which, job, harness_args):
    if not which:
        which = 'standalone'
 
    logging.debug('Selected harness: %s', which)
 
    harness_name = 'harness_%s' % which
    harness_module = common.setup_modules.import_module(harness_name,
                                                        'autotest_lib.client.bin')
    harness_instance = getattr(harness_module, harness_name)(job, harness_args)
 
    return harness_instance