summaryrefslogtreecommitdiffstats
path: root/test/test.service.in
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-08-02 16:25:03 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-08-05 15:13:38 +0200
commitaf153e36ae67c242251951c12d6d6b6ae4783845 (patch)
treeddd998cf6aab5eafe6791f17bdb7ad6daef07441 /test/test.service.in
parentmkosi: Switch back to btrfs (diff)
downloadsystemd-af153e36ae67c242251951c12d6d6b6ae4783845.tar.xz
systemd-af153e36ae67c242251951c12d6d6b6ae4783845.zip
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.
Diffstat (limited to 'test/test.service.in')
-rw-r--r--test/test.service.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test.service.in b/test/test.service.in
index 790c513da4..ef9dba30c4 100644
--- a/test/test.service.in
+++ b/test/test.service.in
@@ -4,9 +4,12 @@ Description=%N
Wants=basic.target network.target @wants@
After=basic.target network.target @after@
Before=getty-pre.target
+StateDirectory=%N
[Service]
ExecStartPre=rm -f /failed /testok
+ExecStartPre=/usr/lib/systemd/tests/integration-test-setup.sh setup
ExecStart=@command@
+ExecStopPost=/usr/lib/systemd/tests/integration-test-setup.sh finalize
Type=oneshot
MemoryAccounting=@memory-accounting@