diff options
author | Sam Leonard <sam.leonard@codethink.co.uk> | 2024-04-16 17:17:59 +0200 |
---|---|---|
committer | Sam Leonard <sam.leonard@codethink.co.uk> | 2024-04-16 17:18:55 +0200 |
commit | 211062e3b5b66450884f7f603963579f6ce27420 (patch) | |
tree | 98177cb6002852070af17fc4cce0b052a643df8b /test/units/testsuite-64.sh | |
parent | test-64-udev-storage: partition disk inside testcase - testcase_long_sysfs_path (diff) | |
download | systemd-211062e3b5b66450884f7f603963579f6ce27420.tar.xz systemd-211062e3b5b66450884f7f603963579f6ce27420.zip |
test-64-udev-storage: partition disk inside testcase - testcase_virtio_scsi_identically_named_partitions
Diffstat (limited to '')
-rwxr-xr-x | test/units/testsuite-64.sh | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh index fa823bce0c..0e5a1d140b 100755 --- a/test/units/testsuite-64.sh +++ b/test/units/testsuite-64.sh @@ -239,16 +239,27 @@ testcase_nvme_subsystem() { } testcase_virtio_scsi_identically_named_partitions() { - local num + local num_part num_disk i j + local alphabet='abcdefghijklmnopqrstuvwxyz' if [[ -v ASAN_OPTIONS || "$(systemd-detect-virt -v)" == "qemu" ]]; then - num=$((4 * 4)) + num_part=4 + num_disk=4 else - num=$((16 * 8)) + num_part=8 + num_disk=16 fi + for ((i = 0; i < num_disk; i++)); do + sfdisk "/dev/sd${alphabet:$i:1}" <<EOF +label: gpt + +$(for ((j = 1; j <= num_part; j++)); do echo 'name="Hello world", size=2M'; done) +EOF + done + lsblk --noheadings -a -o NAME,PARTLABEL - [[ "$(lsblk --noheadings -a -o NAME,PARTLABEL | grep -c "Hello world")" -eq "$num" ]] + [[ "$(lsblk --noheadings -a -o NAME,PARTLABEL | grep -c "Hello world")" -eq "$((num_part * num_disk))" ]] } testcase_multipath_basic_failover() { |