diff -Nru autopkgtest-3.15.2/debian/bzr-builder.manifest autopkgtest-3.16/debian/bzr-builder.manifest --- autopkgtest-3.15.2/debian/bzr-builder.manifest 2015-07-03 12:42:04.000000000 +0000 +++ autopkgtest-3.16/debian/bzr-builder.manifest 2015-07-10 16:21:51.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0~1175 -lp:~vila/autopkgtest/git-master revid:git-v1:45041c82d232be8a35a9319ebb125beb00f284ad +# bzr-builder format 0.3 deb-version {debupstream}-0~1186 +lp:~vila/autopkgtest/git-master revid:git-v1:a75197106e634f20add1f2d1bf8c58372df2cf75 diff -Nru autopkgtest-3.15.2/debian/changelog autopkgtest-3.16/debian/changelog --- autopkgtest-3.15.2/debian/changelog 2015-07-03 12:42:04.000000000 +0000 +++ autopkgtest-3.16/debian/changelog 2015-07-10 16:21:51.000000000 +0000 @@ -1,20 +1,44 @@ -autopkgtest (3.15.2-0~1175~ubuntu14.10.1) utopic; urgency=low +autopkgtest (3.16-0~1186~ubuntu14.10.1) utopic; urgency=low * Auto build. - -- Vincent Ladeuil Fri, 03 Jul 2015 12:42:04 +0000 + -- Vincent Ladeuil Fri, 10 Jul 2015 16:21:51 +0000 -autopkgtest (3.15.2) UNRELEASED; urgency=medium +autopkgtest (3.16) unstable; urgency=medium + Behaviour changes and improvements: * ssh-setup/nova: Re-try nova boot up to three times if it fails, and sleep 5 minutes in between. This occasionally fails due to exceeding quota or temporary glitches. + * Drop gpg-signing local archive and mark it as [trusted=yes] instead. This + gets rid of the requirement to generate a gpg key on first run. Drop + corresponding --gnupg-home option. (LP: #1472691) + * Drop long-obsolete --tmp-dir backwards compat option. + * ssh-setup/snappy: Adjust ubuntu-device-flash arguments to new + release/channel structure from Ubuntu 15.10, and default to rolling/edge. + Add new --release option. + + Bug fixes: * ssh-setup/nova: Silence "invalid command wait-reboot" warning. * setup-commands/cloud-vm-setup: Purge cloud-init too. It sometimes causes longer hangs on boot and might interfere with tests in other ways, and we only need it for first-time initialization anyway. + * adt-virt-qemu: adt-buildvm-ubuntu-cloud: Don't use -enable-kvm QEMU option + if /dev/kvm does not exist. (Closes: #790650) + * Quiesce warnings from tar. Avoids "time stamp is in the future" log spew. + (LP: #1468868) + * Move apt sources setup from setup-commands/cloud-vm-setup to + ssh-setup/nova. --apt-pocket does not work with the former as that runs + too late. + * Use Dpkg::Deps to evaluate/reduce build dependencies for expanding + "@builddeps@". This handles build profiles. (Closes: #787093) + * Resolve build profiles when installing build dependencies to build tested + package. + * Adjust NullRunner.test_tmp_install_perl test case to use + libtest-requires-perl instead of libtest-tester-perl; the latter got + removed from Debian. - -- Martin Pitt Tue, 30 Jun 2015 11:14:30 +0200 + -- Martin Pitt Fri, 10 Jul 2015 11:26:36 +0200 autopkgtest (3.15.1) unstable; urgency=medium diff -Nru autopkgtest-3.15.2/lib/adt_run_args.py autopkgtest-3.16/lib/adt_run_args.py --- autopkgtest-3.15.2/lib/adt_run_args.py 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/lib/adt_run_args.py 2015-07-10 16:21:51.000000000 +0000 @@ -240,10 +240,6 @@ g_log.add_argument('-o', '--output-dir', help='Write test artifacts (stdout/err, log, debs, etc)' ' to OUTPUT-DIR (must not exist or be empty)') - # backwards compatible alias - g_log.add_argument('--tmp-dir', dest='output_dir', - help='Alias for --output-dir for backwards ' - 'compatibility') g_log.add_argument('-l', '--log-file', dest='logfile', help='Write the log LOGFILE, emptying it beforehand,' ' instead of using OUTPUT-DIR/log') @@ -319,15 +315,6 @@ # misc g_misc = parser.add_argument_group('other options') - # keep backwards compatible path - gnupghome_default = '~/.autopkgtest/gpg' - if not os.path.isdir(os.path.expanduser(gnupghome_default)): - gnupghome_default = '~/.cache/autopkgtest' - g_misc.add_argument( - '--gnupg-home', dest='gnupghome', metavar='DIR', - default=gnupghome_default, - help='use DIR rather than %(default)s (for signing private ' - 'apt archive)') g_misc.add_argument( '--no-auto-control', dest='auto_control', action='store_false', default=True, @@ -402,7 +389,4 @@ copy_pairs.append((host, tb)) args.copy = copy_pairs - if args.gnupghome.startswith('~/'): - args.gnupghome = os.path.expanduser(args.gnupghome) - return (args, actions, virt_args) diff -Nru autopkgtest-3.15.2/lib/testdesc.py autopkgtest-3.16/lib/testdesc.py --- autopkgtest-3.15.2/lib/testdesc.py 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/lib/testdesc.py 2015-07-10 16:21:51.000000000 +0000 @@ -233,19 +233,28 @@ return packages -def _debian_build_deps_from_source(srcdir): - deps = [] +def _debian_build_deps_from_source(srcdir, testbed_arch): + deps = '' for st in parse_rfc822(os.path.join(srcdir, 'debian/control')): if 'Build-depends' in st: - for d in st['Build-depends'].split(','): - dp = d.strip() - if dp: - deps.append(dp) + deps += st['Build-depends'] if 'Build-depends-indep' in st: - for d in st['Build-depends-indep'].split(','): - dp = d.strip() - if dp: - deps.append(dp) + deps += ', ' + st['Build-depends-indep'] + + # resolve arch specific dependencies and build profiles + perl = subprocess.Popen(['perl', '-'], stdin=subprocess.PIPE, + stdout=subprocess.PIPE) + code = '''use Dpkg::Deps; + $dep = deps_parse('%s', reduce_arch => 1, reduce_profiles => 1, + build_dep => 1, host_arch => '%s'); + print $dep->output(), "\\n"; + ''' % (deps, testbed_arch) + deps = perl.communicate(code.encode('UTF-8'))[0].decode('UTF-8').strip() + if perl.returncode != 0: + raise InvalidControl('source', 'Invalid build dependencies') + + deps = [d.strip() for d in deps.split(',')] + # @builddeps@ should always imply build-essential deps.append('build-essential') return deps @@ -277,7 +286,7 @@ pass -def _parse_debian_depends(testname, dep_str, srcdir): +def _parse_debian_depends(testname, dep_str, srcdir, testbed_arch): '''Parse Depends: line in a Debian package Split dependencies (comma separated), validate their syntax, and expand @ @@ -298,7 +307,7 @@ adtlog.debug('synthesised dependency %s' % d) deps.append(d) elif alt_group_str == '@builddeps@': - for d in _debian_build_deps_from_source(srcdir): + for d in _debian_build_deps_from_source(srcdir, testbed_arch): adtlog.debug('synthesised dependency %s' % d) deps.append(d) else: @@ -334,7 +343,7 @@ return None -def parse_debian_source(srcdir, testbed_caps, control_path=None, +def parse_debian_source(srcdir, testbed_caps, testbed_arch, control_path=None, auto_control=True): '''Parse test descriptions from a Debian DEP-8 source dir @@ -375,7 +384,8 @@ test_names = record['Tests'].replace(',', ' ').split() depends = _parse_debian_depends(test_names[0], record.get('Depends', '@'), - srcdir) + srcdir, + testbed_arch) if 'Test-command' in record: raise InvalidControl('*', 'Only one of "Tests" or ' '"Test-Command" may be given') @@ -391,7 +401,8 @@ command = record['Test-command'] depends = _parse_debian_depends(command, record.get('Depends', '@'), - srcdir) + srcdir, + testbed_arch) command_counter += 1 name = 'command%i' % command_counter _debian_check_unknown_fields(name, record) diff -Nru autopkgtest-3.15.2/lib/VirtSubproc.py autopkgtest-3.16/lib/VirtSubproc.py --- autopkgtest-3.15.2/lib/VirtSubproc.py 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/lib/VirtSubproc.py 2015-07-10 16:21:51.000000000 +0000 @@ -317,8 +317,9 @@ # (argh Ubuntu touch) directories = '/var/cache /home' check_exec(['sh', '-ec', 'for d in %s; do if [ -w $d ]; then ' - 'tar --create --absolute-names -f $d/autopkgtest-tmpdir.tar' - ''' '%s'; rm -f /run/autopkgtest-reboot-prepare-mark; ''' + ' tar --warning=none --create --absolute-names ' + ''' -f $d/autopkgtest-tmpdir.tar '%s'; ''' + ' rm -f /run/autopkgtest-reboot-prepare-mark; ' ' exit 0; fi; done; exit 1''' % (directories, downtmp)], downp=True, timeout=copy_timeout) adtlog.debug('cmd_reboot: saved current downtmp, rebooting') @@ -334,7 +335,8 @@ # restore downtmp check_exec(['sh', '-ec', 'for d in %s; do ' 'if [ -e $d/autopkgtest-tmpdir.tar ]; then ' - ' tar --extract --absolute-names -f $d/autopkgtest-tmpdir.tar;' + ' tar --warning=none --extract --absolute-names ' + ' -f $d/autopkgtest-tmpdir.tar;' ' rm $d/autopkgtest-tmpdir.tar; exit 0; ' 'fi; done; exit 1' % directories], downp=True, timeout=copy_timeout) @@ -507,8 +509,9 @@ localcmdl = ['cat'] else: taropts = [None, None] - taropts[isrc] = '-c .' - taropts[idst] = '--preserve-permissions --extract --no-same-owner' + taropts[isrc] = '--warning=none -c .' + taropts[idst] = '--warning=none --preserve-permissions --extract ' \ + '--no-same-owner' rune = 'cd %s; tar %s -f -' % (remfileq, taropts[iremote]) if upp: diff -Nru autopkgtest-3.15.2/run-from-checkout autopkgtest-3.16/run-from-checkout --- autopkgtest-3.15.2/run-from-checkout 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/run-from-checkout 2015-07-10 16:21:51.000000000 +0000 @@ -5,4 +5,4 @@ # our root directory export AUTOPKGTEST_BASE=$(dirname $(readlink -f $0)) export PATH="${AUTOPKGTEST_BASE}/runner:${AUTOPKGTEST_BASE}/virt-subproc:$PATH" -adt-run --gnupg-home "$AUTOPKGTEST_BASE/tests/home/.cache/autopkgtest" "$@" +adt-run "$@" diff -Nru autopkgtest-3.15.2/runner/adt-run autopkgtest-3.16/runner/adt-run --- autopkgtest-3.15.2/runner/adt-run 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/runner/adt-run 2015-07-10 16:21:51.000000000 +0000 @@ -960,7 +960,7 @@ if self.execute(['sh', opts.verbosity >= 2 and '-exc' or '-ec', script], kind='install')[0] != 0: bomb('Failed to update click AppArmor rules') - def satisfy_dependencies_string(self, deps, what, recommends=False): + def satisfy_dependencies_string(self, deps, what, recommends=False, build_dep=False): '''Install dependencies from a string into the testbed''' adtlog.debug('%s: satisfying %s' % (what, deps)) @@ -972,12 +972,16 @@ # resolve arch specific dependencies; don't use universal_newlines # here, it's broken for stdin on Python 3.2 + if build_dep: + extra_args = ', reduce_profiles => 1, build_dep => 1' + else: + extra_args = '' perl = subprocess.Popen(['perl', '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) code = '''use Dpkg::Deps; - $dep = deps_parse('%s', reduce_arch => 1, host_arch => '%s'); + $dep = deps_parse('%s', reduce_arch => 1, host_arch => '%s' %s); print $dep->output(), "\\n"; - ''' % (deps, self.dpkg_arch) + ''' % (deps, self.dpkg_arch, extra_args) deps = perl.communicate(code.encode('UTF-8'))[0].decode('UTF-8').strip() if perl.returncode != 0: bomb('failed to run perl for parsing dependencies') @@ -1405,32 +1409,6 @@ '-o', 'APT::Get::force-yes=true', '-o', 'APT::Get::Assume-Yes=true'] - def genkey(self): - adtlog.debug('Binaries: preparing for key generation') - - if not os.path.exists(os.path.dirname(opts.gnupghome)): - os.makedirs(os.path.dirname(opts.gnupghome)) - mkdir_okexist(opts.gnupghome, 0o700) - - script = ''' - exec >&2 - cd "$1" - cat <<"END" >key-gen-params -Key-Type: DSA -Key-Length: 1024 -Key-Usage: sign -Name-Real: autopkgtest per-run key -Name-Comment: do not trust this key -Name-Email: autopkgtest@example.com -END - set -x - gpg --homedir="$1" --batch --no-random-seed-file --gen-key key-gen-params -''' - cmdl = ['sh', '-ec', script, 'x', opts.gnupghome] - rc = script_out(cmdl, what='genkey', script=script)[0] - if rc: - bomb('key generation failed, code %d' % rc) - def _configure_apt(self, tb): prefs = TestbedPath(testbed, os.path.join(tmp, 'apt-prefs'), '/etc/apt/preferences.d/90autopkgtest') @@ -1479,11 +1457,6 @@ adtlog.debug('Binaries: no registered binaries, not publishing anything') return - if os.path.exists(os.path.join(opts.gnupghome, 'secring.gpg')): - adtlog.debug('Binaries: no key generation needed') - else: - self.genkey() - self._configure_apt(testbed) script = ''' @@ -1492,11 +1465,8 @@ apt-ftparchive packages . >Packages gzip Packages.gz apt-ftparchive release . >Release - rm -f Release.gpg - gpg --homedir="$2" --batch --no-random-seed-file --detach-sign --armour -o Release.gpg Release - gpg --homedir="$2" --batch --no-random-seed-file --export >archive-key.pgp ''' - cmdl = ['sh', '-ec', script, 'x', self.dir.host, opts.gnupghome] + cmdl = ['sh', '-ec', script, 'x', self.dir.host] rc = script_out(cmdl, what='ftparchive', script=script)[0] if rc: bomb('apt-ftparchive or signature failed, code %d' % rc) @@ -1507,26 +1477,25 @@ testbed.check_exec(['rm', '-rf', self.dir.tb]) self.dir.copydown() - aptkey_out = TempTestbedPath(testbed, 'apt-key.out') + aptupdate_out = TempTestbedPath(testbed, 'apt-update.out') script = ''' - apt-key add %(d)s/archive-key.pgp - echo "deb file://%(d)s /" >/etc/apt/sources.list.d/autopkgtest.list + echo "deb [trusted=yes] file://%(d)s /" >/etc/apt/sources.list.d/autopkgtest.list if [ "x`ls /var/lib/dpkg/updates`" != x ]; then echo >&2 "/var/lib/dpkg/updates contains some files, aargh"; exit 1 fi apt-get --quiet --no-list-cleanup -o Dir::Etc::sourcelist=/etc/apt/sources.list.d/autopkgtest.list -o Dir::Etc::sourceparts=/dev/null update 2>&1 cp /var/lib/dpkg/status %(o)s - ''' % {'d': self.dir.tb, 'o': aptkey_out.tb} + ''' % {'d': self.dir.tb, 'o': aptupdate_out.tb} testbed.mungeing_apt() testbed.check_exec(['sh', '-ec', script], kind='install') testbed.blamed += self.blamed - aptkey_out.copyup() + aptupdate_out.copyup() adtlog.debug('Binaries: publish reinstall checking...') pkgs_reinstall = set() pkg = None - for l in open(aptkey_out.host, encoding='UTF-8'): + for l in open(aptupdate_out.host, encoding='UTF-8'): if l.startswith('Package: '): pkg = l[9:].rstrip() elif l.startswith('Status: install '): @@ -1737,7 +1706,8 @@ d = deb822.Deb822(sequence=f) bd = d.get('Build-Depends', '') bdi = d.get('Build-Depends-Indep', '') - testbed.satisfy_dependencies_string(bd + ', ' + bdi + ', ' + ', '.join(build_essential), arg) + testbed.satisfy_dependencies_string(bd + ', ' + bdi + ', ' + ', '.join(build_essential), arg, + build_dep=True) source_rules_command([dpkg_buildpackage], 'build', cwd=result_pwd) @@ -1854,7 +1824,8 @@ else: tests_tree = build_source(kind, arg, built_binaries) (tests, skipped) = testdesc.parse_debian_source( - tests_tree.host, testbed.caps, control_path=control_override, + tests_tree.host, testbed.caps, testbed.dpkg_arch, + control_path=control_override, auto_control=opts.auto_control) if skipped: diff -Nru autopkgtest-3.15.2/runner/adt-run.1 autopkgtest-3.16/runner/adt-run.1 --- autopkgtest-3.15.2/runner/adt-run.1 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/runner/adt-run.1 2015-07-10 16:21:51.000000000 +0000 @@ -330,14 +330,6 @@ .SH OTHER OPTIONS .TP -.BI --gnupg-home= dir -Uses \fIdir\fR as the gnupg key directory for local apt archive signing. -The specified directory should not contain keyrings containing other -unrelated keys, since \fBadt-run\fR does not specify to \fBgpg\fR -which keys to use. The default is -.BR $HOME/.cache/autopkgtest . - -.TP .BI --no-auto-control Disable automatic test generation with autodep8, even if it is installed. In that case, packages without tests will exit with code 8 ("No tests in this diff -Nru autopkgtest-3.15.2/setup-commands/cloud-vm-setup autopkgtest-3.16/setup-commands/cloud-vm-setup --- autopkgtest-3.15.2/setup-commands/cloud-vm-setup 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/setup-commands/cloud-vm-setup 2015-07-10 16:21:51.000000000 +0000 @@ -8,22 +8,6 @@ # autopkgtests. This is similar to adt-setup-vm, but won't configure serial # console or networking. -# set up apt sources -mirror_rel=`awk '/^deb .*(debian|ubuntu)/ { print $2,$3; exit }' /etc/apt/sources.list` -if [ "${mirror_rel%ubuntu*}" != "$mirror_rel" ]; then - cat << EOF > "$root/etc/apt/sources.list" -deb $mirror_rel main restricted universe multiverse -deb ${mirror_rel}-updates main restricted universe multiverse -deb-src $mirror_rel main restricted universe multiverse -deb-src ${mirror_rel}-updates main restricted universe multiverse -EOF -else - cat << EOF > "$root/etc/apt/sources.list" -deb $mirror_rel main contrib non-free -deb-src $mirror_rel main contrib non-free -EOF -fi - # go-faster apt/dpkg echo "Acquire::Languages \"none\";" > /etc/apt/apt.conf.d/90nolanguages echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/autopkgtest diff -Nru autopkgtest-3.15.2/ssh-setup/nova autopkgtest-3.16/ssh-setup/nova --- autopkgtest-3.15.2/ssh-setup/nova 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/ssh-setup/nova 2015-07-10 16:21:51.000000000 +0000 @@ -183,6 +183,9 @@ cat < $userdata #cloud-config manage_etc_hosts: true +apt_sources: +- source: deb \$MIRROR \$RELEASE restricted multiverse +- source: deb-src \$MIRROR \$RELEASE restricted multiverse apt_update: true apt_upgrade: false $MIRROR diff -Nru autopkgtest-3.15.2/ssh-setup/snappy autopkgtest-3.16/ssh-setup/snappy --- autopkgtest-3.15.2/ssh-setup/snappy 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/ssh-setup/snappy 2015-07-10 16:21:51.000000000 +0000 @@ -8,10 +8,13 @@ # Path to an existing snappy image. This won't be modified (QEMU will use # this as a snapshot base with a temporary overlay). If not given, uses # ubuntu-device-flash to create a temporary image. -# --channel -# Passed to ubuntu-device-flash's "core" command to select a non-default -# channel (e. g. "ubuntu-core/devel-proposed"). This does not work -# together with --image. +# -r | --release +# Passed to ubuntu-device-flash's "core" command to select a release other +# than the default "rolling". This does not work together with --image. +# -c | --channel +# Passed to ubuntu-device-flash's "core" command to select a +# channel other than the default "edge" (e. g. "alpha"). This does not +# work together with --image. # -b | --show-boot # Show VM console output on stdout, to make boot messages visible. # @@ -42,7 +45,8 @@ DEBUG= TEMPIMAGE= QEMU_PID= -CHANNEL= +RELEASE=rolling +CHANNEL=edge SERIAL=none QEMU_CMD="qemu-system-$(uname -m) -enable-kvm -m 512 -localtime -nographic -net user -net nic,model=virtio -snapshot" @@ -62,8 +66,8 @@ } parse_args() { - SHORTOPTS="i:b" - LONGOPTS="image:,debug,channel:,temp-image,qemu-pid:,show-boot" + SHORTOPTS="i:bc:r:" + LONGOPTS="image:,debug,channel:,release:,temp-image,qemu-pid:,show-boot" TEMP=$(getopt -o $SHORTOPTS --long $LONGOPTS -- "$@") eval set -- "$TEMP" @@ -74,8 +78,10 @@ IMAGE="$2"; shift 2;; --debug) DEBUG=1; shift;; - --channel) + -c|--channel) CHANNEL="$2"; shift 2;; + -r|--release) + RELEASE="$2"; shift 2;; -b|--show-boot) SERIAL=stdio; shift;; @@ -94,7 +100,7 @@ esac done - debug "parse_args: IMAGE='$IMAGE' DEBUG=$DEBUG CHANNEL='$CHANNEL' TEMPIMAGE=$TEMPIMAGE" + debug "parse_args: IMAGE='$IMAGE' DEBUG=$DEBUG RELEASE='$RELEASE' CHANNEL='$CHANNEL' TEMPIMAGE=$TEMPIMAGE" } find_free_port() { @@ -125,12 +131,9 @@ if [ -z "$IMAGE" ]; then info "No image given, calling ubuntu-device-flash to create a temporary one..." IMAGE=$(mktemp --tmpdir snappy.XXXXXX.img) + rm -f $IMAGE EXTRAOPTS="--image $IMAGE --temp-image" - UDF_OPTS="" - if [ -n "$CHANNEL" ]; then - UDF_OPTS="--channel=$CHANNEL" - fi - sudo ubuntu-device-flash --verbose core --output="$IMAGE" --developer-mode $UDF_OPTS >&2 + sudo ubuntu-device-flash --verbose core --channel=$CHANNEL --output="$IMAGE" --developer-mode $RELEASE >&2 debug "image $IMAGE built successfully" elif [ -n "$CHANNEL" ]; then error "The --channel option does not work with --image" diff -Nru autopkgtest-3.15.2/tests/adt-run autopkgtest-3.16/tests/adt-run --- autopkgtest-3.15.2/tests/adt-run 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/tests/adt-run 2015-07-10 16:21:51.000000000 +0000 @@ -73,6 +73,7 @@ temp_home = os.path.join(self.workdir, 'home') shutil.copytree(os.path.join(test_dir, 'home'), temp_home) os.chmod(os.path.join(temp_home, '.ssh', 'id_rsa'), 0o600) + os.mkdir(os.path.join(temp_home, '.cache')) # avoid re-downloading ubuntu-device-flash images os.symlink(os.path.join(self.orig_home, '.cache', 'ubuntuimages'), @@ -791,8 +792,8 @@ self.assertRegex(err, 'WARNING.*will only work for some packages') @unittest.skipIf(os.getuid() == 0, 'needs to run as user') - @unittest.skipIf(os.path.exists('/usr/share/perl5/Test/Tester.pm'), - 'needs libtest-tester-perl uninstalled') + @unittest.skipIf(os.path.exists('/usr/share/perl5/Test/Requires.pm'), + 'needs libtest-requires-perl uninstalled') @unittest.skipIf(os.path.exists('/usr/share/doc/libconvert-uulib-perl'), 'needs libconvert-uulib-perl uninstalled') @unittest.skipUnless(have_apt, 'needs apt-get download working') @@ -800,8 +801,8 @@ '''temp dir unpack of Perl dependencies''' # one arch: all, one binary - p = self.build_src('Tests: t\nDepends: libtest-tester-perl, libconvert-uulib-perl', - {'t': '#!/usr/bin/perl\nuse Test::Tester;\nuse Convert::UUlib;\n'}) + p = self.build_src('Tests: t\nDepends: libtest-requires-perl, libconvert-uulib-perl', + {'t': '#!/usr/bin/perl\nuse Test::Requires;\nuse Convert::UUlib;\n'}) (code, out, err) = self.adt_run(['-B', p + '//']) self.assertEqual(code, 0, err) @@ -1340,6 +1341,27 @@ self.assertIn('synthesised dependency build-essential\n', err) self.assertIn('processing dependency testdep2\n', err) + def test_build_deps_profiles(self): + '''test depends on build dependencies with build profiles''' + + p = self.build_src('''Tests: pass +Depends: @builddeps@ +Restrictions: needs-root +''', {'pass': '#!/bin/sh\ntrue'}) + + # add extra build dependencies to testpkg + subprocess.check_call(['sed', '-i', '/^Build-Depends:/ s/:.*/: bdepyes , bdepno /', + os.path.join(p, 'debian', 'control')]) + + (code, out, err) = self.adt_run(['-d', '-B', '--unbuilt-tree=' + p], + [self.chroot]) + self.assertEqual(code, 0, err) + self.assertRegex(out, 'pass\s+PASS') + + self.assertIn('synthesised dependency bdepyes\n', err) + self.assertNotIn('bdepno', err) + self.assertIn('synthesised dependency build-essential\n', err) + def test_logfile(self): '''--log-file option''' @@ -1857,8 +1879,8 @@ p = self.build_src('Tests: pass\nDepends: coreutils\nRestrictions: build-needed\n', {'pass': '#!/bin/sh -e\n./test_built | grep -q "built script OK"\n' './test_abspath | grep -q "built script OK"\necho GOOD'}) - # add Build-Depends-Indep: - subprocess.check_call(['sed', '-i', '/^Build-Depends:/ a\Build-Depends-Indep: aspell-doc', + # add Build-Depends-Indep: and a build profile package + subprocess.check_call(['sed', '-i', '/^Build-Depends:/ a\Build-Depends-Indep: aspell-doc, nonexisting ', os.path.join(p, 'debian', 'control')]) (code, out, err) = self.adt_run(['--no-built-binaries', '--unbuilt-tree=' + p], @@ -1910,7 +1932,7 @@ # should build and install package self.assertIn('dh build', err) - self.assertRegex(out, '\npass\s+PASS', out) + self.assertRegex(out, '\npass\s+PASS', out + err) self.assertIn('Unpacking testpkg', out) self.assertIn('binaries/./testpkg.deb', out) self.assertIn('Unpacking aspell-doc', out) @@ -2143,8 +2165,7 @@ # check binaries bins = os.listdir(os.path.join(outdir, 'binaries')) self.assertEqual(set(bins), - set(['Release.gpg', 'archive-key.pgp', 'Release', - 'Packages.gz', 'Packages', 'testpkg.deb'])) + set(['Release', 'Packages.gz', 'Packages', 'testpkg.deb'])) # check for cruft in outdir self.assertEqual(set(os.listdir(outdir)), @@ -3786,8 +3807,8 @@ self.assertRegex(out, 'release: .*ubuntu.*core') self.assertIn('I am powerful\nroot\n', out) - def test_channel(self): - '''--channel ubuntu-core/devel-proposed''' + def test_release_channel(self): + '''--release and --channel''' p = self.build_src('Tests: user\nDepends:\n\n' 'Tests: root\nDepends:\nRestrictions: needs-root', @@ -3795,7 +3816,7 @@ 'root': '#!/bin/sh\necho I am powerful\nwhoami'}) (code, out, err) = self.adt_run(['-d', '-B', p + '//'], self.virt_args + - ['--', '--channel', 'ubuntu-core/devel-proposed']) + ['--', '--release=15.04', '--channel=stable']) self.assertEqual(code, 0, err) self.assertRegex(out, 'user\s+PASS', out) self.assertRegex(out, 'root\s+PASS', out) Binary files /tmp/d9RrNOzRgO/autopkgtest-3.15.2/tests/home/.cache/autopkgtest/pubring.gpg and /tmp/z67L4bape4/autopkgtest-3.16/tests/home/.cache/autopkgtest/pubring.gpg differ Binary files /tmp/d9RrNOzRgO/autopkgtest-3.15.2/tests/home/.cache/autopkgtest/secring.gpg and /tmp/z67L4bape4/autopkgtest-3.16/tests/home/.cache/autopkgtest/secring.gpg differ Binary files /tmp/d9RrNOzRgO/autopkgtest-3.15.2/tests/home/.cache/autopkgtest/trustdb.gpg and /tmp/z67L4bape4/autopkgtest-3.16/tests/home/.cache/autopkgtest/trustdb.gpg differ diff -Nru autopkgtest-3.15.2/tests/testdesc autopkgtest-3.16/tests/testdesc --- autopkgtest-3.15.2/tests/testdesc 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/tests/testdesc 2015-07-10 16:21:51.000000000 +0000 @@ -184,7 +184,7 @@ if pkgcontrol: with open(os.path.join(self.pkgdir, 'debian', 'control'), 'w', encoding='UTF-8') as f: f.write(pkgcontrol) - return testdesc.parse_debian_source(self.pkgdir, caps) + return testdesc.parse_debian_source(self.pkgdir, caps, 'amd64') def test_no_control(self): '''no test control file''' @@ -318,12 +318,22 @@ (ts, skipped) = self.call_parse( 'Tests: t\nDepends: @, @builddeps@, foo (>= 7)', 'Source: nums\nBuild-Depends: bd1, bd2 [armhf], bd3:native (>= 7) | bd4 [linux-any]\n' - 'Build-Depends-Indep: bdi1\n' + 'Build-Depends-Indep: bdi1, bdi2 [amd64]\n' '\n' 'Package: one\nArchitecture: any') - self.assertEqual(ts[0].depends, ['one (>= 0~)', 'bd1', 'bd2 [armhf]', - 'bd3:native (>= 7) | bd4 [linux-any]', - 'bdi1', 'build-essential', 'foo (>= 7)']) + self.assertEqual(ts[0].depends, ['one (>= 0~)', 'bd1', 'bd3:native (>= 7) | bd4', + 'bdi1', 'bdi2', 'build-essential', 'foo (>= 7)']) + self.assertFalse(skipped) + + def test_builddeps_profiles(self): + '''@builddeps@ expansion with build profiles''' + + (ts, skipped) = self.call_parse( + 'Tests: t\nDepends: @, @builddeps@', + 'Source: nums\nBuild-Depends: bd1, bd2 , bd3 , bdnotme \n' + '\n' + 'Package: one\nArchitecture: any') + self.assertEqual(ts[0].depends, ['one (>= 0~)', 'bd1', 'bd2', 'bd3', 'build-essential']) self.assertFalse(skipped) def test_complex_deps(self): @@ -377,7 +387,7 @@ with open(c_path, 'w') as f: f.write('Tests: one\nDepends: foo') - (ts, skipped) = testdesc.parse_debian_source(self.pkgdir, [], + (ts, skipped) = testdesc.parse_debian_source(self.pkgdir, [], 'amd64', control_path=c_path) self.assertEqual(len(ts), 1) t = ts[0] diff -Nru autopkgtest-3.15.2/tools/adt-buildvm-ubuntu-cloud autopkgtest-3.16/tools/adt-buildvm-ubuntu-cloud --- autopkgtest-3.15.2/tools/adt-buildvm-ubuntu-cloud 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/tools/adt-buildvm-ubuntu-cloud 2015-07-10 16:21:51.000000000 +0000 @@ -131,7 +131,7 @@ stderr=subprocess.STDOUT) != 0: sys.stderr.write('ERROR: genisoimage not found\n') sys.exit(1) - if not os.access('/dev/kvm', os.W_OK): + if os.path.exists('/dev/kvm') and not os.access('/dev/kvm', os.W_OK): sys.stderr.write('ERROR: no permission to write /dev/kvm\n') sys.exit(1) @@ -284,15 +284,19 @@ tty_sock = os.path.join(workdir, 'ttyS0') - qemu = subprocess.Popen([qemu_command, '-enable-kvm', '-m', '512', - '-localtime', '-nographic', - '-monitor', 'null', - '-net', 'user', - '-net', 'nic,model=virtio', - '-serial', 'unix:%s,server,nowait' % tty_sock, - '-drive', 'file=%s,if=virtio' % image, - '-drive', 'file=%s,if=virtio,readonly' % seed]) + argv = [qemu_command, '-m', '512', + '-localtime', '-nographic', + '-monitor', 'null', + '-net', 'user', + '-net', 'nic,model=virtio', + '-serial', 'unix:%s,server,nowait' % tty_sock, + '-drive', 'file=%s,if=virtio' % image, + '-drive', 'file=%s,if=virtio,readonly' % seed] + if os.path.exists('/dev/kvm'): + argv.append('-enable-kvm') + + qemu = subprocess.Popen(argv) try: if verbose: tty = VirtSubproc.get_unix_socket(tty_sock) diff -Nru autopkgtest-3.15.2/virt-subproc/adt-virt-qemu autopkgtest-3.16/virt-subproc/adt-virt-qemu --- autopkgtest-3.15.2/virt-subproc/adt-virt-qemu 2015-07-03 12:42:03.000000000 +0000 +++ autopkgtest-3.16/virt-subproc/adt-virt-qemu 2015-07-10 16:21:51.000000000 +0000 @@ -461,7 +461,6 @@ # start QEMU argv = [args.qemu_command, - '-enable-kvm', '-m', str(args.ram_size), '-smp', str(args.cpus), '-localtime', @@ -478,6 +477,9 @@ argv.append('-drive') argv.append('file=%s,if=virtio,index=%i,readonly' % (image, i + 1)) + if os.path.exists('/dev/kvm'): + argv.append('-enable-kvm') + # pass through option to qemu if args.qemu_options: argv.extend(args.qemu_options.split())