summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/chroot_local-includes/usr/share/tails/torbrowser-AppArmor-profile.patch9
-rw-r--r--features/step_definitions/time_syncing.rb28
-rw-r--r--features/step_definitions/usb.rb2
-rw-r--r--features/support/helpers/misc_helpers.rb15
-rw-r--r--features/support/helpers/storage_helper.rb9
-rw-r--r--wiki/src/contribute/release_process/test.mdwn17
6 files changed, 58 insertions, 22 deletions
diff --git a/config/chroot_local-includes/usr/share/tails/torbrowser-AppArmor-profile.patch b/config/chroot_local-includes/usr/share/tails/torbrowser-AppArmor-profile.patch
index d6f8bf6..baef2ba 100644
--- a/config/chroot_local-includes/usr/share/tails/torbrowser-AppArmor-profile.patch
+++ b/config/chroot_local-includes/usr/share/tails/torbrowser-AppArmor-profile.patch
@@ -1,5 +1,5 @@
diff --git a/apparmor/torbrowser.Browser.firefox b/apparmor/torbrowser.Browser.firefox
-index 0df7ad9..ae26e61 100644
+index 0df7ad9..6d1346c 100644
--- a/apparmor/torbrowser.Browser.firefox
+++ b/apparmor/torbrowser.Browser.firefox
@@ -1,13 +1,15 @@
@@ -105,7 +105,7 @@ index 0df7ad9..ae26e61 100644
# Should use abstractions/gstreamer instead once merged upstream
/etc/udev/udev.conf r,
-@@ -72,6 +87,16 @@
+@@ -72,6 +87,21 @@
/sys/devices/pci[0-9]*/**/uevent r,
owner /{dev,run}/shm/shmfd-* rw,
@@ -119,6 +119,11 @@ index 0df7ad9..ae26e61 100644
+ /usr/local/lib/tor-browser/firefox Pix,
+ /usr/bin/seahorse-tool Ux,
+
++ # Spell checking (the "enchant" abstraction includes these rules
++ # too, but it allows way more stuff than what we need)
++ /usr/share/hunspell/ r,
++ /usr/share/hunspell/* r,
++
# KDE 4
owner @{HOME}/.kde/share/config/* r,
diff --git a/features/step_definitions/time_syncing.rb b/features/step_definitions/time_syncing.rb
index 161a416..d9881aa 100644
--- a/features/step_definitions/time_syncing.rb
+++ b/features/step_definitions/time_syncing.rb
@@ -1,11 +1,35 @@
+# In some steps below we allow some slack when verifying that the date
+# was set appropriately because it may take time to send the `date`
+# command over the remote shell and get the answer back, parsing and
+# post-processing of the result, etc.
+def max_time_drift
+ 5
+end
+
When /^I set the system time to "([^"]+)"$/ do |time|
next if @skip_steps_while_restoring_background
- @vm.execute("date -s '#{time}'")
+ @vm.execute_successfully("date -s '#{time}'")
+ new_time = DateTime.parse(@vm.execute_successfully("date").stdout).to_time
+ expected_time_lower_bound = DateTime.parse(time).to_time
+ expected_time_upper_bound = expected_time_lower_bound + max_time_drift
+ assert(expected_time_lower_bound <= new_time &&
+ new_time <= expected_time_upper_bound,
+ "The guest's time was supposed to be set to " \
+ "'#{expected_time_lower_bound}' but is '#{new_time}'")
end
When /^I bump the system time with "([^"]+)"$/ do |timediff|
next if @skip_steps_while_restoring_background
- @vm.execute("date -s 'now #{timediff}'")
+ old_time = DateTime.parse(@vm.execute_successfully("date").stdout).to_time
+ @vm.execute_successfully("date -s 'now #{timediff}'")
+ new_time = DateTime.parse(@vm.execute_successfully("date").stdout).to_time
+ expected_time_lower_bound = DateTime.parse(
+ cmd_helper("date -d '#{old_time} #{timediff}'")).to_time
+ expected_time_upper_bound = expected_time_lower_bound + max_time_drift
+ assert(expected_time_lower_bound <= new_time &&
+ new_time <= expected_time_upper_bound,
+ "The guest's time was supposed to be bumped to " \
+ "'#{expected_time_lower_bound}' but is '#{new_time}'")
end
Then /^Tails clock is less than (\d+) minutes incorrect$/ do |max_diff_mins|
diff --git a/features/step_definitions/usb.rb b/features/step_definitions/usb.rb
index 2c657ca..0fbff8a 100644
--- a/features/step_definitions/usb.rb
+++ b/features/step_definitions/usb.rb
@@ -304,7 +304,7 @@ end
def tails_persistence_enabled?
persistence_state_file = "/var/lib/live/config/tails.persistence"
return @vm.execute("test -e '#{persistence_state_file}'").success? &&
- @vm.execute('. #{persistence_state_file} && ' +
+ @vm.execute(". '#{persistence_state_file}' && " +
'test "$TAILS_PERSISTENCE_ENABLED" = true').success?
end
diff --git a/features/support/helpers/misc_helpers.rb b/features/support/helpers/misc_helpers.rb
index 830fa1c..a0edf17 100644
--- a/features/support/helpers/misc_helpers.rb
+++ b/features/support/helpers/misc_helpers.rb
@@ -96,3 +96,18 @@ def get_tor_relays
cmd = 'awk "/^r/ { print \$6 }" /var/lib/tor/cached-microdesc-consensus'
@vm.execute(cmd).stdout.chomp.split("\n")
end
+
+def get_free_space(machine, path)
+ case machine
+ when 'host'
+ assert(File.exists?(path), "Path '#{path}' not found on #{machine}.")
+ free = cmd_helper("df '#{path}'")
+ when 'guest'
+ assert(@vm.file_exist?(path), "Path '#{path}' not found on #{machine}.")
+ free = @vm.execute_successfully("df '#{path}'")
+ else
+ raise 'Unsupported machine type #{machine} passed.'
+ end
+ output = free.split("\n").last
+ return output.match(/[^\s]\s+[0-9]+\s+[0-9]+\s+([0-9]+)\s+.*/)[1].chomp.to_i
+end
diff --git a/features/support/helpers/storage_helper.rb b/features/support/helpers/storage_helper.rb
index 41240d2..35b6dff 100644
--- a/features/support/helpers/storage_helper.rb
+++ b/features/support/helpers/storage_helper.rb
@@ -68,6 +68,15 @@ class VMStorage
options[:size] ||= 2
options[:unit] ||= "GiB"
options[:type] ||= "qcow2"
+ # Require 'slightly' more space to be available to give a bit more leeway
+ # with rounding, temp file creation, etc.
+ reserved = 500
+ needed = convert_to_MiB(options[:size].to_i, options[:unit])
+ avail = convert_to_MiB(get_free_space('host', @pool_path), "KiB")
+ assert(avail - reserved >= needed,
+ "Error creating disk \"#{name}\" in \"#{@pool_path}\". " \
+ "Need #{needed} MiB but only #{avail} MiB is available of " \
+ "which #{reserved} MiB is reserved for other temporary files.")
begin
old_vol = @pool.lookup_volume_by_name(name)
rescue Libvirt::RetrieveError
diff --git a/wiki/src/contribute/release_process/test.mdwn b/wiki/src/contribute/release_process/test.mdwn
index 9bb3090..2a7af06 100644
--- a/wiki/src/contribute/release_process/test.mdwn
+++ b/wiki/src/contribute/release_process/test.mdwn
@@ -190,23 +190,6 @@ tracked by tickets prefixed with `todo/test_suite:`.
* When we receive this bug report on the tails-bugs mailing-list,
Schleuder tells us that it was sent encrypted.
-# Time
-
-(automate: [[!tails_ticket 5836]])
-
-1. Boot Tails without a network cable connected.
- (e.g. `virsh domif-setlink tails-dev 52:54:00:05:17:62 down`.)
-2. Set an administration password.
-3. set the time to an obviously wrong one:
-
- date --set="Mon, 01 Mar 2000 15:45:34 - 0800"
-
-4. Connect the network cable.
- (e.g. `virsh domif-setlink tails-dev 52:54:00:05:17:62 up`)
-
-=> the date should be corrected and Tor/Vidalia should start
-correctly.
-
# Erase memory on shutdown
- `memlockd` must be running