mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
mkosi: various improvements (#38156)
This commit is contained in:
16
.github/workflows/coverage.yml
vendored
16
.github/workflows/coverage.yml
vendored
@@ -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
|
||||
|
||||
22
.github/workflows/linter.yml
vendored
22
.github/workflows/linter.yml
vendored
@@ -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
|
||||
|
||||
12
.github/workflows/mkosi.yml
vendored
12
.github/workflows/mkosi.yml
vendored
@@ -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 }} \
|
||||
|
||||
@@ -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 <BRANCH> # 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
|
||||
```
|
||||
|
||||
@@ -9,7 +9,7 @@ else
|
||||
fi
|
||||
|
||||
exec "${SPAWN[@]}" \
|
||||
mkosi sandbox -- \
|
||||
mkosi box -- \
|
||||
clangd \
|
||||
--compile-commands-dir=build \
|
||||
--path-mappings="\
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[Config]
|
||||
MinimumVersion=commit:0d1143150835b21c1bfe64428df5f45b558280b1
|
||||
MinimumVersion=commit:184472f0f1f831ca29953546ec01fd941ff763a6
|
||||
Dependencies=
|
||||
exitrd
|
||||
initrd
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
11
mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/efi.conf
Normal file
11
mkosi/mkosi.conf.d/centos-fedora/mkosi.conf.d/efi.conf
Normal file
@@ -0,0 +1,11 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[Match]
|
||||
Architecture=uefi
|
||||
|
||||
[Content]
|
||||
Packages=
|
||||
sbsigntools
|
||||
|
||||
VolatilePackages=
|
||||
systemd-boot
|
||||
@@ -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
|
||||
|
||||
@@ -5,6 +5,7 @@ Distribution=centos
|
||||
|
||||
[Distribution]
|
||||
Release=10
|
||||
Repositories=epel,epel-next
|
||||
|
||||
[Build]
|
||||
Environment=
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[Match]
|
||||
Release=9
|
||||
|
||||
[Distribution]
|
||||
Repositories=
|
||||
epel
|
||||
epel-next
|
||||
@@ -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
|
||||
@@ -1,12 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[Match]
|
||||
Repositories=epel
|
||||
|
||||
[Content]
|
||||
Packages=
|
||||
dfuzzer
|
||||
dhcp-server
|
||||
erofs-utils
|
||||
knot
|
||||
qrencode
|
||||
@@ -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=
|
||||
|
||||
@@ -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=
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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=
|
||||
|
||||
@@ -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=
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[Match]
|
||||
Distribution=opensuse
|
||||
|
||||
[Build]
|
||||
Environment=
|
||||
GIT_URL=https://github.com/bmwiedemann/openSUSE
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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+',
|
||||
|
||||
Reference in New Issue
Block a user