Make get_partitions() work for partitioned disks
In general case, attached disks could be partitioned,
and this leads to multiple records in /proc/partitions,
for my laptop which is:
evgeny@eantyshev2:~$ cat /proc/partitions
major minor #blocks name
8 0 125034840 sda
8 1 524288 sda1
8 2 249856 sda2
8 3 124259328 sda3
8 16 976762584 sdb
11 0 1048575 sr0
252 0 1084366848 dm-0
252 1 16650240 dm-1
QEMU adds block devices as unpartitioned disks, so that
we have 1 disk <-> 1 partition match. But this is just
an implementation specific coincidence.
Because the attached disk can have GPT table
and a primary partition covering available disk space, and in this
case it would mean 2 extra devices.
Namely, to run Tempest on Virtuozzo containers, we should allow for
partitioned disks attached.
CT-f9e98104 /# cat /proc/partitions
major minor #blocks name
182 686608 2097152 ploop42913
182 686609 2095104 ploop42913p1
182 506688 1048576 ploop31668
182 506689 1046528 ploop31668p1
Here we see 2 devices for each disk: root disk block device ploop31668,
and partition block device ploop31668p1. We only want to see
root device for each disk, not the partition ones, or
some testcases don't work
(test_verify_created_server_ephemeral_disk naturally expects
device appearance of 1 extra device).
Change-Id: Icd0043b661c41a51acf62cc07cb80c2e9bae56d4
6 files changed