ejabberd Test Suites
ejabberd comes with a comprehensive test suite to cover various part of the software platform.
XMPP end-to-end protocol test suite
Running ejabberd test suite
This test suite is a set of end-2-end integration tests that act like XMPP clients connecting with the server and is testing ejabberd at the protocol level. It also contains tests for the various backends that ejabberd supports.
The test suite is modular and can be run in parts (to focus on a group of features) or run for a specific backend.
CT_BACKENDS environment variable specifies which backend tests to
Note: You must build ejabberd with proper backend support for the tests to
work. If the tests fail and you aren't sure why, check the
configure build options
to make sure ejabberd is compiled with adequate backend support.
Note: these tests are e2e tests that operate a full ejabberd instance. So the ports that ejabberd needs must be available for testing. So you can't run an ejabberd instance at the same time you test.
Other options you can use to limit the tests that will be run is to pass a list
groups to test. Some
no_db: Runs subgroups
Usually, it is enough to just limit tests with
CT_BACKENDS and let the test
suite decide which relevant tests to run. Sometimes you may want to only focus
on a specific backend, skipping the generic
Some example commands for running the XMPP end-to-end test suite using rebar and rebar3 ct:
CT_BACKENDS=mnesia rebar ct suites=ejabberd CT_BACKENDS=mnesia rebar ct suites=ejabberd groups=mnesia CT_BACKENDS=mnesia rebar ct suites=ejabberd groups=generic CT_BACKENDS=mnesia rebar3 ct --suite=test/ejabberd_SUITE --group=offline_flex,offline_send_all CT_BACKENDS=redis rebar3 ct --suite=test/ejabberd_SUITE --group=offline_flex,offline_send_all
If you have every backend configured, you can run all the tests with:
Test suite conventions
The records used in test suite are autogenerated and come from
tools/xmpp_codec.hrl. This is handy to match packets/results against expected
ejabberd depends on a lot of dependent modules. The dependencies can be tested independently by checking them out and running their test suites directly.
Build test status
We run tests for ejabberd and dependencies automatically via Github Actions. We have a Dashboard available on Github to check the overall test status for all projects: ProcessOne Github Dashboard