diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 7c06507eb1..c5e7ad75b8 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: systemd/mkosi@0d1143150835b21c1bfe64428df5f45b558280b1 + - uses: systemd/mkosi@184472f0f1f831ca29953546ec01fd941ff763a6 # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space # immediately, we remove the files in the background. However, we first move them to a different location @@ -83,22 +83,22 @@ jobs: run: mkosi summary - name: Build tools tree - run: sudo mkosi -f sandbox -- true + run: sudo mkosi -f box -- true - name: Configure meson run: | - sudo mkosi sandbox -- \ + sudo mkosi box -- \ meson setup \ --buildtype=debugoptimized \ build - name: Build image - run: sudo mkosi sandbox -- meson compile -C build mkosi + run: sudo mkosi box -- meson compile -C build mkosi - name: Initial coverage report run: | sudo mkdir -p build/test/coverage - sudo mkosi sandbox -- \ + sudo mkosi box -- \ lcov \ --directory build/mkosi.builddir/arch~rolling~x86-64 \ --capture \ @@ -115,7 +115,7 @@ jobs: # --preserve-env makes sure all the github actions environment variables are propagated which are # used in integration-test-wrapper.py to construct the `gh` command line to download the journals # of failed tests. - sudo --preserve-env mkosi sandbox -- \ + sudo --preserve-env mkosi box -- \ env \ TEST_RUNNER=ubuntu-24.04 \ meson test \ @@ -147,10 +147,10 @@ jobs: lcov_args+=(--add-tracefile "${file}") done < <(find build/test/coverage -name "TEST-*.coverage-info") - sudo mkosi sandbox -- lcov --ignore-errors inconsistent,inconsistent "${lcov_args[@]}" --output-file build/test/coverage/everything.coverage-info + sudo mkosi box -- lcov --ignore-errors inconsistent,inconsistent "${lcov_args[@]}" --output-file build/test/coverage/everything.coverage-info - name: List coverage report - run: sudo mkosi sandbox -- lcov --ignore-errors inconsistent,inconsistent --list build/test/coverage/everything.coverage-info + run: sudo mkosi box -- lcov --ignore-errors inconsistent,inconsistent --list build/test/coverage/everything.coverage-info - name: Coveralls uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 73609e89e9..a489b55661 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -38,7 +38,7 @@ jobs: LINTER_RULES_PATH: .github/linters GITHUB_ACTIONS_CONFIG_FILE: actionlint.yml - - uses: systemd/mkosi@0d1143150835b21c1bfe64428df5f45b558280b1 + - uses: systemd/mkosi@184472f0f1f831ca29953546ec01fd941ff763a6 - name: Check that tabs are not used in Python code run: sh -c '! git grep -P "\\t" -- src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py' @@ -51,29 +51,29 @@ jobs: ToolsTreeRelease=rawhide EOF - mkosi -f sandbox -- true + mkosi -f box -- true - name: Run mypy run: | - mkosi sandbox -- mypy --version - mkosi sandbox -- mypy src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py + mkosi box -- mypy --version + mkosi box -- mypy src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py - name: Run ruff check run: | - mkosi sandbox -- ruff --version - mkosi sandbox -- ruff check src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py + mkosi box -- ruff --version + mkosi box -- ruff check src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py - name: Run ruff format run: | - mkosi sandbox -- ruff --version - if ! mkosi sandbox -- ruff format --check src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py + mkosi box -- ruff --version + if ! mkosi box -- ruff format --check src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py then echo "Please run 'ruff format' on the above files or apply the diffs below manually" - mkosi sandbox -- ruff format --check --quiet --diff src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py + mkosi box -- ruff format --check --quiet --diff src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py fi - name: Configure meson - run: mkosi sandbox -- env CC=clang CXX=clang++ meson setup -Dlocalegen-path=/usr/bin/locale-gen -Dcompat-mutable-uid-boundaries=true build + run: mkosi box -- env CC=clang CXX=clang++ meson setup -Dlocalegen-path=/usr/bin/locale-gen -Dcompat-mutable-uid-boundaries=true build - name: Run clang-tidy - run: mkosi sandbox -- meson test -C build --suite=clang-tidy --print-errorlogs --no-stdsplit + run: mkosi box -- meson test -C build --suite=clang-tidy --print-errorlogs --no-stdsplit diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 0cc613a061..6ea2a79bff 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -147,7 +147,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: systemd/mkosi@0d1143150835b21c1bfe64428df5f45b558280b1 + - uses: systemd/mkosi@184472f0f1f831ca29953546ec01fd941ff763a6 # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space # immediately, we remove the files in the background. However, we first move them to a different location @@ -214,21 +214,21 @@ jobs: run: mkosi summary - name: Build tools tree - run: sudo mkosi -f sandbox -- true + run: sudo mkosi -f box -- true - name: Configure meson run: | # /usr/sbin/bpftool is completely broken inside containers on Ubuntu which makes meson blow up so # disable the bpf-framework stuff to avoid the issue. # TODO: Drop when we move off Ubuntu Noble as this will be fixed in the next Ubuntu LTS release. - sudo mkosi sandbox -- \ + sudo mkosi box -- \ meson setup \ --buildtype=debugoptimized \ -Dbpf-framework=disabled \ build - name: Build image - run: sudo mkosi sandbox -- meson compile -C build mkosi + run: sudo mkosi box -- meson compile -C build mkosi - name: Make sure sources weren't polluted by package build scripts run: | @@ -243,7 +243,7 @@ jobs: - name: Run integration tests run: | - if [[ "$(sudo mkosi sandbox -- meson test --help)" == *"--max-lines"* ]]; then + if [[ "$(sudo mkosi box -- meson test --help)" == *"--max-lines"* ]]; then MAX_LINES=(--max-lines 300) else MAX_LINES=() @@ -256,7 +256,7 @@ jobs: # --preserve-env makes sure all the github actions environment variables are propagated which are # used in integration-test-wrapper.py to construct the `gh` command line to download the journals # of failed tests. - sudo --preserve-env mkosi sandbox -- \ + sudo --preserve-env mkosi box -- \ env \ TEST_PREFER_QEMU=${{ matrix.vm }} \ TEST_NO_QEMU=${{ matrix.no_qemu }} \ diff --git a/docs/HACKING.md b/docs/HACKING.md index dffea56b0f..37f1148b54 100644 --- a/docs/HACKING.md +++ b/docs/HACKING.md @@ -40,16 +40,16 @@ Then, you can build, run and test systemd executables as follows: ```sh $ mkosi -f genkey # Generate signing keys once. -$ mkosi -f sandbox -- meson setup -Dbpf-framework=disabled build # bpftool detection inside mkosi sandbox is broken on Ubuntu Noble and older -$ mkosi -f sandbox -- meson compile -C build -$ mkosi -f sandbox -- build/systemctl --version -$ mkosi -f sandbox -- meson test -C build # Run the unit tests +$ mkosi -f box -- meson setup -Dbpf-framework=disabled build # bpftool detection inside mkosi box is broken on Ubuntu Noble and older +$ mkosi -f box -- meson compile -C build +$ mkosi -f box -- build/systemctl --version +$ mkosi -f box -- meson test -C build # Run the unit tests ``` To build and boot an OS image with the latest systemd installed: ```sh -$ mkosi -f sandbox -- meson compile -C build mkosi # (re-)build the OS image +$ mkosi -f box -- meson compile -C build mkosi # (re-)build the OS image $ mkosi boot # Boot the image with systemd-nspawn. $ mkosi vm # Boot the image with qemu. ``` @@ -65,8 +65,8 @@ $ cd systemd $ git checkout -b # where BRANCH is the name of the branch $ $EDITOR src/core/main.c # or wherever you'd like to make your changes $ mkosi -f genkey # Generate signing keys once. -$ mkosi -f sandbox -- meson setup build # Set up meson -$ mkosi -f sandbox -- meson compile -C build mkosi # (re-)build the test image +$ mkosi -f box -- meson setup build # Set up meson +$ mkosi -f box -- meson compile -C build mkosi # (re-)build the test image $ mkosi vm # Boot the image in qemu $ git add -p # interactively put together your patch $ git commit # commit it @@ -85,7 +85,7 @@ not required to write basic patches. ## Building the OS image without a tools tree By default, `mkosi` will first build a tools tree and use it build the image and -provide the environment for `mkosi sandbox`. To disable the tools tree and use +provide the environment for `mkosi box`. To disable the tools tree and use binaries from your host instead, write the following to `mkosi/mkosi.local.conf`: ```conf @@ -311,7 +311,7 @@ To debug systemd-boot in an IDE such as VSCode we can use a launch configuration right in your editor of choice (with the right plugin installed). When using mkosi, we can run clangd in the mkosi tools tree to avoid needing to install clangd on the host machine. -All that is required is to run `mkosi -f sandbox true` once to make sure the tools tree is available and to modify +All that is required is to run `mkosi -f box true` once to make sure the tools tree is available and to modify the path of the clangd binary used by your editor to the `mkosi.clangd` script included in the systemd repository. For example, for VScode, you'd have to add the following to the VSCode workspace settings of the systemd repository: @@ -329,7 +329,7 @@ When using clangd, it's recommended to setup the build directory containing the compilation database used by clangd to use clang as the compiler as well: ```sh -$ mkosi sandbox -- env CC=clang CXX=clang++ meson setup build +$ mkosi box -- env CC=clang CXX=clang++ meson setup build ``` Additionally, the `gensources` target can be used to make sure all generated @@ -337,5 +337,5 @@ sources are generated to avoid clangd complaining that these source files don't exist. ```sh -$ mkosi sandbox -- ninja -C build gensources +$ mkosi box -- ninja -C build gensources ``` diff --git a/mkosi/mkosi.clangd b/mkosi/mkosi.clangd index f2e741f0fa..ba7aa99ad6 100755 --- a/mkosi/mkosi.clangd +++ b/mkosi/mkosi.clangd @@ -9,7 +9,7 @@ else fi exec "${SPAWN[@]}" \ - mkosi sandbox -- \ + mkosi box -- \ clangd \ --compile-commands-dir=build \ --path-mappings="\ diff --git a/mkosi/mkosi.conf b/mkosi/mkosi.conf index 4682332c16..7772ff208c 100644 --- a/mkosi/mkosi.conf +++ b/mkosi/mkosi.conf @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Config] -MinimumVersion=commit:0d1143150835b21c1bfe64428df5f45b558280b1 +MinimumVersion=commit:184472f0f1f831ca29953546ec01fd941ff763a6 Dependencies= exitrd initrd diff --git a/mkosi/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf b/mkosi/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf index ba8508925e..07e4f48d3b 100644 --- a/mkosi/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf +++ b/mkosi/mkosi.conf.d/arch/mkosi.conf.d/pkgenv.conf @@ -1,8 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -[Match] -Distribution=arch - [Build] Environment= GIT_URL=https://gitlab.archlinux.org/archlinux/packaging/packages/systemd.git diff --git a/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf b/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf index 69d1c22975..0de00d82ac 100644 --- a/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf +++ b/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf @@ -27,6 +27,8 @@ Packages= cryptsetup device-mapper-event device-mapper-multipath + dfuzzer + erofs-utils git-core glibc-langpack-de glibc-langpack-en @@ -38,6 +40,7 @@ Packages= iputils iscsi-initiator-utils kernel-core + knot libcap-ng-utils man-db nmap-ncat @@ -52,6 +55,7 @@ Packages= python3-pexpect # needed to upgrade and downgrade systemd-ukify in tests python3-zstd + qrencode quota rpm softhsm diff --git a/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/efi.conf b/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/efi.conf new file mode 100644 index 0000000000..90b7668f55 --- /dev/null +++ b/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/efi.conf @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Match] +Architecture=uefi + +[Content] +Packages= + sbsigntools + +VolatilePackages= + systemd-boot diff --git a/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf b/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf index d617c33239..8324883f67 100644 --- a/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf +++ b/mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/pkgenv.conf @@ -1,9 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -[Match] -Distribution=|centos -Distribution=|fedora - [Build] Environment= GIT_URL=https://src.fedoraproject.org/rpms/systemd.git diff --git a/mkosi/mkosi.conf.d/centos/mkosi.conf b/mkosi/mkosi.conf.d/centos/mkosi.conf index 2961ee316b..ea0a34b4fd 100644 --- a/mkosi/mkosi.conf.d/centos/mkosi.conf +++ b/mkosi/mkosi.conf.d/centos/mkosi.conf @@ -5,6 +5,7 @@ Distribution=centos [Distribution] Release=10 +Repositories=epel,epel-next [Build] Environment= diff --git a/mkosi/mkosi.conf.d/centos/mkosi.conf.d/10-epel.conf b/mkosi/mkosi.conf.d/centos/mkosi.conf.d/10-epel.conf deleted file mode 100644 index 9e92a4f226..0000000000 --- a/mkosi/mkosi.conf.d/centos/mkosi.conf.d/10-epel.conf +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -[Match] -Release=9 - -[Distribution] -Repositories= - epel - epel-next diff --git a/mkosi/mkosi.conf.d/centos/mkosi.conf.d/20-efi.conf b/mkosi/mkosi.conf.d/centos/mkosi.conf.d/20-efi.conf deleted file mode 100644 index edefbe7977..0000000000 --- a/mkosi/mkosi.conf.d/centos/mkosi.conf.d/20-efi.conf +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -[Match] -Repositories=epel -Architecture=|x86 -Architecture=|x86-64 -Architecture=|arm -Architecture=|arm64 -Architecture=|riscv32 -Architecture=|riscv64 -Architecture=|loongarch64 - -[Content] -Packages= - sbsigntools - -VolatilePackages= - systemd-boot diff --git a/mkosi/mkosi.conf.d/centos/mkosi.conf.d/20-epel-packages.conf b/mkosi/mkosi.conf.d/centos/mkosi.conf.d/20-epel-packages.conf deleted file mode 100644 index 6bcc663e59..0000000000 --- a/mkosi/mkosi.conf.d/centos/mkosi.conf.d/20-epel-packages.conf +++ /dev/null @@ -1,12 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -[Match] -Repositories=epel - -[Content] -Packages= - dfuzzer - dhcp-server - erofs-utils - knot - qrencode diff --git a/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/efi-debug.conf b/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/efi-debug.conf index b6422af16a..9252d4b20e 100644 --- a/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/efi-debug.conf +++ b/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/efi-debug.conf @@ -4,13 +4,7 @@ Environment=WITH_DEBUG=1 [Match] -Architecture=|x86 -Architecture=|x86-64 -Architecture=|arm -Architecture=|arm64 -Architecture=|riscv32 -Architecture=|riscv64 -Architecture=|loongarch64 +Architecture=uefi [Content] VolatilePackages= diff --git a/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/efi.conf b/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/efi.conf index c808ddd9cf..3836792ad1 100644 --- a/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/efi.conf +++ b/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/efi.conf @@ -2,13 +2,7 @@ # sbsigntool exists only on UEFI architectures [Match] -Architecture=|x86 -Architecture=|x86-64 -Architecture=|arm -Architecture=|arm64 -Architecture=|riscv32 -Architecture=|riscv64 -Architecture=|loongarch64 +Architecture=uefi [Content] Packages= diff --git a/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf b/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf index a8d547db99..18a2e01ba3 100644 --- a/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf +++ b/mkosi/mkosi.conf.d/debian-ubuntu/mkosi.conf.d/pkgenv.conf @@ -1,9 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -[Match] -Distribution=|debian -Distribution=|ubuntu - [Build] Environment= GIT_URL=https://salsa.debian.org/systemd-team/systemd.git diff --git a/mkosi/mkosi.conf.d/fedora/mkosi.conf b/mkosi/mkosi.conf.d/fedora/mkosi.conf index b954d2802a..e2a479eb6d 100644 --- a/mkosi/mkosi.conf.d/fedora/mkosi.conf +++ b/mkosi/mkosi.conf.d/fedora/mkosi.conf @@ -10,15 +10,11 @@ Release=rawhide Packages= btrfs-progs compsize - dfuzzer dhcp-server dnf5 - erofs-utils f2fs-tools # Required for systemd-networkd-tests.py (netdevsim and sch_xxx modules) kernel-modules-extra kernel-modules-internal - knot - qrencode rpmautospec scsi-target-utils diff --git a/mkosi/mkosi.conf.d/fedora/mkosi.conf.d/efi.conf b/mkosi/mkosi.conf.d/fedora/mkosi.conf.d/efi.conf deleted file mode 100644 index 44de850ee0..0000000000 --- a/mkosi/mkosi.conf.d/fedora/mkosi.conf.d/efi.conf +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -[Match] -Distribution=fedora -Architecture=|x86 -Architecture=|x86-64 -Architecture=|arm -Architecture=|arm64 -Architecture=|riscv32 -Architecture=|riscv64 -Architecture=|loongarch64 - -[Content] -Packages= - sbsigntools - -VolatilePackages= - systemd-boot diff --git a/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/efi-debug.conf b/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/efi-debug.conf index b63e00be5e..9ef1833a88 100644 --- a/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/efi-debug.conf +++ b/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/efi-debug.conf @@ -4,13 +4,7 @@ Environment=WITH_DEBUG=1 [Match] -Architecture=|x86 -Architecture=|x86-64 -Architecture=|arm -Architecture=|arm64 -Architecture=|riscv32 -Architecture=|riscv64 -Architecture=|loongarch64 +Architecture=uefi [Content] VolatilePackages= diff --git a/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/efi.conf b/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/efi.conf index 7ee6b4eaf7..7cb650a44e 100644 --- a/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/efi.conf +++ b/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/efi.conf @@ -1,14 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Match] -Distribution=opensuse -Architecture=|x86 -Architecture=|x86-64 -Architecture=|arm -Architecture=|arm64 -Architecture=|riscv32 -Architecture=|riscv64 -Architecture=|loongarch64 +Architecture=uefi [Content] VolatilePackages= diff --git a/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf b/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf index 0721a2e24d..6a29c26675 100644 --- a/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf +++ b/mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/pkgenv.conf @@ -1,8 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -[Match] -Distribution=opensuse - [Build] Environment= GIT_URL=https://github.com/bmwiedemann/openSUSE diff --git a/test/integration-tests/README.md b/test/integration-tests/README.md index 66f1a314be..c98d6f93da 100644 --- a/test/integration-tests/README.md +++ b/test/integration-tests/README.md @@ -17,7 +17,7 @@ $ mkosi genkey Next, we can build the integration test image with meson: ```shell -$ mkosi -f sandbox -- meson compile -C build mkosi +$ mkosi -f box -- meson compile -C build mkosi ``` By default, the `mkosi` meson target which builds the integration test image depends on @@ -38,24 +38,24 @@ directory (`OutputDirectory=`) to point to the other directory using `mkosi/mkos After the image has been built, the integration tests can be run with: ```shell -$ mkosi -f sandbox -- meson test -C build --setup=integration --suite integration-tests --num-processes "$(($(nproc) / 4))" +$ mkosi -f box -- meson test -C build --setup=integration --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 -$ mkosi -f sandbox -- meson test -C build --setup=integration -v TEST-01-BASIC +$ mkosi -f box -- meson test -C build --setup=integration -v TEST-01-BASIC ``` -See `mkosi -f sandbox -- meson introspect build --tests` for a list of tests. +See `mkosi -f box -- 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 -$ mkosi -f sandbox -- meson test -C build --setup=integration -i TEST-01-BASIC +$ mkosi -f box -- meson test -C build --setup=integration -i TEST-01-BASIC ``` Due to limitations in meson, the integration tests do not yet depend on the @@ -64,7 +64,7 @@ running the integration tests. To rebuild the image and rerun a test, the following command can be used: ```shell -$ mkosi -f sandbox -- meson compile -C build mkosi && mkosi -f sandbox -- meson test -C build --setup=integration -v TEST-01-BASIC +$ mkosi -f box -- meson compile -C build mkosi && mkosi -f box -- meson test -C build --setup=integration -v TEST-01-BASIC ``` The integration tests use the same mkosi configuration that's used when you run @@ -78,7 +78,7 @@ To iterate on an integration test, let's first get a shell in the integration te the following: ```shell -$ mkosi -f sandbox -- meson compile -C build mkosi && mkosi -f sandbox -- meson test -C build --setup=shell -i TEST-01-BASIC +$ mkosi -f box -- meson compile -C build mkosi && mkosi -f box -- meson test -C build --setup=shell -i TEST-01-BASIC ``` This will get us a shell in the integration test environment after booting the machine without running the @@ -173,9 +173,9 @@ Finally, we'll make use of the standalone mode of running the integration tests to avoid having to install any build dependencies. ```sh -$ mkosi -f sandbox -- meson setup testsuite test/integration-tests/standalone +$ mkosi -f box -- meson setup testsuite test/integration-tests/standalone $ mkosi -f -$ mkosi sandbox -- meson test -C testsuite --num-processes "$(($(nproc) / 4))" +$ mkosi box -- meson test -C testsuite --num-processes "$(($(nproc) / 4))" ``` ### SELinux AVCs diff --git a/test/integration-tests/standalone/meson.build b/test/integration-tests/standalone/meson.build index 6b5a454767..ec76af1952 100644 --- a/test/integration-tests/standalone/meson.build +++ b/test/integration-tests/standalone/meson.build @@ -4,9 +4,9 @@ # as follows: # # mkosi genkey -# mkosi -f sandbox -- meson setup testsuite test/integration-tests/standalone +# mkosi -f box -- meson setup testsuite test/integration-tests/standalone # mkosi -f -# mkosi sandbox -- meson test -C testsuite +# mkosi box -- meson test -C testsuite # project('systemd-testsuite', license : 'LGPLv2+',