(maint) Add option for BEAKER_HOSTS file to be pregenerated in acceptance tests

Before, the host configuration was hard-coded. Added an option
to specify an ENV var in order to use a different string or a
pregenerated hostfile.

This also allows us to use abs in production, so that has been added
to the Gemfile
This commit is contained in:
Spencer McElmurry 2017-11-27 15:55:33 -08:00
parent 8fd2538382
commit ddae40bade
2 changed files with 3 additions and 1 deletions

View file

@ -19,6 +19,7 @@ end
# don't want to create a transitive dependency
group :acceptance_testing do
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.0')
gem "beaker-abs", *location_for(ENV['ABS_VERSION'] || '~> 0.3.0')
end

View file

@ -20,11 +20,12 @@ Runs the base beaker acceptance test using the hypervisor library
beaker_gem_spec = Gem::Specification.find_by_name('beaker')
beaker_gem_dir = beaker_gem_spec.gem_dir
beaker_test_base_dir = File.join(beaker_gem_dir, 'acceptance/tests/base')
beaker_hosts = ENV['BEAKER_HOSTS'] || 'redhat7-64af-64default.mdcal'
load_path_option = File.join(beaker_gem_dir, 'acceptance/lib')
sh("beaker",
"--tests", beaker_test_base_dir,
"--log-level", "verbose",
"--hosts", "redhat7-64af-redhat7-64default.mdcal",
"--hosts", beaker_hosts,
"--load-path", load_path_option,
"--keyfile", ENV['KEY'] || "#{ENV['HOME']}/.ssh/id_rsa-acceptance")
end