A design document for integration testing is available at
http://www.freeipa.org/page/V3/Integration_testing. I've copied it below
for easier quoting.
= Overview =
Make it possible to write and run multi-host integration tests (such as:
install master & replica, add user on replica, verify it's added on master).
These tests will be run from continuous integration.
Any developer can also run them manually.
= Use Cases =
== Continuous integration ==
The developer team at Red Hat will run a Jenkins continuous integration
that will run the tests automatically (after each commit if resources are
The CI results will be posted publicly.
== Developer testing ==
Anyone is be able to run integration tests without advanced infrastructure,
only a number of virtual machines to run the tests on is needed.
== Beaker integration ==
The tests will run seamlessly inside [http://beaker-project.org/
A special option enables reporting via BeakerLib.
= Non-goals =
A complete testing/continuous integration setup needs some steps that
be included in IPA's test suite:
* Building the code
* VM provisioning
There are just too many disparate ways to do it; people
with a virtual datacenter should already have a preferred tool.
If we come up with something for ourselves we'll have to make too many
assumptions for it to be useful somewhere else.
* Configuring the basic system, installing the packages
Again support for this can be added in the future.
(Release Puppet/Ansible configuration?)
The Python package with the IPA test suite is renamed to
packaged for RPM-based systems as <tt>freeipa-tests</tt>.
Eventually the package will be included in Fedora.
Integration tests will be controlled from a single machine, and executed
on a number of "remote" machines that act as servers, replicas, clients,
The controlling machine communicates with the others via the SSH protocol.
(The controlling machine may be the same as one of the "remote" ones.)
Integration tests are included in the main IPA set suite, and configured
environment variables. If the variables are missing, all integration
If an insufficient number of hosts is configured for a test, the individiual
test will be skipped.
A tool is provided to run installed tests.
The remote machines used for integration testing are required to have
IPA packages installed, firewall opened up, any needed workarounds
downgrades, SELinux mode,...), and sshd set up to allow root login.
The test runner will connect to these machines, install IPA, perform the
and then uninstall IPA & return the systems to their previous state.
A plugin for integration with BeakerLib is provided.
= Test configuration =
Tests are configured using these environment variables.
== Host configuration ==
: FQDN of the first IPA server
: FQDNs of other IPA servers (space-separated)
: FQDNs of IPA clients (space-separated)
; $MASTER_env2, $REPLICA_env2, $CLIENT_env2, $MASTER_env3, ...
: can be used for additional domains when needed
DNS needs to be set up so that IP addresses can be obtained for these hosts.
== Basic configuration ==
: Directory for test data on the remote hosts
: Default: /root/ipatests
: IP of a DNS forwarder
: Default: 22.214.171.124
== Test customization ==
: IPA domain name
: Default: taken from $MASTER
: NIS domain name
: Default: ipatest
: NIS domain name
: Default: ipatest
: Set to TRUE for IPv6-only connectivity
: Set to enable test debugging
: Admin username
: Default: admin
: Admin user password
: Default: Secret123
: Directory manager DN
: Default: cn=Directory Manager
: Directory manager password
: Default: Secret123
= Supporting tools =
== ipa-test-config ==
This tool reads the configuration variables above and outputs a Bash script
that sets a much more complete set of variables for easy shell-based testing
or test set-up.
Without arguments, <tt>ipa-test-config</tt> outputs information specific
to the host it is run on. When given a hostname, it prints config for that
With the <tt>--global</tt> flag, it outputs configuration common to all
== ipa-run-tests ==
This tool is a wrapper arount <tt>nosetests</tt> and accepts the same
It loads any additional plugins and runs tests from the system-installed IPA
== Other ==
TBD: Additional command-line tools may be provided for tasks such as
IPA in a given topology.
= Implementation =
Test cases are implemented as Nose test classes, with
installation/uninstallation as class setup/teardown.
A BeakerLib plugin is provided that starts/ends Beaker phases for Nose test
contexts and cases, issues a Beaker assertion (rlPass/rlFail) for each test
case, and collects and submits relevant logs.
A separate plugin will be provided to collect logs outside of a Beaker
= Example instructions =
To run the test called <tt>test_integration/test_simple_replication.py</tt>,
which needs to run with two masters, follow these instructions.
Install the IPA server packages on two machines, and do any preparations
necessary to install IPA (e.g. configure/disable the firewall).
Then, install the <tt>freeipa-tests</tt> package on the machine that
the tests (this may be one of the machines above, or preferably a different
Set MASTER and REPLICA environment variables to the fully qualified
of the two machines prepared earlier.
Also set any other relevant variables listed in
[[#Test configuration|Test configuration]].
You may run <tt>ipa-test-config --global</tt> to verify how the test
configuration will be handled.
The next steps depend on whether the test will run within a BeakerLib
== With BeakerLib ==
Set up a BeakerLib test (e.g. <tt>rlJournalStart</tt>), and run:
ipa-run-tests --with-beakerlib --no-skip
The output is somewhat messy as BeakerLib logs are printed to standard
Not that output from external hosts is buffered, so installation may appear
Archive any relevant data (e.g. with <tt>rlJournalPrintText</tt>),
and end the BeakerLib session (<tt>rlJournalEnd</tt>).
== Without BeakerLib ==
As with other Nose tests, no output is shown for test setup (installation)
if nothing goes wrong, so there may be a long time without output.
A summary is printed at the end of the test run.
= Feature Managment =
=== UI ===
=== CLI ===
= Major configuration options and enablement =
See instructions above.
= Replication =
= Updates and Upgrades =
(Note: The tests can theoretically be used to drive hosts with other
of IPA packages to test backward/forward compatibility.)
= Dependencies =
The freeipa-test package will depend on some libraries that are already used
for unit tests and other test-related tasks:
Integration testing brings in a dependency on a library for the SSH
Naturally, the new dependencies are not needed in a production environment.
= External Impact =
Cooperation with QE is underway.
= Design author =
Freeipa-devel mailing list