]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
docs: Use mkosi sandbox in test documentation as well
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 2 Jan 2025 15:17:53 +0000 (16:17 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 2 Jan 2025 15:17:53 +0000 (16:17 +0100)
Same change as in HACKING.md, but for running the integration tests.

test/README.md

index 7f7a7e658cb464c9ccd8be78d40211fab036d629..1404fc77ea55964f0083e6aeebe0c1fd245cc0cd 100644 (file)
@@ -11,7 +11,7 @@ reconfiguring meson to make sure it is picked up properly.
 We also need to make sure the required meson options are enabled:
 
 ```shell
-$ meson setup --reconfigure build -Dremote=enabled
+$ mkosi -f sandbox meson setup --reconfigure build -Dremote=enabled
 ```
 
 To make sure `mkosi` doesn't try to build systemd from source during the image build
@@ -31,7 +31,7 @@ to /etc which is used when building the image instead.
 Next, we can build the integration test image with meson:
 
 ```shell
-$ meson compile -C build mkosi
+$ mkosi -f sandbox meson compile -C build mkosi
 ```
 
 By default, the `mkosi` meson target which builds the integration test image depends on
@@ -52,24 +52,24 @@ directory (`OutputDirectory=`) to point to the other directory using `mkosi.loca
 After the image has been built, the integration tests can be run with:
 
 ```shell
-$ env SYSTEMD_INTEGRATION_TESTS=1 meson test -C build --no-rebuild --suite integration-tests --num-processes "$(($(nproc) / 4))"
+$ env SYSTEMD_INTEGRATION_TESTS=1 mkosi -f sandbox meson test -C build --no-rebuild --suite integration-tests --num-processes "$(($(nproc) / 4))"
 ```
 
 As usual, specific tests can be run in meson by appending the name of the test
 which is usually the name of the directory e.g.
 
 ```shell
-$ env SYSTEMD_INTEGRATION_TESTS=1 meson test -C build --no-rebuild -v TEST-01-BASIC
+$ env SYSTEMD_INTEGRATION_TESTS=1 mkosi -f sandbox meson test -C build --no-rebuild -v TEST-01-BASIC
 ```
 
-See `meson introspect build --tests` for a list of tests.
+See `mkosi -f sandbox meson introspect build --tests` for a list of tests.
 
 To interactively debug a failing integration test, the `--interactive` option
 (`-i`) for `meson test` can be used. Note that this requires meson v1.5.0 or
 newer:
 
 ```shell
-$ env SYSTEMD_INTEGRATION_TESTS=1 meson test -C build --no-rebuild -i TEST-01-BASIC
+$ env SYSTEMD_INTEGRATION_TESTS=1 mkosi -f sandbox meson test -C build --no-rebuild -i TEST-01-BASIC
 ```
 
 Due to limitations in meson, the integration tests do not yet depend on the
@@ -78,7 +78,7 @@ running the integration tests. To rebuild the image and rerun a test, the
 following command can be used:
 
 ```shell
-$ meson compile -C build mkosi && env SYSTEMD_INTEGRATION_TESTS=1 meson test -C build --no-rebuild -v TEST-01-BASIC
+$ mkosi -f sandbox meson compile -C build mkosi && env SYSTEMD_INTEGRATION_TESTS=1 mkosi -f sandbox meson test -C build --no-rebuild -v TEST-01-BASIC
 ```
 
 The integration tests use the same mkosi configuration that's used when you run
@@ -92,7 +92,7 @@ To iterate on an integration test, let's first get a shell in the integration te
 the following:
 
 ```shell
-$ meson compile -C build mkosi && env SYSTEMD_INTEGRATION_TESTS=1 TEST_SHELL=1 meson test -C build --no-rebuild -i TEST-01-BASIC
+$ mkosi -f sandbox meson compile -C build mkosi && env SYSTEMD_INTEGRATION_TESTS=1 TEST_SHELL=1 mkosi -f sandbox meson test -C build --no-rebuild -i TEST-01-BASIC
 ```
 
 This will get us a shell in the integration test environment after booting the machine without running the