From dba2a4e3e78c08de71c19d266aff9a407766e457 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 6 Nov 2011 19:21:29 -0800 Subject: [PATCH] Check that VirtualBox isn't running at the beginning of the acceptance tests --- test/acceptance/base.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/acceptance/base.rb b/test/acceptance/base.rb index 38a427359..bbb2bbbe2 100644 --- a/test/acceptance/base.rb +++ b/test/acceptance/base.rb @@ -7,6 +7,12 @@ require File.expand_path("../helpers/isolated_environment", __FILE__) require File.expand_path("../helpers/output", __FILE__) require File.expand_path("../helpers/virtualbox", __FILE__) +# If VirtualBox is currently running, fail. +if Acceptance::VirtualBox.find_vboxsvc + $stderr.puts "VirtualBox must be closed and remain closed for the duration of the tests." + abort +end + # Enable logging if requested if ENV["ACCEPTANCE_LOGGING"] logger = Log4r::Logger.new("acceptance") @@ -18,10 +24,10 @@ end # Parse the command line options and load the global configuration. if !ENV.has_key?("ACCEPTANCE_CONFIG") $stderr.puts "A configuration file must be passed into the acceptance test." - exit + abort elsif !File.file?(ENV["ACCEPTANCE_CONFIG"]) $stderr.puts "The configuration file must exist." - exit + abort end $acceptance_options = Acceptance::Config.new(ENV["ACCEPTANCE_CONFIG"])