diff -Nru autopkgtest-2.9/debian/changelog autopkgtest-2.9.1/debian/changelog --- autopkgtest-2.9/debian/changelog 2014-02-27 10:23:46.000000000 +0000 +++ autopkgtest-2.9.1/debian/changelog 2014-03-06 12:44:17.000000000 +0000 @@ -1,3 +1,24 @@ +autopkgtest (2.9.1) unstable; urgency=medium + + [ Martin Pitt ] + * doc/README.package-tests: Clarify syntax of test Depends:, and point to + the relevant Debian Policy specification. + * adt-build-lxc: Fall back to assuming /var/lib/lxc/ as container directory + if lxc-config does not exist. It was introduced in 1.0, but Debian + unstable still has 0.9. (Closes: #740437) + * tests: Extend test_artifacts() to multiple tests writing artifacts, also + with overwriting existing files and writing into subdirs. + * VirtSubproc: Fix copyup_shareddir() to get along with existing + directories. (LP: #1288668) + * settings.make: Switch default prefix to /usr, as our scripts hardcode that + for finding VirtSubproc.py and this is a native package. (LP: #1287264) + + [ Steve Langasek ] + * Fix adt-virt-schroot to correctly return root-on-testbed when we're + running adt-run as root. (Closes: #740868) + + -- Martin Pitt Thu, 06 Mar 2014 13:44:07 +0100 + autopkgtest (2.9) unstable; urgency=low New features: diff -Nru autopkgtest-2.9/debian/rules autopkgtest-2.9.1/debian/rules --- autopkgtest-2.9/debian/rules 2014-02-27 10:23:46.000000000 +0000 +++ autopkgtest-2.9.1/debian/rules 2014-03-06 12:44:17.000000000 +0000 @@ -28,10 +28,9 @@ dh "$@" override_dh_auto_install: - $(MAKE) install-here DESTDIR=$(CURDIR)/debian/autopkgtest prefix=/usr + $(MAKE) install-here DESTDIR=$(CURDIR)/debian/autopkgtest $(MAKE) -C xen install \ DESTDIR=$(CURDIR)/debian/autopkgtest-xenlvm \ - prefix=/usr \ pkgname=autopkgtest-xenlvm \ cfg_suffix='' diff -Nru autopkgtest-2.9/doc/README.package-tests autopkgtest-2.9.1/doc/README.package-tests --- autopkgtest-2.9/doc/README.package-tests 2014-02-27 10:23:46.000000000 +0000 +++ autopkgtest-2.9.1/doc/README.package-tests 2014-03-06 12:44:17.000000000 +0000 @@ -74,7 +74,9 @@ Depends: Declares that the specified packages must be installed for the - test to go ahead. + test to go ahead. This supports all features of dpkg dependencies + (see https://www.debian.org/doc/debian-policy/ch-relationships.html), + plus the following extensions: `@' stands for the package(s) generated by the source package containing the tests; each dependency (strictly, or-clause, which diff -Nru autopkgtest-2.9/lib/VirtSubproc.py autopkgtest-2.9.1/lib/VirtSubproc.py --- autopkgtest-2.9/lib/VirtSubproc.py 2014-02-27 10:23:46.000000000 +0000 +++ autopkgtest-2.9.1/lib/VirtSubproc.py 2014-03-06 12:44:17.000000000 +0000 @@ -400,6 +400,18 @@ return None +def copytree(src, dst): + '''Like shutils.copytree(), but merges with existing dst''' + + if not os.path.exists(dst): + shutil.copytree(src, dst, symlinks=True) + return + + for f in os.listdir(src): + fsrc = os.path.join(src, f) + subprocess.check_call(['cp', '-at', dst, fsrc]) + + def copyup_shareddir(tb, host, is_dir, downtmp_host): debug('copyup_shareddir: tb %s, host %s, is_dir %s, downtmp_host %s' % ( tb, host, is_dir, downtmp_host)) @@ -429,7 +441,7 @@ debug('copyup_shareddir: tb(host) %s is not already at ' 'destination %s, copying' % (tb, host)) if is_dir: - shutil.copytree(tb, host, symlinks=True) + copytree(tb, host) else: shutil.copy(tb, host) diff -Nru autopkgtest-2.9/settings.make autopkgtest-2.9.1/settings.make --- autopkgtest-2.9/settings.make 2014-02-27 10:23:46.000000000 +0000 +++ autopkgtest-2.9.1/settings.make 2014-03-06 12:44:17.000000000 +0000 @@ -1,4 +1,4 @@ -prefix = /usr/local +prefix = /usr dest_prefix = $(DESTDIR)$(prefix) share = $(dest_prefix)/share bindir = $(dest_prefix)/bin diff -Nru autopkgtest-2.9/tests/adt-run autopkgtest-2.9.1/tests/adt-run --- autopkgtest-2.9/tests/adt-run 2014-02-27 10:23:46.000000000 +0000 +++ autopkgtest-2.9.1/tests/adt-run 2014-03-06 12:44:17.000000000 +0000 @@ -918,9 +918,17 @@ def test_artifacts(self): '''tests producing additional artifacts''' - p = self.build_src('Tests: pass\nDepends:\nRestrictions: needs-root\n', - {'pass': '#!/bin/sh -e\n[ -d "$ADT_ARTIFACTS" ]\n' - 'echo I am fine > $ADT_ARTIFACTS/health.txt\n'}) + p = self.build_src('Tests: a1 a2 a3 a4\nDepends:\nRestrictions: needs-root\n', + {'a1': '#!/bin/sh -e\n[ -d "$ADT_ARTIFACTS" ]\n' + 'echo old > $ADT_ARTIFACTS/health.txt\n', + 'a2': '#!/bin/sh -e\n[ -d "$ADT_ARTIFACTS" ]\n' + 'echo I am fine > $ADT_ARTIFACTS/health.txt\n', + 'a3': '#!/bin/sh -e\n[ -d "$ADT_ARTIFACTS" ]\n' + 'mkdir $ADT_ARTIFACTS/logs\n' + 'echo world > $ADT_ARTIFACTS/logs/hello.txt\n', + 'a4': '#!/bin/sh -e\n[ -d "$ADT_ARTIFACTS" ]\n' + 'mkdir $ADT_ARTIFACTS/logs\n' + 'echo 42 > $ADT_ARTIFACTS/logs/answer.txt\n'}) outdir = os.path.join(self.workdir, 'out') @@ -931,15 +939,22 @@ # test should succeed self.assertEqual(code, 0, err) - self.assertRegex(out, 'tree0t-pass\s+PASS', out) + self.assertRegex(out, 'tree0t-a1\s+PASS', out) + self.assertRegex(out, 'tree0t-a2\s+PASS', out) + self.assertRegex(out, 'tree0t-a3\s+PASS', out) + self.assertRegex(out, 'tree0t-a4\s+PASS', out) # check for cruft in output dir files = [f for f in os.listdir(outdir) if not fnmatch.fnmatch(f, 'ubtree*-std*')] self.assertEqual(set(files), set(['log', 'artifacts'])) - # check artifact + # check artifact; a2 should overwrite a1's health.txt with open(os.path.join(outdir, 'artifacts', 'health.txt')) as f: self.assertEqual(f.read(), 'I am fine\n') + with open(os.path.join(outdir, 'artifacts', 'logs', 'hello.txt')) as f: + self.assertEqual(f.read(), 'world\n') + with open(os.path.join(outdir, 'artifacts', 'logs', 'answer.txt')) as f: + self.assertEqual(f.read(), '42\n') def test_slash_in_test_name(self): '''test names must not contain /''' diff -Nru autopkgtest-2.9/tools/adt-build-lxc autopkgtest-2.9.1/tools/adt-build-lxc --- autopkgtest-2.9/tools/adt-build-lxc 2014-02-27 10:23:46.000000000 +0000 +++ autopkgtest-2.9.1/tools/adt-build-lxc 2014-03-06 12:44:17.000000000 +0000 @@ -34,7 +34,7 @@ NAME="adt-${RELEASE}" # fall back for older LXC option name -LXCDIR=`lxc-config lxc.lxcpath` || LXCDIR=`lxc-config lxcpath` +LXCDIR=`lxc-config lxc.lxcpath` || LXCDIR=`lxc-config lxcpath` || LXCDIR=/var/lib/lxc LXC_ARGS="-t $DISTRO -- -r $RELEASE" diff -Nru autopkgtest-2.9/virt-subproc/adt-virt-schroot autopkgtest-2.9.1/virt-subproc/adt-virt-schroot --- autopkgtest-2.9/virt-subproc/adt-virt-schroot 2014-02-27 10:23:46.000000000 +0000 +++ autopkgtest-2.9.1/virt-subproc/adt-virt-schroot 2014-03-06 12:44:17.000000000 +0000 @@ -97,7 +97,8 @@ capabilities.append('revert') if (match(cfg['root-users'], [os.getuid()], pw_uid) or - match(cfg['root-groups'], [os.getgid()] + os.getgroups(), gr_gid)): + match(cfg['root-groups'], [os.getgid()] + os.getgroups(), gr_gid) or + os.getuid() == 0): VirtSubproc.debug('have "root-on-testbed" capability') capabilities.append('root-on-testbed')