autopkgtest
Run package tests in a clean environment
TLDR
Build the package in the current directory and run all tests directly on the system
Run a specific test for the package in the current directory
Download and build a specific package with apt-get, then run all tests
Test the package in the current directory using a new root directory
Test the package in the current directory without rebuilding it
SYNOPSIS
autopkgtest [options]
PARAMETERS
--help
Show help message and exit.
--version
Show program's version number and exit.
--apt-options
Options to pass to apt-get.
--archive
URL to use as Debian archive for test environment.
--color={always,auto,never}
Control color output.
--debug
Enable debug output.
--gdb
Run test within GDB.
--load-vtconsole-keyboard
Load vtconsole keyboard layout inside the test environment.
--no-apt-upgrade
Do not run 'apt-get update' and 'apt-get dist-upgrade' before testing.
--no-remove
Do not remove test environment after the tests have finished.
--overlay-source
Overlay the contents of
--result-file
Write test results to
--timeout
Set timeout for the entire test run.
The Debian package (.deb file) or the source directory containing the debian/control file.
Description of the test environment to use (e.g., 'lxc', 'qemu').
DESCRIPTION
autopkgtest is a tool and framework for running automated tests on Debian packages. It aims to ensure that packages install, function correctly, and do not regress after updates. It can run tests defined within the package itself (debian/tests), or external tests provided separately. autopkgtest creates isolated testing environments (often using virtual machines or containers) to prevent interference between tests and the host system. Test results are then reported, indicating whether the package passed or failed its tests. The key advantages of autopkgtest are automation, isolation, and reproducibility. It allows for continuous integration, quick identification of regressions, and confident package updates. The framework supports various test execution environments, including chroots, LXC containers, and QEMU virtual machines, using different builders. Each test environment can be configured for specific dependencies and configurations to ensure comprehensive testing.
autopkgtest's primary use case is in the Debian archive, but can be used in any Debian-based environment. It's usually triggered by package uploads, updates to dependencies, or schedule, making it ideal for CI systems that monitor the software packaging process. Its flexibility and robust tooling makes it crucial for any deployment that requires regular security updates.
CAVEATS
autopkgtest requires root privileges or proper configuration to create test environments using tools like LXC or QEMU. The tool relies on properly configured apt sources within the test environment. Correctly setting up and configuring the test environment descriptions is crucial for accurate testing.
TEST ENVIRONMENT DESCRIPTIONS
Test environment descriptions define how autopkgtest creates and configures the testing environment. These descriptions can specify the type of environment (LXC, QEMU, chroot), the Debian archive to use, and any additional packages or settings required. They are crucial for ensuring that tests are run in a consistent and reproducible manner.
DEBIAN/TESTS
The 'debian/tests' directory inside a Debian package source directory contains the tests that are run by autopkgtest. These tests are typically shell scripts or other executable files that check the functionality of the installed package. Packages should include tests in 'debian/tests' to allow for automated verification after installation.
BUILDERS
autopkgtest uses builders to create and manage the test environments. Different builders support different environment types (e.g., 'lxc', 'qemu'). The choice of builder depends on the system configuration and the desired level of isolation.
HISTORY
autopkgtest was developed to improve the quality assurance of Debian packages. It was initially designed to run tests defined within Debian packages (debian/tests). Over time, its capabilities have been expanded to support external tests, diverse testing environments, and integration with continuous integration systems. The command has seen continuous development by the Debian QA team and the wider Debian community. Over time it became a critical tool in maintaining the stability and quality of the Debian archive.