Commit 863204b0 authored by anonym's avatar anonym
Browse files

Merge remote-tracking branch 'origin/stable' into test/10148-capture-per-scenario-videos

Conflicts:
	wiki/src/contribute/release_process/test/usage.mdwn
parents cc729b82 4ddbc9da
......@@ -110,7 +110,7 @@ end
Then /^drive "([^"]+)" is detected by Tails$/ do |name|
next if @skip_steps_while_restoring_background
raise "Tails is not running" if @vm.is_running?
raise "Tails is not running" unless @vm.is_running?
try_for(10, :msg => "Drive '#{name}' is not detected by Tails") do
@vm.disk_detected?(name)
end
......
......@@ -43,9 +43,11 @@ end
# Bind Java's stdout to debug_log() via our magical pseudo fifo
# logger.
file_output_stream = Java::Io::FileOutputStream.new(DEBUG_LOG_PSEUDO_FIFO)
print_stream = Java::Io::PrintStream.new(file_output_stream)
Java::Lang::System.setOut(print_stream)
def bind_java_to_pseudo_fifo_logger
file_output_stream = Java::Io::FileOutputStream.new(DEBUG_LOG_PSEUDO_FIFO)
print_stream = Java::Io::PrintStream.new(file_output_stream)
Java::Lang::System.setOut(print_stream)
end
def findfailed_hook(pic)
STDERR.puts ""
......
......@@ -5,6 +5,23 @@ require 'tmpdir'
# Run once, before any feature
AfterConfiguration do |config|
if File.exist?($config["TMPDIR"])
if !File.directory?($config["TMPDIR"])
raise "Temporary directory '#{$config["TMPDIR"]}' exists but is not a " +
"directory"
end
if !File.owned?($config["TMPDIR"])
raise "Temporary directory '#{$config["TMPDIR"]}' must be owned by the " +
"current user"
end
FileUtils.chmod(0755, $config["TMPDIR"])
else
begin
FileUtils.mkdir_p($config["TMPDIR"])
rescue Errno::EACCES => e
raise "Cannot create temporary directory: #{e.to_s}"
end
end
# Start a thread that monitors a pseudo fifo file and debug_log():s
# anything written to it "immediately" (well, as fast as inotify
# detects it). We're forced to a convoluted solution like this
......@@ -25,6 +42,8 @@ AfterConfiguration do |config|
watcher.run
end
end
# Fix Sikuli's debug_log():ing.
bind_java_to_pseudo_fifo_logger
end
# For @product tests
......@@ -50,23 +69,6 @@ def add_after_scenario_hook(&block)
end
BeforeFeature('@product') do |feature|
if File.exist?($config["TMPDIR"])
if !File.directory?($config["TMPDIR"])
raise "Temporary directory '#{$config["TMPDIR"]}' exists but is not a " +
"directory"
end
if !File.owned?($config["TMPDIR"])
raise "Temporary directory '#{$config["TMPDIR"]}' must be owned by the " +
"current user"
end
FileUtils.chmod(0755, $config["TMPDIR"])
else
begin
Dir.mkdir($config["TMPDIR"])
rescue Errno::EACCES => e
raise "Cannot create temporary directory: #{e.to_s}"
end
end
delete_all_snapshots if !KEEP_SNAPSHOTS
if TAILS_ISO.nil?
raise "No Tails ISO image specified, and none could be found in the " +
......
......@@ -178,7 +178,6 @@ CAPTURE_ALL=
LOG_FILE=
VNC_VIEWER=
VNC_SERVER=
DEBUG=
PAUSE_ON_FAIL=
KEEP_SNAPSHOTS=
SIKULI_RETRY_FINDFAILED=
......
......@@ -32,6 +32,17 @@ feature, we'd simply run something like:
./run_test_suite features/build.feature
Actually, `run_test_suite` is just a wrapper around `cucumber`, so any
`cucumber` option can be passed too, although after an `--` so they
are not confused with the wrapper's options. For instance:
./run_test_suite ... -- --format debug features/apt.feature
will enable the `debug` formatter, which in Tails' Cucumber setup will
enable debugging information to be printed (which is *very* useful
when debugging or developing for the test suite) unlike in vanilla
Cucumber, where it's used for debugging the formatting subsystem.
For full instructions, see its `--help`.
Note: since the test suite itself uses `virt-viewer` to interact with
......@@ -79,9 +90,6 @@ by the local configuration file:
* `CAPTURE_ALL`: Keep videos for all scenarios, including those that
succeed (implies `CAPTURE`). Defaults to `false`.
* `DEBUG`: Boolean value. If set to `true`, various debugging info
will be printed. Defaults to `false`.
* `MAX_NEW_TOR_CIRCUIT_RETRIES`: Integer. Upon failure, some test steps may be
run again after requesting that connections are made using new Tor circuits. This
configuration variable limits how many times forcing a circuit will be
......
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