[PATCH 2/3] adt-run: add --upgrade-to option for upgrade tests

Martin Pitt mpitt at debian.org
Sat Jun 28 14:26:11 UTC 2014


Hello Antonio,

Antonio Terceiro [2014-06-27 21:17 -0300]:
> +  * adt-run: add --upgrade-to option for upgrade tests. The system will be
> +    upgraded after installing test dependencies, but before running the test.

My first reaction to that was "why doesn't the test itself run the
dist-upgrade?", but I suppose you want to do this at a larger scale
and not replicate the upgrade logic everywhere.

Upgrades are rather complex and this will probably open a can of
worms, but I suppose we could try this for a while and put a "WARNING:
experimental feature" tag on it :-)

Conceptually this is still a bit weird, as the codification of what
the entire test is supposed to do is split between the control files
and test scripts (where they really belong) and command line options
(which might be forgotten, or specified unexpectedly, etc.). I think
I'd rather see a semantics where the upgrade is triggered by a flag in
the test control, and the command line option merely specifies the
target release (with a sensible default such as "current development
series").

> +        add_sources = '''awk 'BEGIN { done = 0 } /^deb / { if (done==0) { $3 = "%s"; print; done=1 }}' ''' \
> +            '''/etc/apt/sources.list > /etc/apt/sources.list.d/%s.list''' % (suite, suite)

This must not only apply to the first line, but to all lines which
contain the current release. OTOH this must ignore apt sources which
do *not* apply to the currently running release code name, such as any
third-party or local or backports source or sources which already
apply to a different release. E. g. it's not uncommon to have a
deb-src for unstable on a wheezy machine for easy building of
backports with apt-get source -b.

Supposedly this should call lsb_release or parse /etc/lsb-release
(although this counts as an implementation detail). Unfortunately the
code name of the currently running release isn't in /etc/os-release.

> +        upgrade = '((apt-get update || (sleep 15; apt-get update)) && apt-get dist-upgrade -y -o Dpkg::Options::="--force-confnew") 2>&1'

Aren't conffile prompts for unmodified packages something which
upgrade tests ought to detect? That's a rather important part of the
upgrade tests that we do in Ubuntu, as often config files become
conffiles (and cause a prompt), or vice-versa conffiles become
orphaned. At least the first case ought to be caught as conffile
prompts for (humanly) unmodified files are a nuisance and confusing.

> +        global testbed
> +        testbed.needs_reset()

Just "self.needs-reset()" will do. :-)

Thanks,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)



More information about the autopkgtest-devel mailing list