hwdb-test: don't rely on --root= quirk

Previously, the test would rely on the fact that systemd-hwdb would
follow symlinks outside of the --root= hierarchy. That's a bug however,
and systemd-hwdb shouldn't do that. Hence let's remove the fact that the
test relies on it, so that we can then fix systemd-hwdb (specifically:
conf_files_list()) accordingly.
This commit is contained in:
Lennart Poettering 2022-08-22 14:06:10 +02:00
parent 3730dc5d5b
commit 3979ea8644

View file

@ -22,7 +22,7 @@ D="$(mktemp --tmpdir --directory "hwdb-test.XXXXXXXXXX")"
# shellcheck disable=SC2064
trap "rm -rf '$D'" EXIT INT QUIT PIPE
mkdir -p "$D/etc/udev"
ln -s "$ROOTDIR/hwdb.d" "$D/etc/udev/hwdb.d"
cp -a "$ROOTDIR/hwdb.d" "$D/etc/udev/hwdb.d"
# Test "good" properties" — no warnings or errors allowed
err=$("$SYSTEMD_HWDB" update --root "$D" 2>&1 >/dev/null) && rc= || rc=$?
@ -41,9 +41,9 @@ if [ ! -e "$D/etc/udev/hwdb.bin" ]; then
fi
# Test "bad" properties" — warnings required, errors not allowed
rm -f "$D/etc/udev/hwdb.bin" "$D/etc/udev/hwdb.d"
rm -rf "$D/etc/udev/hwdb.bin" "$D/etc/udev/hwdb.d"
ln -s "$ROOTDIR/test/hwdb.d" "$D/etc/udev/hwdb.d"
cp -a "$ROOTDIR/test/hwdb.d" "$D/etc/udev/hwdb.d"
err=$("$SYSTEMD_HWDB" update --root "$D" 2>&1 >/dev/null) && rc= || rc=$?
if [ -n "$rc" ]; then
echo "$SYSTEMD_HWDB returned $rc"