Add env variable for machine ID path
authorMartin Pitt <mpitt@debian.org>
Wed, 18 Jan 2017 10:21:35 +0000 (11:21 +0100)
committerAdrian Bunk <bunk@debian.org>
Thu, 29 Jun 2023 13:57:02 +0000 (14:57 +0100)
commitca9dcc0d2756010255c0f771e9fe6b50aea40b55
treef6af0f3633993ac968e36fce1c9b5fb144d79fe7
parente7480af817ff2d8617b0f782930cf20709f08402
Add env variable for machine ID path

During package build, in minimal chroots, or other systems which do not already
have an /etc/machine-id we get six test failures. Introduce a
$SYSTEMD_MACHINE_ID_PATH environment variable which can specify a location
other than /etc/machine-id, so that the unit tests are independent from the
environment.

Also adjust test-fs-util to not assume that /etc/machine-id exists. Use
/etc/passwd instead which is created by base-files.

Closes: #851445
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=62344

Gbp-Pq: Topic debian
Gbp-Pq: Name Add-env-variable-for-machine-ID-path.patch
src/libsystemd/sd-id128/sd-id128.c
src/test/test-fs-util.c