summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2016-08-26 14:52:59 +0200
committeranonym <anonym@riseup.net>2016-08-26 14:52:59 +0200
commitdc879a0ec7e330dc5c0a9bf4e42483b90ccbdf9f (patch)
tree83f05bf5792b4f692d6a4b700e56c23a380dc001
parentfb6da598d88fc5fc059dd21d7f8f64d9bdcb54ce (diff)
Always sync the time from the host when restoring from a snapshot.
Previously we wouldn't do it when the network was plugged but Tor wasn't running, which can cause issues if we *then* start Tor since the time may be off.
-rw-r--r--features/step_definitions/common_steps.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
index 37223b4..428c392 100644
--- a/features/step_definitions/common_steps.rb
+++ b/features/step_definitions/common_steps.rb
@@ -98,12 +98,12 @@ def post_snapshot_restore_hook
# The guest's Tor's circuits' states are likely to get out of sync
# with the other relays, so we ensure that we have fresh circuits.
# Time jumps and incorrect clocks also confuses Tor in many ways.
+ $vm.host_to_guest_time_sync
if $vm.has_network?
if $vm.execute("systemctl --quiet is-active tor@default.service").success?
$vm.execute("systemctl stop tor@default.service")
$vm.execute("rm -f /var/log/tor/log")
$vm.execute("systemctl --no-block restart tails-tor-has-bootstrapped.target")
- $vm.host_to_guest_time_sync
$vm.spawn("restart-tor")
wait_until_tor_is_working
if $vm.file_content('/proc/cmdline').include?(' i2p')
@@ -114,8 +114,6 @@ def post_snapshot_restore_hook
$vm.spawn('/usr/local/sbin/tails-i2p start')
end
end
- else
- $vm.host_to_guest_time_sync
end
end