-#!/usr/bin/python2.4
+#!/usr/bin/python2.6
#
# adt-run is part of autopkgtest
# autopkgtest is a tool for testing Debian binary packages
from optparse import OptionParser
signal.signal(signal.SIGINT, signal.SIG_DFL) # undo stupid Python SIGINT thing
+try: our_base = os.environ['AUTOPKGTEST_BASE']+'/lib'
+except KeyError: our_base = '/usr/share/autopkgtest/python';
+sys.path.insert(1, our_base)
+
+from Autopkgtest import *
+
#---------- global variables
tmpdir = None # pathstring on host
xtra = ''
if p.spec is not None:
xtra = ' spec[%s]=%s' % (p.spec, getattr(p,'spec_tb',None))
- raise ("internal error: %s (%s)" % (how, str(p)))
+ raise Exception("internal error: %s (%s)" % (how, str(p)))
def _ensure_path(p, tbp):
if p.path[tbp] is None:
elif type(act) == str:
act = (act,act)
else:
- raise ("unknown action in list `%s' having"
+ raise Exception("unknown action in list `%s' having"
" type `%s'" % (act, type(act)))
(pathstr, kindpath) = act
if len(pec) < 1: tb.bomb('too few results from print-execute-command')
cmdl = map(urllib.unquote, pec[0].split(','))
- shellquote_re = regexp.compile('"')
- def shellquote_arg(s): return "'" + shellquote_re.sub(r"'\''", s) + "'"
- def shellquote_cmdl(l): return ' '.join(map(shellquote_arg,l))
-
tb._debug('cmdl = %s' % (`cmdl`))
tb.ec_auxverbscript = TemporaryFile('satdep-auxverb')
print >>open(tb.ec_auxverbscript.write(),'w'), (
'''#!/bin/sh
-set -ex
-echo >&2 ": $*"
+set -e
if [ $# = 2 ] && [ "x$1" = xdpkg-architecture ] && [ "x$2" = x-qDEB_HOST_ARCH ]; then
# This is a pretty nasty hack. Hopefully it can go away
# eventually. See #635763.
def __init__(r,rname,base): pass
class Restriction_rw_build_tree(Restriction): pass
+class Restriction_build_neeeded(Restriction): pass
class Restriction_breaks_testbed(Restriction):
def __init__(r, rname, base):
- if 'revert' not in testbed.caps:
+ if 'revert-full-system' not in testbed.caps:
raise Unsupported(f.lno,
- 'Test breaks testbed but testbed cannot revert')
+ 'Test breaks testbed but testbed does not advertise revert-full-system')
class Restriction_needs_root(Restriction):
def __init__(r, rname, base):
if 'root-on-testbed' not in testbed.caps:
stanzas = read_control(act, result_pwd_af, control_override)
for stanza in stanzas:
for t in stanza[' tests']:
- if 'no-build-needed' not in t.feature_names:
+ if 'build-needed' in t.restriction_names:
build_needed('test %s' % t.tname)
- for d in t.depends:
- if '@' in d:
- build_needed('test %s '
- 'dependency %s' % (t.tname,d))
debug_b('build not needed')
built = False