X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=Rakefile;h=3e8d4cb9526d1ac226aa591ea64ac558f905e50a;hb=89c747ab3b2caad9b36b8ce53a693537f4db6f36;hp=6242a3704b18fcc53339e339efed28607be71bd4;hpb=f2265b470bd6a2d246450602b1c90adbc876e3ff;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/Rakefile b/Rakefile index 6242a37..3e8d4cb 100644 --- a/Rakefile +++ b/Rakefile @@ -1,14 +1,38 @@ -require 'rake' +require 'puppet_blacksmith/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +require 'puppetlabs_spec_helper/rake_tasks' -task :default => [:spec] +PuppetLint.configuration.send('relative') +PuppetLint.configuration.send('disable_documentation') +PuppetLint.configuration.send('disable_single_quote_string_with_variables') -desc "Run all module spec tests (Requires rspec-puppet gem)" -task :spec do - system("rspec spec/**/*_spec.rb") -end +desc 'Generate pooler nodesets' +task :gen_nodeset do + require 'beaker-hostgenerator' + require 'securerandom' + require 'fileutils' -desc "Build package" -task :build do - system("puppet-module build") -end + agent_target = ENV['TEST_TARGET'] + if ! agent_target + STDERR.puts 'TEST_TARGET environment variable is not set' + STDERR.puts 'setting to default value of "redhat-64default."' + agent_target = 'redhat-64default.' + end + master_target = ENV['MASTER_TEST_TARGET'] + if ! master_target + STDERR.puts 'MASTER_TEST_TARGET environment variable is not set' + STDERR.puts 'setting to default value of "redhat7-64mdcl"' + master_target = 'redhat7-64mdcl' + end + + targets = "#{master_target}-#{agent_target}" + cli = BeakerHostGenerator::CLI.new([targets]) + nodeset_dir = "tmp/nodesets" + nodeset = "#{nodeset_dir}/#{targets}-#{SecureRandom.uuid}.yaml" + FileUtils.mkdir_p(nodeset_dir) + File.open(nodeset, 'w') do |fh| + fh.print(cli.execute) + end + puts nodeset +end