test: Add a way to quickly iterate on an integration test
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 2 Aug 2024 14:25:03 +0000 (16:25 +0200)
committerLuca Boccassi <bluca@debian.org>
Thu, 15 Aug 2024 13:04:41 +0000 (14:04 +0100)
commitdf3736d149568d5c94b1ab292a25f7d2aa20b1aa
tree5c0831c3432ce6ffec8f140d5043b0158e3f1d95
parent8c61438bd5ba649ea8c51c718ff35193c33e13d3
test: Add a way to quickly iterate on an integration test

Rebuilding the integration test every time is very slow. Let's
introduce a way to iterate on an integration test without rebuilding
the image every time. By making a btrfs snapshot before we run the
integration test, we can then systemctl soft-reboot after running
the test to restore the rootfs to a pristine state before running
the test again.

As /run/nextroot will get nuked on reboot or soft-reboot, we introduce
a tmpfiles snippet to make sure it is recreated every (soft-)reboot
and adapt the existing tests to deal with this new symlink.

(cherry picked from commit af153e36ae67c242251951c12d6d6b6ae4783845)
mkosi.extra/usr/lib/tmpfiles.d/snapshot.conf [new file with mode: 0644]
test/README.testsuite
test/integration-test-setup.sh [new file with mode: 0755]
test/meson.build
test/test.service.in
test/units/TEST-09-REBOOT.sh
test/units/TEST-82-SOFTREBOOT.sh