summaryrefslogtreecommitdiffstats
path: root/features
diff options
context:
space:
mode:
authorCyril Brulebois <ckb@riseup.net>2019-01-05 18:55:23 +0100
committerCyril Brulebois <ckb@riseup.net>2019-01-05 18:55:30 +0100
commit928d6e2ae187cb4520563b6e9408d5659350d561 (patch)
tree70a0a93666fcc518580b82cd8d3a3d9b1f6b7adc /features
parentdc054d38888b5fafd0ff7ff8795edd9cc296c915 (diff)
Test suite: move flags check from guestfs to live checking (refs: #16003).
Note: The udisksctl output parsing is needed in several places so that's getting a refactoring in later commits.
Diffstat (limited to 'features')
-rw-r--r--features/step_definitions/usb.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/features/step_definitions/usb.rb b/features/step_definitions/usb.rb
index 0fcedc9..d99082f 100644
--- a/features/step_definitions/usb.rb
+++ b/features/step_definitions/usb.rb
@@ -848,11 +848,16 @@ Then /^the label of the FAT filesystem on the system partition on "([^"]+)" is "
end
Then /^the system partition on "([^"]+)" has the expected flags$/ do |name|
- $vm.storage.guestfs_disk_helper(name) do |g, _|
- partition = g.list_partitions().first
- partition_flags = g.blkid(partition)["PART_ENTRY_FLAGS"]
- expected_flags = '0xd000000000000005'
- assert(partition_flags == expected_flags,
- "Got #{partition_flags} as partition flags on #{name}, instead of the expected #{expected_flags}")
- end
+ disk_dev = $vm.disk_dev(name)
+ part_dev = disk_dev + "1"
+
+ # Extract partition area:
+ part_details = $vm.execute_successfully("udisksctl info --block-device #{part_dev} | sed '1,/^ org\.freedesktop\.UDisks2\.Partition:$/d'").stdout
+
+ # See SYSTEM_PARTITION_FLAGS in create-usb-image-from-iso: 0xd000000000000005,
+ # displayed in decimal (14987979559889010693) in udisksctl's output:
+ expected_flags = 0xd000000000000005
+ flags = part_details.scan(/^\s+Flags:\s+(\d+)$/).first.first
+ assert(flags == expected_flags.to_s,
+ "Got #{flags} as partition flags on #{part_dev} (for #{name}), instead of the expected #{expected_flags}")
end