Merge pull request #22960 from mrc0mmand/use-udevadm-wait

test: use the new `udevadm wait` verb to wait for the loop device
This commit is contained in:
Luca Boccassi
2022-04-04 18:39:59 +01:00
committed by GitHub
3 changed files with 28 additions and 34 deletions
+23 -22
View File
@@ -3076,27 +3076,6 @@ if conf.get('ENABLE_BINFMT') == 1
endif
endif
if conf.get('ENABLE_REPART') == 1
exe = executable(
'systemd-repart',
systemd_repart_sources,
include_directories : includes,
link_with : [libshared],
dependencies : [threads,
libblkid,
libfdisk],
install_rpath : rootlibexecdir,
install : true,
install_dir : rootbindir)
public_programs += exe
if want_tests != 'false'
test('test-repart',
test_repart_sh,
args : exe.full_path())
endif
endif
if conf.get('ENABLE_SYSUPDATE') == 1
exe = executable(
'systemd-sysupdate',
@@ -3517,7 +3496,7 @@ public_programs += executable(
install : true,
install_dir : rootlibexecdir)
public_programs += executable(
udevadm = executable(
'udevadm',
udevadm_sources,
include_directories : includes,
@@ -3531,6 +3510,28 @@ public_programs += executable(
install_rpath : udev_rpath,
install : true,
install_dir : rootbindir)
public_programs += udevadm
if conf.get('ENABLE_REPART') == 1
exe = executable(
'systemd-repart',
systemd_repart_sources,
include_directories : includes,
link_with : [libshared],
dependencies : [threads,
libblkid,
libfdisk],
install_rpath : rootlibexecdir,
install : true,
install_dir : rootbindir)
public_programs += exe
if want_tests != 'false'
test('test-repart',
test_repart_sh,
args : [exe.full_path(), udevadm.full_path()])
endif
endif
executable(
'systemd-shutdown',
+3 -4
View File
@@ -6,7 +6,9 @@ set -o pipefail
[[ -e /dev/loop-control ]] || exit 77
repart="${1:?}"
udevadm="${2:?}"
test -x "$repart"
test -x "$udevadm"
PATH=$PATH:/sbin:/usr/sbin
@@ -199,10 +201,7 @@ $D/zzz7 : start= 6291416, size= 98304, type=0FC63DAF-8483-4772-8E79-3D
EOF
LOOP="$(losetup -P --show --find "$D/zzz")"
while : ; do
test -e "$LOOP" && break
sleep .2
done
"${udevadm:?}" wait --timeout 60 --initialized=yes --settle "${LOOP:?}"
VOLUME="test-repart-$RANDOM"
+2 -8
View File
@@ -174,10 +174,7 @@ rm -r /tmp/testsuite-58.3-defs/
mkdir -p /tmp/testsuite-58-issue-21817-defs/
truncate -s 100m /var/tmp/testsuite-58-issue-21817.img
LOOP=$(losetup -P --show -f /var/tmp/testsuite-58-issue-21817.img)
while : ; do
test -e "$LOOP" && break
sleep .2
done
udevadm wait --timeout 60 --initialized=yes --settle "${LOOP:?}"
printf 'size=50M,type=%s\n,\n' "${root_guid}" | sfdisk -X gpt "$LOOP"
cat >/tmp/testsuite-58-issue-21817-defs/test.conf <<EOF
[Partition]
@@ -219,10 +216,7 @@ EOF
truncate -s 100m "/tmp/testsuite-58-sector-$1.img"
LOOP=$(losetup -b "$1" -P --show -f "/tmp/testsuite-58-sector-$1.img" )
while : ; do
test -e "$LOOP" && break
sleep .2
done
udevadm wait --timeout 60 --initialized=yes --settle "${LOOP:?}"
systemd-repart --pretty=yes --definitions=/tmp/testsuite-58-sector/ --seed=750b6cd5c4ae4012a15e7be3c29e6a47 --empty=require --dry-run=no "$LOOP"
rm -rf /tmp/testsuite-58-sector
sfdisk --verify "$LOOP"