Patchwork [8,of,9,debian-packaging] test-debian-packages: new test for testing construction of debian packages

login
register
mail settings
Submitter Augie Fackler
Date Aug. 26, 2015, 7:08 p.m.
Message ID <16a96256683d535ad64a.1440616129@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/10291/
State Superseded
Commit a02c22e4814222e025db86a2cdc1225fa8227989
Headers show

Comments

Augie Fackler - Aug. 26, 2015, 7:08 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1440475709 14400
#      Tue Aug 25 00:08:29 2015 -0400
# Node ID 16a96256683d535ad64a628d30849ce7a326cf70
# Parent  65d972362afc1edba83ce4e785f7d54ba83a36f3
test-debian-packages: new test for testing construction of debian packages

This test takes over a minute to run to completion on my workstation,
and far longer if the docker images have to be built for the first
time on a given host. As such, the entire test is tagged as slow.

The test does *not* require dpkg - it merely requires one of docker or
dpkg be available to usefully test. On a (say) fedora machine with
docker installed, it'l still test creating debian packages using
docker.

Patch

diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t
new file mode 100644
--- /dev/null
+++ b/tests/test-debian-packages.t
@@ -0,0 +1,34 @@ 
+#require test-repo slow
+
+We check debian package contents with portable tools so that when
+we're on non-debian machines we can still test the packages that are
+built using docker.
+  $ checkdeb() {
+  >   ls *.deb
+  >   ar x mercurial*.deb
+  >   tar tf data.tar* | grep localrepo | sort
+  > }
+  $ OUTPUTDIR=`pwd`
+  $ export OUTPUTDIR
+
+#if docker
+  $ cd "$TESTDIR"/..
+  $ make docker-debian-jessie > $OUTPUTDIR/build.log 2>&1
+  $ cd $OUTPUTDIR
+  $ checkdeb
+  mercurial-*.deb (glob)
+  ./usr/lib/python2.7/site-packages/mercurial/localrepo.py
+  ./usr/lib/python2.7/site-packages/mercurial/localrepo.pyc
+  $ rm -f *.deb build.log
+#endif
+
+#if dpkg
+  $ cd "$TESTDIR"/..
+  $ make debian-jessie > $OUTPUTDIR/build.log 2>&1
+  $ cd $OUTPUTDIR
+  $ checkdeb
+  mercurial-*.deb (glob)
+  ./usr/lib/python2.7/site-packages/mercurial/localrepo.py
+  ./usr/lib/python2.7/site-packages/mercurial/localrepo.pyc
+  $ rm -f *.deb build.log
+#endif