]> git.ipfire.org Git - thirdparty/systemd.git/commit
test: rework dmsetup test to wait for device to disappear
authorLuca Boccassi <luca.boccassi@gmail.com>
Tue, 4 Nov 2025 16:54:11 +0000 (16:54 +0000)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 4 Nov 2025 19:08:44 +0000 (04:08 +0900)
commit1e1f63e63b9cf5907a24af6248e4173267f3d56c
tree2d3af4f8e0470a364475180d0d16206ca5f08585
parent71d64f05271965a1e2cec727dbd7d974cbf95739
test: rework dmsetup test to wait for device to disappear

There might be a delay between an umount and a refcounted device
to disappear, so the test can be flaky:

[   36.107128] TEST-50-DISSECT.sh[1662]: ++ dmsetup ls
[   36.108314] TEST-50-DISSECT.sh[1663]: ++ grep loop
[   36.109283] TEST-50-DISSECT.sh[1664]: ++ grep -c verity
[   36.110284] TEST-50-DISSECT.sh[1360]: + test 1 -eq 1
[   36.111555] TEST-50-DISSECT.sh[1360]: + umount -R /tmp/TEST-50-IMAGES.hxm/mount
[   36.112237] TEST-50-DISSECT.sh[1668]: ++ dmsetup ls
[   36.113039] TEST-50-DISSECT.sh[1669]: ++ grep loop
[   36.113833] TEST-50-DISSECT.sh[1670]: ++ grep -c verity
[   36.114517] TEST-50-DISSECT.sh[1360]: + test 0 -eq 1
[   36.116734] TEST-50-DISSECT.sh[1000]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/TEST-50-DISSECT.dissect.sh failed'

https://github.com/systemd/systemd/actions/runs/19062162467/job/54444112653?pr=39540#logs

Switch to searching for the dm entry and check for it specifically,
and wait for it to disappear before checking that it is no longer
in the dm table.

Follow-up for 10fc43e504da5962fa5f04341ae8ba92a9981be9
test/units/TEST-50-DISSECT.dissect.sh