Skip to content
Daniel Markstedt edited this page Dec 17, 2024 · 21 revisions

Netatalk Testing

At present, Netatalk has two test automation suites, both written in pure C:

  • afpd component integration tests
  • afptest system integration test suite

The former can be run stateless through the Meson test runner.

The latter requires a test environment with a correctly configured and running netatalk instance. It can be run stand-alone, or through the Meson test runner (but only spectest; see below.)

The component integration test code is located in test/afpd, and the system integration tests in test/testsuite.

Run the afpd tests

In order to run the tests, build Netatalk with tests enabled, then run the meson test target from within the build directory:

meson setup build -Dwith-tests=true
meson compile -C build
cd build
meson test

Passing results should look something like this:

ninja: Entering directory `/home/atalk/devel/netatalk/build'
ninja: no work to do.
1/2 afpd integration tests - setup        OK              0.42s
2/2 afpd integration tests - run          OK              1.98s

Ok:                 2   
Expected Fail:      0   
Fail:               0   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /home/atalk/devel/netatalk/build/meson-logs/testlog.txt

Note that the suite contains multiple tests. See test.c for the full list of assertions.

Run the spectest test suite

The spectest test suite ensures that there are no breakages in AFP specification conformance. The test runner binary is called afp_spectest.

  • Build netatalk with the testsuite Add-on enabled.
meson setup build -Dwith-testsuite=true
meson compile -C build

The majority of the spec tests are also running in the GitHub CI workflow, the only exceptions being a handful that require special setup that is cumbersome to replicate.

Clone this wiki locally