chiark / gitweb /
set DEBCONF_FRONTEND=noninteractive
authorIan Jackson <ian@anarres>
Tue, 3 Apr 2007 17:49:17 +0000 (18:49 +0100)
committerIan Jackson <ian@anarres>
Tue, 3 Apr 2007 17:49:17 +0000 (18:49 +0100)
runner/adt-run

index 3521af3c39cca2aa324a8abbf9fd398414e14f62..f743427107a9f465351472c350bf47f83090762b 100755 (executable)
@@ -738,7 +738,7 @@ class Testbed:
        if not tb._need_reset_apt: return
        what = 'aptget-update-reset'
        cmdl = ['apt-get','-qy','update']
-       rc = tb.execute(what, cmdl, timeout=timeouts['install'])
+       rc = tb.execute(what, cmdl, kind='install')
        if rc:
                pstderr("\n" "warning: failed to restore"
                        " testbed apt cache, exit code %d" % rc)
@@ -783,7 +783,7 @@ class Testbed:
        cmdl = ['python','-c',script]
        what = 'install-deps'
        rc = testbed.execute(what+'-debinstall', cmdl, script=script,
-                               timeout=timeouts['install'])
+                               kind='install')
        if rc: badpkg('dependency install failed, exit code %d' % rc)
  def needs_reset(tb):
        tb._debug('needs_reset, previously=%s' % tb.modified, 1)
@@ -850,7 +850,7 @@ class Testbed:
        return rl[0]
  def execute(tb, what, cmdl,
                si='/dev/null', so='/dev/null', se=None, cwd=None,
-               script=False, tmpdir=None, timeout=timeouts['short']):
+               script=False, tmpdir=None, kind='short'):
        # Options for script:
        #   False - do not call debug_subprocess, no synch. reporting required
        #   None or string - call debug_subprocess with that value,
@@ -859,6 +859,8 @@ class Testbed:
        #   None - usual Errplumb (output is of kind 2c)
        #   string - path on testbed (output is of kind 2d)
 
+       timeout = timeouts[kind]
+
        if script is not False: debug_subprocess(what, cmdl, script=script)
        if cwd is None: cwd = tb.scratch.write(True)
 
@@ -884,6 +886,7 @@ class Testbed:
 
        if xdump is not None and 'execute-debug' in tb.caps: cmdl += [xdump]
        if tmpdir is not None: cmdl.append('env=TMPDIR=%s' % tmpdir)
+       if kind=='install': cmdl.append('env=DEBIAN_FRONTEND=noninteractive')
 
        rc = tb.commandr1('execute', cmdl)
        try: rc = int(rc)
@@ -1073,7 +1076,7 @@ class Test:
 
        rc = testbed.execute('test-'+t.what, tfl,
                so=so.write(True), se=se.write(True), cwd=tree.read(True),
-               tmpdir=tmpdir, timeout=timeouts['test'])
+               tmpdir=tmpdir, kind='test')
 
        so_read = so.read()
        se_read = se.read()
@@ -1398,7 +1401,7 @@ END
        testbed.mungeing_apt()
        rc = testbed.execute('apt-key', ['sh','-ec',script],
                                so=so.write(True), cwd=b.dir.write(True),
-                               script=script)
+                               script=script, kind='install')
        if rc: bomb('apt setup failed with exit code %d' % rc)
 
        testbed.blamed += b.blamed
@@ -1419,8 +1422,8 @@ END
                what = 'apt-get-reinstall'
                cmdl = (b.apt_get() + ['--reinstall','install'] +
                        [pkg for pkg in pkgs_reinstall])
-               rc = testbed.execute(what, cmdl, script=None,
-                               timeout=timeouts['install'])
+               cmdl.append('env=DEBIAN_FRONTEND=noninteractive')
+               rc = testbed.execute(what, cmdl, script=None, kind='install')
                if rc: badpkg("installation of basic binarries failed,"
                                " exit code %d" % rc)
 
@@ -1429,8 +1432,7 @@ END
                what = 'apt-get-install-%s' % pkg
                testbed.blame(pkg)
                cmdl = b.apt_get() + ['install',pkg]
-               rc = testbed.execute(what, cmdl, script=None,
-                               timeout=timeouts['install'])
+               rc = testbed.execute(what, cmdl, script=None, kind='install')
                if rc: badpkg("installation of %s failed, exit code %d"
                                % (pkg, rc))
 
@@ -1446,8 +1448,7 @@ def source_rules_command(act,script,what,which,work,cwd,
        so = TemporaryFile('%s-%s-results' % (what,which))
        rc = testbed.execute('%s-%s' % (what,which),
                        ['sh','-ec',script]+xargs, script=script,
-                       so=so.write(True), cwd=cwd,
-                       timeout=timeouts['build'])
+                       so=so.write(True), cwd=cwd, kind='build')
        results = open(so.read()).read().rstrip('\n')
        if len(results): results = results.split("\n")
        else: results = []
@@ -1517,8 +1518,7 @@ def build_source(act, control_override):
                        ]])
                cmdl = ['python','-c',script]
                whatp = what+'-dpkgsource'
-               rc = testbed.execute(what, cmdl, script=script,
-                               timeout=timeouts['install'])
+               rc = testbed.execute(what, cmdl, script=script, kind='install')
                if rc: badpkg('dpkg-source install failed, exit code %d' % rc)
 
        work = TemporaryDir(what+'-build')
@@ -1629,8 +1629,7 @@ def build_source(act, control_override):
 
                cmdl = ['python','-c',script]
                whatp = what+'-builddeps'
-               rc = testbed.execute(what, cmdl, script=script,
-                               timeout=timeouts['install'])
+               rc = testbed.execute(what, cmdl, script=script, kind='install')
                if rc: badpkg('build-depends install failed,'
                              ' exit code %d' % rc)