Testing on a immutable rootfs
Tests should be self-contained and not require changes to the rootfs: any change to the rootfs causes the tested system to diverge from the one used in production, reducing the value of testing.
Changing the rootfs is also impossible or very cumbersome to do with
some deployment systems such as
or OSTree. Other systems may simply not ship
package management systems like
dpkg due to size constraints,
making package dependencies not viable.
Tests meant to be run on targets should then be self-sufficient and should not require dependencies to be installed on the rootfs.
Writing self-contained tests
- Each tests is shipped in a separate git repository under the tests GitLab group
- Check existing tests like the D-Bus reply time ones or the Canterbury ones
- Add a subtree of the
commonfolder. For convenience, use the
common-subtree.shscript to add a git-subtree into your repository: ../common/common-subtree.sh add See the README for further details
- For tests requiring additional binaries not shipped on the base image:
- Tests should use compiled executables included with
update_test_binaries.shand/or POSIX shell scripts (avoid bashisms and assume that
- Test the scripts in a
- Add your repository to the
test-repositories.txtlist and Jenkins will keep the binaries automatically updated