diff -Nru autopkgtest-2.9.1/debian/changelog autopkgtest-2.9.2/debian/changelog --- autopkgtest-2.9.1/debian/changelog 2014-03-06 12:44:17.000000000 +0000 +++ autopkgtest-2.9.2/debian/changelog 2014-03-12 07:13:55.000000000 +0000 @@ -1,3 +1,17 @@ +autopkgtest (2.9.2) unstable; urgency=medium + + * VirtSubproc.py, copydown_shareddir(): Fix "src and dest are the same file" + error when file is already in the shared downtmp. + * VirtSubproc.py, copydown_shareddir(): Remove already existing target + directory to avoid copying an updated directory into the old one. + * adt-run: Show timestamps at the beginning, start of preparation (i. e. + mostly installing dependencies), and start and end of tests. + (LP: #1290760) + * Run NullRunnerNoRoot tests during package build. Add python-debian build + dependency for that. + + -- Martin Pitt Wed, 12 Mar 2014 08:13:50 +0100 + autopkgtest (2.9.1) unstable; urgency=medium [ Martin Pitt ] diff -Nru autopkgtest-2.9.1/debian/control autopkgtest-2.9.2/debian/control --- autopkgtest-2.9.1/debian/control 2014-03-06 12:44:17.000000000 +0000 +++ autopkgtest-2.9.2/debian/control 2014-03-12 07:13:55.000000000 +0000 @@ -5,6 +5,7 @@ Priority: optional Standards-Version: 3.9.5 Build-Depends: debhelper (>= 8), + python-debian, pyflakes, pep8 Vcs-Git: git://git.debian.org/git/autopkgtest/autopkgtest.git diff -Nru autopkgtest-2.9.1/debian/rules autopkgtest-2.9.2/debian/rules --- autopkgtest-2.9.1/debian/rules 2014-03-06 12:44:17.000000000 +0000 +++ autopkgtest-2.9.2/debian/rules 2014-03-12 07:13:55.000000000 +0000 @@ -46,6 +46,7 @@ override_dh_auto_test: tests/pyflakes tests/pep8 + tests/adt-run NullRunnerNoRoot # necessary until we move to compat level 9 override_dh_pysupport: diff -Nru autopkgtest-2.9.1/lib/VirtSubproc.py autopkgtest-2.9.2/lib/VirtSubproc.py --- autopkgtest-2.9.1/lib/VirtSubproc.py 2014-03-06 12:44:17.000000000 +0000 +++ autopkgtest-2.9.2/lib/VirtSubproc.py 2014-03-12 07:13:55.000000000 +0000 @@ -457,6 +457,7 @@ host = os.path.normpath(host) tb = os.path.normpath(tb) + downtmp_host = os.path.normpath(downtmp_host) timeout_start(copy_timeout) try: @@ -477,6 +478,8 @@ if host == tb: host_tmp = None else: + subprocess.call(downs['auxverb'] + ['rm', '-rf', tb], + preexec_fn=preexecfn) cp = subprocess.Popen(downs['auxverb'] + ['cp', '-a', host, tb], preexec_fn=preexecfn) cp.communicate() diff -Nru autopkgtest-2.9.1/runner/adt-run autopkgtest-2.9.2/runner/adt-run --- autopkgtest-2.9.1/runner/adt-run 2014-03-06 12:44:17.000000000 +0000 +++ autopkgtest-2.9.2/runner/adt-run 2014-03-12 07:13:55.000000000 +0000 @@ -87,7 +87,7 @@ print >> sys.stderr, message -def debug(message, minlevel=0): +def debug(message, minlevel=0, timestamp=False): '''Write a debug message to stderr according to --quiet''' if opts.debuglevel < minlevel: @@ -96,6 +96,8 @@ p = 'adt-run' if minlevel: p += str(minlevel) + if timestamp: + p += ' [%s]' % time.strftime('%Y-%m-%d %H:%M:%S') p += ': ' log_msg(message, p) @@ -586,7 +588,7 @@ debug('** ' + m, minlevel) def start(self): - debug('version @devel@') + debug('version @devel@', timestamp=True) debug_subprocess('vserver', opts.vserver) self.sp = subprocess.Popen(opts.vserver, stdin=subprocess.PIPE, @@ -1195,8 +1197,8 @@ debug('constructed; path=%s' % self.path, 1) debug(' .depends=%s' % self.depends, 1) - def _debug(self, m): - debug('& %s: %s' % (self.what, m)) + def _debug(self, m, timestamp=False): + debug('& %s: %s' % (self.what, m), timestamp=timestamp) def report(self, m): report(self.what, m) @@ -1207,7 +1209,7 @@ report(self.what, 'FAIL ' + m) def prepare(self, tree): - self._debug('preparing') + self._debug('preparing', True) dn = [] for d in self.depends: self._debug(' processing dependency ' + d) @@ -1289,7 +1291,7 @@ debug('shared_downtmp with FIFO not supported', 1) if show_realtime: - self._debug('[----------------------------------------') + self._debug('[-----------------------', True) debug('teeing to stdout: %s, stderr: %s' % (fifo_out.host, fifo_err.host), 2) tee_out = os.fork() if tee_out == 0: @@ -1330,15 +1332,16 @@ os.kill(tee_err, signal.SIGTERM) os.waitpid(tee_out, 0) os.waitpid(tee_err, 0) - self._debug('----------------------------------------]') + self._debug('-----------------------]', True) # without a shared downtmp we cannot show realtime output and need # to show stdout afterwards else: - self._debug('running...') + self._debug('running...', True) rc = testbed.execute('test-' + self.what, test_argv, so=so.tb, se=se.tb, cwd=tree.tb, xenv=xenv, kind='test') + self._debug('finished', True) debug('testbed executing test finished with exit status %i' % rc, 1) # copy stdout/err files to host diff -Nru autopkgtest-2.9.1/tests/adt-run autopkgtest-2.9.2/tests/adt-run --- autopkgtest-2.9.1/tests/adt-run 2014-03-06 12:44:17.000000000 +0000 +++ autopkgtest-2.9.2/tests/adt-run 2014-03-12 07:13:55.000000000 +0000 @@ -183,7 +183,7 @@ # should show test stdout/err self.assertIn('babble\n', out) - self.assertRegex(err, '-+\nI am fine\nadt-run: & tree0t-pass: --') + self.assertRegex(err, '-+\nI am fine\nadt-run \[[0-9: -]+\]: & tree0t-pass: --') # but not complain about stderr self.assertNotIn('stderr', err) @@ -1127,6 +1127,22 @@ self.assertRegex(out, 'im\s+SKIP .*machine', out) self.assertNotIn('ok', out) + def test_tree_garbage(self): + '''copied source tree contains only expected files''' + + p = self.build_src('Tests: g\nDepends:\nRestrictions: needs-root\n', + {'g': '#!/bin/sh\npwd\nLC_ALL=C ls .\n'}) + + (code, out, err) = self.adt_run(['-B', '--unbuilt-tree=' + p], + [self.chroot]) + self.assertEqual(code, 0, err) + self.assertRegex(out, 'tree0t-g\s+PASS', out) + + self.assertRegex(out, '^/tmp/adt-run.*/ubtree0-build/real-tree\n' + 'Makefile\ndebian\ntest_static\n') + # should not have any test stderr + self.assertNotIn('stderr', err) + @unittest.skipUnless('ADT_TEST_SCHROOT' in os.environ, 'Set $ADT_TEST_SCHROOT to an existing schroot')