summaryrefslogtreecommitdiffstats
path: root/features
diff options
context:
space:
mode:
authorCyril Brulebois <ckb@riseup.net>2019-01-05 21:47:46 +0100
committerCyril Brulebois <ckb@riseup.net>2019-01-05 22:06:02 +0100
commiteef12f0fb5614a21f73c2974c5fd46dee5e8fed2 (patch)
treef3d5923b1f2290dd2c06b18390105707e09d0393 /features
parent1e05702b9d5626970d17f10bbcaae3ba1ae2dfea (diff)
Test suite: switch partition size check to the new helper (refs: #16003).
Diffstat (limited to 'features')
-rw-r--r--features/step_definitions/usb.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/features/step_definitions/usb.rb b/features/step_definitions/usb.rb
index a87e89d..78e0bc7 100644
--- a/features/step_definitions/usb.rb
+++ b/features/step_definitions/usb.rb
@@ -836,16 +836,18 @@ Then /^the system partition on "([^"]+)" is an EFI system partition$/ do |name|
end
Then /^the FAT filesystem on the system partition on "([^"]+)" is at least (\d+)(.+) large$/ do |name, size, unit|
+ # Let's use bytes all the way:
wanted_size = convert_to_bytes(size.to_i, unit)
- $vm.storage.guestfs_disk_helper(name) do |g, _|
- partition = g.list_partitions().first
- # returned PART_ENTRY_SIZE is expressed in (512-byte) blocks
- partition_size = g.blkid(partition)["PART_ENTRY_SIZE"].to_i * 512
- wanted_size = convert_to_bytes(size.to_i, unit)
- assert(partition_size >= wanted_size,
- "FAT partition is too small: #{partition_size} is less than #{wanted_size}")
- end
+ disk_dev = $vm.disk_dev(name)
+ part_dev = disk_dev + "1"
+
+ udisks_info = $vm.execute_successfully("udisksctl info --block-device #{part_dev}").stdout
+ partition_size = parse_udisksctl_info(udisks_info)['org.freedesktop.UDisks2.Partition']['Size'].to_i
+
+ # Partition size:
+ assert(partition_size >= wanted_size,
+ "FAT partition is too small: #{partition_size} is less than #{wanted_size}")
# -B 1 forces size to be expressed in bytes rather than (1K) blocks:
fs_size = $vm.execute_successfully(