How do I contribute an autopkg test for a ubuntu package?


Autopkg tests can be written for any ubuntu package. The tests follow the DEP 8 specification for including tests as part of a deb package.

Writing a test

A test can be written in a myriad of languages. Common examples are C, bash, python and perl. To write a test:

  1. Branch the package bzr branch ubuntu:
  2. Add a source section in debian/control called XS-Testsuite: autopkgtest
  3. Add the tests to debian/tests/ folder
  4. Add a debian/tests/control which specifies the requirements for the testbed. For example:
Tests: build
Depends: build-essential

Contributing tests

Getting the test into ubuntu follows the normal ubuntu developer process. In short, you

  1. Branch the source of the package you wish to add a test
  2. Edit the debian/control and debian/tests/control file to enable the tests
  3. Add the test(s) to debian/tests folder
  4. Commit your changes and propose a merge

More information

To see a list of current autopkgtests, you can see the live jenkins output of all the tests that are currently being automatically run here.

In addition, the ubuntu developer documentation has further information on contributing an autopkg testcase, including examples of tests.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.