From 7b9e412d8aba8f415f35d02da5e5fa5bd92632cc Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 6 Oct 2024 15:39:36 +0900 Subject: [PATCH] test: add test case for issue #34637 (cherry picked from commit 88d186e4829bc7ef4a4253fe2bf4857903bca830) --- test/units/TEST-17-UDEV.diskseq.sh | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 test/units/TEST-17-UDEV.diskseq.sh diff --git a/test/units/TEST-17-UDEV.diskseq.sh b/test/units/TEST-17-UDEV.diskseq.sh new file mode 100755 index 0000000000..0cb717fbd0 --- /dev/null +++ b/test/units/TEST-17-UDEV.diskseq.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +# shellcheck disable=SC2010 +# shellcheck disable=SC2317 +set -ex +set -o pipefail + +# shellcheck source=test/units/util.sh +. "$(dirname "$0")"/util.sh + +# This is a test case for issue #34637. + +at_exit() ( + set +e + + systemctl stop test-diskseq.service || : + rm -f /run/systemd/system/test-diskseq.service + systemctl daemon-reload + + [[ -d "$TMPDIR" ]] && rm -rf "$TMPDIR" + + udevadm control --log-level=info +) + +trap at_exit EXIT + +udevadm control --log-level=debug + +TMPDIR="$(mktemp -d)" +truncate -s 16M "$TMPDIR"/foo.raw +mkfs.ext4 -L foo "$TMPDIR"/foo.raw + +mkdir -p /run/systemd/system/ +cat >/run/systemd/system/test-diskseq.service <