summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--features/support/config.rb16
2 files changed, 19 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e7f386e..f9db672 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,3 +49,6 @@
# Files generated during the test suite
/features/misc_files/video.mp4
+
+# The test suite's local configuration file
+/features/config/local.yml
diff --git a/features/support/config.rb b/features/support/config.rb
index f83fc69..912720a 100644
--- a/features/support/config.rb
+++ b/features/support/config.rb
@@ -1,6 +1,22 @@
require 'fileutils'
+require 'yaml'
require "#{Dir.pwd}/features/support/helpers/misc_helpers.rb"
+# These two files deal with options like some of the settings passed
+# to the `run_test_suite` script, and "secrets" like credentials
+# (passwords, SSH keys) to be used in tests.
+DEFAULTS_CONFIG_FILE = "#{Dir.pwd}/features/config/defaults.yml"
+LOCAL_CONFIG_FILE = "#{Dir.pwd}/features/config/local.yml"
+
+assert File.exists?(DEFAULTS_CONFIG_FILE)
+$config = YAML.load(File.read(DEFAULTS_CONFIG_FILE))
+if File.exists?(LOCAL_CONFIG_FILE)
+ $config.merge!(YAML.load(File.read(LOCAL_CONFIG_FILE)))
+end
+# Options passed to the `run_test_suite` script will always take
+# precedence.
+$config.merge!(ENV)
+
# Dynamic
$tails_iso = ENV['ISO'] || raise "No ISO set with --iso"
$old_tails_iso = ENV['OLD_ISO'] || raise "No old ISO set with --old-iso"