From 5cfa4e2d3271210f8ee092e7ad0a93af71d96ba1 Mon Sep 17 00:00:00 2001 From: Scott McClellan Date: Wed, 27 Jun 2018 13:15:22 -0500 Subject: [PATCH] (maint) Add rake tasks for running acceptance tests This adds `rake acceptance:full` and `rake acceptance:smoke` tasks for running acceptance tests. --- Rakefile | 1 + acceptance/Gemfile | 4 ++- acceptance/tasks/acceptance.rake | 60 ++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 acceptance/tasks/acceptance.rake diff --git a/Rakefile b/Rakefile index 513ae2cf3..93305197a 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ require 'rake' require 'pathname' +load './acceptance/tasks/acceptance.rake' RAKE_ROOT = File.expand_path(File.dirname(__FILE__)) begin diff --git a/acceptance/Gemfile b/acceptance/Gemfile index 3b1f86de8..57a0efbef 100644 --- a/acceptance/Gemfile +++ b/acceptance/Gemfile @@ -12,11 +12,13 @@ end beaker_version = ENV['BEAKER_LOCATION'] || ENV['BEAKER_VERSION'] group :ci, :system_tests do + gem 'rake' if beaker_version gem 'beaker', *location_for(beaker_version) else - gem 'beaker', '~> 2.5' + gem 'beaker', '~> 3.30' end + gem 'beaker-pe', '~> 1.40.7' gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'] || "~> 0.2") gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || "~> 0.2") gem 'public_suffix', '1.4.6' diff --git a/acceptance/tasks/acceptance.rake b/acceptance/tasks/acceptance.rake new file mode 100644 index 000000000..8b95f9446 --- /dev/null +++ b/acceptance/tasks/acceptance.rake @@ -0,0 +1,60 @@ +require 'rake' + +def generate_hosts(pe_version, hypervisor = 'vmpooler', + test_target = 'centos7-64mdc-64a') + hosts_file = 'hosts.cfg' + puts "Generating hosts..." + cmd = < #{hosts_file} +HEREDOC + + Dir.chdir('acceptance'){ + system(cmd) + } + + hosts_file +end + +def run_beaker(hosts_file, tests, package_version) +cmd = <