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

Merge three steps together and reorder them.

We merge "Tor has built a circuit", "the time has synced" and "Tor is ready"
into a single step called "Tor is ready". This simplifies scenarios quite a bit,
and allows us to always do the checks in the right order, without each scenario
trying its own version.

Speaking of the right order: we wait for the "Tor is ready" notification first.
it disappears after a timeout, so if we wait for other events first, we
sometimes cannot find the notification picture on screen later on.
parent 02ba5b28
......@@ -15,9 +15,7 @@ Feature: Installing packages through APT
And I log in to a new session
And GNOME has started
And I have a network connection
And Tor has built a circuit
And the time has synced
And I am told that Tor is ready
And Tor is ready
And I have closed all annoying notifications
And I save the state so the background can be restored next scenario
......
......@@ -18,8 +18,8 @@ Feature: Various checks
Scenario: The shipped Tails signing key is up-to-date
Given the network is plugged
And Tor has built a circuit
And I am told that Tor is ready
And I have a network connection
And Tor is ready
And I have closed all annoying notifications
Then the shipped Tails signing key is not outdated
......@@ -32,8 +32,7 @@ Feature: Various checks
Given I wait between 30 and 60 seconds
When the network is plugged
Then I have a network connection
And Tor has built a circuit
And I am told that Tor is ready
And Tor is ready
And I have closed all annoying notifications
And process "vidalia" is running
And the time has synced
......
......@@ -10,9 +10,7 @@ Feature:
And the computer boots Tails
And I log in to a new session
And I have a network connection
And Tor has built a circuit
And the time has synced
And I am told that Tor is ready
And Tor is ready
And I have closed all annoying notifications
And all Internet traffic has only flowed through Tor
And I save the state so the background can be restored next scenario
......
......@@ -223,6 +223,27 @@ Given /^I have a network connection$/ do
try_for(120) { @vm.has_network? }
end
Given /^Tor is ready$/ do
next if @skip_steps_while_restoring_background
# First, we wait for the notification to be displayed:
# it disappears after a timeout, so if we wait for other events first,
# we sometimes cannot find the notification picture on screen later.
case @theme
when "winxp"
notification_picture = "WinXPTorIsReady.png"
else
notification_picture = "GnomeTorIsReady.png"
end
@screen.wait(notification_picture, 300)
# Having seen the "Tor is ready" notification implies that Tor has
# built a circuit, but let's check it directly to be on the safe side.
step "Tor has built a circuit"
step "the time has synced"
end
Given /^Tor has built a circuit$/ do
next if @skip_steps_while_restoring_background
wait_until_tor_is_working
......@@ -252,18 +273,6 @@ Given /^Iceweasel has started and is not loading a web page$/ do
@screen.type("about:blank" + Sikuli::Key.ENTER)
end
Given /^I am told that Tor is ready$/ do
next if @skip_steps_while_restoring_background
case @theme
when "winxp"
notification_picture = "WinXPTorIsReady.png"
else
notification_picture = "GnomeTorIsReady.png"
end
@screen.wait(notification_picture, 300)
end
Given /^I have closed all annoying notifications$/ do
next if @skip_steps_while_restoring_background
case @theme
......
......@@ -16,40 +16,35 @@ Feature: Time syncing
Scenario: Clock with host's time
When the network is plugged
And I have a network connection
And Tor has built a circuit
And the time has synced
And Tor is ready
Then Tails clock is less than 5 minutes incorrect
Scenario: Clock is one day in the past
When I bump the system time with "-1 day"
And the network is plugged
And I have a network connection
And Tor has built a circuit
And the time has synced
And Tor is ready
Then Tails clock is less than 5 minutes incorrect
Scenario: Clock way in the past
When I set the system time to "01 Jan 2000 12:34:56"
And the network is plugged
And I have a network connection
And Tor has built a circuit
And the time has synced
And Tor is ready
Then Tails clock is less than 5 minutes incorrect
Scenario: Clock is one day in the future
When I bump the system time with "+1 day"
And the network is plugged
And I have a network connection
And Tor has built a circuit
And the time has synced
And Tor is ready
Then Tails clock is less than 5 minutes incorrect
Scenario: Clock way in the future
When I set the system time to "01 Jan 2020 12:34:56"
And the network is plugged
And I have a network connection
And Tor has built a circuit
And the time has synced
And Tor is ready
Then Tails clock is less than 5 minutes incorrect
# Scenario: Clock vs Tor consensus' valid-{after,until} etc.
......@@ -12,9 +12,7 @@ Feature: Browsing the web using Iceweasel
And I log in to a new session
And GNOME has started
And I have a network connection
And Tor has built a circuit
And the time has synced
And I am told that Tor is ready
And Tor is ready
And I have closed all annoying notifications
And I run "iceweasel"
And Iceweasel has started and is not loading a web page
......
......@@ -13,9 +13,7 @@ Feature: Keyserver interaction with GnuPG
And I log in to a new session
And GNOME has started
And I have a network connection
And Tor has built a circuit
And the time has synced
And I am told that Tor is ready
And Tor is ready
And I have closed all annoying notifications
And the "10CC5BC7" OpenPGP key is not in the live user's public keyring
And I save the state so the background can be restored next scenario
......
......@@ -11,9 +11,7 @@ Feature: Browsing the web using the Unsafe Browser
And I log in to a new session
And GNOME has started
And I have a network connection
And Tor has built a circuit
And the time has synced
And I am told that Tor is ready
And Tor is ready
And I have closed all annoying notifications
And I save the state so the background can be restored next scenario
......
......@@ -25,9 +25,7 @@ Feature: Microsoft Windows XP Camouflage
Scenario: Windows should appear like those in Microsoft Windows XP
When the network is plugged
And I have a network connection
And Tor has built a circuit
And the time has synced
And I am told that Tor is ready
And Tor is ready
And I have closed all annoying notifications
And I run "iceweasel"
Then I see "WinXPIceweaselWindow.png" after at most 120 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