diff --git a/Gemfile b/Gemfile index 5a27a60..6f9004a 100644 --- a/Gemfile +++ b/Gemfile @@ -24,6 +24,7 @@ end group :acceptance do gem 'beaker' gem 'beaker-rspec' + gem 'beaker-hostgenerator' end group :development do diff --git a/Rakefile b/Rakefile index 5ca19fd..459dda0 100644 --- a/Rakefile +++ b/Rakefile @@ -18,6 +18,23 @@ task :validate do end task :acceptance do + require 'beaker-hostgenerator' + + target = ENV['platform'] + if ! target + STDERR.puts 'TEST_TARGET environment variable is not set' + STDERR.puts 'setting to default value of "centos7-64ma."' + target = 'centos7-64ma.' + end + + cli = BeakerHostGenerator::CLI.new([target]) + nodeset_dir = "spec/acceptance/nodesets" + nodeset = "#{nodeset_dir}/#{target}.yml" + FileUtils.mkdir_p(nodeset_dir) + File.open(nodeset, 'w') do |fh| + fh.print(cli.execute) + end + puts nodeset sh "gem build puppet-strings.gemspec" sh "puppet module build spec/unit/puppet/examples/test" sh "BEAKER_set=#{ENV["platform"]} rspec spec/acceptance/*.rb" diff --git a/spec/acceptance/nodesets/centos7.yml b/spec/acceptance/nodesets/centos7.yml deleted file mode 100644 index 216f639..0000000 --- a/spec/acceptance/nodesets/centos7.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -HOSTS: - centos7-64-1: - pe_dir: - pe_ver: - pe_upgrade_dir: - pe_upgrade_ver: - hypervisor: vmpooler - platform: el-7-x86_64 - template: centos-7-x86_64 - roles: - - agent - - master -CONFIG: - nfs_server: none - consoleport: 443 - pooling_api: http://vmpooler.delivery.puppetlabs.net/