From 272bfae40119022334f3d8e22ad17a19a050aa9d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 2 Feb 2006 16:29:50 +0000 Subject: [PATCH] bugfixes --- runner/adt-run | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/runner/adt-run b/runner/adt-run index 8b52320..dd6c13c 100755 --- a/runner/adt-run +++ b/runner/adt-run @@ -100,6 +100,7 @@ class Path: return p.local def ontb(p): if p.down is not None: return p.down + testbed.open() p.down = testbed.scratch.p + '/host-' + p.what testbed.command('copydown', (p.path(), p.down + p.dirsfx)) return p.down @@ -189,6 +190,7 @@ class Testbed: def close(tb): if tb.scratch is None: return tb.scratch = None + if tb.sp is None: return tb.command('close') def bomb(tb, m): if tb.sp is not None: @@ -200,14 +202,16 @@ class Testbed: tb.sp = None raise Quit(16, 'testbed failed: %s' % m) def send(tb, string): + tb.sp.stdin try: debug('>> '+string) print >>tb.sp.stdin, string tb.sp.stdin.flush() tb.lastsend = string except: - tb.bomb('cannot send to testbed: %s' % - formatexception_only(sys.last_type, sys.last_value)) + (type, value, dummy) = sys.exc_info() + tb.bomb('cannot send to testbed: %s' % traceback. + format_exception_only(type, value)) def expect(tb, keyword, nresults=-1): l = tb.sp.stdout.readline() if not l: tb.bomb('unexpected eof from the testbed') @@ -306,7 +310,9 @@ class Test: 'test name may not contain / character') for k in base: setattr(t,k,base[k]) t.tname = tname - t.p = opts.build_tree.append(tname, 'test-'+tname) + if len(base['testsdir']): tpath = base['testsdir'] + '/' + tname + else: tpath = tname + t.p = opts.build_tree.append(tpath, 'test-'+tname) t.p.ontb() def report(t, m): report(t.tname, m) -- 2.30.2