Revert "test: test new systemd-dissect --attach/--detach/--loop-ref= and /dev/loop/* symlinks"

This reverts commit f5e46b9e09.
This commit is contained in:
Luca Boccassi 2023-07-20 22:26:40 +01:00
parent b0efbe9b81
commit 5022fab15f

View file

@ -470,48 +470,6 @@ mount -t ddi "${image}.gpt" "$T" -o ro,X-mount.mkdir,discard
umount -R "$T"
rmdir "$T"
LOOP="$(systemd-dissect --attach --loop-ref=waldo "${image}.raw")"
# Wait until the symlinks we want to test are established
udevadm trigger -w "$LOOP"
# Check if the /dev/loop/* symlinks really reference the right device
test /dev/loop/by-ref/waldo -ef "$LOOP"
if [ "$(stat -c '%Hd:%Ld' "${image}.raw")" != '?d:?d' ] ; then
# Old stat didn't know the %Hd and %Ld specifiers and turned them into ?d
# instead. Let's simply skip the test on such old systems.
test "$(stat -c '/dev/loop/by-inode/%Hd:%Ld-%i' "${image}.raw")" -ef "$LOOP"
fi
# Detach by loopback device
systemd-dissect --detach "$LOOP"
# Test long reference name.
# Note, sizeof_field(struct loop_info64, lo_file_name) == 64,
# and --loop-ref accepts upto 63 characters, and udev creates symlink
# based on the name when it has upto _62_ characters.
name="$(for _ in {1..62}; do echo -n 'x'; done)"
LOOP="$(systemd-dissect --attach --loop-ref="$name" "${image}.raw")"
udevadm trigger -w "$LOOP"
# Check if the /dev/loop/by-ref/$name symlink really references the right device
test "/dev/loop/by-ref/$name" -ef "$LOOP"
# Detach by the /dev/loop/by-ref symlink
systemd-dissect --detach "/dev/loop/by-ref/$name"
name="$(for _ in {1..63}; do echo -n 'x'; done)"
LOOP="$(systemd-dissect --attach --loop-ref="$name" "${image}.raw")"
udevadm trigger -w "$LOOP"
# Check if the /dev/loop/by-ref/$name symlink does not exist
test ! -e "/dev/loop/by-ref/$name"
# Detach by backing inode
systemd-dissect --detach "${image}.raw"
(! systemd-dissect --detach "${image}.raw")
# check for confext functionality
mkdir -p /run/confexts/test/etc/extension-release.d
echo "ID=_any" >/run/confexts/test/etc/extension-release.d/extension-release.test