Bug#786039: add debconf testing

Martin Pitt mpitt at debian.org
Fri Jul 10 10:46:13 UTC 2015


Control: tag -1 wontfix

Hey Wouter,

Wouter Verhelst [2015-05-20 11:49 +0200]:
> It would be great if autopkgtest were to include a method to test
> debconf scripts. This could be done by creating a custom debconf
> frontend that takes answers to questions from autopkgtest rather than
> from the user. The system could automatically permutate values over
> various runs (e.g., install the package once while answering "yes" to a
> boolean, and once while answering "no" to a boolean)

FWIW, I think implementing it in such generality is way too much work,
we'll always miss just one more case, and implementing every concrete
case in a particular package test is magnitudes simpler and more
maintainable than trying to generalize it.

Note that your tests aren't limited in what they can do. If you want
to pre-seed debconf before package installation, then just don't use
debian/tests/control's "Depends:", but instead have your test install
the package by itself:

debian/tests/foo:
   for v in values; do
     echo "set mypackage/mykey $v" | debconf-communicate
     apt-get install -y mypackage
     # do some assertions
     apt-get purge -y mypackage
   done

This would even work if mypackage already happens to be installed --
autopkgtest will never uninstall a package as that's not generally
possible/safe. But your test can do any kind of --force-depends or
dpkg-reconfigure etc.  that it wants to apply (e. g. if you want to
test a Priority: required package).

Thus I mark that as wontfix for now. If you agree, we can close the
bug too.

Thanks,

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20150710/cdb839da/attachment.sig>


More information about the autopkgtest-devel mailing list