Commit a2630100 authored by anonym's avatar anonym
Browse files

Test suite: test re-installing over an existing Tails installation.

As kurono's work on #14720 showed, the Installer's "re-install"
feature is a bit fragile, so this is a preemptive regression test for
when he starts working on it again. :)

Refs: #14720
parent 1b276dbc
......@@ -56,8 +56,11 @@ def recover_from_upgrader_failure
$vm.spawn('tails-upgrade-frontend-wrapper', user: LIVE_USER)
end
Given /^I clone USB drive "([^"]+)" to a new USB drive "([^"]+)"$/ do |from, to|
Given /^I clone USB drive "([^"]+)" to a (new|temporary) USB drive "([^"]+)"$/ do |from, mode, to|
$vm.storage.clone_to_new_disk(from, to)
if mode == 'temporary'
add_after_scenario_hook { $vm.storage.delete_volume(to) }
end
end
Given /^I unplug USB drive "([^"]+)"$/ do |name|
......@@ -123,7 +126,7 @@ Then /^(no|the "([^"]+)") USB drive is selected$/ do |mode, name|
end
end
When /^I (install|upgrade) Tails (?:to|on) USB drive "([^"]+)" (by cloning|from an ISO)$/ do |action, name, source|
When /^I (install|reinstall|upgrade) Tails (?:to|on) USB drive "([^"]+)" (by cloning|from an ISO)$/ do |action, name, source|
step "I start Tails Installer"
# If the device was plugged *just* before this step, it might not be
# completely ready (so it's shown) at this stage.
......@@ -140,7 +143,12 @@ When /^I (install|upgrade) Tails (?:to|on) USB drive "([^"]+)" (by cloning|from
file_chooser.button('Open').click
end
begin
@installer.button(action.capitalize).click
if action == 'reinstall'
label = 'Reinstall (delete all data)'
else
label = action.capitalize
end
@installer.button(label).click
@installer.child('Question', roleName: 'alert').button('Yes').click
try_for(30*60) do
@installer
......
......@@ -52,6 +52,16 @@ Feature: Installing Tails to a USB drive
Then the running Tails is installed on USB drive "install"
But there is no persistence partition on USB drive "install"
Scenario: Re-installing Tails over an existing USB installation with a persistent partition
# We reach this first checkpoint only to ensure that the ' __internal' disk has reached the state (Tails installed + persistent partition set up) we need before we clone it below.
Given I have started Tails without network from a USB drive with a persistent partition enabled and logged in
Given I have started Tails from DVD without network and logged in
And I clone USB drive "__internal" to a temporary USB drive "install"
And I plug USB drive "install"
When I reinstall Tails to USB drive "install" by cloning
Then the running Tails is installed on USB drive "install"
And there is no persistence partition on USB drive "install"
Scenario: Booting Tails from a USB drive without a persistent partition and creating one
Given I have started Tails without network from a USB drive without a persistent partition and stopped at Tails Greeter's login screen
And I log in to a new session
......
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