Commit 27ba461b authored by anonym's avatar anonym
Browse files

Merge remote-tracking branch...

Merge remote-tracking branch 'origin/bugfix/14622-installer-check-space-before-deleting' into stable

Fix-committed: #14622
parents 05d34a41 783c0ef6
......@@ -20,10 +20,12 @@ Then /^Tails has no disk swap enabled$/ do
mem_info)
end
Given /^I create an? ([[:alnum:]]+) partition( labeled "([^"]+)")? with an? ([[:alnum:]]+) filesystem( encrypted with password "([^"]+)")? on disk "([^"]+)"$/ do |parttype, has_label, label, fstype, is_encrypted, luks_password, name|
Given /^I create an?( (\d+) ([[:alpha:]]+))? ([[:alnum:]]+) partition( labeled "([^"]+)")? with an? ([[:alnum:]]+) filesystem( encrypted with password "([^"]+)")? on disk "([^"]+)"$/ do |with_size, size, unit, parttype, has_label, label, fstype, is_encrypted, luks_password, name|
opts = {}
opts.merge!(:label => label) if has_label
opts.merge!(:luks_password => luks_password) if is_encrypted
opts.merge!(:size => size) if with_size
opts.merge!(:unit => unit) if with_size
$vm.storage.disk_mkpartfs(name, parttype, fstype, opts)
end
......
......@@ -104,7 +104,7 @@ When /^I start Tails Installer$/ do
$vm.focus_window('Tails Installer')
end
When /^I am told that the destination device (.*)$/ do |status|
When /^I am told by Tails Installer that.*"([^"]+)".*$/ do |status|
try_for(10) do
tails_installer_match_status(status)
end
......
......@@ -156,8 +156,22 @@ class VMStorage
def disk_mkpartfs(name, parttype, fstype, opts = {})
opts[:label] ||= nil
opts[:luks_password] ||= nil
opts[:size] ||= nil
opts[:unit] ||= nil
guestfs_disk_helper(name) do |g, disk_handle|
g.part_disk(disk_handle, parttype)
if ! opts[:size].nil? and ! opts[:unit].nil?
g.part_init(disk_handle, parttype)
size_in_bytes = convert_to_bytes(opts[:size].to_f, opts[:unit])
sector_size = g.blockdev_getss(disk_handle)
size_in_sectors = (size_in_bytes / sector_size).floor
# leave some room for the partition table
offset_in_sectors = (convert_to_bytes(4, 'MiB') / sector_size).floor
g.part_add(disk_handle, 'primary',
offset_in_sectors,
offset_in_sectors + size_in_sectors - 1)
else
g.part_disk(disk_handle, parttype)
end
g.part_set_name(disk_handle, 1, opts[:label]) if opts[:label]
primary_partition = g.list_partitions()[0]
if opts[:luks_password]
......
......@@ -10,7 +10,7 @@ Feature: Installing Tails to a USB drive
But a suitable USB device is not found
And no USB drive is selected
When I plug USB drive "too-small-device"
Then I am told that the destination device is too small
Then I am told by Tails Installer that the destination device "is too small"
And no USB drive is selected
When I unplug USB drive "too-small-device"
And I temporarily create a 7200 MiB disk named "big-enough"
......@@ -23,7 +23,7 @@ Feature: Installing Tails to a USB drive
And I create a gpt partition with a vfat filesystem on disk "gptfat"
And I plug USB drive "gptfat"
When I start Tails Installer
Then I am told that the destination device is too small
Then I am told by Tails Installer that the destination device "is too small"
Scenario: Detecting when a target USB drive is inserted or removed
Given I have started Tails from DVD without network and logged in
......
@product
Feature: Upgrading an old Tails USB installation
As a Tails user
If I have an old versoin of Tails installed on a USB device
If I have an old version of Tails installed on a USB device
and the USB device has a persistent partition
I want to upgrade Tails on it
and keep my persistent partition in the process
......@@ -10,6 +10,14 @@ Feature: Upgrading an old Tails USB installation
# other. When editing this feature, make sure you understand these
# dependencies (which are documented below).
Scenario: Try cloning Tails to a too small partition
Given I have started Tails from DVD without network and logged in
And I temporarily create a 7200 MiB disk named "too-small-partition"
And I create a 500 MiB gpt partition labeled "Tails" with a vfat filesystem on disk "too-small-partition"
And I plug USB drive "too-small-partition"
When I start Tails Installer
Then I am told by Tails Installer that I "need to use a downloaded Tails ISO image"
Scenario: Installing an old version of Tails to a pristine USB drive
Given a computer
And the computer is set to boot from the old Tails DVD
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment