Commit df992970 authored by Tails developers's avatar Tails developers
Browse files

Get rid of "I restore the background snapshot" step.

parent cf581e0b
......@@ -6,7 +6,6 @@ Feature: Installing packages through APT
Background:
Given a computer
And I restore the background snapshot if it exists
And I capture all network traffic
And I start the computer
And the computer boots Tails
......@@ -20,7 +19,7 @@ Feature: Installing packages through APT
And the time has synced
And I have closed all annoying notifications
And APT's sources are only {ftp.us,security,back-ports}.debian.org
And I save the background snapshot if it does not exist
And I save the state so the background can be restored next scenario
Scenario: Install packages using apt-get
When I update APT using apt-get
......
......@@ -5,7 +5,6 @@ Feature: Keyserver interaction with GnuPG
Background:
Given a computer
And I restore the background snapshot if it exists
And I capture all network traffic
And I start the computer
And the computer boots Tails
......@@ -16,7 +15,7 @@ Feature: Keyserver interaction with GnuPG
And Iceweasel has autostarted and is not loading a web page
And the time has synced
And I have closed all annoying notifications
And I save the background snapshot if it does not exist
And I save the state so the background can be restored next scenario
Scenario: Fetching PGP keys using the CLI should be done over Tor.
When I successfully fetch a GnuPG key using the CLI
......
......@@ -5,7 +5,6 @@ Feature: Browsing the web using Iceweasel
Background:
Given a computer
And I restore the background snapshot if it exists
And I capture all network traffic
And I start the computer
And the computer boots Tails
......@@ -16,7 +15,7 @@ Feature: Browsing the web using Iceweasel
And Iceweasel has autostarted and is not loading a web page
And the time has synced
And I have closed all annoying notifications
And I save the background snapshot if it does not exist
And I save the state so the background can be restored next scenario
Scenario: Opening check.torproject.org in Iceweasel will show the green onion and the congratualtions message.
When I open the address "https://check.torproject.org" in Iceweasel
......
......@@ -7,11 +7,10 @@ Feature: Root access control enforcement
Background:
Given a computer
And I restore the background snapshot if it exists
And the network is unplugged
And I start the computer
And the computer boots Tails
And I save the background snapshot if it does not exist
And I save the state so the background can be restored next scenario
Scenario: If an administrative password is set in Tails Greeter the amnesia user should be able to run arbitrary commands with administrative privileges.
Given I enable more Tails Greeter options
......
......@@ -27,17 +27,6 @@ def restore_background
end
end
Given /^I restore the background snapshot if it exists$/ do
# We use size?() instead of the more intuitive exist?() here due
# to the libvirt permission workaround in env.rb.
if File.size?($background_snapshot)
restore_background
# From now on all steps will be skipped (and pass) until we reach
# the step which saved the snapshot.
@skip_steps_while_restoring_background = true
end
end
Given /^a computer$/ do
@vm.destroy if @vm
@vm = VM.new($vm_xml_path, $x_display)
......@@ -232,11 +221,23 @@ Given /^I have closed all annoying notifications$/ do
end
end
Given /^I save the background snapshot if it does not exist$/ do
if !@skip_steps_while_restoring_background
Given /^I save the state so the background can be restored next scenario$/ do
if @skip_steps_while_restoring_background
assert(File.size?($background_snapshot),
"We have been skipping steps but there is no snapshot to restore")
else
# To be sure we run the feature from scratch we remove any
# leftover snapshot that wasn't removed.
if File.exist?($background_snapshot)
File.delete($background_snapshot)
end
# Workaround for libvirt permission issues. See the run_test_suite
# script for more information about a similar libvirt premission issue.
FileUtils.touch($background_snapshot)
FileUtils.chmod(0666, $background_snapshot)
@vm.save_snapshot($background_snapshot)
restore_background
end
restore_background
# Now we stop skipping steps from the snapshot restore.
@skip_steps_while_restoring_background = false
end
......
......@@ -23,7 +23,11 @@ end
# BeforeScenario
Before do
@screen = Sikuli::Screen.new
@skip_steps_while_restoring_background = false
if File.size?($background_snapshot)
@skip_steps_while_restoring_background = true
else
@skip_steps_while_restoring_background = false
end
@theme = "gnome"
end
......
......@@ -5,13 +5,12 @@ Feature: Time syncing
Background:
Given a computer
And I restore the background snapshot if it exists
And the network is unplugged
And I start the computer
And the computer boots Tails
And I log in to a new session
And GNOME has started
And I save the background snapshot if it does not exist
And I save the state so the background can be restored next scenario
Scenario: Clock with host's time
When the network is plugged
......
......@@ -5,7 +5,6 @@ Feature: Browsing the web using the Unsafe Browser
Background:
Given a computer
And I restore the background snapshot if it exists
And I start the computer
And the computer boots Tails
And I log in to a new session
......@@ -16,7 +15,7 @@ Feature: Browsing the web using the Unsafe Browser
And I have killed the process "iceweasel"
And the time has synced
And I have closed all annoying notifications
And I save the background snapshot if it does not exist
And I save the state so the background can be restored next scenario
Scenario: Closing the Unsafe Browser shows a stop notification.
When I start the Unsafe Browser
......
......@@ -5,7 +5,6 @@ Feature: Microsoft Windows XP Camouflage
Background:
Given a computer
And I restore the background snapshot if it exists
And the network is unplugged
And I start the computer
And the computer boots Tails
......@@ -14,7 +13,7 @@ Feature: Microsoft Windows XP Camouflage
And I log in to a new session
And GNOME has started
And I have closed all annoying notifications
And I save the background snapshot if it does not exist
And I save the state so the background can be restored next scenario
Scenario: I should be presented with a Microsoft Windows XP like desktop
Then I see "WinXPDesktop.png" after at most 10 seconds
......
Supports Markdown
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