From: Ian Jackson Date: Thu, 14 Jun 2012 19:48:47 +0000 (+0100) Subject: tmpdir: always suppply a special tmpdir, with subdirs for ADTTMP and TMPDIR X-Git-Tag: debian/2.2.0~4 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9630e8915c921d98bea37ad8d3becde1bad43582;p=autopkgtest.git tmpdir: always suppply a special tmpdir, with subdirs for ADTTMP and TMPDIR --- diff --git a/runner/adt-run b/runner/adt-run index 47036ed..0ce14d1 100755 --- a/runner/adt-run +++ b/runner/adt-run @@ -1153,22 +1153,27 @@ class Test: rc = testbed.execute('testchmod-'+t.what, ['chmod','+x','--',tf]) if rc: bomb('failed to chmod +x %s' % tf) + testtmp = '%s%s-testtmp' % (testbed.scratch.read(True), t.what) + script = 'rm -rf -- "$@"; mkdir -- "$@"' + if 'needs-root' not in t.restriction_names and opts.user is not None: tfl = ['su',opts.user,'-c',tf] - testtmp = '%s%s-testtmp' % (testbed.scratch.read(True), t.what) - script = 'rm -rf -- "$1"; mkdir -- "$1"' if opts.user: - script += '; chown %s "$1"' % opts.user + script += '; chown %s "$@"' % opts.user if 'rw-build-tree' in t.restriction_names: script += '; chown -R %s "$2"' % opts.user - xenv.append('TMPDIR=%s' % testtmp) - rc = testbed.execute('mktmpdir-'+t.what, - ['sh','-xec',script,'x',xenv=xenv,tree.read(True)]) - if rc: bomb("could not create test tmp `%s', exit code %d" - % (testtmp, rc)) else: tfl = [tf] + test_tmpdir = testtmp+'/tmpdir'; xenv.append('TMPDIR=%s' % test_tmpdir) + test_addtmp = testtmp+'/addtmp'; xenv.append('ADTTMP=%s' % test_adttmp) + rc = testbed.execute('mktmpdir-'+t.what, + ['sh','-xec',script,'x', + test_tmpdir, test_adttmp, + tree.read(True)]) + if rc: bomb("could not create test tmp dirs in `%s', exit code %d" + % (testtmp, rc)) + rc = testbed.execute('test-'+t.what, tfl, so=so.write(True), se=se.write(True), cwd=tree.read(True), xenv=xenv, kind='test')