OLD | NEW |
1 """ | 1 """ |
2 The simple harness interface | 2 The simple harness interface |
3 """ | 3 """ |
4 | 4 |
5 __author__ = """Copyright Andy Whitcroft, Martin J. Bligh 2006""" | 5 __author__ = """Copyright Andy Whitcroft, Martin J. Bligh 2006""" |
6 | 6 |
7 import os, harness, time | 7 import os, harness, time |
8 | 8 |
9 class harness_simple(harness.harness): | 9 class harness_simple(harness.harness): |
10 """ | 10 """ |
11 The simple server harness | 11 The simple server harness |
12 | 12 |
13 Properties: | 13 Properties: |
14 job | 14 job |
15 The job object for this job | 15 The job object for this job |
16 """ | 16 """ |
17 | 17 |
18 def __init__(self, job): | 18 def __init__(self, job, harness_args): |
19 """ | 19 """ |
20 job | 20 job |
21 The job object for this job | 21 The job object for this job |
22 """ | 22 """ |
23 self.setup(job) | 23 self.setup(job) |
24 | 24 |
25 self.status = os.fdopen(3, 'w') | 25 self.status = os.fdopen(3, 'w') |
26 | 26 |
27 | 27 |
28 def test_status(self, status, tag): | 28 def test_status(self, status, tag): |
29 """A test within this job is completing""" | 29 """A test within this job is completing""" |
30 if self.status: | 30 if self.status: |
31 for line in status.split('\n'): | 31 for line in status.split('\n'): |
32 # prepend status messages with | 32 # prepend status messages with |
33 # AUTOTEST_STATUS:tag: so that we can tell | 33 # AUTOTEST_STATUS:tag: so that we can tell |
34 # which lines were sent by the autotest client | 34 # which lines were sent by the autotest client |
35 pre = 'AUTOTEST_STATUS:%s:' % (tag,) | 35 pre = 'AUTOTEST_STATUS:%s:' % (tag,) |
36 self.status.write(pre + line + '\n') | 36 self.status.write(pre + line + '\n') |
37 self.status.flush() | 37 self.status.flush() |
OLD | NEW |