Tianon's Ramblings ✿

home

DEP8 - TL;DR

28 May 2015

DEP stands for “Debian Enhancement Proposals”. DEP8 is about package testing, specifically post-install (as opposed to dh_auto_test which runs during package build, usually for unit tests). It’s great for integration tests, etc. that have more interesting requirements for running than unit tests normally do.

The problem is that the spec is a little bit long in the tooth for casual reading / understanding-at-a-glance.

What follows is my own personal TL;DR version.

$ cd your-package/
$ mkdir -p debian/tests
$ vim debian/tests/control

(editor of your choice)

Tests: my-test
Depends: hello, @
Restrictions: needs-root

(see the spec for more info about what these mean and what valid values are)

$ touch debian/tests/my-test
$ chmod +x debian/tests/my-test
$ vim debian/tests/my-test

(editor of your choice)

#!/bin/bash
set -e

hello

# other bits testing your actual package (installed because of "@" in "Depends:")

(again, see the spec linked above for details of how this script should behave – in general, non-zero exit code or stderr output mean failure)

$ apt-get install autopkgtest # if not already installed
$ adt-run --unbuilt-tree . --- VIRT-SERVER

Where VIRT-SERVER is one of: (as of this writing and installed by default with autopkgtest – YMMV)