1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

test-64-udev-storage: partition disk inside testcase - testcase_long_sysfs_path

This commit is contained in:
Sam Leonard 2024-04-16 13:18:34 +01:00
parent d398a2e004
commit 8d82e39046
No known key found for this signature in database
GPG Key ID: 96850F0978CE78F0
3 changed files with 13 additions and 12 deletions

View File

@ -475,18 +475,6 @@ testcase_long_sysfs_path() {
) )
dd if=/dev/zero of="$testdisk" bs=1M count=64 dd if=/dev/zero of="$testdisk" bs=1M count=64
lodev="$(losetup --show -f -P "$testdisk")"
sfdisk "${lodev:?}" <<EOF
label: gpt
name="test_swap", size=32M
uuid="deadbeef-dead-dead-beef-000000000000", name="test_part", size=5M
EOF
udevadm settle
mkswap -U "deadbeef-dead-dead-beef-111111111111" -L "swap_vol" "${lodev}p1"
mkfs.ext4 -U "deadbeef-dead-dead-beef-222222222222" -L "data_vol" "${lodev}p2"
losetup -d "$lodev"
# Create 25 additional PCI bridges, each one connected to the previous one # Create 25 additional PCI bridges, each one connected to the previous one
# (basically a really long extension cable), and attach a virtio drive to # (basically a really long extension cable), and attach a virtio drive to
# the last one. This should force udev into attempting to create a device # the last one. This should force udev into attempting to create a device

View File

@ -1117,6 +1117,9 @@ install_fs_tools() {
# we use mkfs in system-repart tests # we use mkfs in system-repart tests
image_install /sbin/mkfs.ext4 image_install /sbin/mkfs.ext4
image_install /sbin/mkfs.vfat image_install /sbin/mkfs.vfat
# we use mkswap in udev-storage tests
image_install /sbin/mkswap
} }
install_modules() { install_modules() {

View File

@ -950,6 +950,16 @@ testcase_long_sysfs_path() {
stat /sys/block/vda stat /sys/block/vda
readlink -f /sys/block/vda/dev readlink -f /sys/block/vda/dev
dev="/dev/vda"
sfdisk "${dev:?}" <<EOF
label: gpt
name="test_swap", size=32M
uuid="deadbeef-dead-dead-beef-000000000000", name="test_part", size=5M
EOF
udevadm settle
mkswap -U "deadbeef-dead-dead-beef-111111111111" -L "swap_vol" "${dev}1"
mkfs.ext4 -U "deadbeef-dead-dead-beef-222222222222" -L "data_vol" "${dev}2"
udevadm wait --settle --timeout=30 "${expected_symlinks[@]}" udevadm wait --settle --timeout=30 "${expected_symlinks[@]}"
# Try to mount the data partition manually (using its label) # Try to mount the data partition manually (using its label)