From beebaeeb3f27a3ec46bf027cbca63333c41bc97e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 5 Jul 2023 12:05:45 +0900 Subject: [PATCH] test: change partition label to test if the outdated devlinks are removed The change is intended to reproduce the issue #27983, though the original issue is highly racy, and the test does not reproduce it reliably. But, anyway, it is better to change the partition label to test the devlink removal. --- test/units/testsuite-64.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh index ad502a229c1..789f24f98d1 100755 --- a/test/units/testsuite-64.sh +++ b/test/units/testsuite-64.sh @@ -444,10 +444,14 @@ EOF } testcase_simultaneous_events_2() { - local disk expected i iterations key link num_part part partscript target timeout + local disk expected i iterations key link num_part part script_dir target timeout local -a devices symlinks local -A running + script_dir="$(mktemp --directory "/tmp/test-udev-storage.script.XXXXXXXXXX")" + # shellcheck disable=SC2064 + trap "rm -rf '$script_dir'" RETURN + if [[ -v ASAN_OPTIONS || "$(systemd-detect-virt -v)" == "qemu" ]]; then num_part=20 iterations=1 @@ -469,13 +473,11 @@ testcase_simultaneous_events_2() { devices+=("$target") done - symlinks=("/dev/disk/by-partlabel/testlabel") - - partscript="$(mktemp)" - - cat >"$partscript" <"$script_dir/partscript-$i" <