News
About
Download
Installation
Contact
Copyright

News

06/03/08 pactest 0.3 is ready
- added detection for fakeroot enabled pacman binaries, leftover lock and core files
- fixed number format for statistics line
- display elapsed times for each test cases
- added a COPYING file
- added a patch to disable fakeroot support for pacman 2.9.x
- added --gdb option to ease debugging (suggested by VMiklos)
- added --valgrind option to run tests through valgrind memory checker
- added more test cases
- added gensync support
06/02/13 pactest 0.2 released!
- added support for directories, symlinks and altered files
- removed hardcoded references to package names in testcase scripts
- splited pactest.py in several modules
- lots of code optimizations
- created a home page to host the project
- added README, TODO and ChangeLog files
06/01/30 Initial release
Announcement on the pacman-dev mailing list

About

pactest is a test suite for the Arch Linux package manager pacman.

It has a rather high level view of operations performed by pacman: it automatically creates a test environment based on a test case file description, then it runs pacman, and finally it checks the results of test according to a predefined set of rules.

It is written in Python and provides most of what can be found in pacman's code to create Arch Linux packages or read and write databases entries.

pactest generates the test environment in the subdirectory root which is created in the current working directory by default. The directory structure of the test environment is defined as follows:
var/lib/pacman databases path (local and sync ones)
etc/pacman.conf pacman configuration file
var/cache/pkg sync packages cache
var/log/pactest.log log file collecting pacman outputs
var/pub location for sync repository archives
tmp location for local package archives (to be used with pacman -A or -U)

Each test case is defined in a separate file that is sourced in order to set the environment. Test cases are Python scripts too.

Test case sample sample.py:

	self.description = "Install a package"

	# Create a package object, and add two files to it
	p = pmpkg("dummy", "1.0-3")
	p.files = ["bin/dummy",
	           "usr/man/man1/dummy.1"]

	# Include the package in the test environment
	self.addpkg(p)

	# Set the pacman command to be performed when running the test
	self.args = "-A dummy-1.0-3.pkg.tar.gz"

	# Define a set of rules to decide the test status upon completion:
	# - we want pacman to return 0 as its exit code
	# - package "dummy" must exist in the local database
	# - all files from the package must exist in the filesystem
	self.addrule("PACMAN_RETCODE=0")
	self.addrule("PKG_EXIST=dummy")
	for f in p.files:
		self.addrule("FILE_EXIST=%s" % f)

Running the test case is as simple as calling:

	./pactest.py --test=sample.py

More documentation about test cases creation is available in the pactest archive (see the README file).

Download

Latest release is pactest 0.3.

Archives are available here.

Installation

pactest needs the pacman binary used for test to be run in a fakeroot environment. By default, pacman refuses to run in such an environment.

If you use the latest CVS pacman version (namely pacman 3.0 developement code), you can strip fakeroot detection code by recompiling the code as follows:

	./configure --disable-fakeroot
	make

If you use pacman 2.9 series, this can be done by applying the patch provided in pactest archive (since 0.3):

	cd /path/to/pacman-2.9.8
	patch -Np1 -i pacman-2.9.7-fakeroot.patch
	export CFLAGS=-DNOFAKEROOT
	./configure
	make

pactest does not need any file to be installed. Simply extract the tarball and run the pactest.py script.

Note: make sure the pacman binary you need to test is reachable through your PATH environment parameter, or use the --pacman option on the command line to specify the binary location.

Contact

This test suite is still under development, so feel free to report any bugs or to submit suggestions to me.
More test cases are also welcome :)

Copyright

pactest Copyright (c) 2006 Aurelien Foret <orelien@chez.com> and is licensed through the GNU General Public License.
pacman Copyright (c) 2002-2006 Judd Vinet <jvinet@zeroflux.org> and is licensed through the GNU General Public License.


Last update: 06/03/10, Aurelien Foret <orelien@chez.com>