diff options
537 files changed, 13 insertions, 26268 deletions
diff --git a/.gemspec b/.gemspec deleted file mode 100644 index fd7379ebc..000000000 --- a/.gemspec +++ /dev/null @@ -1,55 +0,0 @@ -# -*- encoding: utf-8 -*- -# -# PLEASE NOTE -# This gemspec is not intended to be used for building the Puppet gem. This -# gemspec is intended for use with bundler when Puppet is a dependency of -# another project. For example, the stdlib project is able to integrate with -# the master branch of Puppet by using a Gemfile path of -# git://github.com/puppetlabs/puppet.git -# -# Please see the [packaging -# repository](https://github.com/puppetlabs/packaging) for information on how -# to build the Puppet gem package. - -begin - require 'puppet/version' -rescue LoadError - $LOAD_PATH.unshift(File.expand_path("../lib", __FILE__)) - require 'puppet/version' -end - -Gem::Specification.new do |s| - s.name = "puppet" - version = Puppet.version - mdata = version.match(/(\d+\.\d+\.\d+)/) - s.version = mdata ? mdata[1] : version - - s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version= - s.authors = ["Puppet Labs"] - s.date = "2012-08-17" - s.description = "Puppet, an automated configuration management tool" - s.email = "puppet@puppetlabs.com" - s.executables = ["puppet"] - s.files = ["bin/puppet"] - s.homepage = "http://puppetlabs.com" - s.rdoc_options = ["--title", "Puppet - Configuration Management", "--main", "README", "--line-numbers"] - s.require_paths = ["lib"] - s.rubyforge_project = "puppet" - s.rubygems_version = "1.8.24" - s.summary = "Puppet, an automated configuration management tool" - - if s.respond_to? :specification_version then - s.specification_version = 3 - - if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q<facter>, [">= 1.7", "< 3"]) - s.add_runtime_dependency(%q<hiera>, ["~> 1.0"]) - else - s.add_dependency(%q<facter>, [">= 1.7", "< 3"]) - s.add_dependency(%q<hiera>, ["~> 1.0"]) - end - else - s.add_dependency(%q<facter>, [">= 1.7", "< 3"]) - s.add_dependency(%q<hiera>, ["~> 1.0"]) - end -end diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 873839586..000000000 --- a/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -.rspec -results -tags -.*.sw[op] -ext/packaging -pkg -test.pp -# YARD generated documentation -.yardoc -/doc -# Now that there is a gemfile, RVM ignores rvmrc in parent directories, so a local one is required -# to work around that. Which we don't want committed, so we can ignore it here. -/.rvmrc -.bundle/ -ext/packaging/ -pkg/ -Gemfile.lock -Gemfile.local -.bundle/ -puppet-acceptance/ -/.project -.idea/ -.ruby-version -.ruby-gemset diff --git a/.mailmap b/.mailmap deleted file mode 100644 index e751536b0..000000000 --- a/.mailmap +++ /dev/null @@ -1,99 +0,0 @@ -Adrien Thebo <adrien@puppetlabs.com> Adrien Thebo <adrien.thebo@gmail.com> -Adrien Thebo <adrien@puppetlabs.com> adrienthebo <adrien@puppetlabs.com> -Allen Ballman <aballman@gmail.com> ballman <ballman@980ebf18-57e1-0310-9a29-db15c13687c0> -Andrew Shafer <andrew@puppetlabs.com> Andrew Shafer <andrew@luke-kaniess-macbook-pro-15.local> -Andrew Shafer <andrew@puppetlabs.com> Andrew Shafer <andrew@reductivelabs.com> -Andrew Shafer <andrew@puppetlabs.com> shafer <shafer@980ebf18-57e1-0310-9a29-db15c13687c0> -Anselm Strauss <amsibamsi@gmail.com> Anselm Strauss <anselm@beastie.ttyv0.net> -Anselm Strauss <amsibamsi@gmail.com> Anselm Strauss <anselm@silversurfer.l.ttyv0.net> -Ben Hengst <notbenh@cpan.org> ben hengst <notbenh@cpan.org> -Ben Hughes <ben@puppetlabs.com> Ben H <git@mumble.org.uk> -Ben Hughes <ben@puppetlabs.com> Ben Hughes <git@mumble.org.uk> -Blake Barnett <blake@soulmachine.net> shadoi <shadoi@980ebf18-57e1-0310-9a29-db15c13687c0> -Brice Figureau <brice-puppet@daysofwonder.com> Brice Figureau <brice@daysofwonder.com> -Bryan Kearney <bkearney@redhat.com> Bryan Kearney <bkearney@localhost.localdomain> -Cameron Thomas <cameron@puppetlabs.com> Cameron Thomas <cs.thomas.dev@gmail.com> -Carl Caum <carl@puppetlabs.com> Carl Caum <carl@carlcaum.com> -Chris Price <chris@puppetlabs.com> Chris Price <cprice@explosivo.(none)> -Chris Price <chris@puppetlabs.com> cprice -Christian Hofstaedtler <hofstaedtler@inqnet.at> Christian Hofstaedtler <ch+git@zeha.at> -Dan Bode <dan@puppetlabs.com> Dan Bode <bodepd@gmail.com> -Dan Bode <dan@puppetlabs.com> Dan Bode <dan@bodepd.com> -Dan Bode <dan@puppetlabs.com> Dan Bode <dan@reductivelabs.com> -Daniel Pittman <daniel@puppetlabs.com> Daniel Pittman <daniel@rimspace.net> -David Lutterkort <lutter@redhat.com> David Lutterkort <dlutter@redhat.com> -David Lutterkort <lutter@redhat.com> lutter <lutter@1f5c1d6a-bddf-0310-8f58-fc49e503516a> -David Lutterkort <lutter@redhat.com> lutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0> -David Schmitt <david@dasz.at> David Schmitt <david@schmitt.edv-bus.at> -Deepak Giridharagopal <deepak@puppetlabs.com> Deepak Giridharagopal <deepak@brownman.org> -Dominic Maraglia <dominic@puppetlabs.com> <dmaraglia@gmail.com> -Donavan Miller <donavan@desinc.net> donavan <donavan@desinc.net> -Eric Sorenson <eric.sorenson@puppetlabs.com> Eric Sorenson <ahpook@gmail.com> -Eric Sorenson <eric.sorenson@puppetlabs.com> Eric Sorenson <eric@explosive.net> -Eric Sorenson <eric.sorenson@puppetlabs.com> Eric Sorenson <eric@leterel.apple.com> -Francois Deppierraz <francois@ctrlaltdel.ch> Francois Deppierraz <francois@slayer.ctrlaltdel.ch> -Garrett Honeycutt <garrett@puppetlabs.com> Garrett Honeycutt <puppet-dev@garretthoneycutt.com> -Gary Larizza <gary@puppetlabs.com> Gary Larizza <ccshots@gmail.com> -Greg Sutcliffe <greg.sutcliffe@gmail.com> Greg Sutcliffe <gsutcliffe@gmail.com> -James Turnbull <james@puppetlabs.com> James Turnbull <james@lovedthanlost.net> -James Turnbull <james@puppetlabs.com> James Turnbull <james@rhizome-lovedthanlost-net.local> -James Turnbull <james@puppetlabs.com> James Turnbull <james@ubuntu904.lovedthanlost.net> -James Turnbull <james@puppetlabs.com> root <root@absinthe.lovedthanlost.net> -Jeff McCune <jeff@puppetlabs.com> <jeff.mccune@northstarlabs.net> -Jeff McCune <jeff@puppetlabs.com> Jeffrey J McCune <jeff@northstarlabs.net> -Jeff McCune <jeff@puppetlabs.com> Jeffrey McCune <mccune.jeff@gmail.com> -Jeff McCune <jeff@puppetlabs.com> mccune <mccune@1f5c1d6a-bddf-0310-8f58-fc49e503516a> -Jeff McCune <jeff@puppetlabs.com> mccune <mccune@980ebf18-57e1-0310-9a29-db15c13687c0> -Jeff Weiss <jeff.weiss@puppetlabs.com> Jeff Weiss <jeff.a.weiss@gmail.com> -Jesse Wolfe <jesse@puppetlabs.com> Jesse Wolfe <jes5199@gmail.com> -Jos Boumans <jos@dwim.org> josb <josb@980ebf18-57e1-0310-9a29-db15c13687c0> -Josh Cooper <josh@puppetlabs.com> Josh Cooper <josh+github@puppetlabs.com> -Josh Cooper <josh@puppetlabs.com> joshcooper <josh+github@puppetlabs.com> -Joshua Harlan Lifton <lifton@puppetlabs.com> lifton <lifton@puppetlabs.com> -Justin Stoller <justin@puppetlabs.com> Justin Stoller <justin.stoller@gmail.com> -Kelsey Hightower <kelsey@puppetlabs.com> Kelsey Hightower <kelsey.hightower@gmail.com> -Kelsey Hightower <kelsey@puppetlabs.com> Kelsey Hightower <kelsey.hightower@puppetlabs.com> -Ken Barber <ken@puppetlabs.com> Ken Barber <ken@bob.sh> -Luke Kanies <luke@puppetlabs.com> <luke@980ebf18-57e1-0310-9a29-db15c13687c0> -Luke Kanies <luke@puppetlabs.com> Luke Kaines <luke@puppetlabs.com> -Luke Kanies <luke@puppetlabs.com> Luke Kanies <luke@madstop.com> -Luke Kanies <luke@puppetlabs.com> Luke Kanies <luke@reductivelabs.com> -Luke Kanies <luke@puppetlabs.com> luke <luke@1f5c1d6a-bddf-0310-8f58-fc49e503516a> -Markus Roberts <markus@puppetlabs.com> Markus Roberts <Markus@reality.com> -Markus Roberts <markus@puppetlabs.com> Markus Roberts <markus@phage.local> -Markus Roberts <markus@puppetlabs.com> markus <markus@AVA-351181.(none)> -Martin Englund <martin@englund.nu> Martin Englund <martin.englund@sun.com> -Matt Palmer <mpalmer@hezmatt.org> mpalmer <mpalmer@980ebf18-57e1-0310-9a29-db15c13687c0> -Matt Robinson <matt@puppetlabs.com> Matt Robinson <mattr@mattrobinson.net> -Matthaus Owens <matthaus@puppetlabs.com> Matthaus Litteken <matthaus@puppetlabs.com> -Matthaus Owens <matthaus@puppetlabs.com> Matthaus Litteken <mlitteken@gmail.com> -Matthaus Owens <matthaus@puppetlabs.com> Matthaus Owens <mlitteken@gmail.com> -Michael Stahnke <stahnma@puppetlabs.com> stahnma <stahnma@websages.com> -Moses Mendoza <moses@puppetlabs.com> MosesMendoza <mendoza.moses@gmail.com> -Nan Liu <nan@puppetlabs.com> Nan Liu <nan.liu@gmail.com> -Nick Fagerlund <nick.fagerlund@puppetlabs.com> nfagerlund <nick.fagerlund@gmail.com> -Nick Fagerlund <nick.fagerlund@puppetlabs.com> nfagerlund <nick.fagerlund@puppetlabs.com> -Nigel Kersten <nigel@puppetlabs.com> Nigel Kersten <nigel@explanatorygap.net> -Nigel Kersten <nigel@puppetlabs.com> Nigel Kersten <nigelk@google.com> -Ohad Levy <ohadlevy@gmail.com> Ohad Levy <ohad.levy@infineon.com> -Patrick Carlisle <patrick@puppetlabs.com> Patrick <patrick@puppetlabs.com> -Patrick Carlisle <patrick@puppetlabs.com> pcarlisle <patrick@puppetlabs.com> -Paul Lathrop <plathrop@digg.com> Paul Lathrop <paul@tertiusfamily.net> -Paul Lathrop <plathrop@digg.com> Paul Lathrop <plathrop@debian.tertiusfamily.net> -Peter Meier <peter.meier@immerda.ch> duritong <peter.meier@immerda.ch> -Peter Meier <peter.meier@immerda.ch> mh <duritong@cronopios.org> -Peter Mørch <peter@morch.com> peter <peter@morch.com> -Pieter van de Bruggen <pieter@puppetlabs.com> Pieter van de Bruggen <pvande@gmail.com> -Rahul Gopinath <rahul@puppetlabs.com> rahul <rahul@pe-solaris11-vm.(none)> -Rahul Gopinath <rahul@puppetlabs.com> rahul <rahul@puppetlabs.com> -Rahul Gopinath <rahul@puppetlabs.com> rahul <rahul@solaris11-master.(none)> -Rahul Gopinath <rahul@puppetlabs.com> vrthra <9@vrtra.net> -Rein Henrichs <rein@puppetlabs.com> Rein Henrichs <reinh@reinh.com> -Rudy Gevaert <rudy@webworm.org> rgevaert <rudy+github@webworm.org> -Rudy Gevaert <rudy@webworm.org> rgevaert <rudy.gevaert+github@ugent.be> -Russ Allbery <rra@stanford.edu> Russ Allbery <rra@debian.org> -Sean E. Millichamp <sean@bruenor.org> Sean Millichamp <sean.millichamp@secure-24.com> -Sean E. Millichamp <sean@bruenor.org> Sean Millichamp <sean@bruenor.org> -Steve McIintosh <stevemac@endpoint.com> steve mcintosh <stevemac@endpoint.com> -Thom May <thom@joost.com> Thom May <thom@clearairturbulence.org> -Thom May <thom@joost.com> Thom May <thom@virelais.nyc.joostas.com> diff --git a/.noexec.yaml b/.noexec.yaml deleted file mode 100644 index 0e0b0206b..000000000 --- a/.noexec.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -exclude: - - gem - - rake - - rspec diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e3f8e696e..000000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: ruby -bundler_args: --without development -script: "bundle exec rake \"parallel:spec[2]\"" -notifications: - email: false -rvm: - - 2.1.1 - - 2.0.0 - - 1.9.3 - - 1.8.7-p374 diff --git a/.yardopts b/.yardopts deleted file mode 100644 index fab728163..000000000 --- a/.yardopts +++ /dev/null @@ -1,17 +0,0 @@ ---protected ---private ---verbose ---markup markdown ---readme README.md ---tag status ---transitive-tag status ---tag comment ---hide-tag comment ---tag dsl:"DSL" ---no-transitive-tag api ---template-path yardoc/templates ---files CO*.md,api/**/*.md ---api public ---api private ---hide-void-return -lib/**/*.rb diff --git a/acceptance/.gitignore b/acceptance/.gitignore deleted file mode 100644 index 553270032..000000000 --- a/acceptance/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.vagrant -local_options.rb -pl-puppet-build.repo -pl-puppet-repos.rpm -repos.tar -repo-configs -log -id_rsa-acceptance -id_rsa-acceptance.pub -preserved_config.yaml -merged_options.rb diff --git a/acceptance/Gemfile b/acceptance/Gemfile deleted file mode 100644 index 29949fee9..000000000 --- a/acceptance/Gemfile +++ /dev/null @@ -1,13 +0,0 @@ -source ENV['GEM_SOURCE'] || "https://rubygems.org" - -gem "beaker", "~> 1.17" -gem 'rake', "~> 10.1.0" - -group(:test) do - gem "rspec", "~> 2.11.0", :require => false - gem "mocha", "~> 0.10.5", :require => false -end - -if File.exists? "#{__FILE__}.local" - eval(File.read("#{__FILE__}.local"), binding) -end diff --git a/acceptance/Rakefile b/acceptance/Rakefile deleted file mode 100644 index b47e51d72..000000000 --- a/acceptance/Rakefile +++ /dev/null @@ -1,355 +0,0 @@ -require 'rake/clean' -require 'pp' -require 'yaml' -$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), 'lib')) -require 'puppet/acceptance/git_utils' -extend Puppet::Acceptance::GitUtils - -ONE_DAY_IN_SECS = 24 * 60 * 60 -REPO_CONFIGS_DIR = "repo-configs" -CLEAN.include('*.tar', REPO_CONFIGS_DIR, 'merged_options.rb') - -module HarnessOptions - - DEFAULTS = { - :type => 'git', - :helper => ['lib/helper.rb'], - :tests => ['tests'], - :log_level => 'debug', - :color => false, - :root_keys => true, - :ssh => { - :keys => ["id_rsa-acceptance"], - }, - :xml => true, - :timesync => false, - :repo_proxy => true, - :add_el_extras => true, - :preserve_hosts => 'onfail', - :forge_host => 'forge-aio01-petest.puppetlabs.com', - :'master-start-curl-retries' => 30, - } - - class Aggregator - attr_reader :mode - - def initialize(mode) - @mode = mode - end - - def get_options(file_path) - puts file_path - if File.exists? file_path - options = eval(File.read(file_path), binding) - else - puts "No options file found at #{File.expand_path(file_path)}" - end - options || {} - end - - def get_mode_options - get_options("./config/#{mode}/options.rb") - end - - def get_local_options - get_options("./local_options.rb") - end - - def final_options(intermediary_options = {}) - mode_options = get_mode_options - local_overrides = get_local_options - final_options = DEFAULTS.merge(mode_options) - final_options.merge!(intermediary_options) - final_options.merge!(local_overrides) - return final_options - end - end - - def self.options(mode, options) - final_options = Aggregator.new(mode).final_options(options) - final_options - end -end - -def beaker_test(mode = :packages, options = {}) - delete_options = options.delete(:__delete_options__) || [] - final_options = HarnessOptions.options(mode, options) - preserve_config = final_options.delete(:__preserve_config__) - - if mode == :git - # Build up project git urls based on git server and fork env variables or defaults - final_options[:install].map! do |install| - if md = /^(\w+)#(\w+)$/.match(install) - project, project_sha = md.captures - "#{build_giturl(project)}##{project_sha}" - elsif md = /^(\w+)$/.match(install) - project = md[1] - "#{build_giturl(project)}##{sha}" - end - end - end - - delete_options.each do |delete_me| - final_options.delete(delete_me) - end - - options_file = 'merged_options.rb' - File.open(options_file, 'w') do |merged| - merged.puts <<-EOS -# Copy this file to local_options.rb and adjust as needed if you wish to run -# with some local overrides. -EOS - merged.puts(final_options.pretty_inspect) - end - - tests = ENV['TESTS'] || ENV['TEST'] - tests_opt = "--tests=#{tests}" if tests - - config_opt = "--hosts=#{config}" if config - - overriding_options = ENV['OPTIONS'] - - args = ["--options-file", options_file, config_opt, tests_opt, overriding_options].compact - - begin - sh("beaker", *args) - ensure - preserve_configuration(final_options, options_file) if preserve_config - end -end - -def preserve_configuration(final_options, options_file) - if (hosts_file = config || final_options[:hosts_file]) && hosts_file !~ /preserved_config/ - cp(hosts_file, "log/latest/config.yml") - generate_config_for_latest_hosts - end - mv(options_file, "log/latest") -end - -def generate_config_for_latest_hosts - preserved_config_hash = { 'HOSTS' => {} } - - puts "\nPreserving configuration so that any preserved nodes can be tested again locally..." - - config_hash = YAML.load_file('log/latest/config.yml') - if !config_hash || !config_hash.include?('HOSTS') - puts "Warning: No HOSTS configuration found in log/latest/config.yml" - return - else - nodes = config_hash['HOSTS'].map do |node_label,hash| - { - :node_label => node_label, - :roles => hash['roles'], - :platform => hash['platform'] - } - end - - pre_suite_log = File.read('log/latest/pre_suite-run.log') - nodes.each do |node_info| - host_regex = /^([\w.]+) \(#{node_info[:node_label]}\)/ - if matched = host_regex.match(pre_suite_log) - hostname = matched[1] - fqdn = "#{hostname}.delivery.puppetlabs.net" - elsif /^#{node_info[:node_label]} /.match(pre_suite_log) - fqdn = "#{node_info[:node_label]}" - puts "* Couldn't find any log lines for #{host_regex}, assuming #{fqdn} is the fqdn" - end - if fqdn - preserved_config_hash['HOSTS'][fqdn] = { - 'roles' => node_info[:roles], - 'platform' => node_info[:platform], - } - else - puts "* Couldn't match #{node_info[:node_label]} in pre_suite-run.log" - end - end - pp preserved_config_hash - - File.open('log/latest/preserved_config.yaml', 'w') do |config_file| - YAML.dump(preserved_config_hash, config_file) - end - end -rescue Errno::ENOENT => e - puts "Warning: Couldn't generate preserved_config.yaml #{e}" -end - -def list_preserved_configurations(secs_ago = ONE_DAY_IN_SECS) - preserved = {} - Dir.glob('log/*_*').each do |dir| - preserved_config_path = "#{dir}/preserved_config.yaml" - yesterday = Time.now - secs_ago.to_i - if preserved_config = File.exists?(preserved_config_path) - directory = File.new(dir) - if directory.ctime > yesterday - hosts = [] - preserved_config = YAML.load_file(preserved_config_path).to_hash - preserved_config['HOSTS'].each do |hostname,values| - hosts << "#{hostname}: #{values['platform']}, #{values['roles']}" - end - preserved[hosts] = directory.to_path - end - end - end - preserved.map { |k,v| [v,k] }.sort { |a,b| a[0] <=> b[0] }.reverse -end - -def list_preserved_hosts(secs_ago = ONE_DAY_IN_SECS) - hosts = Set.new - Dir.glob('log/**/pre*suite*run.log').each do |log| - yesterday = Time.now - secs_ago.to_i - File.open(log, 'r') do |file| - if file.ctime > yesterday - file.each_line do |line| - matchdata = /^(\w+) \(.*?\) \d\d:\d\d:\d\d\$/.match(line.encode!('UTF-8', 'UTF-8', :invalid => :replace)) - hosts.add(matchdata[1]) if matchdata - end - end - end - end - hosts -end - -def release_hosts(hosts = nil, secs_ago = ONE_DAY_IN_SECS) - secs_ago ||= ONE_DAY_IN_SECS - hosts ||= list_preserved_hosts(secs_ago) - - require 'beaker' - vcloud_pooled = Beaker::VcloudPooled.new(hosts.map { |h| { 'vmhostname' => h } }, - :logger => Beaker::Logger.new, - :dot_fog => "#{ENV['HOME']}/.fog", - 'pooling_api' => 'http://vcloud.delivery.puppetlabs.net' , - 'datastore' => 'not-used', - 'resourcepool' => 'not-used', - 'folder' => 'not-used') - vcloud_pooled.cleanup -end - -def print_preserved(preserved) - preserved.each_with_index do |entry,i| - puts "##{i}: #{entry[0]}" - entry[1].each { |h| puts " #{h}" } - end -end - -def beaker_run_type - type = ENV['TYPE'] || :packages - type = type.to_sym -end - -def sha - ENV['SHA'] -end - -def config - ENV['CONFIG'] -end - -namespace :ci do - - task :check_env do - raise(USAGE) unless sha - end - - namespace :test do - - USAGE = <<-EOS -Requires commit SHA to be put under test as environment variable: SHA='<sha>'. -Also must set CONFIG=config/nodes/foo.yaml or include it in an options.rb for Beaker. -You may set TESTS=path/to/test,and/more/tests. -You may set additional Beaker OPTIONS='--more --options' -If testing from git checkouts, you may optionally set the github fork to checkout from using PUPPET_FORK='some-other-puppet-fork' (you may change the HIERA_FORK and FACTER_FORK as well if you wish). -You may also optionally set the git server to checkout repos from using GIT_SERVER='some.git.mirror'. -Or you may set PUPPET_GIT_SERVER='my.host.with.git.daemon', specifically, if you have set up a `git daemon` to pull local commits from. (You will need to allow the git daemon to serve the repo (see `git help daemon` and the docs/acceptance_tests.md for more details)). -If there is a Beaker options hash in a ./local_options.rb, it will be included. Commandline options set through the above environment variables will override settings in this file. -EOS - - desc <<-EOS -Run the acceptance tests through Beaker and install packages on the configuration targets. -#{USAGE} -EOS - task :packages => 'ci:check_env' do - beaker_test - end - - desc <<-EOS -Run the acceptance tests through Beaker and install from git on the configuration targets. -#{USAGE} -EOS - task :git => 'ci:check_env' do - beaker_test(:git) - end - end - - desc "Capture the master and agent hostname from the latest log and construct a preserved_config.yaml for re-running against preserved hosts without provisioning." - task :extract_preserved_config do - generate_config_for_latest_hosts - end - - desc <<-EOS -Run an acceptance test for a given node configuration and preserve the hosts. -Defaults to a packages run, but you can set it to 'git' with TYPE='git'. -#{USAGE} - EOS - task :test_and_preserve_hosts => 'ci:check_env' do - beaker_test(beaker_run_type, :preserve_hosts => 'always', :__preserve_config__ => true) - end - - desc "List acceptance runs from the past day which had hosts preserved." - task :list_preserved do - preserved = list_preserved_configurations - print_preserved(preserved) - end - - desc <<-EOS -Shutdown and destroy any hosts that we have preserved for testing. These should be reaped daily by scripts, but this will free up resources immediately. -Specify a list of comma separated HOST_NAMES if you have a set of dynamic vcloud host names you want to purge outside of what can be grepped from the logs. -You can go back through the last SECS_AGO logs. Default is one day ago in secs. - EOS - task :release_hosts do - host_names = ENV['HOST_NAMES'].split(',') if ENV['HOST_NAMES'] - secs_ago = ENV['SECS_AGO'] - release_hosts(host_names, secs_ago) - end - - task :destroy_preserved_hosts => 'ci:release_hosts' do - puts "Note: we are now releasing hosts back to the vcloud pooling api rather than destroying them directly. The rake task for this is ci:release_hosts" - end - - desc <<-EOS -Rerun an acceptance test using the last captured preserved_config.yaml to skip provisioning. -Or specify a CONFIG_NUMBER from `rake ci:list_preserved`. -Defaults to a packages run, but you can set it to 'git' with TYPE='git'. - EOS - task :test_against_preserved_hosts do - config_number = (ENV['CONFIG_NUMBER'] || 0).to_i - preserved = list_preserved_configurations - print_preserved(preserved) - config_path = preserved[config_number][0] - - puts "Using ##{config_number}: #{config_path}" - - options = { - :hosts_file => "#{config_path}/preserved_config.yaml", - :no_provision => true, - :preserve_hosts => 'always', - } - run_type = beaker_run_type - if run_type == :packages - options.merge!(:pre_suite => [ - 'setup/packages/pre-suite/015_PackageHostsPresets.rb', - 'setup/packages/pre-suite/045_EnsureMasterStartedOnPassenger.rb', - ]) - else - options.merge!(:__delete_options__ => [:pre_suite]) - end - beaker_test(beaker_run_type, options) - end -end - -task :default do - sh('rake -T') -end - -task :spec do - sh('rspec lib') -end diff --git a/acceptance/bin/ci-bootstrap-from-artifacts.sh b/acceptance/bin/ci-bootstrap-from-artifacts.sh deleted file mode 100755 index 7936f428f..000000000 --- a/acceptance/bin/ci-bootstrap-from-artifacts.sh +++ /dev/null @@ -1,54 +0,0 @@ -#! /usr/bin/env bash - -############################################################################### -# Initial preparation for a ci acceptance job in Jenkins. Crucially, it -# handles the untarring of the build artifact and bundle install, getting us to -# a state where we can then bundle exec rake the particular ci:test we want to -# run. -# -# Having this checked in in a script makes it much easier to have multiple -# acceptance jobs. It must be kept agnostic between Linux/Solaris/Windows -# builds, however. - -set -x - -# If $GEM_SOURCE is not set, fall back to rubygems.org -if [ -z $GEM_SOURCE ]; then - export GEM_SOURCE='https://rubygems.org' -fi - -echo "SHA: ${SHA}" -echo "FORK: ${FORK}" -echo "BUILD_SELECTOR: ${BUILD_SELECTOR}" -echo "PACKAGE_BUILD_STATUS: ${PACKAGE_BUILD_STATUS}" - -rm -rf acceptance -mkdir acceptance -cd acceptance -tar -xzf ../acceptance-artifacts.tar.gz - -echo "===== This artifact is from =====" -cat creator.txt - -bundle install --without=development --path=.bundle/gems - -if [[ "${platform}" =~ 'solaris' ]]; then - repo_proxy=" :repo_proxy => false," -fi - -# If the platform is Windows and $ruby_arch is set, append it -if [[ "${platform}" =~ 'win' && ! -z $ruby_arch ]]; then - platform="${platform}-${ruby_arch}" -fi - -cat > local_options.rb <<-EOF -{ - :hosts_file => 'config/nodes/${platform}.yaml', - :ssh => { - :keys => ["${HOME}/.ssh/id_rsa-old.private"], - }, -${repo_proxy} -} -EOF - -[[ (-z "${PACKAGE_BUILD_STATUS}") || ("${PACKAGE_BUILD_STATUS}" = "success") ]] || exit 1 diff --git a/acceptance/bin/ci-package.sh b/acceptance/bin/ci-package.sh deleted file mode 100755 index 44a2c24a5..000000000 --- a/acceptance/bin/ci-package.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/env bash - -set -e -set -x - -JOB_NAME=$1 -[[ (-z "$JOB_NAME") ]] && echo "No job name passed in" && exit 1 - -rake --trace package:implode -rake --trace package:bootstrap - -# This obtains either the sha or tag if the commit is tagged -REF=`rake pl:print_build_params |grep "^ref: " |cut -d ":" -f 2 | tr -d ' '` -rake --trace pl:jenkins:uber_build DOWNSTREAM_JOB="http://jenkins-foss.delivery.puppetlabs.net/job/$JOB_NAME/buildWithParameters?token=iheartjenkins&SHA=$REF&BUILD_SELECTOR=$BUILD_NUMBER&FORK=$GIT_FORK" - -rake ci:acceptance_artifacts SHA=$REF diff --git a/acceptance/config/git/options.rb b/acceptance/config/git/options.rb deleted file mode 100644 index 1056c4133..000000000 --- a/acceptance/config/git/options.rb +++ /dev/null @@ -1,18 +0,0 @@ -{ - :install => [ - 'facter#stable', - 'hiera#stable', - 'puppet', - ], - :pre_suite => [ - 'setup/git/pre-suite/000_EnvSetup.rb', - 'setup/git/pre-suite/010_TestSetup.rb', - 'setup/git/pre-suite/020_PuppetUserAndGroup.rb', - 'setup/common/pre-suite/025_StopFirewall.rb', - 'setup/git/pre-suite/030_PuppetMasterSanity.rb', - 'setup/common/pre-suite/040_ValidateSignCert.rb', - 'setup/git/pre-suite/060_InstallModules.rb', - 'setup/git/pre-suite/070_InstalCACerts.rb', - 'setup/common/pre-suite/100_SetParser.rb', - ], -} diff --git a/acceptance/config/nodes/all.yaml b/acceptance/config/nodes/all.yaml deleted file mode 100644 index 359f99afb..000000000 --- a/acceptance/config/nodes/all.yaml +++ /dev/null @@ -1,55 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-x86_64 - rhel-agent: - roles: - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - fedora-agent: - roles: - - agent - platform: fedora-18-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/fedora-18-i386 - ubuntu-agent: - roles: - - agent - platform: ubuntu-lucid-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-i386 - wheezy-agent: - roles: - - agent - platform: debian-wheezy-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-i386 - centos-agent: - roles: - - agent - platform: centos-5-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-i386 - solaris-agent: - roles: - - agent - platform: solaris-11-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/solaris-11-x86_64 - win2003r2-ruby193-2: - roles: - - agent - platform: windows-2003r2-32 - hypervisor: vsphere - snapshot: git -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/all_but_windows.yaml b/acceptance/config/nodes/all_but_windows.yaml deleted file mode 100644 index 5ca7e2c88..000000000 --- a/acceptance/config/nodes/all_but_windows.yaml +++ /dev/null @@ -1,49 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-x86_64 - rhel-agent: - roles: - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - fedora-agent: - roles: - - agent - platform: fedora-18-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/fedora-18-i386 - ubuntu-agent: - roles: - - agent - platform: ubuntu-lucid-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-i386 - wheezy-agent: - roles: - - agent - platform: debian-wheezy-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-i386 - centos-agent: - roles: - - agent - platform: centos-5-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-i386 - solaris-agent: - roles: - - agent - platform: solaris-11-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/solaris-11-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/all_linux.yaml b/acceptance/config/nodes/all_linux.yaml deleted file mode 100644 index b2fbcb429..000000000 --- a/acceptance/config/nodes/all_linux.yaml +++ /dev/null @@ -1,43 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-x86_64 - rhel-agent: - roles: - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - fedora-agent: - roles: - - agent - platform: fedora-18-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/fedora-18-i386 - ubuntu-agent: - roles: - - agent - platform: ubuntu-lucid-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-i386 - wheezy-agent: - roles: - - agent - platform: debian-wheezy-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-i386 - centos-agent: - roles: - - agent - platform: centos-5-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-i386 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/centos5.yaml b/acceptance/config/nodes/centos5.yaml deleted file mode 100644 index 4ebfb37e3..000000000 --- a/acceptance/config/nodes/centos5.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: centos-5-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-x86_64 - agent: - roles: - - agent - platform: centos-5-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/centos6.yaml b/acceptance/config/nodes/centos6.yaml deleted file mode 100644 index 99f6593f4..000000000 --- a/acceptance/config/nodes/centos6.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: centos-6-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-x86_64 - agent: - roles: - - agent - platform: centos-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/fedora18.yaml b/acceptance/config/nodes/fedora18.yaml deleted file mode 100644 index 899fc04b5..000000000 --- a/acceptance/config/nodes/fedora18.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: fedora-18-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/fedora-18-x86_64 - agent: - roles: - - agent - platform: fedora-18-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/fedora-18-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/fedora19.yaml b/acceptance/config/nodes/fedora19.yaml deleted file mode 100644 index 2a999c495..000000000 --- a/acceptance/config/nodes/fedora19.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: fedora-19-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/fedora-19-x86_64 - agent: - roles: - - agent - platform: fedora-19-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/fedora-19-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/fedora20.yaml b/acceptance/config/nodes/fedora20.yaml deleted file mode 100644 index 9a7bb3a80..000000000 --- a/acceptance/config/nodes/fedora20.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: fedora-20-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/fedora-20-x86_64 - agent: - roles: - - agent - platform: fedora-20-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/fedora-20-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/foss-win-2003r2-ruby193.yaml b/acceptance/config/nodes/foss-win-2003r2-ruby193.yaml deleted file mode 100644 index 05e14c5d6..000000000 --- a/acceptance/config/nodes/foss-win-2003r2-ruby193.yaml +++ /dev/null @@ -1,23 +0,0 @@ -HOSTS: - master: - roles: - - master - - database - - agent - - dashboard - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - win2003r2-ruby193-2: - roles: - - agent - platform: windows-2003r2-32 - hypervisor: vsphere - snapshot: git -CONFIG: - nfs_server: NONE - consoleport: 443 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/lucid.yaml b/acceptance/config/nodes/lucid.yaml deleted file mode 100644 index a9074eb3f..000000000 --- a/acceptance/config/nodes/lucid.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: ubuntu-lucid-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-x86_64 - agent: - roles: - - agent - platform: ubuntu-lucid-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/pe/centos-5-32ma-32da-32da b/acceptance/config/nodes/pe/centos-5-32ma-32da-32da deleted file mode 100644 index 6970dfb3b..000000000 --- a/acceptance/config/nodes/pe/centos-5-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - centos-5-i386-master: - roles: - - master - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-i386 - hypervisor: vcloud - centos-5-i386-dashboard: - roles: - - dashboard - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-i386 - hypervisor: vcloud - centos-5-i386-database: - roles: - - database - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/centos-5-32mda b/acceptance/config/nodes/pe/centos-5-32mda deleted file mode 100644 index 602dc734a..000000000 --- a/acceptance/config/nodes/pe/centos-5-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - centos-5-i386: - roles: - - master - - dashboard - - database - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-i386 - hypervisor: vcloud - centos-5-i386-agent: - roles: - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/centos-5-64ma-64da-64da b/acceptance/config/nodes/pe/centos-5-64ma-64da-64da deleted file mode 100644 index 0d714d9d8..000000000 --- a/acceptance/config/nodes/pe/centos-5-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - centos-5-x86_64-master: - roles: - - master - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-x86_64 - hypervisor: vcloud - centos-5-x86_64-dashboard: - roles: - - dashboard - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-x86_64 - hypervisor: vcloud - centos-5-x86_64-database: - roles: - - database - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/centos-5-64mda b/acceptance/config/nodes/pe/centos-5-64mda deleted file mode 100644 index b12743d31..000000000 --- a/acceptance/config/nodes/pe/centos-5-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - centos-5-x86_64: - roles: - - master - - dashboard - - database - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-x86_64 - hypervisor: vcloud - centos-5-x86_64-agent: - roles: - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/centos-5-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/centos-6-32ma-32da-32da b/acceptance/config/nodes/pe/centos-6-32ma-32da-32da deleted file mode 100644 index cfa2cd54a..000000000 --- a/acceptance/config/nodes/pe/centos-6-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - centos-6-i386-master: - roles: - - master - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-i386 - hypervisor: vcloud - centos-6-i386-dashboard: - roles: - - dashboard - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-i386 - hypervisor: vcloud - centos-6-i386-database: - roles: - - database - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/centos-6-32mda b/acceptance/config/nodes/pe/centos-6-32mda deleted file mode 100644 index 9be3b43a8..000000000 --- a/acceptance/config/nodes/pe/centos-6-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - centos-6-i386: - roles: - - master - - dashboard - - database - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-i386 - hypervisor: vcloud - centos-6-i386-agent: - roles: - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/centos-6-64ma-64da-64da b/acceptance/config/nodes/pe/centos-6-64ma-64da-64da deleted file mode 100644 index d16b976bf..000000000 --- a/acceptance/config/nodes/pe/centos-6-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - centos-6-x86_64-master: - roles: - - master - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-x86_64 - hypervisor: vcloud - centos-6-x86_64-dashboard: - roles: - - dashboard - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-x86_64 - hypervisor: vcloud - centos-6-x86_64-database: - roles: - - database - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/centos-6-64mda b/acceptance/config/nodes/pe/centos-6-64mda deleted file mode 100644 index 3c0c12ea9..000000000 --- a/acceptance/config/nodes/pe/centos-6-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - centos-6-x86_64: - roles: - - master - - dashboard - - database - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-x86_64 - hypervisor: vcloud - centos-6-x86_64-agent: - roles: - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/centos-6-64mda-sol-10-64a b/acceptance/config/nodes/pe/centos-6-64mda-sol-10-64a deleted file mode 100644 index 8908291a4..000000000 --- a/acceptance/config/nodes/pe/centos-6-64mda-sol-10-64a +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - centos-6-x86_64: - roles: - - master - - dashboard - - database - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/centos-6-x86_64 - hypervisor: vcloud - solaris-10-x86_64-agent: - roles: - - agent - platform: solaris-10-i386 - template: Delivery/Quality Assurance/Templates/vCloud/solaris-10-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/debian-6-32ma-32da-32da b/acceptance/config/nodes/pe/debian-6-32ma-32da-32da deleted file mode 100644 index 86c698a2b..000000000 --- a/acceptance/config/nodes/pe/debian-6-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - debian-6-i386-master: - roles: - - master - - agent - platform: debian-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-i386 - hypervisor: vcloud - debian-6-i386-dashboard: - roles: - - dashboard - - agent - platform: debian-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-i386 - hypervisor: vcloud - debian-6-i386-database: - roles: - - database - - agent - platform: debian-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/debian-6-32mda b/acceptance/config/nodes/pe/debian-6-32mda deleted file mode 100644 index fd1a6be90..000000000 --- a/acceptance/config/nodes/pe/debian-6-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - debian-6-i386: - roles: - - master - - dashboard - - database - - agent - platform: debian-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-i386 - hypervisor: vcloud - debian-6-i386-agent: - roles: - - agent - platform: debian-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/debian-6-64ma-64da-64da b/acceptance/config/nodes/pe/debian-6-64ma-64da-64da deleted file mode 100644 index f39520b5e..000000000 --- a/acceptance/config/nodes/pe/debian-6-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - debian-6-amd64-master: - roles: - - master - - agent - platform: debian-6-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-x86_64 - hypervisor: vcloud - debian-6-amd64-dashboard: - roles: - - dashboard - - agent - platform: debian-6-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-x86_64 - hypervisor: vcloud - debian-6-amd64-database: - roles: - - database - - agent - platform: debian-6-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/debian-6-64mda b/acceptance/config/nodes/pe/debian-6-64mda deleted file mode 100644 index 03df60280..000000000 --- a/acceptance/config/nodes/pe/debian-6-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - debian-6-amd64: - roles: - - master - - dashboard - - database - - agent - platform: debian-6-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-x86_64 - hypervisor: vcloud - debian-6-amd64-agent: - roles: - - agent - platform: debian-6-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/debian-7-32ma-32da-32da b/acceptance/config/nodes/pe/debian-7-32ma-32da-32da deleted file mode 100644 index 9690dfd53..000000000 --- a/acceptance/config/nodes/pe/debian-7-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - debian-7-i386-master: - roles: - - master - - agent - platform: debian-7-i386 - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-i386 - hypervisor: vcloud - debian-7-i386-dashboard: - roles: - - dashboard - - agent - platform: debian-7-i386 - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-i386 - hypervisor: vcloud - debian-7-i386-database: - roles: - - database - - agent - platform: debian-7-i386 - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/debian-7-32mda b/acceptance/config/nodes/pe/debian-7-32mda deleted file mode 100644 index f7812efb1..000000000 --- a/acceptance/config/nodes/pe/debian-7-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - debian-7-i386: - roles: - - master - - dashboard - - database - - agent - platform: debian-7-i386 - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-i386 - hypervisor: vcloud - debian-7-i386-agent: - roles: - - agent - platform: debian-7-i386 - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/debian-7-64ma-64da-64da b/acceptance/config/nodes/pe/debian-7-64ma-64da-64da deleted file mode 100644 index 37ee31b2b..000000000 --- a/acceptance/config/nodes/pe/debian-7-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - debian-7-amd64-master: - roles: - - master - - agent - platform: debian-7-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-x86_64 - hypervisor: vcloud - debian-7-amd64-dashboard: - roles: - - dashboard - - agent - platform: debian-7-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-x86_64 - hypervisor: vcloud - debian-7-amd64-database: - roles: - - database - - agent - platform: debian-7-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/debian-7-64mda b/acceptance/config/nodes/pe/debian-7-64mda deleted file mode 100644 index 01ed6a997..000000000 --- a/acceptance/config/nodes/pe/debian-7-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - debian-7-amd64: - roles: - - master - - dashboard - - database - - agent - platform: debian-7-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-x86_64 - hypervisor: vcloud - debian-7-amd64-agent: - roles: - - agent - platform: debian-7-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/debian-7-i386 b/acceptance/config/nodes/pe/debian-7-i386 deleted file mode 100644 index 8857b2c5d..000000000 --- a/acceptance/config/nodes/pe/debian-7-i386 +++ /dev/null @@ -1,16 +0,0 @@ -HOSTS: - debian-7-i386: - roles: - - master - - dashboard - - database - - agent - platform: debian-7-i386 - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/oracle-5-32ma-32da-32da b/acceptance/config/nodes/pe/oracle-5-32ma-32da-32da deleted file mode 100644 index 9cf395c60..000000000 --- a/acceptance/config/nodes/pe/oracle-5-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - oracle-5-i386-master: - roles: - - master - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-5-i386 - hypervisor: vcloud - oracle-5-i386-dashboard: - roles: - - dashboard - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-5-i386 - hypervisor: vcloud - oracle-5-i386-database: - roles: - - database - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-5-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/oracle-5-32mda b/acceptance/config/nodes/pe/oracle-5-32mda deleted file mode 100644 index dda788e0c..000000000 --- a/acceptance/config/nodes/pe/oracle-5-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - oracle-5-i386: - roles: - - master - - dashboard - - database - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-5-i386 - hypervisor: vcloud - oracle-5-i386-agent: - roles: - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-5-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/oracle-5-64ma-64da-64da b/acceptance/config/nodes/pe/oracle-5-64ma-64da-64da deleted file mode 100644 index a6a73966c..000000000 --- a/acceptance/config/nodes/pe/oracle-5-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - oracle-5-x86_64-master: - roles: - - master - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-5-x86_64 - hypervisor: vcloud - oracle-5-x86_64-dashboard: - roles: - - dashboard - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-5-x86_64 - hypervisor: vcloud - oracle-5-x86_64-database: - roles: - - database - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-5-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/oracle-5-64mda b/acceptance/config/nodes/pe/oracle-5-64mda deleted file mode 100644 index 7a4aa4136..000000000 --- a/acceptance/config/nodes/pe/oracle-5-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - oracle-5-x86_64: - roles: - - master - - dashboard - - database - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-5-x86_64 - hypervisor: vcloud - oracle-5-x86_64-agent: - roles: - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-5-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/oracle-6-32ma-32da-32da b/acceptance/config/nodes/pe/oracle-6-32ma-32da-32da deleted file mode 100644 index c86b875c1..000000000 --- a/acceptance/config/nodes/pe/oracle-6-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - oracle-6-i386-master: - roles: - - master - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-6-i386 - hypervisor: vcloud - oracle-6-i386-dashboard: - roles: - - dashboard - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-6-i386 - hypervisor: vcloud - oracle-6-i386-database: - roles: - - database - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-6-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/oracle-6-32mda b/acceptance/config/nodes/pe/oracle-6-32mda deleted file mode 100644 index 06c27a6ec..000000000 --- a/acceptance/config/nodes/pe/oracle-6-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - oracle-6-i386: - roles: - - master - - dashboard - - database - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-6-i386 - hypervisor: vcloud - oracle-6-i386-agent: - roles: - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-6-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/oracle-6-64ma-64da-64da b/acceptance/config/nodes/pe/oracle-6-64ma-64da-64da deleted file mode 100644 index 0b7e5b2d6..000000000 --- a/acceptance/config/nodes/pe/oracle-6-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - oracle-6-x86_64-master: - roles: - - master - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-6-x86_64 - hypervisor: vcloud - oracle-6-x86_64-dashboard: - roles: - - dashboard - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-6-x86_64 - hypervisor: vcloud - oracle-6-x86_64-database: - roles: - - database - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-6-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/oracle-6-64mda b/acceptance/config/nodes/pe/oracle-6-64mda deleted file mode 100644 index a37d09e9b..000000000 --- a/acceptance/config/nodes/pe/oracle-6-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - oracle-6-x86_64: - roles: - - master - - dashboard - - database - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-6-x86_64 - hypervisor: vcloud - oracle-6-x86_64-agent: - roles: - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/oracle-6-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/redhat-5-32ma-32da-32da b/acceptance/config/nodes/pe/redhat-5-32ma-32da-32da deleted file mode 100644 index 38cd8bea8..000000000 --- a/acceptance/config/nodes/pe/redhat-5-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - redhat-5-i386-master: - roles: - - master - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-i386 - hypervisor: vcloud - redhat-5-i386-dashboard: - roles: - - dashboard - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-i386 - hypervisor: vcloud - redhat-5-i386-database: - roles: - - database - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/redhat-5-32mda b/acceptance/config/nodes/pe/redhat-5-32mda deleted file mode 100644 index 3a11de98b..000000000 --- a/acceptance/config/nodes/pe/redhat-5-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - redhat-5-i386: - roles: - - master - - dashboard - - database - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-i386 - hypervisor: vcloud - redhat-5-i386-agent: - roles: - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/redhat-5-64ma-64da-64da b/acceptance/config/nodes/pe/redhat-5-64ma-64da-64da deleted file mode 100644 index d6e637832..000000000 --- a/acceptance/config/nodes/pe/redhat-5-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - redhat-5-x86_64-master: - roles: - - master - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-x86_64 - hypervisor: vcloud - redhat-5-x86_64-dashboard: - roles: - - dashboard - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-x86_64 - hypervisor: vcloud - redhat-5-x86_64-database: - roles: - - database - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/redhat-5-64mda b/acceptance/config/nodes/pe/redhat-5-64mda deleted file mode 100644 index 417422464..000000000 --- a/acceptance/config/nodes/pe/redhat-5-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - redhat-5-x86_64: - roles: - - master - - dashboard - - database - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-x86_64 - hypervisor: vcloud - redhat-5-x86_64-agent: - roles: - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/redhat-6-32ma-32da-32da b/acceptance/config/nodes/pe/redhat-6-32ma-32da-32da deleted file mode 100644 index dacf932d2..000000000 --- a/acceptance/config/nodes/pe/redhat-6-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - redhat-6-i386-master: - roles: - - master - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - hypervisor: vcloud - redhat-6-i386-dashboard: - roles: - - dashboard - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - hypervisor: vcloud - redhat-6-i386-database: - roles: - - database - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/redhat-6-32mda b/acceptance/config/nodes/pe/redhat-6-32mda deleted file mode 100644 index a7dd6348d..000000000 --- a/acceptance/config/nodes/pe/redhat-6-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - redhat-6-i386: - roles: - - master - - dashboard - - database - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - hypervisor: vcloud - redhat-6-i386-agent: - roles: - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/redhat-6-64ma-64da-64da b/acceptance/config/nodes/pe/redhat-6-64ma-64da-64da deleted file mode 100644 index ef8a71cbd..000000000 --- a/acceptance/config/nodes/pe/redhat-6-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - redhat-6-x86_64-master: - roles: - - master - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-x86_64 - hypervisor: vcloud - redhat-6-x86_64-dashboard: - roles: - - dashboard - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-x86_64 - hypervisor: vcloud - redhat-6-x86_64-database: - roles: - - database - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/redhat-6-64mda b/acceptance/config/nodes/pe/redhat-6-64mda deleted file mode 100644 index 702ca3d05..000000000 --- a/acceptance/config/nodes/pe/redhat-6-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - redhat-6-x86_64: - roles: - - master - - dashboard - - database - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-x86_64 - hypervisor: vcloud - redhat-6-x86_64-agent: - roles: - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/scientific-5-32ma-32da-32da b/acceptance/config/nodes/pe/scientific-5-32ma-32da-32da deleted file mode 100644 index ae3a375be..000000000 --- a/acceptance/config/nodes/pe/scientific-5-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - scientific-5-i386-master: - roles: - - master - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-5-i386 - hypervisor: vcloud - scientific-5-i386-dashboard: - roles: - - dashboard - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-5-i386 - hypervisor: vcloud - scientific-5-i386-database: - roles: - - database - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-5-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/scientific-5-32mda b/acceptance/config/nodes/pe/scientific-5-32mda deleted file mode 100644 index 9bbf35e6f..000000000 --- a/acceptance/config/nodes/pe/scientific-5-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - scientific-5-i386: - roles: - - master - - dashboard - - database - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-5-i386 - hypervisor: vcloud - scientific-5-i386-agent: - roles: - - agent - platform: el-5-i386 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-5-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/scientific-5-64ma-64da-64da b/acceptance/config/nodes/pe/scientific-5-64ma-64da-64da deleted file mode 100644 index 5881efd5a..000000000 --- a/acceptance/config/nodes/pe/scientific-5-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - scientific-5-x86_64-master: - roles: - - master - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-5-x86_64 - hypervisor: vcloud - scientific-5-x86_64-dashboard: - roles: - - dashboard - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-5-x86_64 - hypervisor: vcloud - scientific-5-x86_64-database: - roles: - - database - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-5-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/scientific-5-64mda b/acceptance/config/nodes/pe/scientific-5-64mda deleted file mode 100644 index 0906b1c4b..000000000 --- a/acceptance/config/nodes/pe/scientific-5-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - scientific-5-x86_64: - roles: - - master - - dashboard - - database - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-5-x86_64 - hypervisor: vcloud - scientific-5-x86_64-agent: - roles: - - agent - platform: el-5-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-5-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/scientific-6-32ma-32da-32da b/acceptance/config/nodes/pe/scientific-6-32ma-32da-32da deleted file mode 100644 index 9c49d8ac5..000000000 --- a/acceptance/config/nodes/pe/scientific-6-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - scientific-6-i386-master: - roles: - - master - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-6-i386 - hypervisor: vcloud - scientific-6-i386-dashboard: - roles: - - dashboard - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-6-i386 - hypervisor: vcloud - scientific-6-i386-database: - roles: - - database - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-6-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/scientific-6-32mda b/acceptance/config/nodes/pe/scientific-6-32mda deleted file mode 100644 index 7bcc8bcf9..000000000 --- a/acceptance/config/nodes/pe/scientific-6-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - scientific-6-i386: - roles: - - master - - dashboard - - database - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-6-i386 - hypervisor: vcloud - scientific-6-i386-agent: - roles: - - agent - platform: el-6-i386 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-6-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/scientific-6-64ma-64da-64da b/acceptance/config/nodes/pe/scientific-6-64ma-64da-64da deleted file mode 100644 index fe4eadaf0..000000000 --- a/acceptance/config/nodes/pe/scientific-6-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - scientific-6-x86_64-master: - roles: - - master - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-6-x86_64 - hypervisor: vcloud - scientific-6-x86_64-dashboard: - roles: - - dashboard - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-6-x86_64 - hypervisor: vcloud - scientific-6-x86_64-database: - roles: - - database - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-6-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/scientific-6-64mda b/acceptance/config/nodes/pe/scientific-6-64mda deleted file mode 100644 index 4279e9f00..000000000 --- a/acceptance/config/nodes/pe/scientific-6-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - scientific-6-x86_64: - roles: - - master - - dashboard - - database - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-6-x86_64 - hypervisor: vcloud - scientific-6-x86_64-agent: - roles: - - agent - platform: el-6-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/scientific-6-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/sles-11-32ma-32da-32da b/acceptance/config/nodes/pe/sles-11-32ma-32da-32da deleted file mode 100644 index dd2e53017..000000000 --- a/acceptance/config/nodes/pe/sles-11-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - sles-11-i386-master: - roles: - - master - - agent - platform: sles-11-i386 - template: Delivery/Quality Assurance/Templates/vCloud/sles-11-i386 - hypervisor: vcloud - sles-11-i386-dashboard: - roles: - - dashboard - - agent - platform: sles-11-i386 - template: Delivery/Quality Assurance/Templates/vCloud/sles-11-i386 - hypervisor: vcloud - sles-11-i386-database: - roles: - - database - - agent - platform: sles-11-i386 - template: Delivery/Quality Assurance/Templates/vCloud/sles-11-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/sles-11-32mda b/acceptance/config/nodes/pe/sles-11-32mda deleted file mode 100644 index 4e1bd4f9f..000000000 --- a/acceptance/config/nodes/pe/sles-11-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - sles-11-i386: - roles: - - master - - dashboard - - database - - agent - platform: sles-11-i386 - template: Delivery/Quality Assurance/Templates/vCloud/sles-11-i386 - hypervisor: vcloud - sles-11-i386-agent: - roles: - - agent - platform: sles-11-i386 - template: Delivery/Quality Assurance/Templates/vCloud/sles-11-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/sles-11-64ma-64da-64da b/acceptance/config/nodes/pe/sles-11-64ma-64da-64da deleted file mode 100644 index 8efbd0bc0..000000000 --- a/acceptance/config/nodes/pe/sles-11-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - sles-11-x86_64-master: - roles: - - master - - agent - platform: sles-11-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/sles-11-x86_64 - hypervisor: vcloud - sles-11-x86_64-dashboard: - roles: - - dashboard - - agent - platform: sles-11-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/sles-11-x86_64 - hypervisor: vcloud - sles-11-x86_64-database: - roles: - - database - - agent - platform: sles-11-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/sles-11-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/sles-11-64mda b/acceptance/config/nodes/pe/sles-11-64mda deleted file mode 100644 index fd2024280..000000000 --- a/acceptance/config/nodes/pe/sles-11-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - sles-11-x86_64: - roles: - - master - - dashboard - - database - - agent - platform: sles-11-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/sles-11-x86_64 - hypervisor: vcloud - sles-11-x86_64-agent: - roles: - - agent - platform: sles-11-x86_64 - template: Delivery/Quality Assurance/Templates/vCloud/sles-11-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/ubuntu-1004-32ma-32da-32da b/acceptance/config/nodes/pe/ubuntu-1004-32ma-32da-32da deleted file mode 100644 index 043ba6407..000000000 --- a/acceptance/config/nodes/pe/ubuntu-1004-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - ubuntu-1004-i386-master: - roles: - - master - - agent - platform: ubuntu-10.04-i386 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-i386 - hypervisor: vcloud - ubuntu-1004-i386-dashboard: - roles: - - dashboard - - agent - platform: ubuntu-10.04-i386 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-i386 - hypervisor: vcloud - ubuntu-1004-i386-database: - roles: - - database - - agent - platform: ubuntu-10.04-i386 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/ubuntu-1004-32mda b/acceptance/config/nodes/pe/ubuntu-1004-32mda deleted file mode 100644 index 875b363db..000000000 --- a/acceptance/config/nodes/pe/ubuntu-1004-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - ubuntu-1004-i386: - roles: - - master - - dashboard - - database - - agent - platform: ubuntu-10.04-i386 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-i386 - hypervisor: vcloud - ubuntu-1004-agent: - roles: - - agent - platform: ubuntu-10.04-i386 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/ubuntu-1004-64ma-64da-64da b/acceptance/config/nodes/pe/ubuntu-1004-64ma-64da-64da deleted file mode 100644 index d8c271f2b..000000000 --- a/acceptance/config/nodes/pe/ubuntu-1004-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - ubuntu-1004-amd64-master: - roles: - - master - - agent - platform: ubuntu-10.04-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-x86_64 - hypervisor: vcloud - ubuntu-1004-amd64-dashboard: - roles: - - dashboard - - agent - platform: ubuntu-10.04-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-x86_64 - hypervisor: vcloud - ubuntu-1004-amd64-database: - roles: - - database - - agent - platform: ubuntu-10.04-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/ubuntu-1004-64mda b/acceptance/config/nodes/pe/ubuntu-1004-64mda deleted file mode 100644 index 9dd2982ad..000000000 --- a/acceptance/config/nodes/pe/ubuntu-1004-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - ubuntu-1004-amd64: - roles: - - master - - dashboard - - database - - agent - platform: ubuntu-10.04-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-x86_64 - hypervisor: vcloud - ubuntu-1004-agent: - roles: - - agent - platform: ubuntu-10.04-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/ubuntu-1204-32ma-32da-32da b/acceptance/config/nodes/pe/ubuntu-1204-32ma-32da-32da deleted file mode 100644 index 8a9d484a0..000000000 --- a/acceptance/config/nodes/pe/ubuntu-1204-32ma-32da-32da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - ubuntu-1204-i386-master: - roles: - - master - - agent - platform: ubuntu-12.04-i386 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-i386 - hypervisor: vcloud - ubuntu-1204-i386-dashboard: - roles: - - dashboard - - agent - platform: ubuntu-12.04-i386 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-i386 - hypervisor: vcloud - ubuntu-1204-i386-database: - roles: - - database - - agent - platform: ubuntu-12.04-i386 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/ubuntu-1204-32mda b/acceptance/config/nodes/pe/ubuntu-1204-32mda deleted file mode 100644 index 381003eb9..000000000 --- a/acceptance/config/nodes/pe/ubuntu-1204-32mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - ubuntu-1204-i386: - roles: - - master - - dashboard - - database - - agent - platform: ubuntu-12.04-i386 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-i386 - hypervisor: vcloud - ubuntu-1204-agent: - roles: - - agent - platform: ubuntu-12.04-i386 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-i386 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/ubuntu-1204-64ma-64da-64da b/acceptance/config/nodes/pe/ubuntu-1204-64ma-64da-64da deleted file mode 100644 index bf5e34841..000000000 --- a/acceptance/config/nodes/pe/ubuntu-1204-64ma-64da-64da +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - ubuntu-1204-amd64-master: - roles: - - master - - agent - platform: ubuntu-12.04-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-x86_64 - hypervisor: vcloud - ubuntu-1204-amd64-dashboard: - roles: - - dashboard - - agent - platform: ubuntu-12.04-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-x86_64 - hypervisor: vcloud - ubuntu-1204-amd64-database: - roles: - - database - - agent - platform: ubuntu-12.04-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/pe/ubuntu-1204-64mda b/acceptance/config/nodes/pe/ubuntu-1204-64mda deleted file mode 100644 index 8e8cda971..000000000 --- a/acceptance/config/nodes/pe/ubuntu-1204-64mda +++ /dev/null @@ -1,22 +0,0 @@ -HOSTS: - ubuntu-1204-amd64: - roles: - - master - - dashboard - - database - - agent - platform: ubuntu-12.04-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-x86_64 - hypervisor: vcloud - ubuntu-1204-agent: - roles: - - agent - platform: ubuntu-12.04-amd64 - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-x86_64 - hypervisor: vcloud -CONFIG: - nfs_server: none - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic diff --git a/acceptance/config/nodes/precise.yaml b/acceptance/config/nodes/precise.yaml deleted file mode 100644 index 22793b50a..000000000 --- a/acceptance/config/nodes/precise.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: ubuntu-precise-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-x86_64 - agent: - roles: - - agent - platform: ubuntu-precise-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/precise_and_lucid.yaml b/acceptance/config/nodes/precise_and_lucid.yaml deleted file mode 100644 index bd7dfeb33..000000000 --- a/acceptance/config/nodes/precise_and_lucid.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: ubuntu-precise-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1204-x86_64 - agent: - roles: - - agent - platform: ubuntu-lucid-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1004-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/rhel5.yaml b/acceptance/config/nodes/rhel5.yaml deleted file mode 100644 index 61aa05d10..000000000 --- a/acceptance/config/nodes/rhel5.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-5-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-x86_64 - agent: - roles: - - agent - platform: el-5-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/rhel6.yaml b/acceptance/config/nodes/rhel6.yaml deleted file mode 100644 index 6a1d1c1f7..000000000 --- a/acceptance/config/nodes/rhel6.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-x86_64 - agent: - roles: - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/rhel6_and_rhel5.yaml b/acceptance/config/nodes/rhel6_and_rhel5.yaml deleted file mode 100644 index 8fedef6e2..000000000 --- a/acceptance/config/nodes/rhel6_and_rhel5.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-x86_64 - agent: - roles: - - agent - platform: el-5-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-5-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/rhel7.yaml b/acceptance/config/nodes/rhel7.yaml deleted file mode 100644 index b5706dd47..000000000 --- a/acceptance/config/nodes/rhel7.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-7-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-7-x86_64 - agent: - roles: - - agent - platform: el-7-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-7-x86_64 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/solaris10.yaml b/acceptance/config/nodes/solaris10.yaml deleted file mode 100644 index d35c4bbab..000000000 --- a/acceptance/config/nodes/solaris10.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: solaris-10-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/solaris-10-x86_64 - agent: - roles: - - agent - platform: solaris-10-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/solaris-10-x86_64 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/solaris11.yaml b/acceptance/config/nodes/solaris11.yaml deleted file mode 100644 index 0cfbd9260..000000000 --- a/acceptance/config/nodes/solaris11.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: solaris-11-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/solaris-11-x86_64 - agent: - roles: - - agent - platform: solaris-11-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/solaris-11-x86_64 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/squeeze.yaml b/acceptance/config/nodes/squeeze.yaml deleted file mode 100644 index d78609f58..000000000 --- a/acceptance/config/nodes/squeeze.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: debian-squeeze-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-x86_64 - agent: - roles: - - agent - platform: debian-squeeze-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/debian-6-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/standalone/rhel6-and-precise.yaml b/acceptance/config/nodes/standalone/rhel6-and-precise.yaml deleted file mode 100644 index 4aa330c6b..000000000 --- a/acceptance/config/nodes/standalone/rhel6-and-precise.yaml +++ /dev/null @@ -1,14 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - ip: 192.168.40.12 - agent1: - roles: - - agent - platform: ubuntu-12.04-i386 - ip: 192.168.40.10 -CONFIG: - filecount: 12 diff --git a/acceptance/config/nodes/trusty.yaml b/acceptance/config/nodes/trusty.yaml deleted file mode 100644 index 45001c615..000000000 --- a/acceptance/config/nodes/trusty.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: ubuntu-trusty-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1404-x86_64 - agent: - roles: - - agent - platform: ubuntu-trusty-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1404-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/wheezy.yaml b/acceptance/config/nodes/wheezy.yaml deleted file mode 100644 index e805be655..000000000 --- a/acceptance/config/nodes/wheezy.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: debian-wheezy-x86_64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-x86_64 - agent: - roles: - - agent - platform: debian-wheezy-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/debian-7-i386 -CONFIG: - filecount: 12 - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2003r2x64-rubyx64.yaml b/acceptance/config/nodes/win2003r2x64-rubyx64.yaml deleted file mode 100644 index 5a94aab24..000000000 --- a/acceptance/config/nodes/win2003r2x64-rubyx64.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2003r2-x86_64-rubyx64: - roles: - - agent - platform: windows-2003r2-64 - ruby_arch: x64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003r2-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2003r2x64-rubyx86.yaml b/acceptance/config/nodes/win2003r2x64-rubyx86.yaml deleted file mode 100644 index d58429524..000000000 --- a/acceptance/config/nodes/win2003r2x64-rubyx86.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2003r2-x86_64-rubyx86: - roles: - - agent - platform: windows-2003r2-64 - ruby_arch: x86 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003r2-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2003r2x86-rubyx86.yaml b/acceptance/config/nodes/win2003r2x86-rubyx86.yaml deleted file mode 100644 index d91bc7385..000000000 --- a/acceptance/config/nodes/win2003r2x86-rubyx86.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2003r2-i386: - roles: - - agent - platform: windows-2003r2-32 - ruby_arch: x86 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003r2-i386 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2003x64-rubyx64.yaml b/acceptance/config/nodes/win2003x64-rubyx64.yaml deleted file mode 100644 index 4f6f0754e..000000000 --- a/acceptance/config/nodes/win2003x64-rubyx64.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2003-x86_64-rubyx64: - roles: - - agent - platform: windows-2003-64 - ruby_arch: x64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2003x64-rubyx86.yaml b/acceptance/config/nodes/win2003x64-rubyx86.yaml deleted file mode 100644 index 5929ab47d..000000000 --- a/acceptance/config/nodes/win2003x64-rubyx86.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2003-x86_64-rubyx86: - roles: - - agent - platform: windows-2003-64 - ruby_arch: x86 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2003x86-rubyx86.yaml b/acceptance/config/nodes/win2003x86-rubyx86.yaml deleted file mode 100644 index b558a5514..000000000 --- a/acceptance/config/nodes/win2003x86-rubyx86.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2003-i386: - roles: - - agent - platform: windows-2003-32 - ruby_arch: x86 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003-i386 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2008-rubyx64.yaml b/acceptance/config/nodes/win2008-rubyx64.yaml deleted file mode 100644 index 0892d7931..000000000 --- a/acceptance/config/nodes/win2008-rubyx64.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2008-x86_64-rubyx64: - roles: - - agent - platform: windows-2008-64 - ruby_arch: x64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2008-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2008-rubyx86.yaml b/acceptance/config/nodes/win2008-rubyx86.yaml deleted file mode 100644 index 5de98710b..000000000 --- a/acceptance/config/nodes/win2008-rubyx86.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2008-x86_64-rubyx86: - roles: - - agent - platform: windows-2008-64 - ruby_arch: x86 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2008-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2008r2-rubyx64.yaml b/acceptance/config/nodes/win2008r2-rubyx64.yaml deleted file mode 100644 index 3de3f5db1..000000000 --- a/acceptance/config/nodes/win2008r2-rubyx64.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2008r2-x86_64-rubyx64: - roles: - - agent - platform: windows-2008r2-64 - ruby_arch: x64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2008r2-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2008r2-rubyx86.yaml b/acceptance/config/nodes/win2008r2-rubyx86.yaml deleted file mode 100644 index 2020cc6c6..000000000 --- a/acceptance/config/nodes/win2008r2-rubyx86.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2008r2-x86_64-rubyx86: - roles: - - agent - platform: windows-2008r2-64 - ruby_arch: x86 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2008r2-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2012-rubyx64.yaml b/acceptance/config/nodes/win2012-rubyx64.yaml deleted file mode 100644 index 73b8488a1..000000000 --- a/acceptance/config/nodes/win2012-rubyx64.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2012-x86_64-rubyx64: - roles: - - agent - platform: windows-2012-64 - ruby_arch: x64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2012-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2012-rubyx86.yaml b/acceptance/config/nodes/win2012-rubyx86.yaml deleted file mode 100644 index 9e18b234e..000000000 --- a/acceptance/config/nodes/win2012-rubyx86.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2012-x86_64-rubyx86: - roles: - - agent - platform: windows-2012-64 - ruby_arch: x86 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2012-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2012r2-rubyx64.yaml b/acceptance/config/nodes/win2012r2-rubyx64.yaml deleted file mode 100644 index 59c35f4b9..000000000 --- a/acceptance/config/nodes/win2012r2-rubyx64.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2012r2-x86_64-rubyx64: - roles: - - agent - platform: windows-2012r2-64 - ruby_arch: x64 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2012r2-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/nodes/win2012r2-rubyx86.yaml b/acceptance/config/nodes/win2012r2-rubyx86.yaml deleted file mode 100644 index 2ebb2dc71..000000000 --- a/acceptance/config/nodes/win2012r2-rubyx86.yaml +++ /dev/null @@ -1,20 +0,0 @@ -HOSTS: - master: - roles: - - master - - agent - platform: el-6-i386 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/redhat-6-i386 - agent-2012r2-x86_64-rubyx86: - roles: - - agent - platform: windows-2012r2-64 - ruby_arch: x86 - hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2012r2-x86_64 -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/acceptance/config/packages/options.rb b/acceptance/config/packages/options.rb deleted file mode 100644 index 343cbb48a..000000000 --- a/acceptance/config/packages/options.rb +++ /dev/null @@ -1,11 +0,0 @@ -{ - :type => 'foss-packages', - :pre_suite => [ - 'setup/packages/pre-suite/010_Install.rb', - 'setup/packages/pre-suite/015_PackageHostsPresets.rb', - 'setup/common/pre-suite/025_StopFirewall.rb', - 'setup/common/pre-suite/040_ValidateSignCert.rb', - 'setup/packages/pre-suite/045_EnsureMasterStartedOnPassenger.rb', - 'setup/common/pre-suite/100_SetParser.rb', - ], -} diff --git a/acceptance/lib/acceptance_spec_helper.rb b/acceptance/lib/acceptance_spec_helper.rb deleted file mode 100644 index d279a0424..000000000 --- a/acceptance/lib/acceptance_spec_helper.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'fileutils' - -dir = File.expand_path(File.dirname(__FILE__)) -$LOAD_PATH.unshift dir - -RSpec.configure do |config| - config.mock_with :mocha -end diff --git a/acceptance/lib/helper.rb b/acceptance/lib/helper.rb deleted file mode 100644 index c2b5df870..000000000 --- a/acceptance/lib/helper.rb +++ /dev/null @@ -1 +0,0 @@ -$LOAD_PATH << File.expand_path(File.dirname(__FILE__)) diff --git a/acceptance/lib/puppet/acceptance/common_utils.rb b/acceptance/lib/puppet/acceptance/common_utils.rb deleted file mode 100644 index c9aeb1d15..000000000 --- a/acceptance/lib/puppet/acceptance/common_utils.rb +++ /dev/null @@ -1,125 +0,0 @@ -module Puppet - module Acceptance - module CronUtils - def clean(agent, o={}) - o = {:user => 'tstuser'}.merge(o) - run_cron_on(agent, :remove, o[:user]) - apply_manifest_on(agent, %[user { '%s': ensure => absent, managehome => false }] % o[:user]) - end - - def setup(agent, o={}) - o = {:user => 'tstuser'}.merge(o) - apply_manifest_on(agent, %[user { '%s': ensure => present, managehome => false }] % o[:user]) - apply_manifest_on(agent, %[case $operatingsystem { - centos, redhat: {$cron = 'cronie'} - solaris: { $cron = 'core-os' } - default: {$cron ='cron'} } - package {'cron': name=> $cron, ensure=>present, }]) - end - end - - module CAUtils - - def initialize_ssl - hostname = on(master, 'facter hostname').stdout.strip - fqdn = on(master, 'facter fqdn').stdout.strip - - if master.use_service_scripts? - step "Ensure puppet is stopped" - # Passenger, in particular, must be shutdown for the cert setup steps to work, - # but any running puppet master will interfere with webrick starting up and - # potentially ignore the puppet.conf changes. - on(master, puppet('resource', 'service', master['puppetservice'], "ensure=stopped")) - end - - step "Clear SSL on all hosts" - hosts.each do |host| - ssldir = on(host, puppet('agent --configprint ssldir')).stdout.chomp - on(host, "rm -rf '#{ssldir}'") - end - - step "Master: Start Puppet Master" do - master_opts = { - :main => { - :dns_alt_names => "puppet,#{hostname},#{fqdn}", - }, - :__service_args__ => { - # apache2 service scripts can't restart if we've removed the ssl dir - :bypass_service_script => true, - }, - } - with_puppet_running_on(master, master_opts) do - - hosts.each do |host| - next if host['roles'].include? 'master' - - step "Agents: Run agent --test first time to gen CSR" - on host, puppet("agent --test --server #{master}"), :acceptable_exit_codes => [1] - end - - # Sign all waiting certs - step "Master: sign all certs" - on master, puppet("cert --sign --all"), :acceptable_exit_codes => [0,24] - - step "Agents: Run agent --test second time to obtain signed cert" - on agents, puppet("agent --test --server #{master}"), :acceptable_exit_codes => [0,2] - end - end - end - - def clean_cert(host, cn, check = true) - on(host, puppet('cert', 'clean', cn), :acceptable_exit_codes => check ? [0] : [0, 24]) - if check - assert_match(/remov.*Certificate.*#{cn}/i, stdout, "Should see a log message that certificate request was removed.") - on(host, puppet('cert', 'list', '--all')) - assert_no_match(/#{cn}/, stdout, "Should not see certificate in list anymore.") - end - end - - def clear_agent_ssl - return if master.is_pe? - step "All: Clear agent only ssl settings (do not clear master)" - hosts.each do |host| - next if host == master - ssldir = on(host, puppet('agent --configprint ssldir')).stdout.chomp - on( host, host_command("rm -rf '#{ssldir}'") ) - end - end - - def reset_agent_ssl(resign = true) - return if master.is_pe? - clear_agent_ssl - - hostname = master.execute('facter hostname') - fqdn = master.execute('facter fqdn') - - step "Clear old agent certificates from master" do - agents.each do |agent| - next if agent == master && agent.is_using_passenger? - agent_cn = on(agent, puppet('agent --configprint certname')).stdout.chomp - clean_cert(master, agent_cn, false) if agent_cn - end - end - - if resign - step "Master: Ensure the master is listening and autosigning" - with_puppet_running_on(master, - :master => { - :dns_alt_names => "puppet,#{hostname},#{fqdn}", - :autosign => true, - } - ) do - - agents.each do |agent| - next if agent == master && agent.is_using_passenger? - step "Agents: Run agent --test once to obtain auto-signed cert" do - on agent, puppet('agent', "--test --server #{master}"), :acceptable_exit_codes => [0,2] - end - end - end - end - end - - end - end -end diff --git a/acceptance/lib/puppet/acceptance/environment_utils.rb b/acceptance/lib/puppet/acceptance/environment_utils.rb deleted file mode 100644 index b657ad128..000000000 --- a/acceptance/lib/puppet/acceptance/environment_utils.rb +++ /dev/null @@ -1,354 +0,0 @@ -require 'puppet/acceptance/module_utils' - -module Puppet - module Acceptance - module EnvironmentUtils - include Puppet::Acceptance::ModuleUtils - - # Generate puppet manifest for the creation of an environment with - # the given modulepath and manifest and env_name. The created environment - # will have on testing_mod module, and manifest site.pp which includes it. - # - # @param options [Hash<Sym,String>] - # @option options [String] :modulepath Modules directory - # @option options [String] :manifest Manifest directory - # @option options [String] :env_name Environment name - # @return [String] Puppet manifest to create the environment files - def generate_environment(options) - modulepath = options[:modulepath] - manifestpath = options[:manifestpath] - env_name = options[:env_name] - - environment = <<-MANIFEST_SNIPPET - file { - ################################################### - # #{env_name} - #{generate_module("testing_mod", env_name, modulepath)} - - "#{manifestpath}":; - "#{manifestpath}/site.pp": - ensure => file, - mode => 0640, - content => ' - notify { "in #{env_name} site.pp": } - include testing_mod - ' - ; - } - MANIFEST_SNIPPET - end - - # Generate one module's manifest code. - def generate_module(module_name, env_name, modulepath) - module_pp = <<-MANIFEST_SNIPPET - "#{modulepath}":; - "#{modulepath}/#{module_name}":; - "#{modulepath}/#{module_name}/manifests":; - - "#{modulepath}/#{module_name}/manifests/init.pp": - ensure => file, - mode => 0640, - content => 'class #{module_name} { - notify { "include #{env_name} #{module_name}": } - }' - ; - MANIFEST_SNIPPET - end - - # Default, legacy, dynamic and directory environments - # using generate_manifest(), all rooted in testdir. - # - # @param [String] testdir path to the temp directory which will be the confdir all - # the environments live in - # @return [String] Puppet manifest to generate all of the environment files. - def environment_manifest(testdir) - manifest = <<-MANIFEST - File { - ensure => directory, - owner => #{master['user']}, - group => #{master['group']}, - mode => 0750, - } - - file { "#{testdir}": } - - #{generate_environment( - :modulepath => "#{testdir}/modules", - :manifestpath => "#{testdir}/manifests", - :env_name => "default environment")} - - #{generate_environment( - :modulepath => "#{testdir}/testing-modules", - :manifestpath => "#{testdir}/testing-manifests", - :env_name => "legacy testing environment")} - - file { - "#{testdir}/dynamic":; - "#{testdir}/dynamic/testing":; - } - - #{generate_environment( - :modulepath => "#{testdir}/dynamic/testing/modules", - :manifestpath => "#{testdir}/dynamic/testing/manifests", - :env_name => "dynamic testing environment")} - - file { - "#{testdir}/environments":; - "#{testdir}/environments/testing":; - } - - #{generate_environment( - :modulepath => "#{testdir}/environments/testing/modules", - :manifestpath => "#{testdir}/environments/testing/manifests", - :env_name => "directory testing environment")} - - file { - "#{testdir}/environments/testing_environment_conf":; - } - - #{generate_environment( - :modulepath => "#{testdir}/environments/testing_environment_conf/nonstandard-modules", - :manifestpath => "#{testdir}/environments/testing_environment_conf/nonstandard-manifests", - :env_name => "directory testing with environment.conf")} - - file { "#{testdir}/environments/testing_environment_conf/environment.conf": - ensure => file, - mode => 0640, - content => ' - modulepath = nonstandard-modules:$basemodulepath - manifest = nonstandard-manifests - config_version = local-version.sh - ' - } - - file { - "#{testdir}/environments/testing_environment_conf/local-version.sh": - ensure => file, - mode => 0640, - content => '#! /usr/bin/env bash - echo "local testing_environment_conf"' - ; - } - - ################### - # Services - - file { - "#{testdir}/services":; - "#{testdir}/services/testing":; - #{generate_module('service_mod', - "service testing environment", - "#{testdir}/services/testing/modules")} - } - - ####################### - # Config version script - - file { - "#{testdir}/static-version.sh": - ensure => file, - mode => 0640, - content => '#! /usr/bin/env bash - echo "static"' - ; - } - MANIFEST - end - - def get_directory_hash_from(host, path) - dir_hash = {} - on(host, "ls #{path}") do |result| - result.stdout.split.inject(dir_hash) do |hash,f| - hash[f] = "#{path}/#{f}" - hash - end - end - dir_hash - end - - def safely_shadow_directory_contents_and_yield(host, original_path, new_path, &block) - original_files = get_directory_hash_from(host, original_path) - new_files = get_directory_hash_from(host, new_path) - conflicts = original_files.keys & new_files.keys - - step "backup original files" do - conflicts.each do |c| - on(host, "mv #{original_files[c]} #{original_files[c]}.bak") - end - end - - step "shadow original files with temporary files" do - new_files.each do |name,full_path_name| - on(host, "cp -R #{full_path_name} #{original_path}/#{name}") - end - end - - step "open permissions to 770 on all temporary files copied into working dir and set ownership" do - file_list = new_files.keys.map { |name| "#{original_path}/#{name}" }.join(' ') - on(host, "chown -R #{host['user']}:#{host['group']} #{file_list}") - on(host, "chmod -R 770 #{file_list}") - end - - yield - - ensure - step "clear out the temporary files" do - files_to_delete = new_files.keys.map { |name| "#{original_path}/#{name}" } - on(host, "rm -rf #{files_to_delete.join(' ')}") - end - step "move the shadowed files back to their original places" do - conflicts.each do |c| - on(host, "mv #{original_files[c]}.bak #{original_files[c]}") - end - end - end - - # Stand up a puppet master on the master node with the given master_opts - # using the passed envdir as the source of the puppet environment files, - # and passed confdir as the directory to use for the temporary - # puppet.conf. It then runs through a series of environment tests for the - # passed environment and returns a hashed structure of the results. - # - # @return [Hash<Beaker::Host,Hash<Sym,Beaker::Result>>] Hash of - # Beaker::Hosts for each agent run keyed to a hash of Beaker::Result - # objects keyed by each subtest that was performed. - def use_an_environment(environment, description, master_opts, envdir, confdir, options = {}) - master_puppet_conf = master_opts.dup # shallow clone - - results = {} - safely_shadow_directory_contents_and_yield(master, master['puppetpath'], envdir) do - - config_print = options[:config_print] - directory_environments = options[:directory_environments] - - with_puppet_running_on(master, master_puppet_conf, confdir) do - agents.each do |agent| - agent_results = results[agent] = {} - - step "puppet agent using #{description} environment" - args = "-t", "--server", master - args << ["--environment", environment] if environment - # Test agents configured to use directory environments (affects environment - # loading on the agent, especially with regards to requests/node environment) - args << "--environmentpath='$confdir/environments'" if directory_environments && agent != master - on(agent, puppet("agent", *args), :acceptable_exit_codes => (0..255)) do - agent_results[:puppet_agent] = result - end - - if agent == master - args = ["--trace"] - args << ["--environment", environment] if environment - - step "print puppet config for #{description} environment" - on(agent, puppet(*(["config", "print", "basemodulepath", "modulepath", "manifest", "config_version", config_print] + args)), :acceptable_exit_codes => (0..255)) do - agent_results[:puppet_config] = result - end - - step "puppet apply using #{description} environment" - on(agent, puppet(*(["apply", '-e', '"include testing_mod"'] + args)), :acceptable_exit_codes => (0..255)) do - agent_results[:puppet_apply] = result - end - - # Be aware that Puppet Module Tool will create the module directory path if it - # does not exist. So these tests should be run last... - step "install a module into environment" - on(agent, puppet(*(["module", "install", "pmtacceptance-nginx"] + args)), :acceptable_exit_codes => (0..255)) do - agent_results[:puppet_module_install] = result - end - - step "uninstall a module from #{description} environment" - on(agent, puppet(*(["module", "uninstall", "pmtacceptance-nginx"] + args)), :acceptable_exit_codes => (0..255)) do - agent_results[:puppet_module_uninstall] = result - end - end - end - end - end - - return results - end - - # For each Beaker::Host in the results Hash, generates a chart, comparing - # the expected exit code and regexp matches from expectations to the - # Beaker::Result.output for a particular command that was executed in the - # environment. Outputs either 'ok' or text highlighting the errors, and - # returns false if any errors were found. - # - # @param [Hash<Beaker::Host,Hash<Sym,Beaker::Result>>] results - # @param [Hash<Sym,Hash{Sym => Integer,Array<Regexp>}>] expectations - # @return [Array] Returns an empty array of there were no failures, or an - # Array of failed cases. - def review_results(results, expectations) - failed = [] - - results.each do |agent, agent_results| - divider = "-" * 79 - - logger.info divider - logger.info "For: (#{agent.name}) #{agent}" - logger.info divider - - agent_results.each do |testname, execution_results| - expected_exit_code = expectations[testname][:exit_code] - match_tests = expectations[testname][:matches] || [] - not_match_tests = expectations[testname][:does_not_match] || [] - expect_failure = expectations[testname][:expect_failure] - notes = expectations[testname][:notes] - - errors = [] - - if execution_results.exit_code != expected_exit_code - errors << "To exit with an exit code of '#{expected_exit_code}', instead of '#{execution_results.exit_code}'" - end - - match_tests.each do |regexp| - if execution_results.output !~ regexp - errors << "#{errors.empty? ? "To" : "And"} match: #{regexp}" - end - end - - not_match_tests.each do |regexp| - if execution_results.output =~ regexp - errors << "#{errors.empty? ? "Not to" : "And not"} match: #{regexp}" - end - end - - error_msg = "Expected the output:\n#{execution_results.output}\n#{errors.join("\n")}" unless errors.empty? - - case_failed = case - when errors.empty? && expect_failure then 'ok - failed as expected' - when errors.empty? && !expect_failure then 'ok' - else '*UNEXPECTED FAILURE*' - end - logger.info "#{testname}: #{case_failed}" - if case_failed == 'ok - failed as expected' - logger.info divider - logger.info "Case is known to fail as follows:\n#{execution_results.output}\n" - elsif case_failed == '*UNEXPECTED FAILURE*' - failed << "Unexpected failure for #{testname}" - logger.info divider - logger.info "#{error_msg}" - end - - logger.info("------\nNotes: #{notes}") if notes - logger.info divider - end - end - - return failed - end - - def assert_review(review) - failures = [] - review.each do |scenario, failed| - if !failed.empty? - problems = "Problems in the '#{scenario}' output reported above:\n #{failed.join("\n ")}" - logger.warn(problems) - failures << problems - end - end - assert failures.empty?, "Failed Review:\n\n#{failures.join("\n")}\n" - end - end - end -end diff --git a/acceptance/lib/puppet/acceptance/environment_utils_spec.rb b/acceptance/lib/puppet/acceptance/environment_utils_spec.rb deleted file mode 100644 index 596b5dac9..000000000 --- a/acceptance/lib/puppet/acceptance/environment_utils_spec.rb +++ /dev/null @@ -1,144 +0,0 @@ -require File.join(File.dirname(__FILE__),'../../acceptance_spec_helper.rb') -require 'puppet/acceptance/environment_utils' - -module EnvironmentUtilsSpec -describe 'EnvironmentUtils' do - class ATestCase - include Puppet::Acceptance::EnvironmentUtils - - def step(str) - yield - end - - def on(host, command, options = nil) - stdout = host.do(command, options) - yield TestResult.new(stdout) if block_given? - end - end - - class TestResult - attr_accessor :stdout - - def initialize(stdout) - self.stdout = stdout - end - end - - class TestHost - attr_accessor :did, :directories, :attributes - - def initialize(directories, attributes = {}) - self.directories = directories - self.did = [] - self.attributes = attributes - end - - def do(command, options) - did << (options.nil? ? command : [command, options]) - case command - when /^ls (.*)/ then directories[$1] - end - end - - def [](param) - attributes[param] - end - end - - let(:testcase) { ATestCase.new } - let(:host) { TestHost.new(directory_contents, 'user' => 'root', 'group' => 'puppet') } - let(:directory_contents) do - { - '/etc/puppet' => 'foo bar baz widget', - '/tmp/dir' => 'foo dingo bar thing', - } - end - - it "runs the block of code" do - ran_code = false - testcase.safely_shadow_directory_contents_and_yield(host, '/etc/puppet', '/tmp/dir') do - ran_code = true - end - expect(ran_code).to be_true - expect(host.did).to eq([ - "ls /etc/puppet", - "ls /tmp/dir", - "mv /etc/puppet/foo /etc/puppet/foo.bak", - "mv /etc/puppet/bar /etc/puppet/bar.bak", - "cp -R /tmp/dir/foo /etc/puppet/foo", - "cp -R /tmp/dir/dingo /etc/puppet/dingo", - "cp -R /tmp/dir/bar /etc/puppet/bar", - "cp -R /tmp/dir/thing /etc/puppet/thing", - "chown -R root:puppet /etc/puppet/foo /etc/puppet/dingo /etc/puppet/bar /etc/puppet/thing", - "chmod -R 770 /etc/puppet/foo /etc/puppet/dingo /etc/puppet/bar /etc/puppet/thing", - "rm -rf /etc/puppet/foo /etc/puppet/dingo /etc/puppet/bar /etc/puppet/thing", - "mv /etc/puppet/foo.bak /etc/puppet/foo", - "mv /etc/puppet/bar.bak /etc/puppet/bar" - ]) - end - - it "backs up the original items that are shadowed by tmp items" do - testcase.safely_shadow_directory_contents_and_yield(host, '/etc/puppet', '/tmp/dir') {} - expect(host.did.grep(%r{mv /etc/puppet/\w+ })).to eq([ - "mv /etc/puppet/foo /etc/puppet/foo.bak", - "mv /etc/puppet/bar /etc/puppet/bar.bak", - ]) - end - - it "copies in all the tmp items into the working dir" do - testcase.safely_shadow_directory_contents_and_yield(host, '/etc/puppet', '/tmp/dir') {} - expect(host.did.grep(%r{cp})).to eq([ - "cp -R /tmp/dir/foo /etc/puppet/foo", - "cp -R /tmp/dir/dingo /etc/puppet/dingo", - "cp -R /tmp/dir/bar /etc/puppet/bar", - "cp -R /tmp/dir/thing /etc/puppet/thing", - ]) - end - - it "opens the permissions on all copied files to 770 and sets ownership based on host settings" do - testcase.safely_shadow_directory_contents_and_yield(host, '/etc/puppet', '/tmp/dir') {} - expect(host.did.grep(%r{ch(mod|own)})).to eq([ - "chown -R root:puppet /etc/puppet/foo /etc/puppet/dingo /etc/puppet/bar /etc/puppet/thing", - "chmod -R 770 /etc/puppet/foo /etc/puppet/dingo /etc/puppet/bar /etc/puppet/thing", - ]) - end - - it "deletes all the tmp items from the working dir" do - testcase.safely_shadow_directory_contents_and_yield(host, '/etc/puppet', '/tmp/dir') {} - expect(host.did.grep(%r{rm})).to eq([ - "rm -rf /etc/puppet/foo /etc/puppet/dingo /etc/puppet/bar /etc/puppet/thing", - ]) - end - - it "replaces the original items that had been shadowed into the working dir" do - testcase.safely_shadow_directory_contents_and_yield(host, '/etc/puppet', '/tmp/dir') {} - expect(host.did.grep(%r{mv /etc/puppet/\w+\.bak})).to eq([ - "mv /etc/puppet/foo.bak /etc/puppet/foo", - "mv /etc/puppet/bar.bak /etc/puppet/bar" - ]) - end - - it "always cleans up, even if the code we yield to raises an error" do - expect do - testcase.safely_shadow_directory_contents_and_yield(host, '/etc/puppet', '/tmp/dir') do - raise 'oops' - end - end.to raise_error('oops') - expect(host.did).to eq([ - "ls /etc/puppet", - "ls /tmp/dir", - "mv /etc/puppet/foo /etc/puppet/foo.bak", - "mv /etc/puppet/bar /etc/puppet/bar.bak", - "cp -R /tmp/dir/foo /etc/puppet/foo", - "cp -R /tmp/dir/dingo /etc/puppet/dingo", - "cp -R /tmp/dir/bar /etc/puppet/bar", - "cp -R /tmp/dir/thing /etc/puppet/thing", - "chown -R root:puppet /etc/puppet/foo /etc/puppet/dingo /etc/puppet/bar /etc/puppet/thing", - "chmod -R 770 /etc/puppet/foo /etc/puppet/dingo /etc/puppet/bar /etc/puppet/thing", - "rm -rf /etc/puppet/foo /etc/puppet/dingo /etc/puppet/bar /etc/puppet/thing", - "mv /etc/puppet/foo.bak /etc/puppet/foo", - "mv /etc/puppet/bar.bak /etc/puppet/bar" - ]) - end -end -end diff --git a/acceptance/lib/puppet/acceptance/git_utils.rb b/acceptance/lib/puppet/acceptance/git_utils.rb deleted file mode 100644 index 6f27f6b6b..000000000 --- a/acceptance/lib/puppet/acceptance/git_utils.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Puppet - module Acceptance - module GitUtils - def lookup_in_env(env_variable_name, project_name, default) - project_specific_name = "#{project_name.upcase.gsub("-","_")}_#{env_variable_name}" - ENV[project_specific_name] || ENV[env_variable_name] || default - end - - def build_giturl(project_name, git_fork = nil, git_server = nil) - git_fork ||= lookup_in_env('FORK', project_name, 'puppetlabs') - git_server ||= lookup_in_env('GIT_SERVER', project_name, 'github.com') - repo = (git_server == 'github.com') ? - "#{git_fork}/#{project_name}.git" : - "#{git_fork}-#{project_name}.git" - "git://#{git_server}/#{repo}" - end - end - end -end diff --git a/acceptance/lib/puppet/acceptance/git_utils_spec.rb b/acceptance/lib/puppet/acceptance/git_utils_spec.rb deleted file mode 100644 index 39a72a95d..000000000 --- a/acceptance/lib/puppet/acceptance/git_utils_spec.rb +++ /dev/null @@ -1,62 +0,0 @@ -require File.join(File.dirname(__FILE__),'../../acceptance_spec_helper.rb') -require 'puppet/acceptance/git_utils' - -describe 'GitUtils' do - include Puppet::Acceptance::GitUtils - - def with_env(vars) - saved = {} - vars.each do |k,v| - saved[k] = ENV[k] if ENV[k] - ENV[k] = v - end - yield - ensure - vars.keys.each do |k| - saved.include?(k) ? - ENV[k] = saved[k] : - ENV.delete(k) - end - end - - it "looks up an env variable" do - with_env('VAR' => 'from-var') do - expect(lookup_in_env('VAR', 'foo', 'default')).to eq('from-var') - end - end - - it "looks up an env variable and submits default if none found" do - expect(lookup_in_env('VAR', 'foo', 'default')).to eq('default') - end - - it "prefers a project prefixed env variable" do - with_env('VAR' => 'from-var', - 'FOO_BAR_VAR' => 'from-foo-bar-var') do - expect(lookup_in_env('VAR', 'foo-bar', 'default')).to eq('from-foo-bar-var') - end - end - - it "builds a default git url for a project" do - expect(build_giturl('foo')).to eq('git://github.com/puppetlabs/foo.git') - end - - it "builds a git url from passed parameters" do - expect(build_giturl('foo', 'somefork', 'someserver')).to eq('git://someserver/somefork-foo.git') - end - - it "builds a git url based on env variables" do - with_env('GIT_SERVER' => 'gitmirror', - 'FORK' => 'fork') do - expect(build_giturl('foo')).to eq('git://gitmirror/fork-foo.git') - end - end - - it "builds a git url based on project specific env variables" do - with_env('GIT_SERVER' => 'gitmirror', - 'FORK' => 'fork', - 'FOO_GIT_SERVER' => 'project.gitmirror', - 'FOO_FORK' => 'project-fork') do - expect(build_giturl('foo')).to eq('git://project.gitmirror/project-fork-foo.git') - end - end -end diff --git a/acceptance/lib/puppet/acceptance/install_utils.rb b/acceptance/lib/puppet/acceptance/install_utils.rb deleted file mode 100644 index 2888c6c2b..000000000 --- a/acceptance/lib/puppet/acceptance/install_utils.rb +++ /dev/null @@ -1,202 +0,0 @@ -require 'open-uri' -require 'open3' -require 'uri' - -module Puppet - module Acceptance - module InstallUtils - PLATFORM_PATTERNS = { - :redhat => /fedora|el|centos/, - :debian => /debian|ubuntu/, - :debian_ruby18 => /debian|ubuntu-lucid|ubuntu-precise/, - :solaris => /solaris/, - :windows => /windows/, - }.freeze - - # Installs packages on the hosts. - # - # @param hosts [Array<Host>] Array of hosts to install packages to. - # @param package_hash [Hash{Symbol=>Array<String,Array<String,String>>}] - # Keys should be a symbol for a platform in PLATFORM_PATTERNS. Values - # should be an array of package names to install, or of two element - # arrays where a[0] is the command we expect to find on the platform - # and a[1] is the package name (when they are different). - # @param options [Hash{Symbol=>Boolean}] - # @option options [Boolean] :check_if_exists First check to see if - # command is present before installing package. (Default false) - # @return true - def install_packages_on(hosts, package_hash, options = {}) - check_if_exists = options[:check_if_exists] - hosts = [hosts] unless hosts.kind_of?(Array) - hosts.each do |host| - package_hash.each do |platform_key,package_list| - if pattern = PLATFORM_PATTERNS[platform_key] - if pattern.match(host['platform']) - package_list.each do |cmd_pkg| - if cmd_pkg.kind_of?(Array) - command, package = cmd_pkg - else - command = package = cmd_pkg - end - if !check_if_exists || !host.check_for_package(command) - host.logger.notify("Installing #{package}") - additional_switches = '--allow-unauthenticated' if platform_key == :debian - host.install_package(package, additional_switches) - end - end - end - else - raise("Unknown platform '#{platform_key}' in package_hash") - end - end - end - return true - end - - def fetch(base_url, file_name, dst_dir) - FileUtils.makedirs(dst_dir) - src = "#{base_url}/#{file_name}" - dst = File.join(dst_dir, file_name) - if File.exists?(dst) - logger.notify "Already fetched #{dst}" - else - logger.notify "Fetching: #{src}" - logger.notify " and saving to #{dst}" - open(src) do |remote| - File.open(dst, "w") do |file| - FileUtils.copy_stream(remote, file) - end - end - end - return dst - end - - def fetch_remote_dir(url, dst_dir) - logger.notify "fetch_remote_dir (url: #{url}, dst_dir #{dst_dir})" - if url[-1, 1] !~ /\// - url += '/' - end - url = URI.parse(url) - chunks = url.path.split('/') - dst = File.join(dst_dir, chunks.last) - #determine directory structure to cut - #only want to keep the last directory, thus cut total number of dirs - 2 (hostname + last dir name) - cut = chunks.length - 2 - wget_command = "wget -nv -P #{dst_dir} --reject \"index.html*\",\"*.gif\" --cut-dirs=#{cut} -np -nH --no-check-certificate -r #{url}" - - logger.notify "Fetching remote directory: #{url}" - logger.notify " and saving to #{dst}" - logger.notify " using command: #{wget_command}" - - #in ruby 1.9+ we can upgrade this to popen3 to gain access to the subprocess pid - result = `#{wget_command} 2>&1` - result.each_line do |line| - logger.debug(line) - end - if $?.to_i != 0 - raise "Failed to fetch_remote_dir '#{url}' (exit code #{$?}" - end - dst - end - - def stop_firewall_on(host) - case host['platform'] - when /debian/ - on host, 'iptables -F' - when /fedora|el-7/ - on host, puppet('resource', 'service', 'firewalld', 'ensure=stopped') - when /el|centos/ - on host, puppet('resource', 'service', 'iptables', 'ensure=stopped') - when /ubuntu/ - on host, puppet('resource', 'service', 'ufw', 'ensure=stopped') - else - logger.notify("Not sure how to clear firewall on #{host['platform']}") - end - end - - def install_repos_on(host, sha, repo_configs_dir) - platform = host['platform'].with_version_codename - platform_configs_dir = File.join(repo_configs_dir,platform) - - case platform - when /^(fedora|el|centos)-(\d+)-(.+)$/ - variant = (($1 == 'centos') ? 'el' : $1) - fedora_prefix = ((variant == 'fedora') ? 'f' : '') - version = $2 - arch = $3 - - rpm = fetch( - "http://yum.puppetlabs.com", - "puppetlabs-release-%s-%s.noarch.rpm" % [variant, version], - platform_configs_dir - ) - - pattern = "pl-puppet-%s-%s-%s%s-%s.repo" - repo_filename = pattern % [ - sha, - variant, - fedora_prefix, - version, - arch - ] - repo = fetch( - "http://builds.puppetlabs.lan/puppet/%s/repo_configs/rpm/" % sha, - repo_filename, - platform_configs_dir - ) - - link = "http://builds.puppetlabs.lan/puppet/%s/repos/%s/%s%s/products/%s/" % [sha, variant, fedora_prefix, version, arch] - if not link_exists?(link) - link = "http://builds.puppetlabs.lan/puppet/%s/repos/%s/%s%s/devel/%s/" % [sha, variant, fedora_prefix, version, arch] - end - if not link_exists?(link) - raise "Unable to reach a repo directory at #{link}" - end - repo_dir = fetch_remote_dir(link, platform_configs_dir) - - on host, "rm -rf /root/*.repo; rm -rf /root/*.rpm; rm -rf /root/#{arch}" - - scp_to host, rpm, '/root' - scp_to host, repo, '/root' - scp_to host, repo_dir, '/root' - - on host, "mv /root/*.repo /etc/yum.repos.d" - on host, "find /etc/yum.repos.d/ -name \"*.repo\" -exec sed -i \"s/baseurl\\s*=\\s*http:\\/\\/builds.puppetlabs.lan.*$/baseurl=file:\\/\\/\\/root\\/#{arch}/\" {} \\;" - on host, "rpm -Uvh --force /root/*.rpm" - - when /^(debian|ubuntu)-([^-]+)-(.+)$/ - variant = $1 - version = $2 - arch = $3 - - deb = fetch( - "http://apt.puppetlabs.com/", - "puppetlabs-release-%s.deb" % version, - platform_configs_dir - ) - - list = fetch( - "http://builds.puppetlabs.lan/puppet/%s/repo_configs/deb/" % sha, - "pl-puppet-%s-%s.list" % [sha, version], - platform_configs_dir - ) - - repo_dir = fetch_remote_dir("http://builds.puppetlabs.lan/puppet/%s/repos/apt/%s" % [sha, version], platform_configs_dir) - - on host, "rm -rf /root/*.list; rm -rf /root/*.deb; rm -rf /root/#{version}" - - scp_to host, deb, '/root' - scp_to host, list, '/root' - scp_to host, repo_dir, '/root' - - on host, "mv /root/*.list /etc/apt/sources.list.d" - on host, "find /etc/apt/sources.list.d/ -name \"*.list\" -exec sed -i \"s/deb\\s\\+http:\\/\\/builds.puppetlabs.lan.*$/deb file:\\/\\/\\/root\\/#{version} #{version} main/\" {} \\;" - on host, "dpkg -i --force-all /root/*.deb" - on host, "apt-get update" - else - host.logger.notify("No repository installation step for #{platform} yet...") - end - end - end - end -end diff --git a/acceptance/lib/puppet/acceptance/install_utils_spec.rb b/acceptance/lib/puppet/acceptance/install_utils_spec.rb deleted file mode 100644 index 3c077f1d2..000000000 --- a/acceptance/lib/puppet/acceptance/install_utils_spec.rb +++ /dev/null @@ -1,263 +0,0 @@ -require File.join(File.dirname(__FILE__),'../../acceptance_spec_helper.rb') -require 'puppet/acceptance/install_utils' - -module InstallUtilsSpec -describe 'InstallUtils' do - - class ATestCase - include Puppet::Acceptance::InstallUtils - end - - class Platform < String - - def with_version_codename - self - end - end - - class TestHost - attr_accessor :config - def initialize(config = {}) - self.config = config - end - - def [](key) - config[key] - end - end - - let(:host) { TestHost.new } - let(:testcase) { ATestCase.new } - - describe "install_packages_on" do - it "raises an error if package_hash has unknown platform keys" do - expect do - testcase.install_packages_on(host, { :foo => 'bar'}) - end.to raise_error(RuntimeError, /Unknown platform 'foo' in package_hash/) - end - - shared_examples_for(:install_packages_on) do |platform,command,package| - - let(:package_hash) do - { - :redhat => ['rh_package'], - :debian => [['db_command', 'db_package']], - } - end - let(:additional_switches) { platform == 'debian' ? '--allow-unauthenticated' : nil } - - before do - logger = mock('logger', :notify => nil) - host.stubs(:logger).returns(logger) - host.config['platform'] = Platform.new(platform) - end - - it "installs packages on a host" do - host.expects(:check_for_package).never - host.expects(:install_package).with(package, additional_switches).once - testcase.install_packages_on(host, package_hash) - end - - it "checks and installs packages on a host" do - host.expects(:check_for_package).with(command).once - host.expects(:install_package).with(package, additional_switches).once - testcase.install_packages_on(host, package_hash, :check_if_exists => true) - end - end - - it_should_behave_like(:install_packages_on, 'fedora', 'rh_package', 'rh_package') - it_should_behave_like(:install_packages_on, 'debian', 'db_command', 'db_package') - end - - describe "fetch" do - before do - logger = stub('logger', :notify => nil) - testcase.stubs(:logger).returns(logger) - FileUtils.expects(:makedirs).with('dir') - end - - it "does not fetch if destination file already exists" do - File.expects(:exists?).with('dir/file').returns(true) - testcase.expects(:open).never - testcase.fetch('http://foo', 'file', 'dir') - end - - it "fetches file from url and stores in destination directory as filename" do - stream = mock('stream') - file = mock('file') - testcase.expects(:open).with('http://foo/file').yields(stream) - File.expects(:open).with('dir/file', 'w').yields(file) - FileUtils.expects(:copy_stream).with(stream, file) - testcase.fetch('http://foo', 'file', 'dir') - end - - it "returns path to destination file" do - testcase.expects(:open).with('http://foo/file') - expect(testcase.fetch('http://foo', 'file', 'dir')).to eql('dir/file') - end - end - - describe "fetch_remote_dir" do - before do - logger = stub('logger', {:notify => nil, :debug => nil}) - testcase.stubs(:logger).returns(logger) - end - - it "calls wget with the right amount of cut dirs for url that ends in '/'" do - url = 'http://builds.puppetlabs.lan/puppet/7807591405af849da2ad6534c66bd2d4efff604f/repos/el/6/devel/x86_64/' - testcase.expects(:`).with("wget -nv -P dir --reject \"index.html*\",\"*.gif\" --cut-dirs=6 -np -nH --no-check-certificate -r #{url} 2>&1").returns("log") - - expect( testcase.fetch_remote_dir(url, 'dir')).to eql('dir/x86_64') - end - - it "calls wget with the right amount of cut dirs for url that doesn't end in '/'" do - url = 'http://builds.puppetlabs.lan/puppet/7807591405af849da2ad6534c66bd2d4efff604f/repos/apt/wheezy' - testcase.expects(:`).with("wget -nv -P dir --reject \"index.html*\",\"*.gif\" --cut-dirs=4 -np -nH --no-check-certificate -r #{url}/ 2>&1").returns("log") - - expect( testcase.fetch_remote_dir(url, 'dir')).to eql('dir/wheezy') - end - - end - - shared_examples_for :redhat_platforms do |platform,sha,files| - before do - host.config['platform'] = Platform.new(platform) - end - - it "fetches and installs repo configurations for #{platform}" do - platform_configs_dir = "repo-configs/#{platform}" - - rpm_url = files[:rpm][0] - rpm_file = files[:rpm][1] - testcase.expects(:fetch).with( - "http://yum.puppetlabs.com", - rpm_file, - platform_configs_dir - ).returns("#{platform_configs_dir}/#{rpm_file}") - - repo_url = files[:repo][0] - repo_file = files[:repo][1] - testcase.expects(:fetch).with( - repo_url, - repo_file, - platform_configs_dir - ).returns("#{platform_configs_dir}/#{repo_file}") - - repo_dir_url = files[:repo_dir][0] - repo_dir = files[:repo_dir][1] - testcase.expects(:link_exists?).returns( true ) - testcase.expects(:fetch_remote_dir).with( - repo_dir_url, - platform_configs_dir - ).returns("#{platform_configs_dir}/#{repo_dir}") - testcase.expects(:link_exists?).returns( true ) - - testcase.expects(:on).with(host, regexp_matches(/rm.*repo; rm.*rpm; rm.*#{repo_dir}/)) - testcase.expects(:scp_to).with(host, "#{platform_configs_dir}/#{rpm_file}", '/root') - testcase.expects(:scp_to).with(host, "#{platform_configs_dir}/#{repo_file}", '/root') - testcase.expects(:scp_to).with(host, "#{platform_configs_dir}/#{repo_dir}", '/root') - testcase.expects(:on).with(host, regexp_matches(%r{mv.*repo /etc/yum.repos.d})) - testcase.expects(:on).with(host, regexp_matches(%r{find /etc/yum.repos.d/ -name .*})) - testcase.expects(:on).with(host, regexp_matches(%r{rpm.*/root/.*rpm})) - - testcase.install_repos_on(host, sha, 'repo-configs') - end - end - - describe "install_repos_on" do - let(:sha) { "abcdef10" } - - it_should_behave_like(:redhat_platforms, - 'el-6-i386', - 'abcdef10', - { - :rpm => [ - "http://yum.puppetlabs.com", - "puppetlabs-release-el-6.noarch.rpm", - ], - :repo => [ - "http://builds.puppetlabs.lan/puppet/abcdef10/repo_configs/rpm/", - "pl-puppet-abcdef10-el-6-i386.repo", - ], - :repo_dir => [ - "http://builds.puppetlabs.lan/puppet/abcdef10/repos/el/6/products/i386/", - "i386", - ], - }, - ) - - it_should_behave_like(:redhat_platforms, - 'fedora-20-x86_64', - 'abcdef10', - { - :rpm => [ - "http://yum.puppetlabs.com", - "puppetlabs-release-fedora-20.noarch.rpm", - ], - :repo => [ - "http://builds.puppetlabs.lan/puppet/abcdef10/repo_configs/rpm/", - "pl-puppet-abcdef10-fedora-f20-x86_64.repo", - ], - :repo_dir => [ - "http://builds.puppetlabs.lan/puppet/abcdef10/repos/fedora/f20/products/x86_64/", - "x86_64", - ], - }, - ) - - it_should_behave_like(:redhat_platforms, - 'centos-5-x86_64', - 'abcdef10', - { - :rpm => [ - "http://yum.puppetlabs.com", - "puppetlabs-release-el-5.noarch.rpm", - ], - :repo => [ - "http://builds.puppetlabs.lan/puppet/abcdef10/repo_configs/rpm/", - "pl-puppet-abcdef10-el-5-x86_64.repo", - ], - :repo_dir => [ - "http://builds.puppetlabs.lan/puppet/abcdef10/repos/el/5/products/x86_64/", - "x86_64", - ], - }, - ) - - it "installs on a debian host" do - host.config['platform'] = platform = Platform.new('ubuntu-precise-x86_64') - platform_configs_dir = "repo-configs/#{platform}" - - deb = "puppetlabs-release-precise.deb" - testcase.expects(:fetch).with( - "http://apt.puppetlabs.com/", - deb, - platform_configs_dir - ).returns("#{platform_configs_dir}/#{deb}") - - list = "pl-puppet-#{sha}-precise.list" - testcase.expects(:fetch).with( - "http://builds.puppetlabs.lan/puppet/#{sha}/repo_configs/deb/", - list, - platform_configs_dir - ).returns("#{platform_configs_dir}/#{list}") - - testcase.expects(:fetch_remote_dir).with( - "http://builds.puppetlabs.lan/puppet/#{sha}/repos/apt/precise", - platform_configs_dir - ).returns("#{platform_configs_dir}/precise") - - testcase.expects(:on).with(host, regexp_matches(/rm.*list; rm.*deb; rm.*/)) - testcase.expects(:scp_to).with(host, "#{platform_configs_dir}/#{deb}", '/root') - testcase.expects(:scp_to).with(host, "#{platform_configs_dir}/#{list}", '/root') - testcase.expects(:scp_to).with(host, "#{platform_configs_dir}/precise", '/root') - testcase.expects(:on).with(host, regexp_matches(%r{mv.*list /etc/apt/sources.list.d})) - testcase.expects(:on).with(host, regexp_matches(%r{find /etc/apt/sources.list.d/ -name .*})) - testcase.expects(:on).with(host, regexp_matches(%r{dpkg -i.*/root/.*deb})) - testcase.expects(:on).with(host, regexp_matches(%r{apt-get update})) - - testcase.install_repos_on(host, sha, 'repo-configs') - end - end -end -end diff --git a/acceptance/lib/puppet/acceptance/module_utils.rb b/acceptance/lib/puppet/acceptance/module_utils.rb deleted file mode 100644 index ac67998a8..000000000 --- a/acceptance/lib/puppet/acceptance/module_utils.rb +++ /dev/null @@ -1,228 +0,0 @@ -module Puppet - module Acceptance - module ModuleUtils - - # Return an array of paths to installed modules for a given host. - # - # Example return value: - # - # [ - # "/opt/puppet/share/puppet/modules/apt", - # "/opt/puppet/share/puppet/modules/auth_conf", - # "/opt/puppet/share/puppet/modules/concat", - # ] - # - # @param host [String] hostname - # @return [Array] paths for found modules - def get_installed_modules_for_host (host) - on host, puppet("module list --render-as pson") - str = stdout.lines.to_a.last - pat = /\(([^()]+)\)/ - mods = str.scan(pat).flatten - return mods - end - - # Return a hash of array of paths to installed modules for a hosts. - # The individual hostnames are the keys of the hash. The only value - # for a given key is an array of paths for the found modules. - # - # Example return value: - # - # { - # "my_master" => - # [ - # "/opt/puppet/share/puppet/modules/apt", - # "/opt/puppet/share/puppet/modules/auth_conf", - # "/opt/puppet/share/puppet/modules/concat", - # ], - # "my_agent01" => - # [ - # "/opt/puppet/share/puppet/modules/apt", - # "/opt/puppet/share/puppet/modules/auth_conf", - # "/opt/puppet/share/puppet/modules/concat", - # ], - # } - # - # @param hosts [Array] hostnames - # @return [Hash] paths for found modules indexed by hostname - def get_installed_modules_for_hosts (hosts) - mods = {} - hosts.each do |host| - mods[host] = get_installed_modules_for_host host - end - return mods - end - - # Compare the module paths in given hashes and remove paths that - # are were not present in the first hash. The use case for this - # method is to remove any modules that were installed during the - # course of a test run. - # - # Installed module hashes would be gathered using the - # `get_+installed_module_for_hosts` command in the setup stage - # and teardown stages of a test. These hashes would be passed into - # this method in order to find modules installed during the test - # and delete them in order to return the SUT environments to their - # initial state. - # - # TODO: Enhance to take versions into account, so that upgrade/ - # downgrade events during a test does not persist in the SUT - # environment. - # - # @param beginning_hash [Hash] paths for found modules indexed - # by hostname. Taken in the setup stage of a test. - # @param ending_hash [Hash] paths for found modules indexed - # by hostname. Taken in the teardown stage of a test. - def rm_installed_modules_from_hosts (beginning_hash, ending_hash) - ending_hash.each do |host, mod_array| - mod_array.each do |mod| - if ! beginning_hash[host].include? mod - on host, "rm -rf #{mod}" - end - end - end - end - - # Convert a semantic version number string to an integer. - # - # Example return value given an input of '1.2.42': - # - # 10242 - # - # @param semver [String] semantic version number - def semver_to_i ( semver ) - # semver assumed to be in format <major>.<minor>.<patch> - # calculation assumes that each segment is < 100 - tmp = semver.split('.') - tmp[0].to_i * 10000 + tmp[1].to_i * 100 + tmp[2].to_i - end - - # Compare two given semantic version numbers. - # - # Returns an integer indicating the relationship between the two: - # 0 indicates that both are equal - # a value greater than 0 indicates that the semver1 is greater than semver2 - # a value less than 0 indicates that the semver1 is less than semver2 - # - def semver_cmp ( semver1, semver2 ) - semver_to_i(semver1) - semver_to_i(semver2) - end - - # Assert that a module was installed according to the UI.. - # - # This is a wrapper to centralize the validation about how - # the UI responded that a module was installed. - # It is called after a call # to `on ( host )` and inspects - # STDOUT for specific content. - # - # @param stdout [String] - # @param module_author [String] the author portion of a module name - # @param module_name [String] the name portion of a module name - # @param module_verion [String] the version of the module to compare to - # installed version - # @param compare_op [String] the operator for comparing the verions of - # the installed module - def assert_module_installed_ui ( stdout, module_author, module_name, module_version = nil, compare_op = nil ) - valid_compare_ops = {'==' => 'equal to', '>' => 'greater than', '<' => 'less than'} - assert_match(/#{module_author}-#{module_name}/, stdout, - "Notice that module '#{module_author}-#{module_name}' was installed was not displayed") - if version - /#{module_author}-#{module_name} \(.*v(\d+\.\d+\.\d+)/ =~ stdout - installed_version = Regexp.last_match[1] - if valid_compare_ops.include? compare_op - assert_equal( true, semver_cmp(installed_version, module_version).send(compare_op, 0), - "Installed version '#{installed_version}' of '#{module_name}' was not #{valid_compare_ops[compare_op]} '#{module_version}'") - end - end - end - - # Assert that a module is installed on disk. - # - # @param host [HOST] the host object to make the remote call on - # @param moduledir [String] the path where the module should be - # @param module_name [String] the name portion of a module name - def assert_module_installed_on_disk ( host, moduledir, module_name ) - # module directory should exist - on host, %Q{[ -d "#{moduledir}/#{module_name}" ]} - - owner = '' - group = '' - on host, %Q{ls -ld "#{moduledir}"} do - listing = stdout.split(' ') - owner = listing[2] - group = listing[3] - end - - # A module's files should have: - # * a mode of 444 (755, if they're a directory) - # * owner == owner of moduledir - # * group == group of moduledir - on host, %Q{ls -alR "#{moduledir}/#{module_name}"} do - listings = stdout.split("\n") - listings = listings.grep(/^[bcdlsp-]/) - listings = listings.reject { |l| l =~ /\.\.$/ } - - listings.each do |line| - assert_match /(drwxr-xr-x|[^d]r--r--r--)[^\d]+\d+\s+#{owner}\s+#{group}/, line, - "bad permissions for '#{line[/\S+$/]}' - expected 444/755, #{owner}, #{group}" - end - end - end - - # Assert that a module is not installed on disk. - # - # @param host [HOST] the host object to make the remote call on - # @param moduledir [String] the path where the module should be - # @param module_name [String] the name portion of a module name - def assert_module_not_installed_on_disk ( host, moduledir, module_name ) - on host, %Q{[ ! -d "#{moduledir}/#{module_name}" ]} - end - - # Create a simple legacy and directory environment at :path_to_environments. - # - # @note Also registers a teardown block to remove generated files. - # - # @param path_to_environments [String] directory to contain all the - # generated environment files - # @return [String] path to the new puppet configuration file defining the - # environments - def generate_base_legacy_and_directory_environments(path_to_environments) - puppet_conf = "#{path_to_environments}/puppet2.conf" - legacy_env = "#{path_to_environments}/legacyenv" - dir_envs = "#{path_to_environments}/environments" - - step "ensure we don't have left over bad state from another, possibly failed run" - on master, "rm -rf #{legacy_env} #{dir_envs} #{puppet_conf}" - - # and register to clean up afterwords - teardown do - on master, "rm -rf #{legacy_env} #{dir_envs} #{puppet_conf}" - end - - step 'Configure a non-default legacy and directory environment' - apply_manifest_on master, %Q{ - file { - [ - '#{legacy_env}', - '#{legacy_env}/modules', - '#{dir_envs}', - '#{dir_envs}/direnv', - ]: - ensure => directory, - } - file { - '#{puppet_conf}': - source => $settings::config, - } - } - - on master, puppet("config", "set", - "modulepath", "#{legacy_env}/modules", - "--section", "legacyenv", - "--config", puppet_conf) - - return puppet_conf - end - end - end -end diff --git a/acceptance/lib/puppet/acceptance/solaris_util.rb b/acceptance/lib/puppet/acceptance/solaris_util.rb deleted file mode 100644 index 5467fd888..000000000 --- a/acceptance/lib/puppet/acceptance/solaris_util.rb +++ /dev/null @@ -1,187 +0,0 @@ -module Puppet - module Acceptance - module ZoneUtils - def clean(agent) - lst = on(agent, "zoneadm list -cip").stdout.lines.each do |l| - case l - when /tstzone:running/ - on agent,"zoneadm -z tstzone halt" - on agent,"zoneadm -z tstzone uninstall -F" - on agent,"zonecfg -z tstzone delete -F" - on agent,"rm -f /etc/zones/tstzone.xml" - when /tstzone:configured/ - on agent,"zonecfg -z tstzone delete -F" - on agent,"rm -f /etc/zones/tstzone.xml" - when /tstzone:*/ - on agent,"zonecfg -z tstzone delete -F" - on agent,"rm -f /etc/zones/tstzone.xml" - end - end - lst = on(agent, "zfs list").stdout.lines.each do |l| - case l - when /rpool.tstzones/ - on agent,"zfs destroy -r rpool/tstzones" - end - end - on agent, "rm -rf /tstzones" - end - - def setup(agent, o={}) - o = {:size => '64m'}.merge(o) - end - end - module IPSUtils - def clean(agent, o={}) - o = {:repo => '/var/tstrepo', :pkg => 'mypkg', :publisher => 'tstpub.lan'}.merge(o) - on agent, "rm -rf %s||:" % o[:repo] - on agent, "rm -rf /tst||:" - on agent, "pkg uninstall %s||:" % o[:pkg] - on agent, "pkg unset-publisher %s ||:" % o[:publisher] - end - def setup(agent, o={}) - o = {:repo => '/var/tstrepo', :publisher => 'tstpub.lan'}.merge(o) - on agent, "mkdir -p %s" % o[:repo] - on agent, "pkgrepo create %s" % o[:repo] - on agent, "pkgrepo set -s %s publisher/prefix=%s" % [o[:repo], o[:publisher]] - on agent, "pkgrepo -s %s refresh" % o[:repo] - end - def setup_fakeroot(agent, o={}) - o = {:root=>'/opt/fakeroot'}.merge(o) - on agent, "rm -rf %s" % o[:root] - on agent, "mkdir -p %s/tst/usr/bin" % o[:root] - on agent, "mkdir -p %s/tst/etc" % o[:root] - on agent, "echo dummy > %s/tst/usr/bin/x" % o[:root] - on agent, "echo val > %s/tst/etc/y" % o[:root] - end - def setup_fakeroot2(agent, o={}) - o = {:root=>'/opt/fakeroot'}.merge(o) - on agent, "rm -rf %s" % o[:root] - on agent, "mkdir -p %s/tst2/usr/bin" % o[:root] - on agent, "mkdir -p %s/tst2/etc" % o[:root] - on agent, "echo dummy > %s/tst2/usr/bin/x" % o[:root] - on agent, "echo val > %s/tst2/etc/y" % o[:root] - end - def send_pkg2(agent, o={}) - o = {:repo=>'/var/tstrepo', :root=>'/opt/fakeroot', :publisher=>'tstpub.lan', :pkg=>'mypkg2@0.0.1', :pkgdep => 'mypkg@0.0.1'}.merge(o) - on agent, "(pkgsend generate %s; echo set name=pkg.fmri value=pkg://%s/%s)> /tmp/%s.p5m" % [o[:root], o[:publisher], o[:pkg], o[:pkg]] - on agent, "echo depend type=require fmri=%s >> /tmp/%s.p5m" % [o[:pkgdep], o[:pkg]] - on agent, "pkgsend publish -d %s -s %s /tmp/%s.p5m" % [o[:root], o[:repo], o[:pkg]] - on agent, "pkgrepo refresh -p %s -s %s" % [o[:publisher], o[:repo]] - on agent, "pkg refresh" - on agent, "pkg list -g %s" % o[:repo] - end - - def send_pkg(agent, o={}) - o = {:repo=>'/var/tstrepo', :root=>'/opt/fakeroot', :publisher=>'tstpub.lan', :pkg=>'mypkg@0.0.1'}.merge(o) - on agent, "(pkgsend generate %s; echo set name=pkg.fmri value=pkg://%s/%s)> /tmp/%s.p5m" % [o[:root], o[:publisher], o[:pkg], o[:pkg]] - on agent, "pkgsend publish -d %s -s %s /tmp/%s.p5m" % [o[:root], o[:repo], o[:pkg]] - on agent, "pkgrepo refresh -p %s -s %s" % [o[:publisher], o[:repo]] - on agent, "pkg refresh" - end - def set_publisher(agent, o={}) - o = {:repo=>'/var/tstrepo', :publisher=>'tstpub.lan'}.merge(o) - on agent, "pkg set-publisher -g %s %s" % [o[:repo], o[:publisher]] - on agent, "pkg refresh" - end - end - module SMFUtils - def clean(agent, o={}) - o = {:service => 'tstapp'}.merge(o) - on agent, "svcadm disable %s ||:" % o[:service] - on agent, "svccfg delete %s ||:" % o[:service] - on agent, "rm -rf /var/svc/manifest/application/%s.xml ||:" % o[:service] - on agent, "rm -f /opt/bin/%s ||:" % o[:service] - end - def setup(agent, o={}) - setup_methodscript(agent, o) - end - - def setup_methodscript(agent, o={}) - o = {:service => 'tstapp'}.merge(o) - on agent, "mkdir -p /opt/bin" - create_remote_file agent, '/lib/svc/method/%s' % o[:service], %[ -#!/usr/bin/sh -. /lib/svc/share/smf_include.sh -case "$1" in - start) /opt/bin/%s ;; - stop) - ctid=`svcprop -p restarter/contract $SMF_FMRI` - if [ -n "$ctid" ]; then - smf_kill_contract $ctid TERM - fi - ;; - *) echo "Usage: $0 { start | stop }" ; exit 1 ;; -esac -exit $SMF_EXIT_OK - ] % ([o[:service]] * 4) - create_remote_file agent, ('/opt/bin/%s' % o[:service]), %[ -#!/usr/bin/sh -cleanup() { - rm -f /tmp/%s.pidfile; exit 0 -} - -trap cleanup INT TERM -trap '' HUP -(while :; do sleep 1; done) & echo $! > /tmp/%s.pidfile - ] % ([o[:service]] * 2) - on agent, "chmod 755 /lib/svc/method/%s" % o[:service] - on agent, "chmod 755 /opt/bin/%s" % o[:service] - on agent, "mkdir -p /var/svc/manifest/application" - create_remote_file agent, ('/var/smf-%s.xml' % o[:service]), -%[<?xml version="1.0"?> -<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> -<service_bundle type='manifest' name='%s:default'> - <service name='application/tstapp' type='service' version='1'> - <create_default_instance enabled='false' /> - <single_instance /> - <method_context> <method_credential user='root' group='root' /> </method_context> - <exec_method type='method' name='start' exec='/lib/svc/method/%s start' timeout_seconds="60" /> - <exec_method type='method' name='stop' exec='/lib/svc/method/%s stop' timeout_seconds="60" /> - <exec_method type='method' name='refresh' exec='/lib/svc/method/%s refresh' timeout_seconds="60" /> - <stability value='Unstable' /> - <template> - <common_name> <loctext xml:lang='C'>Dummy</loctext> </common_name> - <documentation> - <manpage title='tstapp' section='1m' manpath='/usr/share/man' /> - </documentation> - </template> -</service> -</service_bundle> - ] % ([o[:service]] * 4) - on agent, "svccfg -v validate /var/smf-%s.xml" % o[:service] - on agent, "echo > /var/svc/log/application-%s:default.log" % o[:service] - return ("/var/smf-%s.xml" % o[:service]), ("/lib/svc/method/%s" % o[:service]) - end - end - module ZFSUtils - def clean(agent, o={}) - o = {:fs=>'tstfs', :pool=>'tstpool', :poolpath => '/ztstpool'}.merge(o) - on agent, "zfs destroy -r %s/%s ||:" % [o[:pool], o[:fs]] - on agent, "zpool destroy %s ||:" % o[:pool] - on agent, "rm -rf %s ||:" % o[:poolpath] - end - - def setup(agent, o={}) - o = {:poolpath=>'/ztstpool', :pool => 'tstpool'}.merge(o) - on agent, "mkdir -p %s/mnt" % o[:poolpath] - on agent, "mkdir -p %s/mnt2" % o[:poolpath] - on agent, "mkfile 64m %s/dsk" % o[:poolpath] - on agent, "zpool create %s %s/dsk" % [ o[:pool], o[:poolpath]] - end - end - module ZPoolUtils - def clean(agent, o={}) - o = {:pool=>'tstpool', :poolpath => '/ztstpool'}.merge(o) - on agent, "zpool destroy %s ||:" % o[:pool] - on agent, "rm -rf %s ||:" % o[:poolpath] - end - - def setup(agent, o={}) - o = {:poolpath => '/ztstpool'}.merge(o) - on agent, "mkdir -p %s/mnt||:" % o[:poolpath] - on agent, "mkfile 100m %s/dsk1 %s/dsk2 %s/dsk3 %s/dsk5 ||:" % ([o[:poolpath]] * 4) - on agent, "mkfile 50m %s/dsk4 ||:" % o[:poolpath] - end - end - end -end diff --git a/acceptance/lib/puppet/acceptance/temp_file_utils.rb b/acceptance/lib/puppet/acceptance/temp_file_utils.rb deleted file mode 100644 index b5fed5262..000000000 --- a/acceptance/lib/puppet/acceptance/temp_file_utils.rb +++ /dev/null @@ -1,113 +0,0 @@ -module Puppet - module Acceptance - module TempFileUtils - - # Create a file on the host. - # Parameters: - # [host] the host to create the file on - # [file_path] the path to the file to be created - # [file_content] a string containing the contents to be written to the file - # [options] a hash containing additional behavior options. Currently supported: - # * :mkdirs (default false) if true, attempt to create the parent directories on the remote host before writing - # the file - # * :owner (default 'root') the username of the user that the file should be owned by - # * :group (default 'puppet') the name of the group that the file should be owned by - # * :mode (default '644') the mode (file permissions) that the file should be created with - def create_test_file(host, file_rel_path, file_content, options = {}) - - # set default options - options[:mkdirs] ||= false - options[:owner] ||= host['user'] - options[:group] ||= host['group'] - options[:mode] ||= "755" - - file_path = get_test_file_path(host, file_rel_path) - - mkdirs(host, File.dirname(file_path)) if (options[:mkdirs] == true) - create_remote_file(host, file_path, file_content) - - # - # NOTE: we need these chown/chmod calls because the acceptance framework connects to the nodes as "root", but - # puppet 'master' runs as user 'puppet'. Therefore, in order for puppet master to be able to read any files - # that we've created, we have to carefully set their permissions - # - - chown(host, options[:owner], options[:group], file_path) - chmod(host, options[:mode], file_path) - - end - - - # Given a relative path, returns an absolute path for a test file. Basically, this just prepends the - # a unique temp dir path (specific to the current test execution) to your relative path. - def get_test_file_path(host, file_rel_path) - File.join(@host_test_tmp_dirs[host.name], file_rel_path) - end - - - # Check for the existence of a temp file for the current test; basically, this just calls file_exists?(), - # but prepends the path to the current test's temp dir onto the file_rel_path parameter. This allows - # tests to be written using only a relative path to specify file locations, while still taking advantage - # of automatic temp file cleanup at test completion. - def test_file_exists?(host, file_rel_path) - file_exists?(host, get_test_file_path(host, file_rel_path)) - end - - def file_exists?(host, file_path) - host.execute("test -f \"#{file_path}\"", - :acceptable_exit_codes => [0, 1]) do |result| - return result.exit_code == 0 - end - end - - def file_contents(host, file_path) - host.execute("cat \"#{file_path}\"") do |result| - return result.stdout - end - end - - def tmpdir(host, basename) - host_tmpdir = host.tmpdir(basename) - # we need to make sure that the puppet user can traverse this directory... - chmod(host, "755", host_tmpdir) - host_tmpdir - end - - def mkdirs(host, dir_path) - on(host, "mkdir -p #{dir_path}") - end - - def chown(host, owner, group, path) - on(host, "chown #{owner}:#{group} #{path}") - end - - def chmod(host, mode, path) - on(host, "chmod #{mode} #{path}") - end - - - def initialize_temp_dirs() - # pluck this out of the test case environment; not sure if there is a better way - @cur_test_file = @path - @cur_test_file_shortname = File.basename(@cur_test_file, File.extname(@cur_test_file)) - - # we need one list of all of the hosts, to assist in managing temp dirs. It's possible - # that the master is also an agent, so this will consolidate them into a unique set - @all_hosts = Set[master, *agents] - - # now we can create a hash of temp dirs--one per host, and unique to this test--without worrying about - # doing it twice on any individual host - @host_test_tmp_dirs = Hash[@all_hosts.map do |host| [host.name, tmpdir(host, @cur_test_file_shortname)] end ] - end - - def remove_temp_dirs() - @all_hosts.each do |host| - on(host, "rm -rf #{@host_test_tmp_dirs[host.name]}") - end - end - - # a silly variable for keeping track of whether or not all of the tests passed... - @all_tests_passed = false - end - end -end diff --git a/acceptance/lib/puppet/acceptance/windows_utils.rb b/acceptance/lib/puppet/acceptance/windows_utils.rb deleted file mode 100644 index c16f64d74..000000000 --- a/acceptance/lib/puppet/acceptance/windows_utils.rb +++ /dev/null @@ -1,25 +0,0 @@ -module Puppet - module Acceptance - module WindowsUtils - def profile_base(agent) - getbasedir = <<'END' -require 'win32/dir' -puts Dir::PROFILE.match(/(.*)\\\\[^\\\\]*/)[1] -END - on(agent, "#{ruby_cmd(agent)} -rubygems -e \"#{getbasedir}\"").stdout.chomp - end - - # ruby for Windows on a PE install lives in <path to Puppet Enterprise>/sys/ruby/bin/ruby.exe - # However, FOSS can just use "ruby". - def ruby_cmd(agent) - if options[:type] =~ /pe/ - pre_env = agent['puppetbindir'] ? "env PATH=\"#{agent['puppetbindir']}:#{agent['puppetbindir']}/../sys/ruby/bin/:${PATH}\"" : '' - "#{pre_env} ruby.exe" - else - 'ruby' - end - end - - end - end -end diff --git a/acceptance/lib/puppet_x/acceptance/external_cert_fixtures.rb b/acceptance/lib/puppet_x/acceptance/external_cert_fixtures.rb deleted file mode 100644 index 7eadc7426..000000000 --- a/acceptance/lib/puppet_x/acceptance/external_cert_fixtures.rb +++ /dev/null @@ -1,324 +0,0 @@ -module PuppetX -module Acceptance -class ExternalCertFixtures - attr_reader :fixture_dir - attr_reader :test_dir - attr_reader :master_name - attr_reader :agent_name - - ## - # ExternalCerts provides a utility class to fill in fixture data and other - # large blobs of text configuration for the acceptance testing of External CA - # behavior. - # - # @param [String] fixture_dir The fixture directory to read from. - # - # @param [String] test_dir The directory on the remote system, used for - # filling in templates. - # - # @param [String] master_name The common name the master should be reachable - # at. This name should match up with the certificate files in the fixture - # directory, e.g. master1.example.org. - # - # @param [String] agent_name The common name the agent is configured to use. - # This name should match up with the certificate files in the fixture - # directory, e.g. - def initialize(fixture_dir, test_dir, master_name = "master1.example.org", agent_name = "agent1.example.org") - @fixture_dir = fixture_dir - @test_dir = test_dir - @master_name = master_name - @agent_name = agent_name - end - - def master_short_name - @master_short_name ||= master_name.gsub(/\..*/, '') - end - - def host_entry - @host_entry ||= "127.0.0.3 #{master_name} #{master_short_name} puppet\n" - end - - def root_ca_cert - @root_ca_cert ||= File.read(File.join(fixture_dir, 'root', 'ca-root.crt')) - end - - def agent_ca_cert - @agent_ca_cert ||= File.read(File.join(fixture_dir, 'agent-ca', 'ca-agent-ca.crt')) - end - - def master_ca_cert - @master_ca_cert ||= File.read(File.join(fixture_dir, 'master-ca', 'ca-master-ca.crt')) - end - - def master_ca_crl - @master_ca_crl ||= File.read(File.join(fixture_dir, 'master-ca', 'ca-master-ca.crl')) - end - - def agent_cert - @agent_cert ||= File.read(File.join(fixture_dir, 'leaves', "#{agent_name}.issued_by.agent-ca.crt")) - end - - def agent_key - @agent_key ||= File.read(File.join(fixture_dir, 'leaves', "#{agent_name}.issued_by.agent-ca.key")) - end - - def agent_email_cert - @agent_email_cert ||= File.read(File.join(fixture_dir, 'leaves', "#{agent_name}.email.issued_by.agent-ca.crt")) - end - - def agent_email_key - @agent_email_cert ||= File.read(File.join(fixture_dir, 'leaves', "#{agent_name}.email.issued_by.agent-ca.key")) - end - - def master_cert - @master_cert ||= File.read(File.join(fixture_dir, 'leaves', "#{master_name}.issued_by.master-ca.crt")) - end - - def master_key - @master_key ||= File.read(File.join(fixture_dir, 'leaves', "#{master_name}.issued_by.master-ca.key")) - end - - def master_cert_rogue - @master_cert_rogue ||= File.read(File.join(fixture_dir, 'leaves', "#{master_name}.issued_by.agent-ca.crt")) - end - - def master_key_rogue - @master_key_rogue ||= File.read(File.join(fixture_dir, 'leaves', "#{master_name}.issued_by.agent-ca.key")) - end - - ## Configuration files - def agent_conf - @agent_conf ||= <<-EO_AGENT_CONF -[main] -color = false -certname = #{agent_name} -server = #{master_name} -certificate_revocation = false - -# localcacert must contain the Root CA certificate to complete the 2 level CA -# chain when an intermediate CA certificate is being used. Either the HTTP -# server must send the intermediate certificate during the handshake, or the -# agent must use the `ssl_client_ca_auth` setting to provide the client -# certificate. -localcacert = #{test_dir}/ca_root.crt -EO_AGENT_CONF - end - - def agent_conf_email - @agent_conf ||= <<-EO_AGENT_CONF -[main] -color = false -certname = #{agent_name} -server = #{master_name} -certificate_revocation = false -hostcert = #{test_dir}/agent_email.crt -hostkey = #{test_dir}/agent_email.key -localcacert = #{test_dir}/ca_root.crt -EO_AGENT_CONF - end - - def agent_conf_crl - @agent_conf_crl ||= <<-EO_AGENT_CONF -[main] -certname = #{agent_name} -server = #{master_name} - -# localcacert must contain the Root CA certificate to complete the 2 level CA -# chain when an intermediate CA certificate is being used. Either the HTTP -# server must send the intermediate certificate during the handshake, or the -# agent must use the `ssl_client_ca_auth` setting to provide the client -# certificate. -localcacert = #{test_dir}/ca_root.crt -EO_AGENT_CONF - end - - def master_conf - @master_conf ||= <<-EO_MASTER_CONF -[master] -ca = false -certname = #{master_name} -ssl_client_header = HTTP_X_CLIENT_DN -ssl_client_verify_header = HTTP_X_CLIENT_VERIFY -EO_MASTER_CONF - end - - ## - # Passenger Rack compliant config.ru which is responsible for starting the - # Puppet master. - def config_ru - @config_ru ||= <<-EO_CONFIG_RU -\$0 = "master" -ARGV << "--rack" -ARGV << "--confdir=#{test_dir}/etc/master" -ARGV << "--vardir=#{test_dir}/etc/master/var" -require 'puppet/util/command_line' -run Puppet::Util::CommandLine.new.execute -EO_CONFIG_RU - end - - ## - # auth_conf should return auth authorization file that allows *.example.org - # access to to the full REST API. - def auth_conf - @auth_conf_content ||= File.read(File.join(fixture_dir, 'auth.conf')) - end - - ## - # Apache configuration with Passenger - def httpd_conf - @httpd_conf ||= <<-EO_HTTPD_CONF -User apache -Group apache - -ServerRoot "/etc/httpd" -PidFile run/httpd.pid -Timeout 60 -KeepAlive Off -MaxKeepAliveRequests 100 -KeepAliveTimeout 15 - -<IfModule prefork.c> -StartServers 8 -MinSpareServers 5 -MaxSpareServers 20 -ServerLimit 256 -MaxClients 256 -MaxRequestsPerChild 4000 -</IfModule> - -<IfModule worker.c> -StartServers 4 -MaxClients 300 -MinSpareThreads 25 -MaxSpareThreads 75 -ThreadsPerChild 25 -MaxRequestsPerChild 0 -</IfModule> - -LoadModule auth_basic_module modules/mod_auth_basic.so -LoadModule auth_digest_module modules/mod_auth_digest.so -LoadModule authn_file_module modules/mod_authn_file.so -LoadModule authn_alias_module modules/mod_authn_alias.so -LoadModule authn_anon_module modules/mod_authn_anon.so -LoadModule authn_dbm_module modules/mod_authn_dbm.so -LoadModule authn_default_module modules/mod_authn_default.so -LoadModule authz_host_module modules/mod_authz_host.so -LoadModule authz_user_module modules/mod_authz_user.so -LoadModule authz_owner_module modules/mod_authz_owner.so -LoadModule authz_groupfile_module modules/mod_authz_groupfile.so -LoadModule authz_dbm_module modules/mod_authz_dbm.so -LoadModule authz_default_module modules/mod_authz_default.so -LoadModule ldap_module modules/mod_ldap.so -LoadModule authnz_ldap_module modules/mod_authnz_ldap.so -LoadModule include_module modules/mod_include.so -LoadModule log_config_module modules/mod_log_config.so -LoadModule logio_module modules/mod_logio.so -LoadModule env_module modules/mod_env.so -LoadModule ext_filter_module modules/mod_ext_filter.so -LoadModule mime_magic_module modules/mod_mime_magic.so -LoadModule expires_module modules/mod_expires.so -LoadModule deflate_module modules/mod_deflate.so -LoadModule headers_module modules/mod_headers.so -LoadModule usertrack_module modules/mod_usertrack.so -LoadModule setenvif_module modules/mod_setenvif.so -LoadModule mime_module modules/mod_mime.so -LoadModule dav_module modules/mod_dav.so -LoadModule status_module modules/mod_status.so -LoadModule autoindex_module modules/mod_autoindex.so -LoadModule info_module modules/mod_info.so -LoadModule dav_fs_module modules/mod_dav_fs.so -LoadModule vhost_alias_module modules/mod_vhost_alias.so -LoadModule negotiation_module modules/mod_negotiation.so -LoadModule dir_module modules/mod_dir.so -LoadModule actions_module modules/mod_actions.so -LoadModule speling_module modules/mod_speling.so -LoadModule userdir_module modules/mod_userdir.so -LoadModule alias_module modules/mod_alias.so -LoadModule substitute_module modules/mod_substitute.so -LoadModule rewrite_module modules/mod_rewrite.so -LoadModule proxy_module modules/mod_proxy.so -LoadModule proxy_balancer_module modules/mod_proxy_balancer.so -LoadModule proxy_ftp_module modules/mod_proxy_ftp.so -LoadModule proxy_http_module modules/mod_proxy_http.so -LoadModule proxy_ajp_module modules/mod_proxy_ajp.so -LoadModule proxy_connect_module modules/mod_proxy_connect.so -LoadModule cache_module modules/mod_cache.so -LoadModule suexec_module modules/mod_suexec.so -LoadModule disk_cache_module modules/mod_disk_cache.so -LoadModule cgi_module modules/mod_cgi.so -LoadModule version_module modules/mod_version.so - -LoadModule ssl_module modules/mod_ssl.so -LoadModule passenger_module modules/mod_passenger.so - -ServerName #{master_name} -DocumentRoot "#{test_dir}/etc/master/public" - -DefaultType text/plain -TypesConfig /etc/mime.types - -# Same thing, just using a certificate issued by the Agent CA, which should not -# be trusted by the clients. - -Listen 8140 https -Listen 8141 https - -<VirtualHost _default_:8140> - SSLEngine on - SSLProtocol ALL -SSLv2 - SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP - - SSLCertificateFile "#{test_dir}/master.crt" - SSLCertificateKeyFile "#{test_dir}/master.key" - - # The chain file is sent to the client during handshake. - SSLCertificateChainFile "#{test_dir}/ca_master_bundle.crt" - # The CA cert file is used to authenticate clients - SSLCACertificateFile "#{test_dir}/ca_agent_bundle.crt" - - SSLVerifyClient optional - SSLVerifyDepth 2 - SSLOptions +StdEnvVars - RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e - RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e - RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e - - DocumentRoot "#{test_dir}/etc/master/public" - - PassengerRoot /usr/share/gems/gems/passenger-3.0.17 - PassengerRuby /usr/bin/ruby - - RackAutoDetect On - RackBaseURI / -</VirtualHost> - -<VirtualHost _default_:8141> - SSLEngine on - SSLProtocol ALL -SSLv2 - SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP - SSLCertificateFile "#{test_dir}/master_rogue.crt" - SSLCertificateKeyFile "#{test_dir}/master_rogue.key" - - SSLCertificateChainFile "#{test_dir}/ca_agent_bundle.crt" - SSLCACertificateFile "#{test_dir}/ca_agent_bundle.crt" - - SSLVerifyClient optional - SSLVerifyDepth 2 - SSLOptions +StdEnvVars - RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e - RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e - RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e - - DocumentRoot "#{test_dir}/etc/master/public" - - PassengerRoot /usr/share/gems/gems/passenger-3.0.17 - PassengerRuby /usr/bin/ruby - - RackAutoDetect On - RackBaseURI / -</VirtualHost> -EO_HTTPD_CONF - end -end -end -end diff --git a/acceptance/pending/ticket_11860_exec_should_not_override_locale.rb b/acceptance/pending/ticket_11860_exec_should_not_override_locale.rb deleted file mode 100644 index 1ff1a3027..000000000 --- a/acceptance/pending/ticket_11860_exec_should_not_override_locale.rb +++ /dev/null @@ -1,80 +0,0 @@ -test_name "#11860: exec resources should not override system locale" - -####################################################################################### -# NOTE -####################################################################################### -# -# This test won't run properly until the test agent nodes have the Spanish language -# pack installed on them. On an ubuntu system, this can be done with the following: -# -# apt-get install language-pack-es-base -# -# Also, this test depends on the following pull requests: -# -# https://github.com/puppetlabs/puppet-acceptance/pull/123 -# https://github.com/puppetlabs/facter/pull/159 -# -####################################################################################### - -temp_file_name = "/tmp/11860_exec_should_not_override_locale.txt" -locale_string = "es_ES.UTF-8" - - -step "Check value of LANG environment variable" - -# in this step we are going to run an "exec" block that writes the value of the LANG -# environment variable to a file. We need to verify that exec's are no longer -# forcefully setting this var to 'C'. - - -test_LANG_manifest = <<HERE -exec {"es_ES locale print LANG environment variable": - command => "/usr/bin/printenv LANG > #{temp_file_name}", -} -HERE - -# apply the manifest. -# -# note that we are passing in an extra :environment argument, which will cause the -# framework to temporarily set this variable before executing the puppet command. -# this lets us know what value we should be looking for as the output of the exec. - -apply_manifest_on agents, test_LANG_manifest, :environment => {:LANG => locale_string} - -# cat the temp file and make sure it contained the correct value. -on(agents, "cat #{temp_file_name}").each do |result| - assert_equal(locale_string, "#{result.stdout.chomp}", "Unexpected result for host '#{result.host}'") -end - - - -step "Check for locale-specific output of cat command" - -# in this step we are going to run an "exec" block that runs the "cat" command. The command -# is intentionally invalid, because we are going to run it using a non-standard locale and -# we want to confirm that the error message is in the correct language. - -test_cat_manifest = <<HERE -exec {"es_ES locale invalid cat command": - command => "/bin/cat SOME_FILE_THAT_DOESNT_EXIST > #{temp_file_name} 2>&1", - returns => 1, -} -HERE - -# apply the manifest, again passing in the extra :environment argument to set our locale. -apply_manifest_on agents, test_cat_manifest, :environment => {:LANG => locale_string} - -# cat the output file and ensure that the error message is in spanish -on(agents, "cat #{temp_file_name}").each do |result| - assert_equal("/bin/cat: SOME_FILE_THAT_DOESNT_EXIST: No existe el fichero o el directorio", - "#{result.stdout.chomp}", "Unexpected result for host '#{result.host}'") -end - - -step "cleanup" - -# remove the temp file -on agents, "rm -f #{temp_file_name}" - - - diff --git a/acceptance/pending/ticket_4149_parseonly_should_not_fail.rb b/acceptance/pending/ticket_4149_parseonly_should_not_fail.rb deleted file mode 100644 index 228dec307..000000000 --- a/acceptance/pending/ticket_4149_parseonly_should_not_fail.rb +++ /dev/null @@ -1,18 +0,0 @@ -test_name "#4149: parseonly should do the right thing" - -step "test with a manifest with syntax errors" -manifest = 'class someclass { notify { "hello, world" } }' -apply_manifest_on(agents, manifest, :parseonly => true, :acceptable_exit_codes => [1]) { - stdout =~ /Could not parse for .*: Syntax error/ or - fail_test("didn't get a reported systax error") -} - -step "test with a manifest with correct syntax" -apply_manifest_on agents,'class someclass { notify("hello, world") }', :parseonly => true - -# REVISIT: This tests the current behaviour, which is IMO not actually the -# correct behaviour. On the other hand, if we change this we might -# unexpectedly break things out in the wild, so better to be warned than to be -# surprised by it. --daniel 2010-12-22 -step "test with a class with an invalid attribute" -apply_manifest_on agents, 'file { "/tmp/whatever": fooble => 1 }', :parseonly => true diff --git a/acceptance/pending/ticket_4151_defined_function_should_not_return_true_for_unrealized_virtual_resources.rb b/acceptance/pending/ticket_4151_defined_function_should_not_return_true_for_unrealized_virtual_resources.rb deleted file mode 100644 index 2da392a62..000000000 --- a/acceptance/pending/ticket_4151_defined_function_should_not_return_true_for_unrealized_virtual_resources.rb +++ /dev/null @@ -1,24 +0,0 @@ -test_name "#4151: defined function should not return true for unrealized virtual resources" - -# Jeff McCune <jeff@puppetlabs.com> -# 2010-07-06 -# -# This script is expected to exit non-zero if ticket 4151 has not been -# fixed. -# -# The expected behavior is for defined() to only return true if a virtual -# resource has been realized. -# -# This test creates a virtual resource, does NOT realize it, then calls -# the defined() function against it. If defined returns true, there will -# be an error since Notify["goodbye"] will require a resource which has -# not been realized. - - -manifest1 = %q{ - @notify { "hello": } - if (defined(Notify["hello"])) { $requires = [ Notify["hello"] ] } - notify { "goodbye": require => $requires } -} - -apply_manifest_on(agents, manifest1) diff --git a/acceptance/pending/ticket_5027_warn_on_dynamic_scope.rb b/acceptance/pending/ticket_5027_warn_on_dynamic_scope.rb deleted file mode 100644 index 762116ce9..000000000 --- a/acceptance/pending/ticket_5027_warn_on_dynamic_scope.rb +++ /dev/null @@ -1,28 +0,0 @@ -test_name "#5027: Issue warnings when using dynamic scope" - -step "Apply dynamic scoping manifest on agents" -apply_manifest_on agents, %q{ - $foo = 'foo_value' - - class a { - $bar = 'bar_value' - - include b - } - - class b inherits c { - notify { $baz: } # should not generate a warning -- inherited from class c - notify { $bar: } # should generate a warning -- uses dynamic scoping - notify { $foo: } # should not generate a warning -- comes from top scope - } - - class c { - $baz = 'baz_value' - } - - include a -} - -step "Verify deprecation warning" -fail_test "Deprecation warning not issued" unless - stdout.include? 'warning: Dynamic lookup of $bar will not be supported in future versions. Use a fully-qualified variable name or parameterized classes.' diff --git a/acceptance/pending/ticket_5224_exec_should_unset_user_env_vars.rb b/acceptance/pending/ticket_5224_exec_should_unset_user_env_vars.rb deleted file mode 100644 index 8f7d8214d..000000000 --- a/acceptance/pending/ticket_5224_exec_should_unset_user_env_vars.rb +++ /dev/null @@ -1,109 +0,0 @@ -test_name "#5224: exec resources should unset user-related environment variables" - -####################################################################################### -# NOTE -####################################################################################### -# -# This test depends on the following pull requests: -# -# https://github.com/puppetlabs/puppet-acceptance/pull/123 -# -# because it needs to be able to set some environment variables for the duration of -# the puppet commands. Shouldn't be moved out of 'pending' until after that has been -# merged. -# -####################################################################################### - - -temp_file_name = "/tmp/5224_exec_should_unset_user_env_vars.txt" -sentinel_string = "Abracadabra" - - -# these should match up with the value of Puppet::Util::POSIX_USER_ENV_VARS, -# but I don't have access to that from here, so this is unfortunately hard-coded -# (cprice 2012-01-27) -POSIX_USER_ENV_VARS = ['HOME', 'USER', 'LOGNAME'] - - - -step "Check value of user-related environment variables" - -# in this step we are going to run some "exec" blocks that writes the value of the -# user-related environment variables to a file. We need to verify that exec's are -# unsetting these vars. - - -test_printenv_manifest = <<HERE -exec {"print %s environment variable": - command => "/usr/bin/printenv %s > #{temp_file_name}", -} -HERE - -# loop over the vars that we care about; these should match up with the value of Puppet::Util::POSIX_USER_ENV_VARS, -# but I don't have access to that from here, so this is unfortunately hard-coded (cprice 2012-01-27) -POSIX_USER_ENV_VARS.each do |var| - - # apply the manifest. - # - # note that we are passing in an extra :environment argument, which will cause the - # framework to temporarily set this variable before executing the puppet command. - # this lets us know what value we should be looking for as the output of the exec. - - apply_manifest_on agents, test_printenv_manifest % [var, var], :environment => {var => sentinel_string} - - # cat the temp file and make sure it contained the correct value. - on(agents, "cat #{temp_file_name}").each do |result| - assert_equal("", "#{result.stdout.chomp}", "Unexpected result for host '#{result.host}', environment var '#{var}'") - end -end - - - - -step "Check value of user-related environment variables when they are provided as part of the exec resource" - -# in this step we are going to run some "exec" blocks that write the value of the -# user-related environment variables to a file. However, this time, the manifest -# explicitly overrides these variables in the "environment" section, so we need to -# be sure that we are respecting these overrides. - -test_printenv_with_env_overrides_manifest = <<HERE -exec {"print %s environment variable": - command => "/usr/bin/printenv %s > #{temp_file_name}", - environment => ["%s=#{sentinel_string}", "FOO=bar"] -} -HERE - -# loop over the vars that we care about; -POSIX_USER_ENV_VARS.each do |var| - - # apply the manifest. - # - # note that we are passing in an extra :environment argument, which will cause the - # framework to temporarily set this variable before executing the puppet command. - # this lets us know what value we should be looking for as the output of the exec. - - apply_manifest_on agents, test_printenv_with_env_overrides_manifest % [var, var, var], - :environment => {var => sentinel_string} - - # cat the temp file and make sure it contained the correct value. - on(agents, "cat #{temp_file_name}").each do |result| - assert_equal(sentinel_string, "#{result.stdout.chomp}", - "Unexpected result for host '#{result.host}', environment var '#{var}'") - end -end - - - - - - - - -step "cleanup" - -# remove the temp file -on agents, "rm -f #{temp_file_name}" - - - diff --git a/acceptance/pending/ticket_6928_puppet_master_parse_fails.rb b/acceptance/pending/ticket_6928_puppet_master_parse_fails.rb deleted file mode 100644 index aac53138a..000000000 --- a/acceptance/pending/ticket_6928_puppet_master_parse_fails.rb +++ /dev/null @@ -1,38 +0,0 @@ -test_name "#6928: Puppet --parseonly should return deprication message" - -# Create good and bad formatted manifests -step "Master: create valid, invalid formatted manifests" -create_remote_file(master, '/tmp/good.pp', %w{notify{good:}} ) -create_remote_file(master, '/tmp/bad.pp', 'notify{bad:') - -step "Master: use --parseonly on an invalid manifest, should return 1 and issue deprecation warning" -on master, puppet_master( %w{--parseonly /tmp/bad.pp} ), :acceptable_exit_codes => [ 1 ] - fail_test "Deprecation warning not issued for --parseonly" unless - stdout.include? '--parseonly has been removed. Please use \'puppet parser validate <manifest>\'' - -step "Agents: create valid, invalid formatted manifests" -agents.each do |host| - create_remote_file(host, '/tmp/good.pp', %w{notify{good:}} ) - create_remote_file(host, '/tmp/bad.pp', 'notify{bad:') -end - -step "Agents: use --parseonly on an invalid manifest, should return 1 and issue deprecation warning" -agents.each do |host| - on(host, "puppet --parseonly /tmp/bad.pp}", :acceptable_exit_codes => [ 1 ]) do - fail_test "Deprecation warning not issued for --parseonly" unless - stdout.include? '--parseonly has been removed. Please use \'puppet parser validate <manifest>\'' - end -end - -step "Test Face for ‘parser validate’ with good manifest -- should pass" -agents.each do |host| - on(host, "puppet parser validate /tmp/good.pp", :acceptable_exit_codes => [ 0 ]) -end - -step "Test Face for ‘parser validate’ with bad manifest -- should fail" -agents.each do |host| - on(host, "puppet parser validate /tmp/bad.pp", :acceptable_exit_codes => [ 1 ]) do - fail_test "Bad manifest detection failed" unless - stderr.include? 'Could not run: Could not parse for environment production' - end -end diff --git a/acceptance/setup/common/pre-suite/025_StopFirewall.rb b/acceptance/setup/common/pre-suite/025_StopFirewall.rb deleted file mode 100644 index 0d651ba01..000000000 --- a/acceptance/setup/common/pre-suite/025_StopFirewall.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'puppet/acceptance/install_utils' - -extend Puppet::Acceptance::InstallUtils - -test_name "Stop firewall" do - hosts.each do |host| - stop_firewall_on(host) - end -end diff --git a/acceptance/setup/common/pre-suite/040_ValidateSignCert.rb b/acceptance/setup/common/pre-suite/040_ValidateSignCert.rb deleted file mode 100644 index 549432427..000000000 --- a/acceptance/setup/common/pre-suite/040_ValidateSignCert.rb +++ /dev/null @@ -1,6 +0,0 @@ -test_name "Validate Sign Cert" - -require 'puppet/acceptance/common_utils' -extend Puppet::Acceptance::CAUtils - -initialize_ssl diff --git a/acceptance/setup/common/pre-suite/100_SetParser.rb b/acceptance/setup/common/pre-suite/100_SetParser.rb deleted file mode 100644 index e8c76e69f..000000000 --- a/acceptance/setup/common/pre-suite/100_SetParser.rb +++ /dev/null @@ -1,23 +0,0 @@ -test_name "add parser=#{ENV['PARSER']} to all puppet.conf (only if $PARSER is set)" do - - parser = ENV['PARSER'] - next if parser.nil? - - hosts.each do |host| - step "adjust #{host} puppet.conf" do - temp = host.tmpdir('parser-set') - opts = { - 'main' => { - 'parser' => parser - } - } - lay_down_new_puppet_conf(host, opts, temp) - - if !options[:install].empty? and parser == 'future' - # We are installing from source rather than packages and need the following: - win_cmd_prefix = 'cmd /c ' if host['platform'] =~ /windows/ - on(host, "#{win_cmd_prefix}gem install rgen") - end - end - end -end diff --git a/acceptance/setup/git/pre-suite/000_EnvSetup.rb b/acceptance/setup/git/pre-suite/000_EnvSetup.rb deleted file mode 100644 index 5be74955b..000000000 --- a/acceptance/setup/git/pre-suite/000_EnvSetup.rb +++ /dev/null @@ -1,67 +0,0 @@ -test_name "Setup environment" - -step "Ensure Git and Ruby" - -require 'puppet/acceptance/install_utils' -extend Puppet::Acceptance::InstallUtils -require 'puppet/acceptance/git_utils' -extend Puppet::Acceptance::GitUtils -require 'beaker/dsl/install_utils' -extend Beaker::DSL::InstallUtils - -PACKAGES = { - :redhat => [ - 'git', - 'ruby', - 'rubygem-json', - ], - :debian => [ - ['git', 'git-core'], - 'ruby', - ], - :debian_ruby18 => [ - 'libjson-ruby', - ], - :solaris => [ - ['git', 'developer/versioning/git'], - ['ruby', 'runtime/ruby-18'], - # there isn't a package for json, so it is installed later via gems - ], - :windows => [ - 'git', - # there isn't a need for json on windows because it is bundled in ruby 1.9 - ], -} - -install_packages_on(hosts, PACKAGES, :check_if_exists => true) - -hosts.each do |host| - case host['platform'] - when /windows/ - arch = host[:ruby_arch] || 'x86' - step "#{host} Selected architecture #{arch}" - - revision = if arch == 'x64' - '2.0.0-x64' - else - '1.9.3-x86' - end - - step "#{host} Install ruby from git using revision #{revision}" - # TODO remove this step once we are installing puppet from msi packages - install_from_git(host, "/opt/puppet-git-repos", - :name => 'puppet-win32-ruby', - :path => build_giturl('puppet-win32-ruby'), - :rev => revision) - on host, 'cd /opt/puppet-git-repos/puppet-win32-ruby; cp -r ruby/* /' - on host, 'cd /lib; icacls ruby /grant "Everyone:(OI)(CI)(RX)"' - on host, 'cd /lib; icacls ruby /reset /T' - on host, 'cd /; icacls bin /grant "Everyone:(OI)(CI)(RX)"' - on host, 'cd /; icacls bin /reset /T' - on host, 'ruby --version' - on host, 'cmd /c gem list' - when /solaris/ - step "#{host} Install json from rubygems" - on host, 'gem install json' - end -end diff --git a/acceptance/setup/git/pre-suite/010_TestSetup.rb b/acceptance/setup/git/pre-suite/010_TestSetup.rb deleted file mode 100644 index ed995335a..000000000 --- a/acceptance/setup/git/pre-suite/010_TestSetup.rb +++ /dev/null @@ -1,53 +0,0 @@ -begin - require 'beaker/dsl/install_utils' -end - -test_name "Install packages and repositories on target machines..." do - extend Beaker::DSL::InstallUtils - - SourcePath = Beaker::DSL::InstallUtils::SourcePath - GitURI = Beaker::DSL::InstallUtils::GitURI - GitHubSig = Beaker::DSL::InstallUtils::GitHubSig - - tmp_repositories = [] - options[:install].each do |uri| - raise(ArgumentError, "#{uri} is not recognized.") unless(uri =~ GitURI) - tmp_repositories << extract_repo_info_from(uri) - end - - repositories = order_packages(tmp_repositories) - - versions = {} - hosts.each_with_index do |host, index| - on host, "echo #{GitHubSig} >> $HOME/.ssh/known_hosts" - - repositories.each do |repository| - step "Install #{repository[:name]}" - if repository[:path] =~ /^file:\/\/(.+)$/ - on host, "test -d #{SourcePath} || mkdir -p #{SourcePath}" - source_dir = $1 - checkout_dir = "#{SourcePath}/#{repository[:name]}" - on host, "rm -f #{checkout_dir}" # just the symlink, do not rm -rf ! - on host, "ln -s #{source_dir} #{checkout_dir}" - on host, "cd #{checkout_dir} && if [ -f install.rb ]; then ruby ./install.rb ; else true; fi" - else - install_from_git host, SourcePath, repository - end - - if index == 1 - versions[repository[:name]] = find_git_repo_versions(host, - SourcePath, - repository) - end - end - end - - step "Agents: create basic puppet.conf" do - agents.each do |agent| - puppetconf = File.join(agent['puppetpath'], 'puppet.conf') - - on agent, "echo '[agent]' > #{puppetconf} && " + - "echo server=#{master} >> #{puppetconf}" - end - end -end diff --git a/acceptance/setup/git/pre-suite/020_PuppetUserAndGroup.rb b/acceptance/setup/git/pre-suite/020_PuppetUserAndGroup.rb deleted file mode 100644 index 394f8d39b..000000000 --- a/acceptance/setup/git/pre-suite/020_PuppetUserAndGroup.rb +++ /dev/null @@ -1,10 +0,0 @@ -test_name 'Puppet User and Group' do - hosts.each do |host| - - step "ensure puppet user and group added to all nodes because this is what the packages do" do - on host, puppet("resource user puppet ensure=present") - on host, puppet("resource group puppet ensure=present") - end - - end -end diff --git a/acceptance/setup/git/pre-suite/030_PuppetMasterSanity.rb b/acceptance/setup/git/pre-suite/030_PuppetMasterSanity.rb deleted file mode 100644 index 926256609..000000000 --- a/acceptance/setup/git/pre-suite/030_PuppetMasterSanity.rb +++ /dev/null @@ -1,16 +0,0 @@ -test_name "Puppet Master sanity checks: PID file and SSL dir creation" - -pidfile = '/var/lib/puppet/run/master.pid' - -hostname = on(master, 'facter hostname').stdout.strip -fqdn = on(master, 'facter fqdn').stdout.strip - -with_puppet_running_on(master, :main => { :dns_alt_names => "puppet,#{hostname},#{fqdn}", :verbose => true, :noop => true }) do - # SSL dir created? - step "SSL dir created?" - on master, "[ -d #{master['puppetpath']}/ssl ]" - - # PID file exists? - step "PID file created?" - on master, "[ -f #{pidfile} ]" -end diff --git a/acceptance/setup/git/pre-suite/060_InstallModules.rb b/acceptance/setup/git/pre-suite/060_InstallModules.rb deleted file mode 100644 index 00243010b..000000000 --- a/acceptance/setup/git/pre-suite/060_InstallModules.rb +++ /dev/null @@ -1,76 +0,0 @@ -require 'pathname' - -# Given an array of modules specified by the --modules command line option, -# Parse all of them into an array of usable hash structures. -class PuppetModules - attr_reader :modules - - def initialize(modules=[]) - @modules = modules - end - - def list - return [] unless modules - modules.collect do |uri| - git_url, git_ref = uri.split '#' - folder = Pathname.new(git_url).basename('.git') - name = folder.to_s.split('-', 2)[1] || folder.to_s - { - :name => name, - :url => git_url, - :folder => folder.to_s, - :ref => git_ref, - :protocol => git_url.split(':')[0].intern, - } - end - end -end - -def install_git_module(mod, hosts) - # The idea here is that each test can symlink the modules they want from a - # temporary directory to this location. This will preserve the global - # state of the system while allowing individual test cases to quickly run - # with a module "installed" in the module path. - moddir = "/opt/puppet-git-repos" - target = "#{moddir}/#{mod[:name]}" - - step "Clone #{mod[:url]} if needed" - on hosts, "test -d #{moddir} || mkdir -p #{moddir}" - on hosts, "test -d #{target} || git clone #{mod[:url]} #{target}" - step "Update #{mod[:name]} and check out revision #{mod[:ref]}" - - commands = ["cd #{target}", - "remote rm origin", - "remote add origin #{mod[:url]}", - "fetch origin", - "checkout -f #{mod[:ref]}", - "reset --hard refs/remotes/origin/#{mod[:ref]}", - "clean -fdx", - ] - - on hosts, commands.join(" && git ") -end - -def install_scp_module(mod, hosts) - moddir = "/opt/puppet-git-repos" - target = "#{moddir}/#{mod[:name]}" - - step "Purge #{target} if needed" - on hosts, "test -d #{target} && rm -rf #{target} || true" - - step "Copy #{mod[:name]} to hosts" - scp_to hosts, mod[:url].split(':', 2)[1], target -end - -modules = PuppetModules.new(options[:modules]).list - -step "Masters: Install Puppet Modules" -masters = hosts.select { |host| host['roles'].include? 'master' } - -modules.each do |mod| - if mod[:protocol] == :scp - install_scp_module(mod, masters) - else - install_git_module(mod, masters) - end -end diff --git a/acceptance/setup/git/pre-suite/070_InstalCACerts.rb b/acceptance/setup/git/pre-suite/070_InstalCACerts.rb deleted file mode 100644 index cc293eaf8..000000000 --- a/acceptance/setup/git/pre-suite/070_InstalCACerts.rb +++ /dev/null @@ -1,66 +0,0 @@ -test_name "Install CA Certs" -confine :to, :platform => 'windows' - -GEOTRUST_GLOBAL_CA = <<-EOM ------BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT -MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i -YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg -R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 -9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq -fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv -iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU -1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ -bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW -MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA -ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l -uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn -Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS -tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF -PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un -hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV -5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== ------END CERTIFICATE----- -EOM - -USERTRUST_NETWORK_CA = <<-EOM ------BEGIN CERTIFICATE----- -MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB -lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug -Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho -dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt -SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG -A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe -MBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v -d3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh -cmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn -0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ -M6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a -MXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd -oI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI -DsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy -oUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD -VR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0 -dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy -bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF -BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM -//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli -CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE -CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t -3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS -KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA== ------END CERTIFICATE----- -EOM - -hosts.each do |host| - step "Installing Geotrust CA cert" - create_remote_file(host, "geotrustglobal.pem", GEOTRUST_GLOBAL_CA) - on host, "chmod 644 geotrustglobal.pem" - on host, "cmd /c certutil -v -addstore Root `cygpath -w geotrustglobal.pem`" - - step "Installing Usertrust Network CA cert" - create_remote_file(host, "usertrust-network.pem", USERTRUST_NETWORK_CA) - on host, "chmod 644 usertrust-network.pem" - on host, "cmd /c certutil -v -addstore Root `cygpath -w usertrust-network.pem`" -end diff --git a/acceptance/setup/packages/pre-suite/010_Install.rb b/acceptance/setup/packages/pre-suite/010_Install.rb deleted file mode 100644 index 4397211fe..000000000 --- a/acceptance/setup/packages/pre-suite/010_Install.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'puppet/acceptance/install_utils' - -extend Puppet::Acceptance::InstallUtils - -test_name "Install Packages" - -step "Install repositories on target machines..." do - - sha = ENV['SHA'] - repo_configs_dir = 'repo-configs' - - hosts.each do |host| - install_repos_on(host, sha, repo_configs_dir) - end -end - - -MASTER_PACKAGES = { - :redhat => [ - 'puppet-server', - ], - :debian => [ - 'puppetmaster-passenger', - ], -# :solaris => [ -# 'puppet-server', -# ], -# :windows => [ -# 'puppet-server', -# ], -} - -AGENT_PACKAGES = { - :redhat => [ - 'puppet', - ], - :debian => [ - 'puppet', - ], -# :solaris => [ -# 'puppet', -# ], -# :windows => [ -# 'puppet', -# ], -} - -install_packages_on(master, MASTER_PACKAGES) -install_packages_on(agents, AGENT_PACKAGES) diff --git a/acceptance/setup/packages/pre-suite/015_PackageHostsPresets.rb b/acceptance/setup/packages/pre-suite/015_PackageHostsPresets.rb deleted file mode 100644 index 1a1101aa5..000000000 --- a/acceptance/setup/packages/pre-suite/015_PackageHostsPresets.rb +++ /dev/null @@ -1,5 +0,0 @@ -if master['platform'] =~ /debian|ubuntu/ - master.uses_passenger! -elsif master['platform'] =~ /redhat|el|centos|scientific/ - master['use-service'] = true -end diff --git a/acceptance/setup/packages/pre-suite/045_EnsureMasterStartedOnPassenger.rb b/acceptance/setup/packages/pre-suite/045_EnsureMasterStartedOnPassenger.rb deleted file mode 100644 index 20f4fdfb5..000000000 --- a/acceptance/setup/packages/pre-suite/045_EnsureMasterStartedOnPassenger.rb +++ /dev/null @@ -1,3 +0,0 @@ -if master.graceful_restarts? - on(master, puppet('resource', 'service', master['puppetservice'], "ensure=running")) -end diff --git a/acceptance/setup/pe/pre-suite/000_Install.rb b/acceptance/setup/pe/pre-suite/000_Install.rb deleted file mode 100644 index acb7f4659..000000000 --- a/acceptance/setup/pe/pre-suite/000_Install.rb +++ /dev/null @@ -1,5 +0,0 @@ -test_name 'Install Puppet Enterprise' do - - # This installs the latest PE build, can be overridden, see API docs - install_pe -end diff --git a/acceptance/tests/agent/agent_disable_lockfile.rb b/acceptance/tests/agent/agent_disable_lockfile.rb deleted file mode 100644 index 0fcc5bfd5..000000000 --- a/acceptance/tests/agent/agent_disable_lockfile.rb +++ /dev/null @@ -1,94 +0,0 @@ -test_name "the agent --disable/--enable functionality should manage the agent lockfile properly" - -# -# This test is intended to ensure that puppet agent --enable/--disable -# work properly, both in terms of complying with our public "API" around -# lockfile semantics ( http://links.puppetlabs.com/agent_lockfiles ), and -# in terms of actually restricting or allowing new agent runs to begin. -# - -require 'puppet/acceptance/temp_file_utils' - -extend Puppet::Acceptance::TempFileUtils - -initialize_temp_dirs() -@all_tests_passed = false - - -############################################################################### -# BEGIN TEST LOGIC -############################################################################### - -teardown do - if @all_tests_passed then - remove_temp_dirs() - end -end - -tuples = [ - ["reason not specified", false], - ["I'm busy; go away.'", true] -] - -tuples.each do |expected_message, explicitly_specify_message| - - with_puppet_running_on(master, {}) do - - step "disable the agent; specify message? '#{explicitly_specify_message}', message: '#{expected_message}'" do - agents.each do |agent| - if (explicitly_specify_message) - on(agent, puppet('agent', "--disable \"#{expected_message}\"")) - else - on(agent, puppet('agent', "--disable")) - end - - agent_disabled_lockfile = "#{agent.puppet['vardir']}/state/agent_disabled.lock" - unless file_exists?(agent, agent_disabled_lockfile) then - fail_test("Failed to create disabled lock file '#{agent_disabled_lockfile}' on agent '#{agent}'") - end - lock_file_content = file_contents(agent, agent_disabled_lockfile) - - # This is a hack; we should parse the JSON into a hash, but I don't - # think I have a library available from the acceptance test framework - # that I can use to do that. So I'm falling back to <gasp> regex. - lock_file_content_regex = /"disabled_message"\s*:\s*"#{expected_message}"/ - unless lock_file_content =~ lock_file_content_regex - fail_test("Disabled lock file contents invalid; expected to match '#{lock_file_content_regex}', got '#{lock_file_content}' on agent '#{agent}'") - end - end - end - - step "attempt to run the agent (message: '#{expected_message}')" do - agents.each do |agent| - on(agent, puppet('agent', "--test --server #{master}"), - :acceptable_exit_codes => [1]) do - disabled_regex = /administratively disabled.*'#{expected_message}'/ - unless result.stdout =~ disabled_regex - fail_test("Unexpected output from attempt to run agent disabled; expecting to match '#{disabled_regex}', got '#{result.stdout}' on agent '#{agent}'") - end - end - end - end - - step "enable the agent (message: '#{expected_message}')" do - agents.each do |agent| - - agent_disabled_lockfile = "#{agent.puppet['vardir']}/state/agent_disabled.lock" - on(agent, puppet('agent', "--enable")) - if file_exists?(agent, agent_disabled_lockfile) then - fail_test("Failed to remove disabled lock file '#{agent_disabled_lockfile}' on agent '#{agent}'") - end - end - end - - step "verify that we can run the agent (message: '#{expected_message}')" do - agents.each do |agent| - on(agent, puppet('agent', "--test --server #{master}")) - end - end - - end # with_puppet_running_on block - -end # tuples block - -@all_tests_passed = true diff --git a/acceptance/tests/agent/fallback_to_cached_catalog.rb b/acceptance/tests/agent/fallback_to_cached_catalog.rb deleted file mode 100644 index ae6b2024d..000000000 --- a/acceptance/tests/agent/fallback_to_cached_catalog.rb +++ /dev/null @@ -1,18 +0,0 @@ -test_name "fallback to the cached catalog" - -step "run agents once to cache the catalog" do - with_puppet_running_on master, {} do - on(agents, puppet("agent -t --server #{master}")) - end -end - -step "run agents again, verify they use cached catalog" do - agents.each do |agent| - # can't use --test, because that will set usecacheonfailure=false - # We use a server that the agent can't possibly talk to in order - # to guarantee that no communication can take place. - on(agent, puppet("agent --onetime --no-daemonize --server puppet.example.com --verbose")) do |result| - assert_match(/Using cached catalog/, result.stdout) - end - end -end diff --git a/acceptance/tests/aix/aix_package_provider.rb b/acceptance/tests/aix/aix_package_provider.rb deleted file mode 100644 index 1d1d8d6dd..000000000 --- a/acceptance/tests/aix/aix_package_provider.rb +++ /dev/null @@ -1,85 +0,0 @@ -test_name "aix package provider should work correctly" - -confine :to, :platform => /aix/ - -dir = "/tmp/aix-packages-#{$$}" - -teardown do - on hosts, "rm -rf #{dir}" -end - -def assert_package_version(package, expected_version) - # The output of lslpp is a colon-delimited list like: - # sudo:sudo.rte:1.8.6.4: : :C: :Configurable super-user privileges runtime: : : : : : :0:0:/: - # We want the version, so grab the third field - on hosts, "lslpp -qLc #{package} | cut -f3 -d:" do - actual_version = stdout.chomp - assert_equal(expected_version, actual_version, "Installed package version #{actual_version} does not match expected version #{expected_version}") - end -end - -package = 'sudo.rte' -version1 = '1.7.10.4' -version2 = '1.8.6.4' - -step "download packages to use for test" - -on hosts, "mkdir -p #{dir}" -on hosts, "curl neptune.puppetlabs.lan/misc/sudo.#{version1}.aix51.lam.bff > #{dir}/sudo.#{version1}.aix51.lam.bff" -on hosts, "curl neptune.puppetlabs.lan/misc/sudo.#{version2}.aix51.lam.bff > #{dir}/sudo.#{version2}.aix51.lam.bff" - -step "setup manifests for testing" - -version1_manifest = <<-MANIFEST -package { '#{package}': - ensure => '#{version1}', - provider => aix, - source => '#{dir}', -} -MANIFEST - -version2_manifest = <<-MANIFEST -package { '#{package}': - ensure => '#{version2}', - provider => aix, - source => '#{dir}', -} -MANIFEST - -absent_manifest = <<-MANIFEST -package { '#{package}': - ensure => absent, - provider => aix, - source => '#{dir}', -} -MANIFEST - -step "install the package" - -apply_manifest_on hosts, version1_manifest - -step "verify package is installed and at the correct version" - -assert_package_version package, version1 - -step "install a newer version of the package" - -apply_manifest_on hosts, version2_manifest - -step "verify package is installed and at the newer version" - -assert_package_version package, version2 - -step "test that downgrading fails by trying to install an older version of the package" - -on hosts, puppet_apply("--verbose", "--detailed-exitcodes"), :stdin => version1_manifest, :acceptable_exit_codes => [4,6] do - assert_match(/aix package provider is unable to downgrade packages/, stdout, "Didn't get an error about downgrading packages") -end - -step "uninstall the package" - -apply_manifest_on hosts, absent_manifest - -step "verify the package is gone" - -on hosts, "lslpp -qLc #{package}", :acceptable_exit_codes => [1] diff --git a/acceptance/tests/aix/nim_package_provider.rb b/acceptance/tests/aix/nim_package_provider.rb deleted file mode 100644 index 68feafe49..000000000 --- a/acceptance/tests/aix/nim_package_provider.rb +++ /dev/null @@ -1,97 +0,0 @@ -test_name "NIM package provider should work correctly" - -confine :to, :platform => "aix" - -# NOTE: This test is duplicated in the pe_acceptance_tests repo - -def assert_package_version(package, expected_version) - # The output of lslpp is a colon-delimited list like: - # sudo:sudo.rte:1.8.6.4: : :C: :Configurable super-user privileges runtime: : : : : : :0:0:/: - # We want the version, so grab the third field - on hosts, "lslpp -qLc #{package} | cut -f3 -d:" do - actual_version = stdout.chomp - assert_equal(expected_version, actual_version, "Installed package version #{actual_version} does not match expected version #{expected_version}") - end -end - -def get_manifest(package, ensure_value) - <<MANIFEST -package {'#{package}': - ensure => '#{ensure_value}', - source => 'lpp_custom', - provider => nim, -} -MANIFEST -end - -def test_apply(package_name, ensure_value, expected_version) - manifest = get_manifest(package_name, ensure_value) - on hosts, puppet_apply(["--detailed-exitcodes", "--verbose"]), - {:stdin => manifest, :acceptable_exit_codes => [2]} - - step "validate installed package version" do - assert_package_version package_name, expected_version - end - - step "run again to ensure idempotency" do - on hosts, puppet_apply(["--detailed-exitcodes", "--verbose"]), - {:stdin => manifest, :acceptable_exit_codes => [0]} - end - - step "validate installed package version" do - assert_package_version package_name, expected_version - end -end - -package_types = { - "RPM" => { - :package_name => "cdrecord", - :old_version => '1.9-6', - :new_version => '1.9-9' - }, - "BFF" => { - :package_name => "bos.atm.atmle", - :old_version => '6.1.7.0', - :new_version => '7.1.2.0' - } -} - -package_types.each do |package_type, details| - step "install a #{package_type} package via 'ensure=>present'" do - package_name = details[:package_name] - version = details[:new_version] - test_apply(package_name, 'present', version) - end - - step "uninstall a #{package_type} package via 'ensure=>absent'" do - package_name = details[:package_name] - version = '' - test_apply(package_name, 'absent', version) - end - - step "install a #{package_type} package via 'ensure=><OLD_VERSION>'" do - package_name = details[:package_name] - version = details[:old_version] - test_apply(package_name, version, version) - end - - step "upgrade a #{package_type} package via 'ensure=><NEW_VERSION>'" do - package_name = details[:package_name] - version = details[:new_version] - test_apply(package_name, version, version) - end - - step "attempt to downgrade a #{package_type} package via 'ensure=><OLD_VERSION>'" do - package_name = details[:package_name] - version = details[:old_version] - - manifest = get_manifest(package_name, version) - on hosts, puppet_apply("--verbose", "--detailed-exitcodes"), - { :stdin => manifest, - :acceptable_exit_codes => [4,6] } do - - assert_match(/NIM package provider is unable to downgrade packages/, stdout, "Didn't get an error about downgrading packages") - end - end - -end diff --git a/acceptance/tests/allow_arbitrary_node_name_fact_for_agent.rb b/acceptance/tests/allow_arbitrary_node_name_fact_for_agent.rb deleted file mode 100644 index 67d38b6b0..000000000 --- a/acceptance/tests/allow_arbitrary_node_name_fact_for_agent.rb +++ /dev/null @@ -1,66 +0,0 @@ -test_name "node_name_fact should be used to determine the node name for puppet agent" - -success_message = "node_name_fact setting was correctly used to determine the node name" - -testdir = master.tmpdir("nodenamefact") -node_names = [] - -on agents, facter('kernel') do - node_names << stdout.chomp -end - -node_names.uniq! - -authfile = "#{testdir}/auth.conf" -authconf = node_names.map do |node_name| - %Q[ -path /catalog/#{node_name} -auth yes -allow * - -path /node/#{node_name} -auth yes -allow * - -path /report/#{node_name} -auth yes -allow * -] -end.join("\n") - -manifest_file = "#{testdir}/manifest.pp" -manifest = %Q[ - Exec { path => "/usr/bin:/bin" } - node default { - notify { "false": } - } -] -manifest << node_names.map do |node_name| - %Q[ - node "#{node_name}" { - notify { "#{success_message}": } - } - ] -end.join("\n") - -with_these_opts = { - 'master' => { - 'rest_authconfig' => "#{testdir}/auth.conf", - 'node_terminus' => 'plain', - 'manifest' => manifest_file, - }, -} - -create_remote_file master, authfile, authconf -create_remote_file master, manifest_file, manifest - -on master, "chmod 644 #{authfile} #{manifest_file}" -on master, "chmod 777 #{testdir}" - -with_puppet_running_on master, with_these_opts, testdir do - - on(agents, puppet('agent', "--no-daemonize --verbose --onetime --node_name_fact kernel --server #{master}")) do - assert_match(/defined 'message'.*#{success_message}/, stdout) - end - -end diff --git a/acceptance/tests/allow_arbitrary_node_name_fact_for_apply.rb b/acceptance/tests/allow_arbitrary_node_name_fact_for_apply.rb deleted file mode 100644 index 4569bdaa1..000000000 --- a/acceptance/tests/allow_arbitrary_node_name_fact_for_apply.rb +++ /dev/null @@ -1,30 +0,0 @@ -test_name "node_name_fact should be used to determine the node name for puppet apply" - -success_message = "node_name_fact setting was correctly used to determine the node name" - -node_names = [] - -on agents, facter('kernel') do - node_names << stdout.chomp -end - -node_names.uniq! - -manifest = %Q[ - Exec { path => "/usr/bin:/bin" } - node default { - notify { "false": } - } -] - -node_names.each do |node_name| - manifest << %Q[ - node "#{node_name}" { - notify { "echo #{success_message}": } - } - ] -end - -on agents, puppet_apply("--verbose --node_name_fact kernel"), :stdin => manifest do - assert_match(/defined 'message'.*#{success_message}/, stdout) -end diff --git a/acceptance/tests/allow_arbitrary_node_name_for_agent.rb b/acceptance/tests/allow_arbitrary_node_name_for_agent.rb deleted file mode 100644 index 0f79b0166..000000000 --- a/acceptance/tests/allow_arbitrary_node_name_for_agent.rb +++ /dev/null @@ -1,49 +0,0 @@ -test_name "node_name_value should be used as the node name for puppet agent" - -success_message = "node_name_value setting was correctly used as the node name" -in_testdir = master.tmpdir('nodenamevalue') - -authfile = "#{in_testdir}/auth.conf" -create_remote_file master, authfile, <<AUTHCONF -path /catalog/specified_node_name -auth yes -allow * - -path /node/specified_node_name -auth yes -allow * - -path /report/specified_node_name -auth yes -allow * -AUTHCONF - -manifest_file = "#{in_testdir}/manifest.pp" -create_remote_file master, manifest_file, <<MANIFEST - Exec { path => "/usr/bin:/bin" } - node default { - notify { "false": } - } - node specified_node_name { - notify { "#{success_message}": } - } -MANIFEST - -on master, "chmod 644 #{authfile} #{manifest_file}" -on master, "chmod 777 #{in_testdir}" - -with_these_opts = { - 'master' => { - 'rest_authconfig' => "#{in_testdir}/auth.conf", - 'node_terminus' => 'plain', - 'manifest' => manifest_file, - } -} - -with_puppet_running_on master, with_these_opts, in_testdir do - - on(agents, puppet('agent', "-t --node_name_value specified_node_name --server #{master}"), :acceptable_exit_codes => [0,2]) do - assert_match(/defined 'message'.*#{success_message}/, stdout) - end - -end diff --git a/acceptance/tests/allow_arbitrary_node_name_for_apply.rb b/acceptance/tests/allow_arbitrary_node_name_for_apply.rb deleted file mode 100644 index d9bf14717..000000000 --- a/acceptance/tests/allow_arbitrary_node_name_for_apply.rb +++ /dev/null @@ -1,17 +0,0 @@ -test_name "node_name_value should be used as the node name for puppet apply" - -success_message = "node_name_value setting was correctly used as the node name" - -manifest = %Q[ - Exec { path => "/usr/bin:/bin" } - node default { - notify { "false": } - } - node a_different_node_name { - notify { "notify #{success_message}": } - } -] - -on agents, puppet_apply("--verbose --node_name_value a_different_node_name"), :stdin => manifest do - assert_match(/defined 'message'.*#{success_message}/, stdout) -end diff --git a/acceptance/tests/allow_symlinks_as_config_directories.rb b/acceptance/tests/allow_symlinks_as_config_directories.rb deleted file mode 100644 index 2d45d4fef..000000000 --- a/acceptance/tests/allow_symlinks_as_config_directories.rb +++ /dev/null @@ -1,27 +0,0 @@ -test_name "Should allow symlinks to directories as configuration directories" -confine :except, :platform => 'windows' - -agents.each do |agent| - step "Create the test confdir with a link to it" - confdir = agent.tmpdir('puppet_conf-directory') - conflink = agent.tmpfile('puppet_conf-symlink') - - on agent, "rm -rf #{conflink} #{confdir}" - - on agent, "mkdir #{confdir}" - on agent, "ln -s #{confdir} #{conflink}" - - on(agent, puppet('config', 'set', 'certname', 'awesome_certname', '--confdir', confdir)) - - manifest = 'notify{"My certname is $clientcert": }' - - step "Run Puppet and ensure it used the conf file in the confdir" - on agent, puppet_apply("--confdir #{conflink}"), :stdin => manifest do - assert_match(/My certname is awesome_certname[^\w]/, stdout) - end - - step "Check that the symlink and confdir are unchanged" - on agent, "[ -L #{conflink} ]" - on agent, "[ -d #{confdir} ]" - on agent, "[ $(readlink #{conflink}) = #{confdir} ]" -end diff --git a/acceptance/tests/apply/classes/parameterized_classes.rb b/acceptance/tests/apply/classes/parameterized_classes.rb deleted file mode 100755 index 9a7029425..000000000 --- a/acceptance/tests/apply/classes/parameterized_classes.rb +++ /dev/null @@ -1,56 +0,0 @@ -test_name "parametrized classes" - -######################################################################## -step "should allow param classes" -manifest = %q{ -class x($y, $z) { - notice("${y}-${z}") -} -class {x: y => '1', z => '2'} -} - -apply_manifest_on(agents, manifest) do - fail_test "inclusion after parameterization failed" unless stdout.include? "1-2" -end - -######################################################################## -# REVISIT: This was ported from the old set of tests, but I think that -# the desired behaviour has recently changed. --daniel 2010-12-23 -step "should allow param class post inclusion" -manifest = %q{ -class x($y, $z) { - notice("${y}-${z}") -} -class {x: y => '1', z => '2'} -include x -} - -apply_manifest_on(agents, manifest) do - fail_test "inclusion after parameterization failed" unless stdout.include? "1-2" -end - -######################################################################## -step "should allow param classes defaults" -manifest = %q{ -class x($y, $z='2') { - notice("${y}-${z}") -} -class {x: y => '1'} -} - -apply_manifest_on(agents, manifest) do - fail_test "the default didn't apply as expected" unless stdout.include? "1-2" -end - -######################################################################## -step "should allow param class defaults to be overriden" -manifest = %q{ -class x($y, $z='2') { - notice("${y}-${z}") -} -class {x: y => '1', z => '3'} -} - -apply_manifest_on(agents, manifest) do - fail_test "the override didn't happen as we expected" unless stdout.include? "1-3" -end diff --git a/acceptance/tests/apply/classes/should_allow_param_override.rb b/acceptance/tests/apply/classes/should_allow_param_override.rb deleted file mode 100755 index 09592ec8b..000000000 --- a/acceptance/tests/apply/classes/should_allow_param_override.rb +++ /dev/null @@ -1,20 +0,0 @@ -test_name "should allow param override" - -manifest = %q{ -class parent { - notify { 'msg': - message => parent, - } -} -class child inherits parent { - Notify['msg'] {message => 'child'} -} -include parent -include child -} - -apply_manifest_on(agents, manifest) do - fail_test "parameter override didn't work" unless - stdout.include? "defined 'message' as 'child'" -end - diff --git a/acceptance/tests/apply/classes/should_allow_param_undef_override.rb b/acceptance/tests/apply/classes/should_allow_param_undef_override.rb deleted file mode 100755 index 39904dc0d..000000000 --- a/acceptance/tests/apply/classes/should_allow_param_undef_override.rb +++ /dev/null @@ -1,36 +0,0 @@ -test_name "should allow overriding a parameter to undef in inheritence" - -agents.each do |agent| - dir = agent.tmpdir('class_undef_override') - out = File.join(dir, 'class_undef_override_out') - source = File.join(dir, 'class_undef_override_test') - -manifest = %Q{ - class parent { - file { 'test': - path => '#{out}', - source => '#{source}', - } - } - class child inherits parent { - File['test'] { - source => undef, - content => 'hello new world!', - } - } - include parent - include child -} - - step "prepare the target file on all systems" - on(agent, "echo 'hello world!' > #{out}") - step "apply the manifest" - apply_manifest_on(agent, manifest) - step "verify the file content" - on(agent, "cat #{out}") do - fail_test "the file was not touched" if stdout.include? "hello world!" - fail_test "the file was not updated" unless stdout.include? "hello new world" - end - - on(agent, "rm -rf #{dir}") -end diff --git a/acceptance/tests/apply/classes/should_include_resources_from_class.rb b/acceptance/tests/apply/classes/should_include_resources_from_class.rb deleted file mode 100755 index b78be6cec..000000000 --- a/acceptance/tests/apply/classes/should_include_resources_from_class.rb +++ /dev/null @@ -1,11 +0,0 @@ -test_name "resources declared in a class can be applied with include" -manifest = %q{ -class x { - notify{'a':} -} -include x -} -apply_manifest_on(agents, manifest) do - fail_test "the resource did not apply" unless - stdout.include? "defined 'message' as 'a'" -end diff --git a/acceptance/tests/apply/classes/should_not_auto_include_resources_from_class.rb b/acceptance/tests/apply/classes/should_not_auto_include_resources_from_class.rb deleted file mode 100755 index 25721eb4c..000000000 --- a/acceptance/tests/apply/classes/should_not_auto_include_resources_from_class.rb +++ /dev/null @@ -1,6 +0,0 @@ -test_name "resources declared in classes are not applied without include" -manifest = %q{ class x { notify { 'test': message => 'never invoked' } } } -apply_manifest_on(agents, manifest) do - fail_test "found the notify despite not including it" if - stdout.include? "never invoked" -end diff --git a/acceptance/tests/apply/hashes/should_not_reassign.rb b/acceptance/tests/apply/hashes/should_not_reassign.rb deleted file mode 100755 index 115e54b2b..000000000 --- a/acceptance/tests/apply/hashes/should_not_reassign.rb +++ /dev/null @@ -1,19 +0,0 @@ -test_name "hash reassignment should fail" -manifest = %q{ -$my_hash = {'one' => '1', 'two' => '2' } -$my_hash['one']='1.5' -} - -agents.each do |host| - parser = on(host, puppet('agent --configprint parser')).stdout.chomp - apply_manifest_on(host, manifest, :acceptable_exit_codes => [1]) do - expected_error_message = - case parser - when 'future' - "Illegal attempt to assign via [index/key]. Not an assignable reference" - else - "Assigning to the hash 'my_hash' with an existing key 'one'" - end - fail_test("didn't find the failure") unless stderr.include?(expected_error_message) - end -end diff --git a/acceptance/tests/concurrency/ticket_2659_concurrent_catalog_requests.rb b/acceptance/tests/concurrency/ticket_2659_concurrent_catalog_requests.rb deleted file mode 100644 index b3fec25d0..000000000 --- a/acceptance/tests/concurrency/ticket_2659_concurrent_catalog_requests.rb +++ /dev/null @@ -1,108 +0,0 @@ -test_name "concurrent catalog requests (PUP-2659)" - -# we're only testing the effects of loading a master with concurrent requests -confine :except, :platform => 'windows' - -step "setup a manifest" - -testdir = master.tmpdir("concurrent") - -apply_manifest_on(master, <<-MANIFEST, :catch_failures => true) - File { - ensure => directory, - owner => #{master['user']}, - group => #{master['group']}, - mode => '750', - } - - file { '#{testdir}': } - file { '#{testdir}/busy': } - file { '#{testdir}/busy/one.txt': - ensure => file, - mode => '640', - content => "Something to read", - } - file { '#{testdir}/busy/two.txt': - ensure => file, - mode => '640', - content => "Something else to read", - } - file { '#{testdir}/busy/three.txt': - ensure => file, - mode => '640', - content => "Something more else to read", - } - - file { '#{testdir}/manifests': } - file { '#{testdir}/manifests/site.pp': - ensure => file, - content => ' - $foo = inline_template(" - <%- 1000.times do - Dir.glob(\\'#{testdir}/busy/*.txt\\').each do |f| - File.read(f) - end - end - %> - \\'touched the file system for a bit\\' - ") - notify { "end": - message => $foo, - } - ', - mode => '640', - } -MANIFEST - -step "start master" -master_opts = { - 'main' => { - 'manifest' => "#{testdir}/manifests/site.pp", - } -} -with_puppet_running_on(master, master_opts, testdir) do - - step "concurrent catalog curls (with alliterative alacrity)" - agents.each do |agent| - cert_path = on(agent, puppet('config', 'print', 'hostcert')).stdout.chomp - key_path = on(agent, puppet('config', 'print', 'hostprivkey')).stdout.chomp - cacert_path = on(agent, puppet('config', 'print', 'localcacert')).stdout.chomp - agent_cert = on(agent, puppet('config', 'print', 'certname')).stdout.chomp - - run_count = 6 - agent_tmpdir = agent.tmpdir("concurrent-loop-script") - test_script = "#{agent_tmpdir}/loop.sh" - create_remote_file(agent, test_script, <<-EOF) - declare -a MYPIDS - loops=#{run_count} - - for (( i=0; i<$loops; i++ )); do - ( - sleep_for="0.$(( $RANDOM % 49 ))" - sleep $sleep_for - url='https://#{master}:8140/production/catalog/#{agent_cert}' - echo "Curling: $url" - curl --tlsv1 -v -# -H 'Accept: text/pson' --cert #{cert_path} --key #{key_path} --cacert #{cacert_path} $url - echo "$PPID Completed" - ) > "#{agent_tmpdir}/catalog-request-$i.out" 2>&1 & - echo "Launched $!" - MYPIDS[$i]=$! - done - - for (( i=0; i<$loops; i++ )); do - wait ${MYPIDS[$i]} - done - - echo "All requests are finished" - EOF - on(agent, "chmod +x #{test_script}") - on(agent, "#{test_script}") - run_count.times do |i| - step "Checking the results of catalog request ##{i}" - on(agent, "cat #{agent_tmpdir}/catalog-request-#{i}.out") do - assert_match(%r{< HTTP/1.* 200}, stdout) - assert_match(%r{touched the file system for a bit}, stdout) - end - end - end -end diff --git a/acceptance/tests/config/apply_file_metadata_specified_in_config.rb b/acceptance/tests/config/apply_file_metadata_specified_in_config.rb deleted file mode 100644 index 932ec74f3..000000000 --- a/acceptance/tests/config/apply_file_metadata_specified_in_config.rb +++ /dev/null @@ -1,26 +0,0 @@ -test_name "#17371 file metadata specified in puppet.conf needs to be applied" - -# when owner/group works on windows for settings, this confine should be removed. -confine :except, :platform => 'windows' - -require 'puppet/acceptance/temp_file_utils' -extend Puppet::Acceptance::TempFileUtils -initialize_temp_dirs() - -agents.each do |agent| - logdir = get_test_file_path(agent, 'log') - - create_test_file(agent, 'site.pp', <<-SITE) - node default { - notify { puppet_run: } - } - SITE - - on(agent, puppet('config', 'set', 'logdir', "'#{logdir} { owner = root, group = root, mode = 0700 }'", '--confdir', get_test_file_path(agent, ''))) - - on(agent, puppet('apply', get_test_file_path(agent, 'site.pp'), '--confdir', get_test_file_path(agent, ''))) - - on(agent, "stat --format '%U:%G %a' #{logdir}") do - assert_match(/root:root 700/, stdout) - end -end diff --git a/acceptance/tests/config/puppet_manages_own_configuration_in_robust_manner.rb b/acceptance/tests/config/puppet_manages_own_configuration_in_robust_manner.rb deleted file mode 100644 index dafef1cff..000000000 --- a/acceptance/tests/config/puppet_manages_own_configuration_in_robust_manner.rb +++ /dev/null @@ -1,82 +0,0 @@ -# User story: -# A new user has installed puppet either from source or from a gem, which does -# not put the "puppet" user or group on the system. They run the puppet master, -# which fails because of the missing user and then correct their actions. They -# expect that after correcting their actions, puppet will work correctly. -test_name "Puppet manages its own configuration in a robust manner" - -skip_test "JVM Puppet cannot change its user while running." if @options[:is_jvm_puppet] - -# when owner/group works on windows for settings, this confine should be removed. -confine :except, :platform => 'windows' -# when managhome roundtrips for solaris, this confine should be removed -confine :except, :platform => 'solaris' -# pe setup includes ownership of external directories such as the passenger -# document root, which puppet itself knows nothing about -confine :except, :type => 'pe' -# same issue for a foss passenger run -if master.is_using_passenger? - skip_test 'Cannot test with passenger.' -end - -if master.use_service_scripts? - # Beaker defaults to leaving puppet running when using service scripts, - # Need to shut it down so we can modify user/group and test startup failure - on(master, puppet('resource', 'service', master['puppetservice'], 'ensure=stopped')) -end - -step "Clear out yaml directory because of a bug in the indirector/yaml. (See #21145)" -on master, 'rm -rf $(puppet master --configprint yamldir)' - -original_state = {} -step "Record original state of system users" do - hosts.each do |host| - original_state[host] = {} - original_state[host][:user] = user = host.execute('puppet config print user') - original_state[host][:group] = group = host.execute('puppet config print group') - original_state[host][:ug_resources] = on(host, puppet('resource', 'user', user)).stdout - original_state[host][:ug_resources] += on(host, puppet('resource', 'group', group)).stdout - original_state[host][:ug_resources] += "Group['#{group}'] -> User['#{user}']\n" - end -end - -teardown do - # And cleaning up yaml dir again here because we are changing service - # user and group ids back to the original uid and gid - on master, 'rm -rf $(puppet master --configprint yamldir)' - - hosts.each do |host| - apply_manifest_on(host, <<-ORIG) - #{original_state[host][:ug_resources]} - ORIG - end - - with_puppet_running_on(master, {}) do - agents.each do |agent| - on agent, puppet('agent', '-t', '--server', master) - end - end -end - -step "Remove system users" do - hosts.each do |host| - on host, puppet('resource', 'user', original_state[host][:user], 'ensure=absent') - on host, puppet('resource', 'group', original_state[host][:group], 'ensure=absent') - end -end - -step "Ensure master fails to start when missing system user" do - on master, puppet('master'), :acceptable_exit_codes => [74] do - assert_match(/could not change to group "#{original_state[master][:group]}"/, result.output) - assert_match(/Could not change to user #{original_state[master][:user]}/, result.output) - end -end - -step "Ensure master starts when making users after having previously failed startup" do - with_puppet_running_on(master, - :master => { :mkusers => true }) do - agents.each do |agent| - on agent, puppet('agent', '-t', '--server', master) - end - end -end diff --git a/acceptance/tests/cycle_detection.rb b/acceptance/tests/cycle_detection.rb deleted file mode 100644 index 44fb11dd9..000000000 --- a/acceptance/tests/cycle_detection.rb +++ /dev/null @@ -1,26 +0,0 @@ -test_name "cycle detection and reporting" - -step "check we report a simple cycle" -manifest = <<EOT -notify { "a1": require => Notify["a2"] } -notify { "a2": require => Notify["a1"] } -EOT - -apply_manifest_on(agents, manifest) do - assert_match(/Found 1 dependency cycle/, stderr, - "found and reported the cycle correctly") -end - -step "report multiple cycles in the same graph" -manifest = <<EOT -notify { "a1": require => Notify["a2"] } -notify { "a2": require => Notify["a1"] } - -notify { "b1": require => Notify["b2"] } -notify { "b2": require => Notify["b1"] } -EOT - -apply_manifest_on(agents, manifest) do - assert_match(/Found 2 dependency cycles/, stderr, - "found and reported the cycle correctly") -end diff --git a/acceptance/tests/doc/should_print_function_reference.rb b/acceptance/tests/doc/should_print_function_reference.rb deleted file mode 100644 index 3ffcf8097..000000000 --- a/acceptance/tests/doc/should_print_function_reference.rb +++ /dev/null @@ -1,5 +0,0 @@ -test_name "verify we can print the function reference" -on(agents, puppet_doc("-r", "function")) do - fail_test "didn't print function reference" unless - stdout.include? 'Function Reference' -end diff --git a/acceptance/tests/doc/ticket_4120_cannot_generate_type_reference.rb b/acceptance/tests/doc/ticket_4120_cannot_generate_type_reference.rb deleted file mode 100755 index 7f721c272..000000000 --- a/acceptance/tests/doc/ticket_4120_cannot_generate_type_reference.rb +++ /dev/null @@ -1,5 +0,0 @@ -test_name "verify we can print the function reference" -on(agents, puppet_doc("-r", "type")) do - fail_test "didn't print type reference" unless - stdout.include? 'Type Reference' -end diff --git a/acceptance/tests/environment/can_enumerate_environments.rb b/acceptance/tests/environment/can_enumerate_environments.rb deleted file mode 100644 index 088e9de1b..000000000 --- a/acceptance/tests/environment/can_enumerate_environments.rb +++ /dev/null @@ -1,69 +0,0 @@ -test_name "Can enumerate environments via an HTTP endpoint" - -def master_port(agent) - setting_on(agent, "agent", "masterport") -end - -def setting_on(host, section, name) - on(host, puppet("config", "print", name, "--section", section)).stdout.chomp -end - -def full_path(host, path) - if host['platform'] =~ /win/ - on(host, "cygpath '#{path}'").stdout.chomp - else - path - end -end - -def curl_master_from(agent, path, headers = '', &block) - url = "https://#{master}:#{master_port(agent)}#{path}" - cert_path = full_path(agent, setting_on(agent, "agent", "hostcert")) - key_path = full_path(agent, setting_on(agent, "agent", "hostprivkey")) - curl_base = "curl --tlsv1 -sg --cert \"#{cert_path}\" --key \"#{key_path}\" -k -H '#{headers}'" - - on agent, "#{curl_base} '#{url}'", &block -end - -master_user = on(master, "puppet master --configprint user").stdout.strip -environments_dir = create_tmpdir_for_user master, "environments" -apply_manifest_on(master, <<-MANIFEST) -File { - ensure => directory, - owner => #{master_user}, - group => #{master['group']}, - mode => 0770, -} - -file { - "#{environments_dir}":; - "#{environments_dir}/env1":; - "#{environments_dir}/env2":; -} -MANIFEST - -master_opts = { - :master => { - :environmentpath => environments_dir - } -} -if master.is_pe? - master_opts[:master][:basemodulepath] = master['sitemoduledir'] -end - -with_puppet_running_on(master, master_opts) do - agents.each do |agent| - step "Ensure that an unauthenticated client cannot access the environments list" do - on agent, "curl --tlsv1 -ksv https://#{master}:#{master_port(agent)}/v2.0/environments", :acceptable_exit_codes => [0,7] do - assert_match(/< HTTP\/1\.\d 403/, stderr) - end - end - - step "Ensure that an authenticated client can retrieve the list of environments" do - curl_master_from(agent, '/v2.0/environments') do - data = JSON.parse(stdout) - assert_equal(["env1", "env2", "production"], data["environments"].keys.sort) - end - end - end -end diff --git a/acceptance/tests/environment/cmdline_overrides_environment.rb b/acceptance/tests/environment/cmdline_overrides_environment.rb deleted file mode 100644 index 78a07413b..000000000 --- a/acceptance/tests/environment/cmdline_overrides_environment.rb +++ /dev/null @@ -1,322 +0,0 @@ -test_name "Commandline modulepath and manifest settings override environment" - -skip_test "CLI-master tests are not applicable" if @options[:is_jvm_puppet] - -testdir = create_tmpdir_for_user master, 'cmdline_and_environment' -environmentpath = "#{testdir}/environments" -modulepath = "#{testdir}/modules" -manifests = "#{testdir}/manifests" -sitepp = "#{manifests}/site.pp" -other_manifestdir = "#{testdir}/other_manifests" -other_sitepp = "#{other_manifestdir}/site.pp" -other_modulepath = "#{testdir}/some_other_modulepath" -cmdline_manifest = "#{testdir}/cmdline.pp" - -step "Prepare manifests and modules" -apply_manifest_on(master, <<-MANIFEST, :catch_failures => true) -File { - ensure => directory, - owner => #{master['user']}, - group => #{master['group']}, - mode => 0750, -} - -############################################## -# A production directory environment -file { - "#{testdir}":; - "#{environmentpath}":; - "#{environmentpath}/production":; - "#{environmentpath}/production/manifests":; - "#{environmentpath}/production/modules":; - "#{environmentpath}/production/modules/amod":; - "#{environmentpath}/production/modules/amod/manifests":; -} - -file { "#{environmentpath}/production/modules/amod/manifests/init.pp": - ensure => file, - mode => 0640, - content => 'class amod { - notify { "amod from production environment": } - }' -} - -file { "#{environmentpath}/production/manifests/production.pp": - ensure => file, - mode => 0640, - content => ' - notify { "in production.pp": } - include amod - ' -} - -############################################################## -# To be set as default manifests and modulepath in puppet.conf -file { - "#{modulepath}":; - "#{modulepath}/amod/":; - "#{modulepath}/amod/manifests":; -} - -file { "#{modulepath}/amod/manifests/init.pp": - ensure => file, - mode => 0640, - content => 'class amod { - notify { "amod from modulepath": } - }' -} - -file { "#{manifests}": } -file { "#{sitepp}": - ensure => file, - mode => 0640, - content => ' - notify { "in site.pp": } - include amod - ' -} - -file { "#{other_manifestdir}": } -file { "#{other_sitepp}": - ensure => file, - mode => 0640, - content => ' - notify { "in other manifestdir site.pp": } - include amod - ' -} - -################################ -# To be specified on commandline -file { - "#{other_modulepath}":; - "#{other_modulepath}/amod/":; - "#{other_modulepath}/amod/manifests":; -} - -file { "#{other_modulepath}/amod/manifests/init.pp": - ensure => file, - mode => 0640, - content => 'class amod { - notify { "amod from commandline modulepath": } - }' -} - -file { "#{cmdline_manifest}": - ensure => file, - mode => 0640, - content => ' - notify { "in cmdline.pp": } - include amod - ' -} -MANIFEST - -def shutdown_puppet_if_running_as_a_service - if master.use_service_scripts? - # Beaker defaults to leaving puppet running when using service scripts, - # Need to shut it down so we can start up with commandline options - on(master, puppet('resource', 'service', master['puppetservice'], 'ensure=stopped')) - end -end - -teardown do - if master.use_service_scripts? - # Beaker defaults to leaving puppet running when using service scripts, - on(master, puppet('resource', 'service', master['puppetservice'], 'ensure=running')) - end -end - -# Note: this is the semantics seen with legacy environments if commandline -# manifest/modulepath are set. -step "CASE 1: puppet master with --manifest and --modulepath overrides set production directory environment" do - if master.is_using_passenger? - step "Skipping for Passenger (PE) setup; since the equivalent of a commandline override would be adding the setting to config.ru, which seems like a very odd thing to do." - else - - shutdown_puppet_if_running_as_a_service - - master_opts = { - 'master' => { - 'environmentpath' => environmentpath, - 'manifest' => sitepp, - 'modulepath' => modulepath, - }, - :__service_args__ => { - :bypass_service_script => true, - }, - } - - master_opts_with_cmdline = master_opts.merge(:__commandline_args__ => "--manifest=#{cmdline_manifest} --modulepath=#{other_modulepath}") - with_puppet_running_on master, master_opts_with_cmdline, testdir do - agents.each do |agent| - on(agent, puppet("agent -t --server #{master}"), :acceptable_exit_codes => [2] ) do - assert_match(/in cmdline\.pp/, stdout) - assert_match(/amod from commandline modulepath/, stdout) - assert_no_match(/production/, stdout) - end - - step "CASE 1a: even if environment is specified" - on(agent, puppet("agent -t --server #{master} --environment production"), :acceptable_exit_codes => [2]) do - assert_match(/in cmdline\.pp/, stdout) - assert_match(/amod from commandline modulepath/, stdout) - assert_no_match(/production/, stdout) - end - end - end - - step "CASE 2: or if you set --manifestdir" do - master_opts_with_cmdline = master_opts.merge(:__commandline_args__ => "--manifestdir=#{other_manifestdir} --modulepath=#{other_modulepath}") - step "CASE 2: it is ignored if manifest is set in puppet.conf to something not using $manifestdir" - with_puppet_running_on master, master_opts_with_cmdline, testdir do - agents.each do |agent| - on(agent, puppet("agent -t --server #{master}"), :acceptable_exit_codes => [2]) do - assert_match(/in production\.pp/, stdout) - assert_match(/amod from commandline modulepath/, stdout) - end - end - end - - step "CASE 2a: but does pull in the default manifest via manifestdir if manifest is not set" - master_opts_with_cmdline = master_opts.merge(:__commandline_args__ => "--manifestdir=#{other_manifestdir} --modulepath=#{other_modulepath}") - master_opts_with_cmdline['master'].delete('manifest') - with_puppet_running_on master, master_opts_with_cmdline, testdir do - agents.each do |agent| - on(agent, puppet("agent -t --server #{master}"), :acceptable_exit_codes => [2]) do - assert_match(/in other manifestdir site\.pp/, stdout) - assert_match(/amod from commandline modulepath/, stdout) - assert_no_match(/production/, stdout) - end - end - end - end - end -end - -step "CASE 3: puppet master with manifest and modulepath set in puppet.conf is overriden by an existing and set production directory environment" do - master_opts = { - 'master' => { - 'environmentpath' => environmentpath, - 'manifest' => sitepp, - 'modulepath' => modulepath, - } - } - if master.is_pe? - master_opts['master']['basemodulepath'] = master['sitemoduledir'] - end - - with_puppet_running_on master, master_opts, testdir do - agents.each do |agent| - step "CASE 3: this case is unfortunate, but will be irrelevant when we remove legacyenv in 4.0" - on(agent, puppet("agent -t --server #{master}"), :acceptable_exit_codes => [2] ) do - assert_match(/in production\.pp/, stdout) - assert_match(/amod from production environment/, stdout) - end - - step "CASE 3a: if environment is specified" - on(agent, puppet("agent -t --server #{master} --environment production"), :acceptable_exit_codes => [2]) do - assert_match(/in production\.pp/, stdout) - assert_match(/amod from production environment/, stdout) - end - end - end -end - -step "CASE 4: puppet master with default manifest, modulepath, environment, environmentpath and an existing '#{environmentpath}/production' directory environment that has not been set" do - - if master.is_using_passenger? - step "Skipping for PE because PE requires most of the existing puppet.conf and /etc/puppetlabs/puppet configuration, and we cannot simply point to a new conf directory." - else - - shutdown_puppet_if_running_as_a_service - - ssldir = on(master, puppet("master --configprint ssldir")).stdout.chomp - master_opts = { - :__service_args__ => { - :bypass_service_script => true, - }, - :__commandline_args__ => "--confdir=#{testdir} --ssldir=#{ssldir}" - } - - with_puppet_running_on master, master_opts, testdir do - agents.each do |agent| - step "CASE 4: #{environmentpath}/production directory environment does not take precedence because default environmentpath is ''" - on(agent, puppet("agent -t --server #{master}"), :acceptable_exit_codes => [2] ) do - assert_match(/in site\.pp/, stdout) - assert_match(/amod from modulepath/, stdout) - end - on(agent, puppet("agent -t --server #{master} --environment production"), :acceptable_exit_codes => [2]) do - assert_match(/in site\.pp/, stdout) - assert_match(/amod from modulepath/, stdout) - end - end - end - end -end - -step "CASE 5: puppet master with explicit dynamic environment settings and empty environmentpath" do - step "CASE 5: Prepare an additional modulepath module" - apply_manifest_on(master, <<-MANIFEST, :catch_failures => true) - File { - ensure => directory, - owner => #{master['user']}, - group => #{master['group']}, - mode => 0750, - } - - # A second module in another modules dir - file { - "#{other_modulepath}":; - "#{other_modulepath}/bmod/":; - "#{other_modulepath}/bmod/manifests":; - } - - file { "#{other_modulepath}/bmod/manifests/init.pp": - ensure => file, - mode => 0640, - content => 'class bmod { - notify { "bmod from other modulepath": } - }' - } - - file { "#{environmentpath}/production/manifests/production.pp": - ensure => file, - mode => 0640, - content => ' - notify { "in production.pp": } - include amod - include bmod - ' - } - MANIFEST - - master_opts = { - 'master' => { - 'manifest' => "#{environmentpath}/$environment/manifests", - 'modulepath' => "#{environmentpath}/$environment/modules:#{other_modulepath}", - } - } - if master.is_pe? - master_opts['master']['modulepath'] << ":#{master['sitemoduledir']}" - end - - with_puppet_running_on master, master_opts, testdir do - agents.each do |agent| - step "CASE 5: pulls in the production environment based on $environment default" - on(agent, puppet("agent -t --server #{master}"), :acceptable_exit_codes => [2] ) do - assert_match(/in production\.pp/, stdout) - assert_match(/amod from production environment/, stdout) - step "CASE 5: and sees modules located in later elements of the modulepath (which would not be seen by a directory env (PUP-2158)" - assert_match(/bmod from other modulepath/, stdout) - end - - step "CASE 5a: pulls in the production environment when explicitly set" - on(agent, puppet("agent -t --server #{master} --environment production"), :acceptable_exit_codes => [2] ) do - assert_match(/in production\.pp/, stdout) - assert_match(/amod from production environment/, stdout) - step "CASE 5a: and sees modules located in later elements of the modulepath (which would not be seen by a directory env (PUP-2158)" - assert_match(/bmod from other modulepath/, stdout) - end - end - end -end diff --git a/acceptance/tests/environment/directory.rb b/acceptance/tests/environment/directory.rb deleted file mode 100644 index a295a9a48..000000000 --- a/acceptance/tests/environment/directory.rb +++ /dev/null @@ -1,224 +0,0 @@ -test_name "directory environments" -require 'puppet/acceptance/environment_utils' -extend Puppet::Acceptance::EnvironmentUtils - -step "setup environments" - -stub_forge_on(master) - -testdir = create_tmpdir_for_user master, "confdir" -puppet_conf_backup_dir = create_tmpdir_for_user(master, "puppet-conf-backup-dir") - -apply_manifest_on(master, environment_manifest(testdir), :catch_failures => true) - -results = {} -review = {} - -#################### -step "[ Run Tests ]" - -existing_directory_scenario = "Test a specific, existing directory environment configuration" -step existing_directory_scenario -master_opts = { - 'main' => { - 'environmentpath' => '$confdir/environments', - 'config_version' => '$confdir/static-version.sh', - } -} -general = [ master_opts, testdir, puppet_conf_backup_dir, { :directory_environments => true } ] - -results[existing_directory_scenario] = use_an_environment("testing", "directory testing", *general) - -default_environment_scenario = "Test behavior of default environment" -step default_environment_scenario -results[default_environment_scenario] = use_an_environment(nil, "default environment", *general) - -non_existent_environment_scenario = "Test for an environment that does not exist" -step non_existent_environment_scenario -results[non_existent_environment_scenario] = use_an_environment("doesnotexist", "non existent environment", *general) - -with_explicit_environment_conf_scenario = "Test a specific, existing directory environment with an explicit environment.conf file" -step with_explicit_environment_conf_scenario -results[with_explicit_environment_conf_scenario] = use_an_environment("testing_environment_conf", "directory with environment.conf testing", *general) - -master_environmentpath_scenario = "Test behavior of a directory environment when environmentpath is set in the master section" -step master_environmentpath_scenario -master_opts = { - 'master' => { - 'environmentpath' => '$confdir/environments', - 'config_version' => '$confdir/static-version.sh', - } -} -results[master_environmentpath_scenario] = use_an_environment("testing", "master environmentpath", master_opts, testdir, puppet_conf_backup_dir, :directory_environments => true, :config_print => '--section=master') - -bad_environmentpath_scenario = "Test behavior of directory environments when environmentpath is set to a non-existent directory" -step bad_environmentpath_scenario -master_opts = { - 'main' => { - 'environmentpath' => '/doesnotexist', - 'config_version' => '$confdir/static-version.sh', - } -} -results[bad_environmentpath_scenario] = use_an_environment("testing", "bad environmentpath", master_opts, testdir, puppet_conf_backup_dir, :directory_environments => true) - -######################################## -step "[ Report on Environment Results ]" - -step "Reviewing: #{existing_directory_scenario}" -existing_directory_expectations = lambda do |env| - { - :puppet_config => { - :exit_code => 0, - :matches => [%r{manifest.*#{master['puppetpath']}/environments/#{env}/manifests$}, - %r{modulepath.*#{master['puppetpath']}/environments/#{env}/modules:.+}, - %r{config_version = $}] - }, - :puppet_module_install => { - :exit_code => 0, - :matches => [%r{Preparing to install into #{master['puppetpath']}/environments/#{env}/modules}, - %r{pmtacceptance-nginx}], - }, - :puppet_module_uninstall => { - :exit_code => 0, - :matches => [%r{Removed.*pmtacceptance-nginx.*from #{master['puppetpath']}/environments/#{env}/modules}], - }, - :puppet_apply => { - :exit_code => 0, - :matches => [%r{include directory #{env} environment testing_mod}], - }, - :puppet_agent => { - :exit_code => 2, - :matches => [%r{Applying configuration version '\d+'}, - %r{in directory #{env} environment site.pp}, - %r{include directory #{env} environment testing_mod}], - }, - } -end -review[existing_directory_scenario] = review_results( - results[existing_directory_scenario], - existing_directory_expectations.call('testing') -) - -step "Reviewing: #{default_environment_scenario}" -default_environment_expectations = existing_directory_expectations.call('production').merge( - :puppet_apply => { - :exit_code => 0, - :matches => [%r{include default environment testing_mod}], - :notes => "The production directory environment is empty, but the inclusion of basemodulepath in the directory environment modulepath picks up the default testing_mod class in $confdir/modules" - }, - :puppet_agent => { - :exit_code => 0, - :matches => [ %r{Applying configuration version '\d+'}], - :does_not_match => [%r{include.*testing_mod}, - %r{Warning.*404}], - :notes => "The master automatically creates an empty production env dir." - } -) -review[default_environment_scenario] = review_results( - results[default_environment_scenario], - default_environment_expectations -) - -step "Reviewing: #{non_existent_environment_scenario}" -non_existent_environment_expectations = lambda do |env,path| - { - :puppet_config => { - :exit_code => 1, - :matches => [%r{Could not find a directory environment named '#{env}' anywhere in the path.*#{path}}], - }, - :puppet_module_install => { - :exit_code => 1, - :matches => [%r{Could not find a directory environment named '#{env}' anywhere in the path.*#{path}}], - }, - :puppet_module_uninstall => { - :exit_code => 1, - :matches => [%r{Could not find a directory environment named '#{env}' anywhere in the path.*#{path}}], - }, - :puppet_apply => { - :exit_code => 1, - :matches => [%r{Could not find a directory environment named '#{env}' anywhere in the path.*#{path}}], - }, - :puppet_agent => { - :exit_code => 1, - :matches => [%r{Warning.*404.*Could not find environment '#{env}'}, - %r{Could not retrieve catalog; skipping run}], - }, - } -end - -review[non_existent_environment_scenario] = review_results( - results[non_existent_environment_scenario], - non_existent_environment_expectations.call('doesnotexist', master['puppetpath']) -) - -existing_directory_with_puppet_conf_expectations = { - :puppet_config => { - :exit_code => 0, - :matches => [%r{manifest.*#{master['puppetpath']}/environments/testing_environment_conf/nonstandard-manifests$}, - %r{modulepath.*#{master['puppetpath']}/environments/testing_environment_conf/nonstandard-modules:.+}, - %r{config_version = #{master['puppetpath']}/environments/testing_environment_conf/local-version.sh$}] - }, - :puppet_module_install => { - :exit_code => 0, - :matches => [%r{Preparing to install into #{master['puppetpath']}/environments/testing_environment_conf/nonstandard-modules}, - %r{pmtacceptance-nginx}], - }, - :puppet_module_uninstall => { - :exit_code => 0, - :matches => [%r{Removed.*pmtacceptance-nginx.*from #{master['puppetpath']}/environments/testing_environment_conf/nonstandard-modules}], - }, - :puppet_apply => { - :exit_code => 0, - :matches => [%r{include directory testing with environment\.conf testing_mod}], - }, - :puppet_agent => { - :exit_code => 2, - :matches => [%r{Applying configuration version 'local testing_environment_conf'}, - %r{in directory testing with environment\.conf site.pp}, - %r{include directory testing with environment\.conf testing_mod}], - }, -} -step "Reviewing: #{with_explicit_environment_conf_scenario}" -review[with_explicit_environment_conf_scenario] = review_results( - results[with_explicit_environment_conf_scenario], - existing_directory_with_puppet_conf_expectations -) - -master_environmentpath_expectations = existing_directory_expectations.call('testing').merge( - :puppet_module_install => { - :exit_code => 0, - :matches => [%r{Preparing to install into #{master['puppetpath']}/modules}, - %r{pmtacceptance-nginx}], - :expect_failure => true, - :notes => "Runs in user mode and doesn't see the master environmenetpath setting.", - }, - :puppet_module_uninstall => { - :exit_code => 0, - :matches => [%r{Removed.*pmtacceptance-nginx.*from #{master['puppetpath']}/modules}], - :expect_failure => true, - :notes => "Runs in user mode and doesn't see the master environmenetpath setting.", - }, - :puppet_apply => { - :exit_code => 0, - :matches => [%r{include default environment testing_mod}], - :expect_failure => true, - :notes => "Runs in user mode and doesn't see the master environmenetpath setting.", - } -) -step "Reviewing: #{master_environmentpath_scenario}" -review[master_environmentpath_scenario] = review_results( - results[master_environmentpath_scenario], - master_environmentpath_expectations -) - -bad_environmentpath_expectations = non_existent_environment_expectations.call('testing', '/doesnotexist') -step "Reviewing: #{bad_environmentpath_scenario}" -review[bad_environmentpath_scenario] = review_results( - results[bad_environmentpath_scenario], - bad_environmentpath_expectations -) - -######################### -step "[ Assert Success ]" - -assert_review(review) diff --git a/acceptance/tests/environment/directory_environment_with_environment_conf.rb b/acceptance/tests/environment/directory_environment_with_environment_conf.rb deleted file mode 100644 index cba94941e..000000000 --- a/acceptance/tests/environment/directory_environment_with_environment_conf.rb +++ /dev/null @@ -1,110 +0,0 @@ -test_name 'Use a directory environment from environmentpath with an environment.conf' - -testdir = create_tmpdir_for_user master, 'use-environment-conf' -absolute_manifestdir = "#{testdir}/manifests" -absolute_modulesdir = "#{testdir}/absolute-modules" -absolute_globalsdir = "#{testdir}/global-modules" - - -master_user = on(master, "puppet master --configprint user").stdout.strip -apply_manifest_on(master, <<-MANIFEST, :catch_failures => true) -File { - ensure => directory, - owner => #{master_user}, - group => #{master['group']}, - mode => 0770, -} - -file { - "#{testdir}":; - "#{testdir}/environments":; - "#{testdir}/environments/direnv":; - "#{testdir}/environments/direnv/environment.conf": - ensure => file, - mode => 0640, - content => ' - manifest=#{absolute_manifestdir} - modulepath=relative-modules:#{absolute_modulesdir}:$basemodulepath - config_version=version_script.sh - ' - ; - - "#{testdir}/environments/direnv/relative-modules":; - "#{testdir}/environments/direnv/relative-modules/relmod":; - "#{testdir}/environments/direnv/relative-modules/relmod/manifests":; - "#{testdir}/environments/direnv/relative-modules/relmod/manifests/init.pp": - ensure => file, - mode => 0640, - content => 'class relmod { - notify { "included relmod": } - }' - ; - - "#{testdir}/environments/direnv/version_script.sh": - ensure => file, - mode => 0750, - content => '#!/usr/bin/env sh -echo "ver123" -' - ; - - "#{absolute_manifestdir}":; - "#{absolute_manifestdir}/site.pp": - ensure => file, - mode => 0640, - content => ' - notify { "direnv site.pp": } - include relmod - include absmod - include globalmod - ' - ; - - "#{absolute_modulesdir}":; - "#{absolute_modulesdir}/absmod":; - "#{absolute_modulesdir}/absmod/manifests":; - "#{absolute_modulesdir}/absmod/manifests/init.pp": - ensure => file, - mode => 0640, - content => 'class absmod { - notify { "included absmod": } - }' - ; - - "#{absolute_globalsdir}":; - "#{absolute_globalsdir}/globalmod":; - "#{absolute_globalsdir}/globalmod/manifests":; - "#{absolute_globalsdir}/globalmod/manifests/init.pp": - ensure => file, - mode => 0640, - content => 'class globalmod { - notify { "included globalmod": } - }' - ; -} -MANIFEST - -master_opts = { - 'master' => { - 'environmentpath' => "#{testdir}/environments", - 'basemodulepath' => "#{absolute_globalsdir}", - } -} -if master.is_pe? - master_opts['master']['basemodulepath'] << ":#{master['sitemoduledir']}" -end - -with_puppet_running_on master, master_opts, testdir do - agents.each do |agent| - on(agent, - puppet("agent", "-t", "--server", master, "--environment", "direnv"), - :acceptable_exit_codes => [2]) do |result| - - assert_match(/direnv site.pp/, result.stdout) - assert_match(/included relmod/, result.stdout) - assert_match(/included absmod/, result.stdout) - assert_match(/included globalmod/, result.stdout) - assert_match(/Applying.*ver123/, result.stdout) - end - end -end diff --git a/acceptance/tests/environment/dynamic.rb b/acceptance/tests/environment/dynamic.rb deleted file mode 100644 index 2431c1155..000000000 --- a/acceptance/tests/environment/dynamic.rb +++ /dev/null @@ -1,121 +0,0 @@ -test_name "dynamic environments" -require 'puppet/acceptance/environment_utils' -extend Puppet::Acceptance::EnvironmentUtils - -step "setup environments" - -stub_forge_on(master) - -testdir = create_tmpdir_for_user master, "confdir" -puppet_conf_backup_dir = create_tmpdir_for_user(master, "puppet-conf-backup-dir") - -apply_manifest_on(master, environment_manifest(testdir), :catch_failures => true) - -results = {} -review = {} - -#################### -step "[ Run Tests ]" - -existing_dynamic_scenario = "Test a specific, existing dynamic environment configuration" -step existing_dynamic_scenario -master_opts = { - 'main' => { - 'manifest' => '$confdir/dynamic/$environment/manifests', - 'modulepath' => '$confdir/dynamic/$environment/modules', - 'config_version' => '$confdir/static-version.sh', - } -} -results[existing_dynamic_scenario] = use_an_environment("testing", "dynamic testing", master_opts, testdir, puppet_conf_backup_dir) - -default_environment_scenario = "Test behavior of default environment" -step default_environment_scenario -results[default_environment_scenario] = use_an_environment(nil, "default environment", master_opts, testdir, puppet_conf_backup_dir) - -non_existent_environment_scenario = "Test for an environment that does not exist" -step non_existent_environment_scenario -results[non_existent_environment_scenario] = use_an_environment("doesnotexist", "non existent environment", master_opts, testdir, puppet_conf_backup_dir) - -######################################## -step "[ Report on Environment Results ]" - -confdir = master.puppet['confdir'] - -step "Reviewing: #{existing_dynamic_scenario}" -review[existing_dynamic_scenario] = review_results(results[existing_dynamic_scenario], - :puppet_config => { - :exit_code => 0, - :matches => [%r{manifest.*#{confdir}/dynamic/testing/manifests$}, - %r{modulepath.*#{confdir}/dynamic/testing/modules$}, - %r{config_version.*#{confdir}/static-version.sh$}] - }, - :puppet_module_install => { - :exit_code => 0, - :matches => [%r{Preparing to install into #{confdir}/dynamic/testing/modules}, - %r{pmtacceptance-nginx}], - }, - :puppet_module_uninstall => { - :exit_code => 0, - :matches => [%r{Removed.*pmtacceptance-nginx.*from #{confdir}/dynamic/testing/modules}], - }, - :puppet_apply => { - :exit_code => 0, - :matches => [%r{include dynamic testing environment testing_mod}], - }, - :puppet_agent => { - :exit_code => 2, - :matches => [%r{Applying configuration version 'static'}, - %r{in dynamic testing environment site.pp}, - %r{include dynamic testing environment testing_mod}], - } -) - -step "Reviewing: #{default_environment_scenario}" -default_expectations = lambda do |env| - { - :puppet_config => { - :exit_code => 0, - :matches => [%r{manifest.*#{confdir}/dynamic/#{env}/manifests$}, - %r{modulepath.*#{confdir}/dynamic/#{env}/modules$}, - %r{^config_version.*#{confdir}/static-version.sh$}] - }, - :puppet_module_install => { - :exit_code => 0, - :matches => [%r{Preparing to install into #{confdir}/dynamic/#{env}/modules}, - %r{pmtacceptance-nginx}], - }, - :puppet_module_uninstall => { - :exit_code => 0, - :matches => [%r{Removed.*pmtacceptance-nginx.*from #{confdir}/dynamic/#{env}/modules}], - }, - :puppet_apply => { - :exit_code => 1, - :matches => [ENV['PARSER'] == 'future' ? - %r{Error:.*Could not find class ::testing_mod} : - %r{Error:.*Could not find class testing_mod} - ], - }, - :puppet_agent => { - :exit_code => 0, - :matches => [%r{Applying configuration version 'static'}], - :does_not_match => [%r{in default environment site.pp}, - %r{include default environment testing_mod}, - %r{Notice: include}], - }, - } -end -review[default_environment_scenario] = review_results( - results[default_environment_scenario], - default_expectations.call('production') -) - -step "Reviewing: #{non_existent_environment_scenario}" -review[non_existent_environment_scenario] = review_results( - results[non_existent_environment_scenario], - default_expectations.call('doesnotexist') -) - -######################### -step "[ Assert Success ]" - -assert_review(review) diff --git a/acceptance/tests/environment/dynamic_environments.rb b/acceptance/tests/environment/dynamic_environments.rb deleted file mode 100644 index 6fe68688a..000000000 --- a/acceptance/tests/environment/dynamic_environments.rb +++ /dev/null @@ -1,138 +0,0 @@ -test_name "Dynamic Environments" - -testdir = create_tmpdir_for_user master, 'dynamic-environment' -environmentsdir = "#{testdir}/environments" - -step "Prepare manifests and modules" -def an_environment(envdir, env) - content = <<-ENVIRONMENT - -#################### -# #{env} environment -file { - "#{envdir}/#{env}":; - "#{envdir}/#{env}/hiera":; - "#{envdir}/#{env}/manifests":; - "#{envdir}/#{env}/modules":; - "#{envdir}/#{env}/modules/amod":; - "#{envdir}/#{env}/modules/amod/manifests":; -} - -file { "#{envdir}/#{env}/hiera/#{env}.yaml": - ensure => file, - mode => 0640, - content => 'foo: foo-#{env}', -} -file { "#{envdir}/#{env}/hiera/common.yaml": - ensure => file, - mode => 0640, - content => 'foo: foo-common', -} -file { "#{envdir}/#{env}/manifests/site.pp": - ensure => file, - mode => 0640, - content => ' - notify { "#{env}-site.pp": } - notify { "hiera": - message => hiera(foo), - } - include amod - ' -} -file { "#{envdir}/#{env}/modules/amod/manifests/init.pp": - ensure => file, - mode => 0640, - content => ' - class amod { - notify { "#{env}-amod": } - } - ' -} - ENVIRONMENT -end - -manifest = <<-MANIFEST -File { - ensure => directory, - owner => #{master['user']}, - group => #{master['group']}, - mode => 0750, -} - -file { - "#{testdir}":; - "#{environmentsdir}":; -} - -file { "#{testdir}/hiera.yaml": - ensure => file, - mode => 0640, - content => ' ---- -:backends: yaml -:yaml: - :datadir: "#{environmentsdir}/%{environment}/hiera" -:hierarchy: - - "%{environment}" - - common - ', -} - -#{an_environment(environmentsdir, 'production')} -#{an_environment(environmentsdir, 'testing')} -MANIFEST - -apply_manifest_on(master, manifest, :catch_failures => true) - -def test_on_agents(environment, default_env = false) - agents.each do |agent| - environment_switch = "--environment #{environment}" if !default_env - on(agent, puppet("agent -t --server #{master}", environment_switch), :acceptable_exit_codes => [2] ) do - assert_match(/#{environment}-site.pp/, stdout) - assert_match(/foo-#{environment}/, stdout) - assert_match(/#{environment}-amod/, stdout) - end - end -end - -ssldir = on(master, puppet("master --configprint ssldir")).stdout.chomp - -common_opts = { - 'modulepath' => "#{testdir}/environments/$environment/modules", - 'hiera_config' => "#{testdir}/hiera.yaml", -} -if master.is_pe? - common_opts['modulepath'] << ":#{master['sitemoduledir']}" -end - -master_opts = { - 'master' => { - 'manifest' => "#{testdir}/environments/$environment/manifests/site.pp", - }.merge(common_opts) -} -with_puppet_running_on master, master_opts, testdir do - step "Agent run with default environment" - test_on_agents('production', true) -end - -master_opts = { - 'master' => { - 'manifest' => "#{testdir}/environments/$environment/manifests/site.pp", - }.merge(common_opts) -} -with_puppet_running_on master, master_opts, testdir do - step "Agent run with testing environment" - test_on_agents('testing') - step "And then agent run with another environment but the same master process" - test_on_agents('production') -end - -master_opts = { - 'master' => { - 'manifestdir' => "#{testdir}/environments/$environment/manifests", - }.merge(common_opts) -} -with_puppet_running_on master, master_opts, testdir do - step "Agent run with testing environment and manifestdir set instead of manifest" - test_on_agents('testing') -end diff --git a/acceptance/tests/environment/static.rb b/acceptance/tests/environment/static.rb deleted file mode 100644 index d37823bd5..000000000 --- a/acceptance/tests/environment/static.rb +++ /dev/null @@ -1,115 +0,0 @@ -test_name "legacy environments" -require 'puppet/acceptance/environment_utils' -extend Puppet::Acceptance::EnvironmentUtils - -step "setup environments" - -stub_forge_on(master) - -testdir = create_tmpdir_for_user master, "confdir" -puppet_conf_backup_dir = create_tmpdir_for_user(master, "puppet-conf-backup-dir") - -apply_manifest_on(master, environment_manifest(testdir), :catch_failures => true) - -results = {} -review = {} - -#################### -step "[ Run Tests ]" - -existing_legacy_scenario = "Test a specific, existing legacy environment configuration" -step existing_legacy_scenario -master_opts = { - 'testing' => { - 'manifest' => "$confdir/testing-manifests", - 'modulepath' => "$confdir/testing-modules", - 'config_version' => "$confdir/static-version.sh", - }, -} -results[existing_legacy_scenario] = use_an_environment("testing", "legacy testing", master_opts, testdir, puppet_conf_backup_dir) - -default_environment_scenario = "Test behavior of default environment" -step default_environment_scenario -results[default_environment_scenario] = use_an_environment(nil, "default environment", master_opts, testdir, puppet_conf_backup_dir) - -non_existent_environment_scenario = "Test for an environment that does not exist" -step non_existent_environment_scenario -results[non_existent_environment_scenario] = use_an_environment("doesnotexist", "non existent environment", master_opts, testdir, puppet_conf_backup_dir) - -######################################## -step "[ Report on Environment Results ]" - -confdir = master.puppet['confdir'] - -step "Reviewing: #{existing_legacy_scenario}" -review[existing_legacy_scenario] = review_results(results[existing_legacy_scenario], - :puppet_config => { - :exit_code => 0, - :matches => [%r{manifest.*#{confdir}/testing-manifests$}, - %r{modulepath.*#{confdir}/testing-modules$}, - %r{config_version.*#{confdir}/static-version.sh$}] - }, - :puppet_module_install => { - :exit_code => 0, - :matches => [%r{Preparing to install into #{confdir}/testing-modules}, - %r{pmtacceptance-nginx}], - }, - :puppet_module_uninstall => { - :exit_code => 0, - :matches => [%r{Removed.*pmtacceptance-nginx.*from #{confdir}/testing-modules}], - }, - :puppet_apply => { - :exit_code => 0, - :matches => [%r{include legacy testing environment testing_mod}], - }, - :puppet_agent => { - :exit_code => 2, - :matches => [%r{Applying configuration version 'static'}, - %r{in legacy testing environment site.pp}, - %r{include legacy testing environment testing_mod}], - } -) - -step "Reviewing: #{default_environment_scenario}" -default_expectations = { - :puppet_config => { - :exit_code => 0, - :matches => [%r{manifest.*#{confdir}/manifests/site.pp$}, - %r{modulepath.*#{confdir}/modules:.*}, - %r{^config_version\s+=\s*$}] - }, - :puppet_module_install => { - :exit_code => 0, - :matches => [%r{Preparing to install into #{confdir}/modules}, - %r{pmtacceptance-nginx}], - }, - :puppet_module_uninstall => { - :exit_code => 0, - :matches => [%r{Removed.*pmtacceptance-nginx.*from #{confdir}/modules}], - }, - :puppet_apply => { - :exit_code => 0, - :matches => [%r{include default environment testing_mod}], - }, - :puppet_agent => { - :exit_code => 2, - :matches => [%r{Applying configuration version '\d+'}, - %r{in default environment site.pp}, - %r{include default environment testing_mod}], - }, -} -review[default_environment_scenario] = review_results( - results[default_environment_scenario], - default_expectations -) - -step "Reviewing: #{non_existent_environment_scenario}" -review[non_existent_environment_scenario] = review_results( - results[non_existent_environment_scenario], - default_expectations -) - -######################### -step "[ Assert Success ]" - -assert_review(review) diff --git a/acceptance/tests/environment/use_agent_environment_when_enc_doesnt_specify.rb b/acceptance/tests/environment/use_agent_environment_when_enc_doesnt_specify.rb deleted file mode 100644 index 310f9fb2b..000000000 --- a/acceptance/tests/environment/use_agent_environment_when_enc_doesnt_specify.rb +++ /dev/null @@ -1,40 +0,0 @@ -test_name "Agent should use agent environment if there is an enc that does not specify the environment" - -testdir = create_tmpdir_for_user master, 'use_agent_env' - -create_remote_file master, "#{testdir}/enc.rb", <<END -#!#{master['puppetbindir']}/ruby -puts <<YAML -parameters: -YAML -END -on master, "chmod 755 #{testdir}/enc.rb" - -create_remote_file(master, "#{testdir}/different.pp", 'notify { "production environment": }') -create_remote_file(master, "#{testdir}/more_different.pp", 'notify { "more_different_string": }') - -master_opts = { - 'main' => { - 'node_terminus' => 'exec', - 'external_nodes' => "#{testdir}/enc.rb", - 'manifest' => "#{testdir}/site.pp" - }, - 'production' => { - 'manifest' => "#{testdir}/different.pp" - }, - 'more_different' => { - 'manifest' => "#{testdir}/more_different.pp" - } -} - -on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" -on master, "chmod -R g+rwX #{testdir}" - -with_puppet_running_on master, master_opts, testdir do - - agents.each do |agent| - run_agent_on(agent, "--no-daemonize --onetime --server #{master} --verbose --environment more_different") - assert_match(/more_different_string/, stdout, "Did not find more_different_string from \"more_different\" environment") - end - -end diff --git a/acceptance/tests/environment/use_agent_environment_when_no_enc.rb b/acceptance/tests/environment/use_agent_environment_when_no_enc.rb deleted file mode 100644 index 9c850bbe1..000000000 --- a/acceptance/tests/environment/use_agent_environment_when_no_enc.rb +++ /dev/null @@ -1,29 +0,0 @@ -test_name "Agent should use agent environment if there is no enc-specified environment" - -testdir = create_tmpdir_for_user master, 'use_agent_env' - -create_remote_file(master, "#{testdir}/different.pp", 'notify { "production environment": }') -create_remote_file(master, "#{testdir}/more_different.pp", 'notify { "more_different_string": }') - -on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" -on master, "chmod -R g+rwX #{testdir}" - -master_opts = { - 'main' => { - 'manifest' => "#{testdir}/site.pp" - }, - 'production' => { - 'manifest' => "#{testdir}/different.pp" - }, - 'more_different' => { - 'manifest' => "#{testdir}/more_different.pp" - } -} - -with_puppet_running_on master, master_opts, testdir do - - agents.each do |agent| - run_agent_on(agent, "--no-daemonize --onetime --server #{master} --verbose --environment more_different") - assert_match(/more_different_string/, stdout, "Did not find more_different_string from \"more_different\" environment") - end -end diff --git a/acceptance/tests/environment/use_enc_environment.rb b/acceptance/tests/environment/use_enc_environment.rb deleted file mode 100644 index 5c182570b..000000000 --- a/acceptance/tests/environment/use_enc_environment.rb +++ /dev/null @@ -1,36 +0,0 @@ -test_name "Agent should environment given by ENC" - -testdir = create_tmpdir_for_user master, 'use_enc_env' - -create_remote_file master, "#{testdir}/enc.rb", <<END -#!#{master['puppetbindir']}/ruby -puts <<YAML -parameters: -environment: special -YAML -END -on master, "chmod 755 #{testdir}/enc.rb" - -master_opts = { - 'master' => { - 'node_terminus' => 'exec', - 'external_nodes' => "#{testdir}/enc.rb", - 'manifest' => "#{testdir}/site.pp" - }, - 'special' => { - 'manifest' => "#{testdir}/different.pp" - } -} - -create_remote_file(master, "#{testdir}/different.pp", 'notify { "expected_string": }') - -on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" -on master, "chmod -R g+rwX #{testdir}" - -with_puppet_running_on master, master_opts, testdir do - - agents.each do |agent| - run_agent_on(agent, "--no-daemonize --onetime --server #{master} --verbose") - assert_match(/expected_string/, stdout, "Did not find expected_string from \"special\" environment") - end -end diff --git a/acceptance/tests/environment/use_enc_environment_for_files.rb b/acceptance/tests/environment/use_enc_environment_for_files.rb deleted file mode 100644 index 02b79badf..000000000 --- a/acceptance/tests/environment/use_enc_environment_for_files.rb +++ /dev/null @@ -1,63 +0,0 @@ -test_name "Agent should use environment given by ENC for fetching remote files" - -testdir = create_tmpdir_for_user master, 'respect_enc_test' - -create_remote_file master, "#{testdir}/enc.rb", <<END -#!#{master['puppetbindir']}/ruby -puts <<YAML -parameters: -environment: special -YAML -END -on master, "chmod 755 #{testdir}/enc.rb" - -on master, "mkdir -p #{testdir}/modules" -# Create a plugin file on the master -on master, "mkdir -p #{testdir}/special/amod/files" -create_remote_file(master, "#{testdir}/special/amod/files/testy", "special_environment") - -on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" -on master, "chmod -R g+rwX #{testdir}" - -master_opts = { - 'master' => { - 'node_terminus' => 'exec', - 'external_nodes' => "#{testdir}/enc.rb", - 'filetimeout' => 1 - }, - 'special' => { - 'modulepath' => "#{testdir}/special", - 'manifest' => "#{testdir}/different.pp" - } -} -if master.is_pe? - master_opts['special']['modulepath'] << ":#{master['sitemoduledir']}" -end - -with_puppet_running_on master, master_opts, testdir do - agents.each do |agent| - atmp = agent.tmpdir('respect_enc_test') - logger.debug "agent: #{agent} \tagent.tmpdir => #{atmp}" - - create_remote_file master, "#{testdir}/different.pp", <<END -file { "#{atmp}/special_testy": - source => "puppet:///modules/amod/testy", -} - -notify { "mytemp is ${::mytemp}": } -END - on master, "chmod 644 #{testdir}/different.pp" - - sleep 2 # Make sure the master has time to reload the file - - run_agent_on(agent, "--no-daemonize --onetime --server #{master} --verbose --trace") - - on agent, "cat #{atmp}/special_testy" do |result| - assert_match(/special_environment/, - result.stdout, - "The file from environment 'special' was not found") - end - - on agent, "rm -rf #{atmp}" - end -end diff --git a/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb b/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb deleted file mode 100644 index bfebc0b8e..000000000 --- a/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb +++ /dev/null @@ -1,43 +0,0 @@ -test_name "Agent should use environment given by ENC for pluginsync" - -testdir = create_tmpdir_for_user master, 'respect_enc_test' - -create_remote_file master, "#{testdir}/enc.rb", <<END -#!#{master['puppetbindir']}/ruby -puts <<YAML -parameters: -environment: special -YAML -END -on master, "chmod 755 #{testdir}/enc.rb" - -master_opts = { - 'master' => { - 'node_terminus' => 'exec', - 'external_nodes' => "#{testdir}/enc.rb" - }, - 'special' => { - 'modulepath' => "#{testdir}/special" - } -} -if master.is_pe? - master_opts['special']['modulepath'] << ":#{master['sitemoduledir']}" -end - -on master, "mkdir -p #{testdir}/modules" -# Create a plugin file on the master -on master, "mkdir -p #{testdir}/special/amod/lib/puppet" -create_remote_file(master, "#{testdir}/special/amod/lib/puppet/foo.rb", "#special_version") - -on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" -on master, "chmod -R g+rwX #{testdir}" - -with_puppet_running_on master, master_opts, testdir do - - agents.each do |agent| - run_agent_on(agent, "--no-daemonize --onetime --server #{master}") - on agent, "cat \"#{agent.puppet['vardir']}/lib/puppet/foo.rb\"" - assert_match(/#special_version/, stdout, "The plugin from environment 'special' was not synced") - on agent, "rm -rf \"#{agent.puppet['vardir']}/lib\"" - end -end diff --git a/acceptance/tests/environment/use_environment_from_environmentpath.rb b/acceptance/tests/environment/use_environment_from_environmentpath.rb deleted file mode 100644 index 78fdce654..000000000 --- a/acceptance/tests/environment/use_environment_from_environmentpath.rb +++ /dev/null @@ -1,189 +0,0 @@ -test_name "Use environments from the environmentpath" - -testdir = create_tmpdir_for_user master, 'use_environmentpath' - -def generate_environment(path_to_env, environment) - env_content = <<-EOS - "#{path_to_env}/#{environment}":; - "#{path_to_env}/#{environment}/manifests":; - "#{path_to_env}/#{environment}/modules":; - EOS -end - -def generate_module_content(module_name, options = {}) - base_path = options[:base_path] - environment = options[:environment] - env_path = options[:env_path] - - path_to_module = [base_path, env_path, environment, "modules"].compact.join("/") - module_info = "module-#{module_name}" - module_info << "-from-#{environment}" if environment - - module_content = <<-EOS - "#{path_to_module}/#{module_name}":; - "#{path_to_module}/#{module_name}/manifests":; - "#{path_to_module}/#{module_name}/files":; - "#{path_to_module}/#{module_name}/templates":; - "#{path_to_module}/#{module_name}/lib":; - "#{path_to_module}/#{module_name}/lib/facter":; - - "#{path_to_module}/#{module_name}/manifests/init.pp": - ensure => file, - mode => 0640, - content => 'class #{module_name} { - notify { "template-#{module_name}": message => template("#{module_name}/our_template.erb") } - file { "$agent_file_location/file-#{module_info}": source => "puppet:///modules/#{module_name}/data" } - }' - ; - "#{path_to_module}/#{module_name}/lib/facter/environment_fact_#{module_name}.rb": - ensure => file, - mode => 0640, - content => "Facter.add(:environment_fact_#{module_name}) { setcode { 'environment fact from #{module_info}' } }" - ; - "#{path_to_module}/#{module_name}/files/data": - ensure => file, - mode => 0640, - content => "data file from #{module_info}" - ; - "#{path_to_module}/#{module_name}/templates/our_template.erb": - ensure => file, - mode => 0640, - content => "<%= @environment_fact_#{module_name} %>" - ; - EOS -end - -def generate_site_manifest(path_to_manifest, *modules_to_include) - manifest_content = <<-EOS - "#{path_to_manifest}/site.pp": - ensure => file, - mode => 0640, - content => "#{modules_to_include.map { |m| "include #{m}" }.join("\n")}" - ; - EOS -end - -master_user = on(master, "puppet master --configprint user").stdout.strip -apply_manifest_on(master, <<-MANIFEST, :catch_failures => true) -File { - ensure => directory, - owner => #{master_user}, - group => #{master['group']}, - mode => 0770, -} - -file { - "#{testdir}":; - "#{testdir}/base":; - "#{testdir}/additional":; - "#{testdir}/modules":; -#{generate_environment("#{testdir}/base", "shadowed")} -#{generate_environment("#{testdir}/base", "onlybase")} -#{generate_environment("#{testdir}/additional", "shadowed")} - -#{generate_module_content("atmp", - :base_path => testdir, - :env_path => 'base', - :environment => 'shadowed')} -#{generate_site_manifest("#{testdir}/base/shadowed/manifests", "atmp", "globalmod")} - -#{generate_module_content("atmp", - :base_path => testdir, - :env_path => 'base', - :environment => 'onlybase')} -#{generate_site_manifest("#{testdir}/base/onlybase/manifests", "atmp", "globalmod")} - -#{generate_module_content("atmp", - :base_path => testdir, - :env_path => 'additional', - :environment => 'shadowed')} -#{generate_site_manifest("#{testdir}/additional/shadowed/manifests", "atmp", "globalmod")} - -# And one global module (--modulepath setting) -#{generate_module_content("globalmod", :base_path => testdir)} - "#{testdir}/additional/production":; - "#{testdir}/additional/production/manifests":; -#{generate_site_manifest("#{testdir}/additional/production/manifests", "globalmod")} -} -MANIFEST - -def run_with_environment(agent, environment, options = {}) - expected_exit_code = options[:expected_exit_code] || 2 - expected_strings = options[:expected_strings] - - step "running an agent in environment '#{environment}'" - atmp = agent.tmpdir("use_environmentpath_#{environment}") - - agent_config = [ - "-t", - "--server", master, - ] - agent_config << '--environment' << environment if environment - # This to test how the agent behaves when using the directory environment - # loaders (which will not load an environment if it does not exist) - agent_config << "--environmentpath='$confdir/environments'" if agent != master - agent_config << { - 'ENV' => { "FACTER_agent_file_location" => atmp }, - } - - on(agent, - puppet("agent", *agent_config), - :acceptable_exit_codes => [expected_exit_code]) do |result| - - yield atmp, result - end - - on agent, "rm -rf #{atmp}" -end - -master_opts = { - 'master' => { - 'environmentpath' => "#{testdir}/additional:#{testdir}/base", - 'basemodulepath' => "#{testdir}/modules", - } -} -if master.is_pe? - master_opts['master']['basemodulepath'] << ":#{master['sitemoduledir']}" -end - -with_puppet_running_on master, master_opts, testdir do - agents.each do |agent| - run_with_environment(agent, "shadowed") do |tmpdir,catalog_result| - ["module-atmp-from-shadowed", "module-globalmod"].each do |expected| - assert_match(/environment fact from #{expected}/, catalog_result.stdout) - end - - ["module-atmp-from-shadowed", "module-globalmod"].each do |expected| - on agent, "cat #{tmpdir}/file-#{expected}" do |file_result| - assert_match(/data file from #{expected}/, file_result.stdout) - end - end - end - - run_with_environment(agent, "onlybase") do |tmpdir,catalog_result| - ["module-atmp-from-onlybase", "module-globalmod"].each do |expected| - assert_match(/environment fact from #{expected}/, catalog_result.stdout) - end - - ["module-atmp-from-onlybase", "module-globalmod"].each do |expected| - on agent, "cat #{tmpdir}/file-#{expected}" do |file_result| - assert_match(/data file from #{expected}/, file_result.stdout) - end - end - end - - if master.is_pe? - step("This test cannot run if the production environment directory does not exist, because the fallback production environment puppet creates has an empty modulepath and PE cannot run without it's basemodulepath in /opt. PUP-2519, which implicitly creates the production environment directory should allow this to run again") - else - run_with_environment(agent, nil, :expected_exit_code => 2) do |tmpdir, catalog_result| - assert_no_match(/module-atmp/, catalog_result.stdout, "module-atmp was included despite no environment being loaded") - - assert_match(/environment fact from module-globalmod/, catalog_result.stdout) - - on agent, "cat #{tmpdir}/file-module-globalmod" do |file_result| - assert_match(/data file from module-globalmod/, file_result.stdout) - end - end - end - end -end diff --git a/acceptance/tests/external_ca_support/apache_external_root_ca.rb b/acceptance/tests/external_ca_support/apache_external_root_ca.rb deleted file mode 100644 index 39bd194c1..000000000 --- a/acceptance/tests/external_ca_support/apache_external_root_ca.rb +++ /dev/null @@ -1,203 +0,0 @@ -begin - require 'puppet_x/acceptance/external_cert_fixtures' -rescue LoadError - $LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__)) - require 'puppet_x/acceptance/external_cert_fixtures' -end - -# This test only runs on EL-6 master roles. -confine :to, :platform => 'el-6' -confine :except, :type => 'pe' - -skip_test "Test not supported on jvm" if @options[:is_jvm_puppet] - -if master.use_service_scripts? - # Beaker defaults to leaving puppet running when using service scripts, - # Need to shut it down so we can start up our apache instance - on(master, puppet('resource', 'service', master['puppetservice'], 'ensure=stopped')) - - teardown do - # And ensure that it is up again after everything is done - on(master, puppet('resource', 'service', master['puppetservice'], 'ensure=running')) - end -end - -# Verify that a trivial manifest can be run to completion. -# Supported Setup: Single, Root CA -# - Agent and Master SSL cert issued by the Root CA -# - Revocation disabled on the agent `certificate_revocation = false` -# - CA disabled on the master `ca = false` -# -# SUPPORT NOTES -# -# * If the x509 alt names extension is used when issuing SSL server certificates -# for the Puppet master, then the client SSL certificate issued by an external -# CA must posses the DNS common name in the alternate name field. This is -# due to a bug in Ruby. If the CN is not duplicated in the Alt Names, then -# the following error will appear on the agent with MRI 1.8.7: -# -# Warning: Server hostname 'master1.example.org' did not match server -# certificate; expected one of master1.example.org, DNS:puppet, -# DNS:master-ca.example.org -# -# See: https://bugs.ruby-lang.org/issues/6493 -test_name "Puppet agent works with Apache, both configured with externally issued certificates from independent intermediate CA's" - -step "Copy certificates and configuration files to the master..." -fixture_dir = File.expand_path('../fixtures', __FILE__) -testdir = master.tmpdir('apache_external_root_ca') -fixtures = PuppetX::Acceptance::ExternalCertFixtures.new(fixture_dir, testdir) - -# We need this variable in scope. -disable_and_reenable_selinux = nil - -# Register our cleanup steps early in a teardown so that they will happen even -# if execution aborts part way. -teardown do - step "Cleanup Apache (httpd) and /etc/hosts" - # Restore /etc/hosts - on master, "cp -p '#{testdir}/hosts' /etc/hosts" - # stop the service before moving files around - on master, "/etc/init.d/httpd stop" - on master, "mv --force /etc/httpd/conf/httpd.conf{,.external_ca_test}" - on master, "mv --force /etc/httpd/conf/httpd.conf{.orig,}" - - if disable_and_reenable_selinux - step "Restore the original state of SELinux" - on master, "setenforce 1" - end -end - -# Read all of the CA certificates. - -# Copy all of the x.509 fixture data over to the master. -create_remote_file master, "#{testdir}/ca_root.crt", fixtures.root_ca_cert -create_remote_file master, "#{testdir}/ca_agent.crt", fixtures.agent_ca_cert -create_remote_file master, "#{testdir}/ca_master.crt", fixtures.master_ca_cert -create_remote_file master, "#{testdir}/ca_master.crl", fixtures.master_ca_crl -create_remote_file master, "#{testdir}/ca_master_bundle.crt", "#{fixtures.master_ca_cert}\n#{fixtures.root_ca_cert}\n" -create_remote_file master, "#{testdir}/ca_agent_bundle.crt", "#{fixtures.agent_ca_cert}\n#{fixtures.root_ca_cert}\n" -create_remote_file master, "#{testdir}/agent.crt", fixtures.agent_cert -create_remote_file master, "#{testdir}/agent.key", fixtures.agent_key -create_remote_file master, "#{testdir}/agent_email.crt", fixtures.agent_email_cert -create_remote_file master, "#{testdir}/agent_email.key", fixtures.agent_email_key -create_remote_file master, "#{testdir}/master.crt", fixtures.master_cert -create_remote_file master, "#{testdir}/master.key", fixtures.master_key -create_remote_file master, "#{testdir}/master_rogue.crt", fixtures.master_cert_rogue -create_remote_file master, "#{testdir}/master_rogue.key", fixtures.master_key_rogue - -## -# Now create the master and agent puppet.conf -# -# We need to create the public directory for Passenger and the modules -# directory to avoid `Error: Could not evaluate: Could not retrieve information -# from environment production source(s) puppet://master1.example.org/plugins` -on master, "mkdir -p #{testdir}/etc/{master/{public,modules/empty/lib},agent}" -# Backup /etc/hosts -on master, "cp -p /etc/hosts '#{testdir}/hosts'" - -# Make master1.example.org resolve if it doesn't already. -on master, "grep -q -x '#{fixtures.host_entry}' /etc/hosts || echo '#{fixtures.host_entry}' >> /etc/hosts" - -create_remote_file master, "#{testdir}/etc/agent/puppet.conf", fixtures.agent_conf -create_remote_file master, "#{testdir}/etc/agent/puppet.conf.crl", fixtures.agent_conf_crl -create_remote_file master, "#{testdir}/etc/agent/puppet.conf.email", fixtures.agent_conf_email -create_remote_file master, "#{testdir}/etc/master/puppet.conf", fixtures.master_conf - -# auth.conf to allow *.example.com access to the rest API -create_remote_file master, "#{testdir}/etc/master/auth.conf", fixtures.auth_conf - -create_remote_file master, "#{testdir}/etc/master/config.ru", fixtures.config_ru - -step "Set filesystem permissions and ownership for the master" -# These permissions are required for Passenger to start Puppet as puppet -on master, "chown -R puppet:puppet #{testdir}/etc/master" - -# These permissions are just for testing, end users should protect their -# private keys. -on master, "chmod -R a+rX #{testdir}" - -agent_cmd_prefix = "--confdir #{testdir}/etc/agent --vardir #{testdir}/etc/agent/var" - -step "Configure EPEL" -epel_release_path = "http://mirror.us.leaseweb.net/epel/6/i386/epel-release-6-8.noarch.rpm" -on master, "rpm -q epel-release || (yum -y install #{epel_release_path} && yum -y upgrade epel-release)" - -step "Configure Apache and Passenger" -packages = [ 'httpd', 'mod_ssl', 'mod_passenger', 'rubygem-passenger', 'policycoreutils-python' ] -packages.each do |pkg| - on master, "rpm -q #{pkg} || (yum -y install #{pkg})" -end - -create_remote_file master, "#{testdir}/etc/httpd.conf", fixtures.httpd_conf -on master, 'test -f /etc/httpd/conf/httpd.conf.orig || cp -p /etc/httpd/conf/httpd.conf{,.orig}' -on master, "cat #{testdir}/etc/httpd.conf > /etc/httpd/conf/httpd.conf" - -step "Make SELinux and Apache play nicely together..." - -on master, "sestatus" do - if stdout.match(/Current mode:.*enforcing/) - disable_and_reenable_selinux = true - else - disable_and_reenable_selinux = false - end -end - -if disable_and_reenable_selinux - on master, "setenforce 0" -end - -step "Start the Apache httpd service..." -on master, 'service httpd restart' - -# Move the agent SSL cert and key into place. -# The filename must match the configured certname, otherwise Puppet will try -# and generate a new certificate and key -step "Configure the agent with the externally issued certificates" -on master, "mkdir -p #{testdir}/etc/agent/ssl/{public_keys,certs,certificate_requests,private_keys,private}" -create_remote_file master, "#{testdir}/etc/agent/ssl/certs/#{fixtures.agent_name}.pem", fixtures.agent_cert -create_remote_file master, "#{testdir}/etc/agent/ssl/private_keys/#{fixtures.agent_name}.pem", fixtures.agent_key - -# Now, try and run the agent on the master against itself. -step "Successfully run the puppet agent on the master" -on master, puppet_agent("#{agent_cmd_prefix} --test"), :acceptable_exit_codes => (0..255) do - assert_no_match /Creating a new SSL key/, stdout - assert_no_match /\Wfailed\W/i, stderr - assert_no_match /\Wfailed\W/i, stdout - assert_no_match /\Werror\W/i, stderr - assert_no_match /\Werror\W/i, stdout - # Assert the exit code so we get a "Failed test" instead of an "Errored test" - assert exit_code == 0 -end - -step "Agent refuses to connect to a rogue master" -on master, puppet_agent("#{agent_cmd_prefix} --ssl_client_ca_auth=#{testdir}/ca_master.crt --masterport=8141 --test"), :acceptable_exit_codes => (0..255) do - assert_no_match /Creating a new SSL key/, stdout - assert_match /certificate verify failed/i, stderr - assert_match /The server presented a SSL certificate chain which does not include a CA listed in the ssl_client_ca_auth file/i, stderr - assert exit_code == 1 -end - -step "Master accepts client cert with email address in subject" -on master, "cp #{testdir}/etc/agent/puppet.conf{,.no_email}" -on master, "cp #{testdir}/etc/agent/puppet.conf{.email,}" -on master, puppet_agent("#{agent_cmd_prefix} --test"), :acceptable_exit_codes => (0..255) do - assert_no_match /\Wfailed\W/i, stdout - assert_no_match /\Wfailed\W/i, stderr - assert_no_match /\Werror\W/i, stdout - assert_no_match /\Werror\W/i, stderr - # Assert the exit code so we get a "Failed test" instead of an "Errored test" - assert exit_code == 0 -end - -step "Agent refuses to connect to revoked master" -on master, "cp #{testdir}/etc/agent/puppet.conf{,.no_crl}" -on master, "cp #{testdir}/etc/agent/puppet.conf{.crl,}" - -revoke_opts = "--hostcrl #{testdir}/ca_master.crl" -on master, puppet_agent("#{agent_cmd_prefix} #{revoke_opts} --test"), :acceptable_exit_codes => (0..255) do - assert_match /certificate revoked.*?example.org/, stderr - assert exit_code == 1 -end - -step "Finished testing External Certificates" diff --git a/acceptance/tests/external_ca_support/fixtures/agent-ca/ca-agent-ca.crt b/acceptance/tests/external_ca_support/fixtures/agent-ca/ca-agent-ca.crt deleted file mode 100644 index 0337bc3a5..000000000 --- a/acceptance/tests/external_ca_support/fixtures/agent-ca/ca-agent-ca.crt +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID3jCCAsagAwIBAgIBATANBgkqhkiG9w0BAQUFADBJMRAwDgYDVQQDDAdSb290 -IENBMRowGAYDVQQLDBFTZXJ2ZXIgT3BlcmF0aW9uczEZMBcGA1UECgwQRXhhbXBs -ZSBPcmcsIExMQzAeFw0xNDA0MDgwMTI1MzZaFw0zNDA0MDMwMTI1MzZaMH0xIzAh -BgNVBAMTGkludGVybWVkaWF0ZSBDQSAoYWdlbnQtY2EpMR8wHQYJKoZIhvcNAQkB -FhB0ZXN0QGV4YW1wbGUub3JnMRkwFwYDVQQKExBFeGFtcGxlIE9yZywgTExDMRow -GAYDVQQLExFTZXJ2ZXIgT3BlcmF0aW9uczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBANAjnBQPul4VZp8/PgnQxZtJQHhgWCRtLw5KDoZHFfQQxGW6utHb -MPIoX4qgJDb8msojb7ZO63C2BAjO5FHwhAwk3SciZX7VEt5YUYg0X1J7GyWHKWEt -yXEiIlXZ0xfXdzZ0kPskITQTLmKav7d08cN8SSqhAMeWhbiZ9xaCFWnYneqGdHc/ -Ps8EPszuJTiwrJsQtoxXFEdZfnJctlleGyZZFk/zg4M3P3RWr/ATBnMqL1Q4VfTd -9C23p+6kYhrYMxfWrawWAqyzn/G17X1TzQY4qW9Imn+RYLEQeBkO+KTl0Y+eaIOD -1PLfGaUu+XUumcMcbqyYgM5heqPEKHMs3g0CAwEAAaOBnDCBmTB5BgNVHSMEcjBw -gBQWr4Al4/rqSL+RM2YB/VHvJGdMY6FNpEswSTEQMA4GA1UEAwwHUm9vdCBDQTEa -MBgGA1UECwwRU2VydmVyIE9wZXJhdGlvbnMxGTAXBgNVBAoMEEV4YW1wbGUgT3Jn -LCBMTEOCCQCxuQRy+xEn4zAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAN -BgkqhkiG9w0BAQUFAAOCAQEAqyvoi3vDeE0Do7k2QiVF4WBhfGEW6921+UMVgMqB -SSV4mJ98ep4lrJA4VZPEW7jZWbox8fpH2WmA4DSK6lBMf7MoLSuDxaTmVDCvauGU -jtOD4ejIKWcJN8tkyFjz7DCca8x7EryZpr5sZMU78jZ/jOVwIK85FX/5ptQdoyo+ -j7TxWz464bUrlCOyzZEKIDViFeahY6Krfsfn60lmaWjXD5WSc9g5V/RA59cECpiT -Dl9Li9Weu0aXoF8nmWVhhBI1drmqvKbffAvQ42K4x2OTFG3r5wbCRSZTCGT2BWZW -M2HXCE5pMoTvM6H4PbMJsJw/x4qonM9HG81EcjHtKDUFGA== ------END CERTIFICATE----- diff --git a/acceptance/tests/external_ca_support/fixtures/agent-ca/ca-agent-ca.key b/acceptance/tests/external_ca_support/fixtures/agent-ca/ca-agent-ca.key deleted file mode 100644 index c83dca3b5..000000000 --- a/acceptance/tests/external_ca_support/fixtures/agent-ca/ca-agent-ca.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDQI5wUD7peFWaf -Pz4J0MWbSUB4YFgkbS8OSg6GRxX0EMRlurrR2zDyKF+KoCQ2/JrKI2+2TutwtgQI -zuRR8IQMJN0nImV+1RLeWFGINF9SexslhylhLclxIiJV2dMX13c2dJD7JCE0Ey5i -mr+3dPHDfEkqoQDHloW4mfcWghVp2J3qhnR3Pz7PBD7M7iU4sKybELaMVxRHWX5y -XLZZXhsmWRZP84ODNz90Vq/wEwZzKi9UOFX03fQtt6fupGIa2DMX1q2sFgKss5/x -te19U80GOKlvSJp/kWCxEHgZDvik5dGPnmiDg9Ty3xmlLvl1LpnDHG6smIDOYXqj -xChzLN4NAgMBAAECggEARD2Ym584fEZJ+iYzAebYEvymTZFQ9MhzaBzxvCasVPP2 -YGAjhlB2ML757CprFTgmy+VoZ/5iBPc4RWcHxrGzqYOgmocVfcsAP7P3L0/0fMdt -9BTnhTwM0rHdTgZ3xlZXeJwpOJ304Oz1BVE1UEHgTjZ+iqJ07fs05nxcXZ3SxXuu -yte/CtOxfiu12qw0Pa3en/wvkqeHPMrPYLD4PJznPIFmcfzVH6qO4DWtblW4HHLW -OqoqgjpuDLe1hjN5RZY0dLnvuKAr1d+ZKhvvuPPKGUR9J2/h/vV1ZMJDW45zJIu3 -XfoFUxxnrSBynBtyfFwkC2Btriryuu9HdfnMxCHpYQKBgQD/r0f36Zj7M571E+5Q -owCAE0qHRd/++p+KA3x/mVnECQ4c42QVwAwW99wd062k/9IbzVS6okbz1tKNsSvS -7TgWc1qAWeoxV8y2Fo3ovs8mOuRxnKMjWwlf9vOVEr49r1h/CP9iEzcjW147hw0m -EyWdBFBLQVLi/XdbguJW9e0bxQKBgQDQZVGM88r60yzo50kFLx4gVPx7nH8LDLkM -HM6Lxk5UQxbHZEzpGpxM+GEypHdRb5d5uITTzZSmosRuUc73mvTJE8hc5kcSZPsh -pEpSS4El7gcp/cmDNrHpqJdW4VwftJ8WYwFNOCCgLcmSNLJovc11j5NtGeP+Leqh -EsjWXOr1qQKBgAxuBv+kWY2MuuOLLoC5C+MuDOd6nCMXJ/5boQfK+rQvBIKfA1ST -W4MaVZcVnVFyJlK3rrDMBsr/3IiK3miIo7tjrDilJl9ztz365rcz33oqTsS/Kqcj -W9dQeBL9MEZrac/zLgcki/+qB3C5Zgg90gxKE2U1LcRfMhg+yqYTmo1JAoGBALWf -J+TdcJELzP8q26Pt/aaWCvo8WSirLPdWf9inuwqK8eZTDwi1jXUzn5qAZhEOXYjS -/MiPSje0cdfn6qY3YZGBcUUt2NE6OviF89QnQ+ZnvcymB6MY3xPSQBuTCzQCugfL -v42qFh0j6qJG1RqeGNuVhxo1z1NudydsdKcGkiwJAoGAYNbfuY3ccWmvX3K9ufL9 -M8m9ADXVE0o9LUQzZZwdv9IsQoeyufR7q0NUxrLqsracbJVhIoRzWZ7AUsWZ2qiX -eME8gioXoJVShTw9TpZY/nuH72iP/SbpZ9s+/43wNP0PTCS2ZQKwxmszz8Eg3qxN -D6ThCdnUCDA4JNQou0GozRQ= ------END PRIVATE KEY----- diff --git a/acceptance/tests/external_ca_support/fixtures/agent-ca/openssl.conf b/acceptance/tests/external_ca_support/fixtures/agent-ca/openssl.conf deleted file mode 100644 index 4259157e1..000000000 --- a/acceptance/tests/external_ca_support/fixtures/agent-ca/openssl.conf +++ /dev/null @@ -1,96 +0,0 @@ -SAN = DNS:puppet - -[ca] -default_ca = master_ca_config - -# Root CA -[root_ca_config] -certificate = /tmp/certchain.KDOYxTc2/agent-ca/ca-agent-ca.crt -private_key = /tmp/certchain.KDOYxTc2/agent-ca/ca-agent-ca.key -database = /tmp/certchain.KDOYxTc2/agent-ca/inventory.txt -new_certs_dir = /tmp/certchain.KDOYxTc2/agent-ca/certs -serial = /tmp/certchain.KDOYxTc2/agent-ca/serial - -default_crl_days = 7300 -default_days = 7300 -default_md = sha1 - -policy = root_ca_policy -x509_extensions = root_ca_exts - -[root_ca_policy] -commonName = supplied -emailAddress = supplied -organizationName = supplied -organizationalUnitName = supplied - -[root_ca_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:true -keyUsage = keyCertSign, cRLSign - -# Master CA -[master_ca_config] -certificate = /tmp/certchain.KDOYxTc2/agent-ca/ca-agent-ca.crt -private_key = /tmp/certchain.KDOYxTc2/agent-ca/ca-agent-ca.key -database = /tmp/certchain.KDOYxTc2/agent-ca/inventory.txt -new_certs_dir = /tmp/certchain.KDOYxTc2/agent-ca/certs -serial = /tmp/certchain.KDOYxTc2/agent-ca/serial - -default_crl_days = 7300 -default_days = 7300 -default_md = sha1 - -policy = master_ca_policy -x509_extensions = master_ca_exts - -# Master CA (Email) -[master_ca_email_config] -certificate = /tmp/certchain.KDOYxTc2/agent-ca/ca-agent-ca.crt -private_key = /tmp/certchain.KDOYxTc2/agent-ca/ca-agent-ca.key -database = /tmp/certchain.KDOYxTc2/agent-ca/inventory.txt -new_certs_dir = /tmp/certchain.KDOYxTc2/agent-ca/certs -serial = /tmp/certchain.KDOYxTc2/agent-ca/serial - -default_crl_days = 7300 -default_days = 7300 -default_md = sha1 - -email_in_dn = yes - -policy = master_ca_email_policy -x509_extensions = master_ca_exts - -[master_ca_policy] -commonName = supplied - -[master_ca_email_policy] -commonName = supplied -emailAddress = supplied - -# default extensions for clients -[master_ca_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:false -keyUsage = keyEncipherment, digitalSignature -extendedKeyUsage = serverAuth, clientAuth - -[master_ssl_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:false -keyUsage = keyEncipherment, digitalSignature -extendedKeyUsage = serverAuth, clientAuth -subjectAltName = $ENV::SAN - -# extensions for the master certificate (specifically adding subjectAltName) -[master_self_ca_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:false -keyUsage = keyEncipherment, digitalSignature -extendedKeyUsage = serverAuth, clientAuth -# include the master's fqdn here, as well as in the CN, to work -# around https://bugs.ruby-lang.org/issues/6493 -# NOTE: Alt Names should be set in the request, so they know -# their FQDN -# subjectAltName = DNS:puppet,DNS:agent-ca.example.org - diff --git a/acceptance/tests/external_ca_support/fixtures/agent-ca/serial b/acceptance/tests/external_ca_support/fixtures/agent-ca/serial deleted file mode 100644 index adb9de8ee..000000000 --- a/acceptance/tests/external_ca_support/fixtures/agent-ca/serial +++ /dev/null @@ -1 +0,0 @@ -08 diff --git a/acceptance/tests/external_ca_support/fixtures/auth.conf b/acceptance/tests/external_ca_support/fixtures/auth.conf deleted file mode 100644 index f0d589588..000000000 --- a/acceptance/tests/external_ca_support/fixtures/auth.conf +++ /dev/null @@ -1,60 +0,0 @@ -# Puppet 3.1.1 auth.conf, modified to allow requests from example.org for -# external ca testing. - -# allow nodes to retrieve their own catalog -path ~ ^/catalog/([^/]+)$ -method find -allow *.example.org -allow $1 - -# allow nodes to retrieve their own node definition -path ~ ^/node/([^/]+)$ -method find -allow *.example.org -allow $1 - -# allow all nodes to access the certificates services -path /certificate_revocation_list/ca -method find -allow * - -# allow all nodes to store their own reports -path ~ ^/report/([^/]+)$ -method save -allow *.example.org -allow $1 - -# Allow all nodes to access all file services; this is necessary for -# pluginsync, file serving from modules, and file serving from custom -# mount points (see fileserver.conf). Note that the `/file` prefix matches -# requests to both the file_metadata and file_content paths. See "Examples" -# above if you need more granular access control for custom mount points. -path /file -allow * - -### Unauthenticated ACLs, for clients without valid certificates; authenticated -### clients can also access these paths, though they rarely need to. - -# allow access to the CA certificate; unauthenticated nodes need this -# in order to validate the puppet master's certificate -path /certificate/ca -auth any -method find -allow * - -# allow nodes to retrieve the certificate they requested earlier -path /certificate/ -auth any -method find -allow * - -# allow nodes to request a new certificate -path /certificate_request -auth any -method find, save -allow * - -# deny everything else; this ACL is not strictly necessary, but -# illustrates the default policy. -path / -auth any diff --git a/acceptance/tests/external_ca_support/fixtures/certchain.sh b/acceptance/tests/external_ca_support/fixtures/certchain.sh deleted file mode 100755 index b104db175..000000000 --- a/acceptance/tests/external_ca_support/fixtures/certchain.sh +++ /dev/null @@ -1,553 +0,0 @@ -#! /bin/bash - -## NOTE: -## This script requires the following in /etc/hosts: -## 127.0.0.2 puppet master1.example.org - -# This will fail with a stock puppet 3.1.1, but will succeed if all of the -# certificate subjects contain only the "CN" portion, and no O, OU, or -# emailAddress. - -# basic config to describe the environment -# B="/tmp/certchain" -B="$(mktemp -d -t certchain.XXXXXXXX)" -HTTPS_PORT=8443 -OPENSSL=$(which openssl) - -# utility method to dedent a heredoc -dedent() { - python -c 'import sys, textwrap; print textwrap.dedent(sys.stdin.read())' -} - -# invoke openssl -openssl() { - echo "----" - echo "running" ${OPENSSL} ${@} - echo " in $PWD" - ${OPENSSL} "${@}" -} - -show_cert() { - local cert="$1" - # openssl x509 -in "${cert}" -noout -text -nameopt RFC2253 - openssl x509 -in "${cert}" -noout -text -} - -hash_cert() { - local cert="$1" - local certdir="${B}/certdir" - local h=$(${OPENSSL} x509 -hash -noout -in ${cert}) - mkdir -p "${certdir}" - ln -s "$cert" "${certdir}/${h}.0" -} - -show_crl() { - local crl="$1" - openssl crl -in "${crl}" -noout -text -} - -hash_crl() { - local crl="$1" - local certdir="${B}/certdir" - local h=$(${OPENSSL} crl -hash -noout -in ${crl}) - mkdir -p "${certdir}" - ln -s "$crl" "${certdir}/${h}.r0" -} - -# clean out any messes this script has made -clean_up() { - stop_apache - rm -rf "$B" -} - -stop_apache() { - local pid pidfile="${B}/apache/httpd.pid" - while true; do - pid=$(cat "${pidfile}" 2>/dev/null || true) - [ -z "$pid" ] && break # break if the pid is gone - kill "$pid" || break # break if the kill fails (process is gone) - sleep 0.1 - done -} - -# perform basic setup: make directories, etc. -set_up() { - mkdir -p "$B" -} - -# create CA certificates: -# -# * $B/root_ca -# * $B/master{1..2}_ca -# -# with each containing: -# -# * openssl.conf -- suitable for signing certificates -# * ca-$name.key -- PEM format certificate key, with no password -# * ca-$name.crt -- PEM format certificate -create_ca_certs() { - local name cn dir subj ca_config - for name in root agent-ca master-ca; do - dir="${B}/${name}" - mkdir -p "${dir}" - ( cd "${dir}" - # if this is the root cert, make a self-signed cert - if [ "$name" = "root" ]; then - subj="/CN=Root CA/OU=Server Operations/O=Example Org, LLC" - openssl req -new -newkey rsa:2048 -days 7300 -nodes -x509 \ - -subj "${subj}" -keyout "ca-${name}.key" -out "ca-${name}.crt" - else - # make a new key for the CA - openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out "ca-${name}.key" - - # build a CSR out of it - dedent > openssl.tmp << OPENSSL_TMP - [req] - prompt = no - distinguished_name = dn_config - - [dn_config] - commonName = Intermediate CA (${name}) - emailAddress = test@example.org - organizationalUnitName = Server Operations - organizationName = Example Org, LLC -OPENSSL_TMP - openssl req -config openssl.tmp -new -key "ca-${name}.key" -out "ca-${name}.csr" - rm openssl.tmp - - # sign it with the root CA - openssl ca -config ../root/openssl.conf -in "ca-${name}.csr" -notext -out "ca-${name}.crt" -batch - - # clean up the now-redundant csr - rm "ca-${name}.csr" - fi - - # set up the CA config; this uses the same file for all, but with different options - # for the root and master CAs - [ "$name" = "root" ] && ca_config=root_ca_config || ca_config=master_ca_config - - dedent > openssl.conf << OPENSSL_CONF - SAN = DNS:puppet - - [ca] - default_ca = ${ca_config} - - # Root CA - [root_ca_config] - certificate = ${dir}/ca-${name}.crt - private_key = ${dir}/ca-${name}.key - database = ${dir}/inventory.txt - new_certs_dir = ${dir}/certs - serial = ${dir}/serial - - default_crl_days = 7300 - default_days = 7300 - default_md = sha1 - - policy = root_ca_policy - x509_extensions = root_ca_exts - - [root_ca_policy] - commonName = supplied - emailAddress = supplied - organizationName = supplied - organizationalUnitName = supplied - - [root_ca_exts] - authorityKeyIdentifier = keyid,issuer:always - basicConstraints = critical,CA:true - keyUsage = keyCertSign, cRLSign - - # Master CA - [master_ca_config] - certificate = ${dir}/ca-${name}.crt - private_key = ${dir}/ca-${name}.key - database = ${dir}/inventory.txt - new_certs_dir = ${dir}/certs - serial = ${dir}/serial - - default_crl_days = 7300 - default_days = 7300 - default_md = sha1 - - policy = master_ca_policy - x509_extensions = master_ca_exts - - # Master CA (Email) - [master_ca_email_config] - certificate = ${dir}/ca-${name}.crt - private_key = ${dir}/ca-${name}.key - database = ${dir}/inventory.txt - new_certs_dir = ${dir}/certs - serial = ${dir}/serial - - default_crl_days = 7300 - default_days = 7300 - default_md = sha1 - - email_in_dn = yes - - policy = master_ca_email_policy - x509_extensions = master_ca_exts - - [master_ca_policy] - commonName = supplied - - [master_ca_email_policy] - commonName = supplied - emailAddress = supplied - - # default extensions for clients - [master_ca_exts] - authorityKeyIdentifier = keyid,issuer:always - basicConstraints = critical,CA:false - keyUsage = keyEncipherment, digitalSignature - extendedKeyUsage = serverAuth, clientAuth - - [master_ssl_exts] - authorityKeyIdentifier = keyid,issuer:always - basicConstraints = critical,CA:false - keyUsage = keyEncipherment, digitalSignature - extendedKeyUsage = serverAuth, clientAuth - subjectAltName = \$ENV::SAN - - # extensions for the master certificate (specifically adding subjectAltName) - [master_self_ca_exts] - authorityKeyIdentifier = keyid,issuer:always - basicConstraints = critical,CA:false - keyUsage = keyEncipherment, digitalSignature - extendedKeyUsage = serverAuth, clientAuth - # include the master's fqdn here, as well as in the CN, to work - # around https://bugs.ruby-lang.org/issues/6493 - # NOTE: Alt Names should be set in the request, so they know - # their FQDN - # subjectAltName = DNS:puppet,DNS:${name}.example.org -OPENSSL_CONF - touch inventory.txt - mkdir certs - echo 01 > serial - - show_cert "${dir}/ca-${name}.crt" - hash_cert "${dir}/ca-${name}.crt" - - # generate an empty CRL for this CA - openssl ca -config "${dir}/openssl.conf" -gencrl -out "${dir}/ca-${name}.crl" - - show_crl "${dir}/ca-${name}.crl" - hash_crl "${dir}/ca-${name}.crl" - ) - done -} - -# revoke leaf cert for $1 issued by master CA $2 -revoke_leaf_cert() { - local fqdn="$1" - local ca="${2:-agent-ca}" - local dir="${B}/${ca}" - - # revoke the cert and regenerate the crl - openssl ca -config "${dir}/openssl.conf" -revoke "${B}/leaves/${fqdn}.issued_by.${ca}.crt" - openssl ca -config "${dir}/openssl.conf" -gencrl -out "${dir}/ca-${ca}.crl" - show_crl "${dir}/ca-${ca}.crl" - # kill -HUP $(< "${B}/apache/httpd.pid") -} - -# revoke CA cert for $1 -revoke_ca_cert() { - local master="$1" - local dir="${B}/root" - - # revoke the cert and regenerate the crl - openssl ca -config "${dir}/openssl.conf" -revoke "${B}/${master}/ca-${master}.crt" - openssl ca -config "${dir}/openssl.conf" -gencrl -out "${dir}/ca-root.crl" - show_crl "${dir}/ca-root.crl" - kill -HUP $(< "${B}/apache/httpd.pid") -} - -# create a "leaf" certificate for the given fqdn, signed by the given ca name. -# $fqdn.issued_by.${ca}.{key,crt} will be placed in "${B}/leaves" -create_leaf_cert() { - local fqdn="$1" ca="$2" exts="$3" - local masterdir="${B}/${ca}" - local dir="${B}/leaves" - local fname="${fqdn}.issued_by.${ca}" - - [ -n "$exts" ] && exts="-extensions $exts" - - mkdir -p "${dir}" - ( cd "${dir}" - - openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out "${fname}.key" - openssl req -subj "/CN=${fqdn}" -new -key "${fname}.key" -out "${fname}.csr" - CN="${fqdn}" SAN="DNS:${fqdn}, DNS:${fqdn%%.*}, DNS:puppet, DNS:puppetmaster" \ - openssl ca -config "${B}/${ca}/openssl.conf" -in "${fname}.csr" -notext \ - -out "${fname}.crt" -batch $exts - ) - show_cert "${dir}/${fname}.crt" -} - -# Note, we can parameterize SubjectAltNames using environment variables. -create_leaf_certs() { - create_leaf_cert master1.example.org master-ca master_ssl_exts - create_leaf_cert master2.example.org master-ca master_ssl_exts - - create_leaf_cert agent1.example.org agent-ca - create_leaf_cert agent2.example.org agent-ca - create_leaf_cert agent3.example.org agent-ca - - create_leaf_cert master1.example.org agent-ca master_ssl_exts # rogue - # create_leaf_cert master1.example.org root master_ssl_exts # rogue - - create_leaf_cert agent1.example.org master-ca # rogue - # create_leaf_cert agent1.example.org root # rogue -} - -# create a "leaf" certificate for the given fqdn, signed by the given ca name, -# with an email address in the subject. -# $fqdn.issued_by.${ca}.{key,crt} will be placed in "${B}/leaves" -create_leaf_email_cert() { - local fqdn="$1" ca="$2" exts="$3" - local masterdir="${B}/${ca}" - local dir="${B}/leaves" - local fname="${fqdn}.issued_by.${ca}" - - mkdir -p "${dir}" - ( cd "${dir}" - - openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out "${fname}.key" - openssl req -subj "/CN=${fqdn}/emailAddress=test@example.com" -new -key "${fname}.key" -out "${fname}.csr" - - openssl ca -config "${B}/${ca}/openssl.conf" -name master_ca_email_config \ - -in "${fname}.csr" -notext -out "${fname}.crt" -batch $exts_arg - ) - show_cert "${dir}/${fname}.crt" -} - -create_leaf_email_certs() { - create_leaf_email_cert master-email1.example.org master-ca master_self_ca_exts - create_leaf_email_cert master-email2.example.org master-ca master_self_ca_exts - create_leaf_email_cert agent-email1.example.org agent-ca - create_leaf_email_cert agent-email2.example.org agent-ca - create_leaf_email_cert agent-email3.example.org agent-ca -} - -set_up_apache() { - local apachedir="${B}/apache" - mkdir -p "${apachedir}/puppetmaster/public" - - echo 'passed'> "${apachedir}/puppetmaster/public/test.txt" - dedent > "${apachedir}/httpd.conf" <<HTTPD_CONF - LoadModule mpm_prefork_module modules/mod_mpm_prefork.so - LoadModule unixd_module modules/mod_unixd.so - LoadModule authn_core_module modules/mod_authn_core.so - LoadModule authz_core_module modules/mod_authz_core.so - LoadModule ssl_module modules/mod_ssl.so - LoadModule headers_module modules/mod_headers.so - LoadModule passenger_module modules/mod_passenger.so - - # NOTE: these may be "fun" to make portable.. - PassengerRoot /usr/share/gems/gems/passenger-3.0.17 - PassengerRuby /usr/bin/ruby - - PidFile "${apachedir}/httpd.pid" - ErrorLog "${apachedir}/error_log" - LogLevel debug - - Listen ${HTTPS_PORT} https - SSLRandomSeed startup file:/dev/urandom 256 - SSLRandomSeed connect builtin - SSLEngine on - SSLProtocol all -SSLv2 - SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 - - # puppet-relevant SSL config: - - SSLCertificateFile "${B}/leaves/master1.example.org.crt" - SSLCertificateKeyFile "${B}/leaves/master1.example.org.key" - # chain in the intermediate cert for this master - SSLCertificateChainFile "${B}/master1/ca-master1.crt" - SSLCACertificatePath "${B}/certdir" - SSLCARevocationPath "${B}/certdir" - SSLCARevocationCheck chain - SSLVerifyClient optional - SSLVerifyDepth 2 - SSLOptions +StdEnvVars - RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e - RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e - RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e - - ServerName master1.example.org - DocumentRoot "${apachedir}/puppetmaster/public" - - # NOTE: this is httpd-2.4 syntax - <Directory "${apachedir}/puppetmaster/public"> - Require all granted - </Directory> - - RackAutoDetect On - RackBaseURI / -HTTPD_CONF -} - -set_up_puppetmaster() { - local apachedir="${B}/apache" - local masterdir="${B}/puppetmaster" - mkdir -p "${masterdir}/conf" "${masterdir}/var" "${masterdir}/manifests" - dedent > "${apachedir}/puppetmaster/config.ru" <<CONFIG_RU - \$0 = "master" - ARGV << "--rack" - ARGV << "--debug" - ARGV << "--confdir=${masterdir}/conf" - ARGV << "--vardir=${masterdir}/var" - require 'puppet/application/master' - run Puppet::Application[:master].run -CONFIG_RU - - dedent > "${masterdir}/conf/puppet.conf" <<PUPPET_CONF - [main] - node_name = cert - strict_hostname_checking = true - - [master] - ca = false - ssl_client_header = SSL_CLIENT_S_DN - ssl_client_verify_header = SSL_CLIENT_VERIFY - manifestdir = ${masterdir}/manifests -PUPPET_CONF - dedent > "${masterdir}/manifests/site.pp" <<SITE_PP - node /client.*.example.org/ { - file { "${B}/i_was_here": - content => "yes I was" - } - } -SITE_PP -} - -start_apache() { - local apachedir="${B}/apache" - if ! httpd -f "${apachedir}/httpd.conf"; then - [ -f "${apachedir}/error_log" ] && tail "${apachedir}/error_log" - false - fi -} - -check_apache() { - # verify the SSL config with openssl. Note that s_client exits with 0 - # no matter what, so this greps the output for an OK status. Also note - # that this only checks that the validation of the server certs is OK, since - # client validation is optional in the httpd config. - echo $'GET /test.txt HTTP/1.0\n' | \ - openssl s_client -connect "127.0.0.1:${HTTPS_PORT}" -verify 2 \ - -cert "${B}/leaves/client2a.example.org.crt" \ - -key "${B}/leaves/client2a.example.org.key" \ - -CAfile "${B}/root/ca-root.crt" \ - | tee "${B}/verify.out" - cat "${B}/apache/error_log" - grep -q "Verify return code: 0 (ok)" "${B}/verify.out" -} - -check_puppetmaster() { - # this is insecure, because otherwise curl will check that 127.0.0.1 == - # master1.example.org and fail; validation of the server certs is done - # above in check_apache, so this is fine. - curl -vks --fail \ - --header 'Accept: yaml' \ - --cert "${B}/leaves/client2a.example.org.crt" \ - --key "${B}/leaves/client2a.example.org.key" \ - "https://127.0.0.1:${HTTPS_PORT}/production/catalog/client2a.example.org" >/dev/null - echo -} - -# set up the agent with the given fqdn -set_up_agent() { - local fqdn="$1" - local agentdir="${B}/agent" - mkdir -p "${agentdir}/conf" "${agentdir}/var" - mkdir -p "${agentdir}/conf/ssl/private_keys" "${agentdir}/conf/ssl/certs" - - dedent > "${agentdir}/conf/puppet.conf" <<PUPPET_CONF - [agent] - server = master1.example.org - # agent can't verify CRLs for a chain - certificate_revocation = false - masterport = ${HTTPS_PORT} - ca_port = ${HTTPS_PORT} - report = false -PUPPET_CONF - # the client needs its own leaf cert/key and the root CA cert - cp "${B}/leaves/${fqdn}.key" "${agentdir}/conf/ssl/private_keys/${fqdn}.pem" - cp "${B}/leaves/${fqdn}.crt" "${agentdir}/conf/ssl/certs/${fqdn}.pem" - cp "${B}/root/ca-root.crt" "${agentdir}/conf/ssl/certs/ca.pem" -} - -# run the agent with the given fqdn; with -f, expect it to fail -run_agent() { - local fqdn="$1" - local expfail=false - local agentdir="${B}/agent" - if [ "$2" = "-f" ]; then - expfail=true - fi - - # the manifest will create this file - rm -f "${B}/i_was_here" - - if puppet agent --test --debug \ - --confdir=/tmp/certchain/agent/conf/ --vardir=/tmp/certchain/agent/var/ \ - --fqdn "${fqdn}"; then - if ${expfail}; then - false - fi - # This appears not to work in 3.1.x - #test -f "${B}/i_was_here" - else - echo "expected failure" - if ! ${expfail}; then - false - fi - # This appears not to work in 3.1.x - #test ! -f "${B}/i_was_here" - fi -} - -call() { - echo "==== $1 ====" - "${@}" -} - -main() { - call clean_up - call set_up - call create_ca_certs - call create_leaf_certs - call create_leaf_email_certs - - # Revoke the second agent and see it fail. - call revoke_leaf_cert agent2.example.org - call revoke_leaf_cert master1.example.org master-ca - - exit 0 - call set_up_apache - call set_up_puppetmaster - call start_apache - call check_apache - call check_puppetmaster - - # set up the client to run normally, then revoke the client's cert and see it fail - call set_up_agent client2a.example.org - call run_agent client2a.example.org - call revoke_leaf_cert client2a.example.org master2 - call run_agent client2a.example.org -f - - # set up the client to run another host, then revoke master2's CA cert - call set_up_agent client2b.example.org - call run_agent client2b.example.org - call revoke_ca_cert master2 - call run_agent client2b.example.org -f - - call clean_up -} - -set -x -set -e -main diff --git a/acceptance/tests/external_ca_support/fixtures/httpd.conf b/acceptance/tests/external_ca_support/fixtures/httpd.conf deleted file mode 100644 index 56707376f..000000000 --- a/acceptance/tests/external_ca_support/fixtures/httpd.conf +++ /dev/null @@ -1,117 +0,0 @@ -ServerRoot "/etc/httpd" -PidFile run/httpd.pid -Timeout 60 -KeepAlive Off -MaxKeepAliveRequests 100 -KeepAliveTimeout 15 - -<IfModule prefork.c> -StartServers 8 -MinSpareServers 5 -MaxSpareServers 20 -ServerLimit 256 -MaxClients 256 -MaxRequestsPerChild 4000 -</IfModule> - -<IfModule worker.c> -StartServers 4 -MaxClients 300 -MinSpareThreads 25 -MaxSpareThreads 75 -ThreadsPerChild 25 -MaxRequestsPerChild 0 -</IfModule> - -LoadModule auth_basic_module modules/mod_auth_basic.so -LoadModule auth_digest_module modules/mod_auth_digest.so -LoadModule authn_file_module modules/mod_authn_file.so -LoadModule authn_alias_module modules/mod_authn_alias.so -LoadModule authn_anon_module modules/mod_authn_anon.so -LoadModule authn_dbm_module modules/mod_authn_dbm.so -LoadModule authn_default_module modules/mod_authn_default.so -LoadModule authz_host_module modules/mod_authz_host.so -LoadModule authz_user_module modules/mod_authz_user.so -LoadModule authz_owner_module modules/mod_authz_owner.so -LoadModule authz_groupfile_module modules/mod_authz_groupfile.so -LoadModule authz_dbm_module modules/mod_authz_dbm.so -LoadModule authz_default_module modules/mod_authz_default.so -LoadModule ldap_module modules/mod_ldap.so -LoadModule authnz_ldap_module modules/mod_authnz_ldap.so -LoadModule include_module modules/mod_include.so -LoadModule log_config_module modules/mod_log_config.so -LoadModule logio_module modules/mod_logio.so -LoadModule env_module modules/mod_env.so -LoadModule ext_filter_module modules/mod_ext_filter.so -LoadModule mime_magic_module modules/mod_mime_magic.so -LoadModule expires_module modules/mod_expires.so -LoadModule deflate_module modules/mod_deflate.so -LoadModule headers_module modules/mod_headers.so -LoadModule usertrack_module modules/mod_usertrack.so -LoadModule setenvif_module modules/mod_setenvif.so -LoadModule mime_module modules/mod_mime.so -LoadModule dav_module modules/mod_dav.so -LoadModule status_module modules/mod_status.so -LoadModule autoindex_module modules/mod_autoindex.so -LoadModule info_module modules/mod_info.so -LoadModule dav_fs_module modules/mod_dav_fs.so -LoadModule vhost_alias_module modules/mod_vhost_alias.so -LoadModule negotiation_module modules/mod_negotiation.so -LoadModule dir_module modules/mod_dir.so -LoadModule actions_module modules/mod_actions.so -LoadModule speling_module modules/mod_speling.so -LoadModule userdir_module modules/mod_userdir.so -LoadModule alias_module modules/mod_alias.so -LoadModule substitute_module modules/mod_substitute.so -LoadModule rewrite_module modules/mod_rewrite.so -LoadModule proxy_module modules/mod_proxy.so -LoadModule proxy_balancer_module modules/mod_proxy_balancer.so -LoadModule proxy_ftp_module modules/mod_proxy_ftp.so -LoadModule proxy_http_module modules/mod_proxy_http.so -LoadModule proxy_ajp_module modules/mod_proxy_ajp.so -LoadModule proxy_connect_module modules/mod_proxy_connect.so -LoadModule cache_module modules/mod_cache.so -LoadModule suexec_module modules/mod_suexec.so -LoadModule disk_cache_module modules/mod_disk_cache.so -LoadModule cgi_module modules/mod_cgi.so -LoadModule version_module modules/mod_version.so - -LoadModule ssl_module modules/mod_ssl.so -LoadModule passenger_module modules/mod_passenger.so - -PassengerRoot /usr/share/gems/gems/passenger-3.0.17 -PassengerRuby /usr/bin/ruby - -Listen 8140 https -SSLRandomSeed startup file:/dev/urandom 256 -SSLRandomSeed connect builtin -SSLEngine on -SSLProtocol all -SSLv2 -SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 - -# puppet-relevant SSL config: - -SSLCertificateFile "${B}/leaves/master1.example.org.crt" -SSLCertificateKeyFile "${B}/leaves/master1.example.org.key" -# chain in the intermediate cert for this master -SSLCertificateChainFile "${B}/master1/ca-master1.crt" -SSLCACertificatePath "${B}/certdir" -SSLCARevocationPath "${B}/certdir" -SSLCARevocationCheck chain -SSLVerifyClient optional -SSLVerifyDepth 2 -SSLOptions +StdEnvVars -RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e -RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e -RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e - -ServerName master1.example.org -DocumentRoot "${apachedir}/puppetmaster/public" - -# NOTE: this is httpd-2.4 syntax -<Directory "${apachedir}/puppetmaster/public"> - Require all granted -</Directory> - -RackAutoDetect On -RackBaseURI / diff --git a/acceptance/tests/external_ca_support/fixtures/httpd.conf.el6.orig b/acceptance/tests/external_ca_support/fixtures/httpd.conf.el6.orig deleted file mode 100644 index d87a32652..000000000 --- a/acceptance/tests/external_ca_support/fixtures/httpd.conf.el6.orig +++ /dev/null @@ -1,1009 +0,0 @@ -# -# This is the main Apache server configuration file. It contains the -# configuration directives that give the server its instructions. -# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information. -# In particular, see -# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html> -# for a discussion of each configuration directive. -# -# -# Do NOT simply read the instructions in here without understanding -# what they do. They're here only as hints or reminders. If you are unsure -# consult the online docs. You have been warned. -# -# The configuration directives are grouped into three basic sections: -# 1. Directives that control the operation of the Apache server process as a -# whole (the 'global environment'). -# 2. Directives that define the parameters of the 'main' or 'default' server, -# which responds to requests that aren't handled by a virtual host. -# These directives also provide default values for the settings -# of all virtual hosts. -# 3. Settings for virtual hosts, which allow Web requests to be sent to -# different IP addresses or hostnames and have them handled by the -# same Apache server process. -# -# Configuration and logfile names: If the filenames you specify for many -# of the server's control files begin with "/" (or "drive:/" for Win32), the -# server will use that explicit path. If the filenames do *not* begin -# with "/", the value of ServerRoot is prepended -- so "logs/foo.log" -# with ServerRoot set to "/etc/httpd" will be interpreted by the -# server as "/etc/httpd/logs/foo.log". -# - -### Section 1: Global Environment -# -# The directives in this section affect the overall operation of Apache, -# such as the number of concurrent requests it can handle or where it -# can find its configuration files. -# - -# -# Don't give away too much information about all the subcomponents -# we are running. Comment out this line if you don't mind remote sites -# finding out what major optional modules you are running -ServerTokens OS - -# -# ServerRoot: The top of the directory tree under which the server's -# configuration, error, and log files are kept. -# -# NOTE! If you intend to place this on an NFS (or otherwise network) -# mounted filesystem then please read the LockFile documentation -# (available at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>); -# you will save yourself a lot of trouble. -# -# Do NOT add a slash at the end of the directory path. -# -ServerRoot "/etc/httpd" - -# -# PidFile: The file in which the server should record its process -# identification number when it starts. Note the PIDFILE variable in -# /etc/sysconfig/httpd must be set appropriately if this location is -# changed. -# -PidFile run/httpd.pid - -# -# Timeout: The number of seconds before receives and sends time out. -# -Timeout 60 - -# -# KeepAlive: Whether or not to allow persistent connections (more than -# one request per connection). Set to "Off" to deactivate. -# -KeepAlive Off - -# -# MaxKeepAliveRequests: The maximum number of requests to allow -# during a persistent connection. Set to 0 to allow an unlimited amount. -# We recommend you leave this number high, for maximum performance. -# -MaxKeepAliveRequests 100 - -# -# KeepAliveTimeout: Number of seconds to wait for the next request from the -# same client on the same connection. -# -KeepAliveTimeout 15 - -## -## Server-Pool Size Regulation (MPM specific) -## - -# prefork MPM -# StartServers: number of server processes to start -# MinSpareServers: minimum number of server processes which are kept spare -# MaxSpareServers: maximum number of server processes which are kept spare -# ServerLimit: maximum value for MaxClients for the lifetime of the server -# MaxClients: maximum number of server processes allowed to start -# MaxRequestsPerChild: maximum number of requests a server process serves -<IfModule prefork.c> -StartServers 8 -MinSpareServers 5 -MaxSpareServers 20 -ServerLimit 256 -MaxClients 256 -MaxRequestsPerChild 4000 -</IfModule> - -# worker MPM -# StartServers: initial number of server processes to start -# MaxClients: maximum number of simultaneous client connections -# MinSpareThreads: minimum number of worker threads which are kept spare -# MaxSpareThreads: maximum number of worker threads which are kept spare -# ThreadsPerChild: constant number of worker threads in each server process -# MaxRequestsPerChild: maximum number of requests a server process serves -<IfModule worker.c> -StartServers 4 -MaxClients 300 -MinSpareThreads 25 -MaxSpareThreads 75 -ThreadsPerChild 25 -MaxRequestsPerChild 0 -</IfModule> - -# -# Listen: Allows you to bind Apache to specific IP addresses and/or -# ports, in addition to the default. See also the <VirtualHost> -# directive. -# -# Change this to Listen on specific IP addresses as shown below to -# prevent Apache from glomming onto all bound IP addresses (0.0.0.0) -# -#Listen 12.34.56.78:80 -Listen 80 - -# -# Dynamic Shared Object (DSO) Support -# -# To be able to use the functionality of a module which was built as a DSO you -# have to place corresponding `LoadModule' lines at this location so the -# directives contained in it are actually available _before_ they are used. -# Statically compiled modules (those listed by `httpd -l') do not need -# to be loaded here. -# -# Example: -# LoadModule foo_module modules/mod_foo.so -# -LoadModule auth_basic_module modules/mod_auth_basic.so -LoadModule auth_digest_module modules/mod_auth_digest.so -LoadModule authn_file_module modules/mod_authn_file.so -LoadModule authn_alias_module modules/mod_authn_alias.so -LoadModule authn_anon_module modules/mod_authn_anon.so -LoadModule authn_dbm_module modules/mod_authn_dbm.so -LoadModule authn_default_module modules/mod_authn_default.so -LoadModule authz_host_module modules/mod_authz_host.so -LoadModule authz_user_module modules/mod_authz_user.so -LoadModule authz_owner_module modules/mod_authz_owner.so -LoadModule authz_groupfile_module modules/mod_authz_groupfile.so -LoadModule authz_dbm_module modules/mod_authz_dbm.so -LoadModule authz_default_module modules/mod_authz_default.so -LoadModule ldap_module modules/mod_ldap.so -LoadModule authnz_ldap_module modules/mod_authnz_ldap.so -LoadModule include_module modules/mod_include.so -LoadModule log_config_module modules/mod_log_config.so -LoadModule logio_module modules/mod_logio.so -LoadModule env_module modules/mod_env.so -LoadModule ext_filter_module modules/mod_ext_filter.so -LoadModule mime_magic_module modules/mod_mime_magic.so -LoadModule expires_module modules/mod_expires.so -LoadModule deflate_module modules/mod_deflate.so -LoadModule headers_module modules/mod_headers.so -LoadModule usertrack_module modules/mod_usertrack.so -LoadModule setenvif_module modules/mod_setenvif.so -LoadModule mime_module modules/mod_mime.so -LoadModule dav_module modules/mod_dav.so -LoadModule status_module modules/mod_status.so -LoadModule autoindex_module modules/mod_autoindex.so -LoadModule info_module modules/mod_info.so -LoadModule dav_fs_module modules/mod_dav_fs.so -LoadModule vhost_alias_module modules/mod_vhost_alias.so -LoadModule negotiation_module modules/mod_negotiation.so -LoadModule dir_module modules/mod_dir.so -LoadModule actions_module modules/mod_actions.so -LoadModule speling_module modules/mod_speling.so -LoadModule userdir_module modules/mod_userdir.so -LoadModule alias_module modules/mod_alias.so -LoadModule substitute_module modules/mod_substitute.so -LoadModule rewrite_module modules/mod_rewrite.so -LoadModule proxy_module modules/mod_proxy.so -LoadModule proxy_balancer_module modules/mod_proxy_balancer.so -LoadModule proxy_ftp_module modules/mod_proxy_ftp.so -LoadModule proxy_http_module modules/mod_proxy_http.so -LoadModule proxy_ajp_module modules/mod_proxy_ajp.so -LoadModule proxy_connect_module modules/mod_proxy_connect.so -LoadModule cache_module modules/mod_cache.so -LoadModule suexec_module modules/mod_suexec.so -LoadModule disk_cache_module modules/mod_disk_cache.so -LoadModule cgi_module modules/mod_cgi.so -LoadModule version_module modules/mod_version.so - -# -# The following modules are not loaded by default: -# -#LoadModule asis_module modules/mod_asis.so -#LoadModule authn_dbd_module modules/mod_authn_dbd.so -#LoadModule cern_meta_module modules/mod_cern_meta.so -#LoadModule cgid_module modules/mod_cgid.so -#LoadModule dbd_module modules/mod_dbd.so -#LoadModule dumpio_module modules/mod_dumpio.so -#LoadModule filter_module modules/mod_filter.so -#LoadModule ident_module modules/mod_ident.so -#LoadModule log_forensic_module modules/mod_log_forensic.so -#LoadModule unique_id_module modules/mod_unique_id.so -# - -# -# Load config files from the config directory "/etc/httpd/conf.d". -# -Include conf.d/*.conf - -# -# ExtendedStatus controls whether Apache will generate "full" status -# information (ExtendedStatus On) or just basic information (ExtendedStatus -# Off) when the "server-status" handler is called. The default is Off. -# -#ExtendedStatus On - -# -# If you wish httpd to run as a different user or group, you must run -# httpd as root initially and it will switch. -# -# User/Group: The name (or #number) of the user/group to run httpd as. -# . On SCO (ODT 3) use "User nouser" and "Group nogroup". -# . On HPUX you may not be able to use shared memory as nobody, and the -# suggested workaround is to create a user www and use that user. -# NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET) -# when the value of (unsigned)Group is above 60000; -# don't use Group #-1 on these systems! -# -User apache -Group apache - -### Section 2: 'Main' server configuration -# -# The directives in this section set up the values used by the 'main' -# server, which responds to any requests that aren't handled by a -# <VirtualHost> definition. These values also provide defaults for -# any <VirtualHost> containers you may define later in the file. -# -# All of these directives may appear inside <VirtualHost> containers, -# in which case these default settings will be overridden for the -# virtual host being defined. -# - -# -# ServerAdmin: Your address, where problems with the server should be -# e-mailed. This address appears on some server-generated pages, such -# as error documents. e.g. admin@your-domain.com -# -ServerAdmin root@localhost - -# -# ServerName gives the name and port that the server uses to identify itself. -# This can often be determined automatically, but we recommend you specify -# it explicitly to prevent problems during startup. -# -# If this is not set to valid DNS name for your host, server-generated -# redirections will not work. See also the UseCanonicalName directive. -# -# If your host doesn't have a registered DNS name, enter its IP address here. -# You will have to access it by its address anyway, and this will make -# redirections work in a sensible way. -# -#ServerName www.example.com:80 - -# -# UseCanonicalName: Determines how Apache constructs self-referencing -# URLs and the SERVER_NAME and SERVER_PORT variables. -# When set "Off", Apache will use the Hostname and Port supplied -# by the client. When set "On", Apache will use the value of the -# ServerName directive. -# -UseCanonicalName Off - -# -# DocumentRoot: The directory out of which you will serve your -# documents. By default, all requests are taken from this directory, but -# symbolic links and aliases may be used to point to other locations. -# -DocumentRoot "/var/www/html" - -# -# Each directory to which Apache has access can be configured with respect -# to which services and features are allowed and/or disabled in that -# directory (and its subdirectories). -# -# First, we configure the "default" to be a very restrictive set of -# features. -# -<Directory /> - Options FollowSymLinks - AllowOverride None -</Directory> - -# -# Note that from this point forward you must specifically allow -# particular features to be enabled - so if something's not working as -# you might expect, make sure that you have specifically enabled it -# below. -# - -# -# This should be changed to whatever you set DocumentRoot to. -# -<Directory "/var/www/html"> - -# -# Possible values for the Options directive are "None", "All", -# or any combination of: -# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews -# -# Note that "MultiViews" must be named *explicitly* --- "Options All" -# doesn't give it to you. -# -# The Options directive is both complicated and important. Please see -# http://httpd.apache.org/docs/2.2/mod/core.html#options -# for more information. -# - Options Indexes FollowSymLinks - -# -# AllowOverride controls what directives may be placed in .htaccess files. -# It can be "All", "None", or any combination of the keywords: -# Options FileInfo AuthConfig Limit -# - AllowOverride None - -# -# Controls who can get stuff from this server. -# - Order allow,deny - Allow from all - -</Directory> - -# -# UserDir: The name of the directory that is appended onto a user's home -# directory if a ~user request is received. -# -# The path to the end user account 'public_html' directory must be -# accessible to the webserver userid. This usually means that ~userid -# must have permissions of 711, ~userid/public_html must have permissions -# of 755, and documents contained therein must be world-readable. -# Otherwise, the client will only receive a "403 Forbidden" message. -# -# See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden -# -<IfModule mod_userdir.c> - # - # UserDir is disabled by default since it can confirm the presence - # of a username on the system (depending on home directory - # permissions). - # - UserDir disabled - - # - # To enable requests to /~user/ to serve the user's public_html - # directory, remove the "UserDir disabled" line above, and uncomment - # the following line instead: - # - #UserDir public_html - -</IfModule> - -# -# Control access to UserDir directories. The following is an example -# for a site where these directories are restricted to read-only. -# -#<Directory /home/*/public_html> -# AllowOverride FileInfo AuthConfig Limit -# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec -# <Limit GET POST OPTIONS> -# Order allow,deny -# Allow from all -# </Limit> -# <LimitExcept GET POST OPTIONS> -# Order deny,allow -# Deny from all -# </LimitExcept> -#</Directory> - -# -# DirectoryIndex: sets the file that Apache will serve if a directory -# is requested. -# -# The index.html.var file (a type-map) is used to deliver content- -# negotiated documents. The MultiViews Option can be used for the -# same purpose, but it is much slower. -# -DirectoryIndex index.html index.html.var - -# -# AccessFileName: The name of the file to look for in each directory -# for additional configuration directives. See also the AllowOverride -# directive. -# -AccessFileName .htaccess - -# -# The following lines prevent .htaccess and .htpasswd files from being -# viewed by Web clients. -# -<Files ~ "^\.ht"> - Order allow,deny - Deny from all - Satisfy All -</Files> - -# -# TypesConfig describes where the mime.types file (or equivalent) is -# to be found. -# -TypesConfig /etc/mime.types - -# -# DefaultType is the default MIME type the server will use for a document -# if it cannot otherwise determine one, such as from filename extensions. -# If your server contains mostly text or HTML documents, "text/plain" is -# a good value. If most of your content is binary, such as applications -# or images, you may want to use "application/octet-stream" instead to -# keep browsers from trying to display binary files as though they are -# text. -# -DefaultType text/plain - -# -# The mod_mime_magic module allows the server to use various hints from the -# contents of the file itself to determine its type. The MIMEMagicFile -# directive tells the module where the hint definitions are located. -# -<IfModule mod_mime_magic.c> -# MIMEMagicFile /usr/share/magic.mime - MIMEMagicFile conf/magic -</IfModule> - -# -# HostnameLookups: Log the names of clients or just their IP addresses -# e.g., www.apache.org (on) or 204.62.129.132 (off). -# The default is off because it'd be overall better for the net if people -# had to knowingly turn this feature on, since enabling it means that -# each client request will result in AT LEAST one lookup request to the -# nameserver. -# -HostnameLookups Off - -# -# EnableMMAP: Control whether memory-mapping is used to deliver -# files (assuming that the underlying OS supports it). -# The default is on; turn this off if you serve from NFS-mounted -# filesystems. On some systems, turning it off (regardless of -# filesystem) can improve performance; for details, please see -# http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap -# -#EnableMMAP off - -# -# EnableSendfile: Control whether the sendfile kernel support is -# used to deliver files (assuming that the OS supports it). -# The default is on; turn this off if you serve from NFS-mounted -# filesystems. Please see -# http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile -# -#EnableSendfile off - -# -# ErrorLog: The location of the error log file. -# If you do not specify an ErrorLog directive within a <VirtualHost> -# container, error messages relating to that virtual host will be -# logged here. If you *do* define an error logfile for a <VirtualHost> -# container, that host's errors will be logged there and not here. -# -ErrorLog logs/error_log - -# -# LogLevel: Control the number of messages logged to the error_log. -# Possible values include: debug, info, notice, warn, error, crit, -# alert, emerg. -# -LogLevel warn - -# -# The following directives define some format nicknames for use with -# a CustomLog directive (see below). -# -LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined -LogFormat "%h %l %u %t \"%r\" %>s %b" common -LogFormat "%{Referer}i -> %U" referer -LogFormat "%{User-agent}i" agent - -# "combinedio" includes actual counts of actual bytes received (%I) and sent (%O); this -# requires the mod_logio module to be loaded. -#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio - -# -# The location and format of the access logfile (Common Logfile Format). -# If you do not define any access logfiles within a <VirtualHost> -# container, they will be logged here. Contrariwise, if you *do* -# define per-<VirtualHost> access logfiles, transactions will be -# logged therein and *not* in this file. -# -#CustomLog logs/access_log common - -# -# If you would like to have separate agent and referer logfiles, uncomment -# the following directives. -# -#CustomLog logs/referer_log referer -#CustomLog logs/agent_log agent - -# -# For a single logfile with access, agent, and referer information -# (Combined Logfile Format), use the following directive: -# -CustomLog logs/access_log combined - -# -# Optionally add a line containing the server version and virtual host -# name to server-generated pages (internal error documents, FTP directory -# listings, mod_status and mod_info output etc., but not CGI generated -# documents or custom error documents). -# Set to "EMail" to also include a mailto: link to the ServerAdmin. -# Set to one of: On | Off | EMail -# -ServerSignature On - -# -# Aliases: Add here as many aliases as you need (with no limit). The format is -# Alias fakename realname -# -# Note that if you include a trailing / on fakename then the server will -# require it to be present in the URL. So "/icons" isn't aliased in this -# example, only "/icons/". If the fakename is slash-terminated, then the -# realname must also be slash terminated, and if the fakename omits the -# trailing slash, the realname must also omit it. -# -# We include the /icons/ alias for FancyIndexed directory listings. If you -# do not use FancyIndexing, you may comment this out. -# -Alias /icons/ "/var/www/icons/" - -<Directory "/var/www/icons"> - Options Indexes MultiViews FollowSymLinks - AllowOverride None - Order allow,deny - Allow from all -</Directory> - -# -# WebDAV module configuration section. -# -<IfModule mod_dav_fs.c> - # Location of the WebDAV lock database. - DAVLockDB /var/lib/dav/lockdb -</IfModule> - -# -# ScriptAlias: This controls which directories contain server scripts. -# ScriptAliases are essentially the same as Aliases, except that -# documents in the realname directory are treated as applications and -# run by the server when requested rather than as documents sent to the client. -# The same rules about trailing "/" apply to ScriptAlias directives as to -# Alias. -# -ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" - -# -# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased -# CGI directory exists, if you have that configured. -# -<Directory "/var/www/cgi-bin"> - AllowOverride None - Options None - Order allow,deny - Allow from all -</Directory> - -# -# Redirect allows you to tell clients about documents which used to exist in -# your server's namespace, but do not anymore. This allows you to tell the -# clients where to look for the relocated document. -# Example: -# Redirect permanent /foo http://www.example.com/bar - -# -# Directives controlling the display of server-generated directory listings. -# - -# -# IndexOptions: Controls the appearance of server-generated directory -# listings. -# -IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8 - -# -# AddIcon* directives tell the server which icon to show for different -# files or filename extensions. These are only displayed for -# FancyIndexed directories. -# -AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip - -AddIconByType (TXT,/icons/text.gif) text/* -AddIconByType (IMG,/icons/image2.gif) image/* -AddIconByType (SND,/icons/sound2.gif) audio/* -AddIconByType (VID,/icons/movie.gif) video/* - -AddIcon /icons/binary.gif .bin .exe -AddIcon /icons/binhex.gif .hqx -AddIcon /icons/tar.gif .tar -AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv -AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip -AddIcon /icons/a.gif .ps .ai .eps -AddIcon /icons/layout.gif .html .shtml .htm .pdf -AddIcon /icons/text.gif .txt -AddIcon /icons/c.gif .c -AddIcon /icons/p.gif .pl .py -AddIcon /icons/f.gif .for -AddIcon /icons/dvi.gif .dvi -AddIcon /icons/uuencoded.gif .uu -AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl -AddIcon /icons/tex.gif .tex -AddIcon /icons/bomb.gif core - -AddIcon /icons/back.gif .. -AddIcon /icons/hand.right.gif README -AddIcon /icons/folder.gif ^^DIRECTORY^^ -AddIcon /icons/blank.gif ^^BLANKICON^^ - -# -# DefaultIcon is which icon to show for files which do not have an icon -# explicitly set. -# -DefaultIcon /icons/unknown.gif - -# -# AddDescription allows you to place a short description after a file in -# server-generated indexes. These are only displayed for FancyIndexed -# directories. -# Format: AddDescription "description" filename -# -#AddDescription "GZIP compressed document" .gz -#AddDescription "tar archive" .tar -#AddDescription "GZIP compressed tar archive" .tgz - -# -# ReadmeName is the name of the README file the server will look for by -# default, and append to directory listings. -# -# HeaderName is the name of a file which should be prepended to -# directory indexes. -ReadmeName README.html -HeaderName HEADER.html - -# -# IndexIgnore is a set of filenames which directory indexing should ignore -# and not include in the listing. Shell-style wildcarding is permitted. -# -IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t - -# -# DefaultLanguage and AddLanguage allows you to specify the language of -# a document. You can then use content negotiation to give a browser a -# file in a language the user can understand. -# -# Specify a default language. This means that all data -# going out without a specific language tag (see below) will -# be marked with this one. You probably do NOT want to set -# this unless you are sure it is correct for all cases. -# -# * It is generally better to not mark a page as -# * being a certain language than marking it with the wrong -# * language! -# -# DefaultLanguage nl -# -# Note 1: The suffix does not have to be the same as the language -# keyword --- those with documents in Polish (whose net-standard -# language code is pl) may wish to use "AddLanguage pl .po" to -# avoid the ambiguity with the common suffix for perl scripts. -# -# Note 2: The example entries below illustrate that in some cases -# the two character 'Language' abbreviation is not identical to -# the two character 'Country' code for its country, -# E.g. 'Danmark/dk' versus 'Danish/da'. -# -# Note 3: In the case of 'ltz' we violate the RFC by using a three char -# specifier. There is 'work in progress' to fix this and get -# the reference data for rfc1766 cleaned up. -# -# Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl) -# English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de) -# Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja) -# Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn) -# Norwegian (no) - Polish (pl) - Portugese (pt) -# Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv) -# Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW) -# -AddLanguage ca .ca -AddLanguage cs .cz .cs -AddLanguage da .dk -AddLanguage de .de -AddLanguage el .el -AddLanguage en .en -AddLanguage eo .eo -AddLanguage es .es -AddLanguage et .et -AddLanguage fr .fr -AddLanguage he .he -AddLanguage hr .hr -AddLanguage it .it -AddLanguage ja .ja -AddLanguage ko .ko -AddLanguage ltz .ltz -AddLanguage nl .nl -AddLanguage nn .nn -AddLanguage no .no -AddLanguage pl .po -AddLanguage pt .pt -AddLanguage pt-BR .pt-br -AddLanguage ru .ru -AddLanguage sv .sv -AddLanguage zh-CN .zh-cn -AddLanguage zh-TW .zh-tw - -# -# LanguagePriority allows you to give precedence to some languages -# in case of a tie during content negotiation. -# -# Just list the languages in decreasing order of preference. We have -# more or less alphabetized them here. You probably want to change this. -# -LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW - -# -# ForceLanguagePriority allows you to serve a result page rather than -# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback) -# [in case no accepted languages matched the available variants] -# -ForceLanguagePriority Prefer Fallback - -# -# Specify a default charset for all content served; this enables -# interpretation of all content as UTF-8 by default. To use the -# default browser choice (ISO-8859-1), or to allow the META tags -# in HTML content to override this choice, comment out this -# directive: -# -AddDefaultCharset UTF-8 - -# -# AddType allows you to add to or override the MIME configuration -# file mime.types for specific file types. -# -#AddType application/x-tar .tgz - -# -# AddEncoding allows you to have certain browsers uncompress -# information on the fly. Note: Not all browsers support this. -# Despite the name similarity, the following Add* directives have nothing -# to do with the FancyIndexing customization directives above. -# -#AddEncoding x-compress .Z -#AddEncoding x-gzip .gz .tgz - -# If the AddEncoding directives above are commented-out, then you -# probably should define those extensions to indicate media types: -# -AddType application/x-compress .Z -AddType application/x-gzip .gz .tgz - -# -# MIME-types for downloading Certificates and CRLs -# -AddType application/x-x509-ca-cert .crt -AddType application/x-pkcs7-crl .crl - -# -# AddHandler allows you to map certain file extensions to "handlers": -# actions unrelated to filetype. These can be either built into the server -# or added with the Action directive (see below) -# -# To use CGI scripts outside of ScriptAliased directories: -# (You will also need to add "ExecCGI" to the "Options" directive.) -# -#AddHandler cgi-script .cgi - -# -# For files that include their own HTTP headers: -# -#AddHandler send-as-is asis - -# -# For type maps (negotiated resources): -# (This is enabled by default to allow the Apache "It Worked" page -# to be distributed in multiple languages.) -# -AddHandler type-map var - -# -# Filters allow you to process content before it is sent to the client. -# -# To parse .shtml files for server-side includes (SSI): -# (You will also need to add "Includes" to the "Options" directive.) -# -AddType text/html .shtml -AddOutputFilter INCLUDES .shtml - -# -# Action lets you define media types that will execute a script whenever -# a matching file is called. This eliminates the need for repeated URL -# pathnames for oft-used CGI file processors. -# Format: Action media/type /cgi-script/location -# Format: Action handler-name /cgi-script/location -# - -# -# Customizable error responses come in three flavors: -# 1) plain text 2) local redirects 3) external redirects -# -# Some examples: -#ErrorDocument 500 "The server made a boo boo." -#ErrorDocument 404 /missing.html -#ErrorDocument 404 "/cgi-bin/missing_handler.pl" -#ErrorDocument 402 http://www.example.com/subscription_info.html -# - -# -# Putting this all together, we can internationalize error responses. -# -# We use Alias to redirect any /error/HTTP_<error>.html.var response to -# our collection of by-error message multi-language collections. We use -# includes to substitute the appropriate text. -# -# You can modify the messages' appearance without changing any of the -# default HTTP_<error>.html.var files by adding the line: -# -# Alias /error/include/ "/your/include/path/" -# -# which allows you to create your own set of files by starting with the -# /var/www/error/include/ files and -# copying them to /your/include/path/, even on a per-VirtualHost basis. -# - -Alias /error/ "/var/www/error/" - -<IfModule mod_negotiation.c> -<IfModule mod_include.c> - <Directory "/var/www/error"> - AllowOverride None - Options IncludesNoExec - AddOutputFilter Includes html - AddHandler type-map var - Order allow,deny - Allow from all - LanguagePriority en es de fr - ForceLanguagePriority Prefer Fallback - </Directory> - -# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var -# ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var -# ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var -# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var -# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var -# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var -# ErrorDocument 410 /error/HTTP_GONE.html.var -# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var -# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var -# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var -# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var -# ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var -# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var -# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var -# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var -# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var -# ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var - -</IfModule> -</IfModule> - -# -# The following directives modify normal HTTP response behavior to -# handle known problems with browser implementations. -# -BrowserMatch "Mozilla/2" nokeepalive -BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 -BrowserMatch "RealPlayer 4\.0" force-response-1.0 -BrowserMatch "Java/1\.0" force-response-1.0 -BrowserMatch "JDK/1\.0" force-response-1.0 - -# -# The following directive disables redirects on non-GET requests for -# a directory that does not include the trailing slash. This fixes a -# problem with Microsoft WebFolders which does not appropriately handle -# redirects for folders with DAV methods. -# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV. -# -BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully -BrowserMatch "MS FrontPage" redirect-carefully -BrowserMatch "^WebDrive" redirect-carefully -BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully -BrowserMatch "^gnome-vfs/1.0" redirect-carefully -BrowserMatch "^XML Spy" redirect-carefully -BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully - -# -# Allow server status reports generated by mod_status, -# with the URL of http://servername/server-status -# Change the ".example.com" to match your domain to enable. -# -#<Location /server-status> -# SetHandler server-status -# Order deny,allow -# Deny from all -# Allow from .example.com -#</Location> - -# -# Allow remote server configuration reports, with the URL of -# http://servername/server-info (requires that mod_info.c be loaded). -# Change the ".example.com" to match your domain to enable. -# -#<Location /server-info> -# SetHandler server-info -# Order deny,allow -# Deny from all -# Allow from .example.com -#</Location> - -# -# Proxy Server directives. Uncomment the following lines to -# enable the proxy server: -# -#<IfModule mod_proxy.c> -#ProxyRequests On -# -#<Proxy *> -# Order deny,allow -# Deny from all -# Allow from .example.com -#</Proxy> - -# -# Enable/disable the handling of HTTP/1.1 "Via:" headers. -# ("Full" adds the server version; "Block" removes all outgoing Via: headers) -# Set to one of: Off | On | Full | Block -# -#ProxyVia On - -# -# To enable a cache of proxied content, uncomment the following lines. -# See http://httpd.apache.org/docs/2.2/mod/mod_cache.html for more details. -# -#<IfModule mod_disk_cache.c> -# CacheEnable disk / -# CacheRoot "/var/cache/mod_proxy" -#</IfModule> -# - -#</IfModule> -# End of proxy directives. - -### Section 3: Virtual Hosts -# -# VirtualHost: If you want to maintain multiple domains/hostnames on your -# machine you can setup VirtualHost containers for them. Most configurations -# use only name-based virtual hosts so the server doesn't need to worry about -# IP addresses. This is indicated by the asterisks in the directives below. -# -# Please see the documentation at -# <URL:http://httpd.apache.org/docs/2.2/vhosts/> -# for further details before you try to setup virtual hosts. -# -# You may use the command line option '-S' to verify your virtual host -# configuration. - -# -# Use name-based virtual hosting. -# -#NameVirtualHost *:80 -# -# NOTE: NameVirtualHost cannot be used without a port specifier -# (e.g. :80) if mod_ssl is being used, due to the nature of the -# SSL protocol. -# - -# -# VirtualHost example: -# Almost any Apache directive may go into a VirtualHost container. -# The first VirtualHost section is used for requests without a known -# server name. -# -#<VirtualHost *:80> -# ServerAdmin webmaster@dummy-host.example.com -# DocumentRoot /www/docs/dummy-host.example.com -# ServerName dummy-host.example.com -# ErrorLog logs/dummy-host.example.com-error_log -# CustomLog logs/dummy-host.example.com-access_log common -#</VirtualHost> diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.email.issued_by.agent-ca.crt b/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.email.issued_by.agent-ca.crt deleted file mode 100644 index dc4c675be..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.email.issued_by.agent-ca.crt +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICTTCCAfegAwIBAgIBBTANBgkqhkiG9w0BAQUFADB9MSMwIQYDVQQDExpJbnRl -cm1lZGlhdGUgQ0EgKGFnZW50LWNhKTEfMB0GCSqGSIb3DQEJARYQdGVzdEBleGFt -cGxlLm9yZzEZMBcGA1UEChMQRXhhbXBsZSBPcmcsIExMQzEaMBgGA1UECxMRU2Vy -dmVyIE9wZXJhdGlvbnMwHhcNMTMwMzMwMDU1MDQ4WhcNMzMwMzI1MDU1MDQ4WjBE -MSEwHwYDVQQDDBhhZ2VudC1lbWFpbDEuZXhhbXBsZS5vcmcxHzAdBgkqhkiG9w0B -CQEWEHRlc3RAZXhhbXBsZS5jb20wXDANBgkqhkiG9w0BAQEFAANLADBIAkEA1yGO -Vq1tH18qqfGofLz4jsQK8L1+sH/Rqv41YwsOwVEvBbvDLhbaokbqdPj49Oilk8jd -2WCFhfeQR2EHYwDbvQIDAQABo4GaMIGXMFsGA1UdIwRUMFKhTaRLMEkxEDAOBgNV -BAMMB1Jvb3QgQ0ExGjAYBgNVBAsMEVNlcnZlciBPcGVyYXRpb25zMRkwFwYDVQQK -DBBFeGFtcGxlIE9yZywgTExDggEBMAwGA1UdEwEB/wQCMAAwCwYDVR0PBAQDAgWg -MB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjANBgkqhkiG9w0BAQUFAANB -AKAeQNxCcQfbMaxxp84Qqi2dTUKnKE4IKOOCgQEPIE9gzZ5Tjig2bJIBfer3hXia -Mudl4EXigQpy2zJ+CIE/Pl4= ------END CERTIFICATE----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.email.issued_by.agent-ca.key b/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.email.issued_by.agent-ca.key deleted file mode 100644 index 6cf5d8426..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.email.issued_by.agent-ca.key +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIBPQIBAAJBANchjlatbR9fKqnxqHy8+I7ECvC9frB/0ar+NWMLDsFRLwW7wy4W -2qJG6nT4+PTopZPI3dlghYX3kEdhB2MA270CAwEAAQJBAMsqgYYSGm/6LAx6kCfd -Ps91DO/1xWNiEtxtXnW+x5yAFjdiM0uhRupci78kHJ+00dDqPGDHpWkmQ/bqzdHM -A/ECIQD+b+ezEA4sUfiSHRkfH4EsBMtDAxS6NyrEk8I1EQYukwIhANhz1+PrDnpI -BO0ql2sIaAO333zYXTT6JAyWBs2zou5vAiEAkw4uhknDR05hMmHrARf+Wmiy6ho/ -wpjb+R3FY1Jhlk0CIQDJPyO5+EEUtkNGUvRHgqBa3KmAxRYb/Hpp7U9UD7HsJwIh -AJR9GTJSdpPz7HSS2GtBxK2AlwWvqIj3zLyL/u4aZRJs ------END RSA PRIVATE KEY----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.agent-ca.crt b/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.agent-ca.crt deleted file mode 100644 index 1d52b3bfa..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.agent-ca.crt +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDsDCCApigAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MSMwIQYDVQQDExpJbnRl -cm1lZGlhdGUgQ0EgKGFnZW50LWNhKTEfMB0GCSqGSIb3DQEJARYQdGVzdEBleGFt -cGxlLm9yZzEZMBcGA1UEChMQRXhhbXBsZSBPcmcsIExMQzEaMBgGA1UECxMRU2Vy -dmVyIE9wZXJhdGlvbnMwHhcNMTQwNDA4MDEyNTM3WhcNMzQwNDAzMDEyNTM3WjAd -MRswGQYDVQQDDBJhZ2VudDEuZXhhbXBsZS5vcmcwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQDAjIjCGe+/hW62yuI9i4bVqZ3X60tQtUTvB1TA4TIAHSqb -MGSSuMBdPKSkLRrASzCUUdPBbNo1MDwcQ6ZulyE6emIxp3V+ISrkRLIfYw+CSqCu -MjuaXHLtC03qOcXvFXYMwJ9xGHkUnylKe2IMVafbtgQ6MXF7E9VxZu4eddf9OCAX -I5ZgehuZjiOOAVZaMfE/0xIUc/aQcyCstv8NKbFdET32nMYnuYprkY12LVsnDsdi -Tfa2zdqHCJBXmAb23QvwRp2scFy9QcCbhF063Fklx4Ix0ut1ifjjywiwDKu/OMiM -2BwpU+JnzSHhKH2VIdJbMpaAt/whyOJ9RrKK6ZDFAgMBAAGjgZowgZcwWwYDVR0j -BFQwUqFNpEswSTEQMA4GA1UEAwwHUm9vdCBDQTEaMBgGA1UECwwRU2VydmVyIE9w -ZXJhdGlvbnMxGTAXBgNVBAoMEEV4YW1wbGUgT3JnLCBMTEOCAQEwDAYDVR0TAQH/ -BAIwADALBgNVHQ8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMC -MA0GCSqGSIb3DQEBBQUAA4IBAQDAgTSbvhE8//g0WNmT3kXVPuGg02v9ML3Uai1f -whq2dbBaERWhfIHBZw0KiNw0fI0MgKtR8qu3nEFOrXZEIgVCtBDv/aTGoudT5nil -WF99bC4OkoAiYLwFOVLjXbc3+wOB7dd9G6pdBnETmWT/MO3WwXxexNx/7yxY2UDI -4g4LOkxQMWC6zCEHp7lNofEKTFGlFgaP65PeLZ2GxnvAVfm1k7rMSy7eeQV2L1Hq -40LhAbQSqsSY8hBoypQnCmf0yijFwTH6wP6hRCu0ptu//W9BSJ4L8bTNg7n/Ff97 -QXtq2qn4OgLIoCSjshs3JbFHiPEpC8He3JKXM+gHWqySe8Ln ------END CERTIFICATE----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.agent-ca.key b/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.agent-ca.key deleted file mode 100644 index fb7a53116..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.agent-ca.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAjIjCGe+/hW62 -yuI9i4bVqZ3X60tQtUTvB1TA4TIAHSqbMGSSuMBdPKSkLRrASzCUUdPBbNo1MDwc -Q6ZulyE6emIxp3V+ISrkRLIfYw+CSqCuMjuaXHLtC03qOcXvFXYMwJ9xGHkUnylK -e2IMVafbtgQ6MXF7E9VxZu4eddf9OCAXI5ZgehuZjiOOAVZaMfE/0xIUc/aQcyCs -tv8NKbFdET32nMYnuYprkY12LVsnDsdiTfa2zdqHCJBXmAb23QvwRp2scFy9QcCb -hF063Fklx4Ix0ut1ifjjywiwDKu/OMiM2BwpU+JnzSHhKH2VIdJbMpaAt/whyOJ9 -RrKK6ZDFAgMBAAECggEAN5EW8nULtEisj8HzEnHOoqCFdcdof80gLJ7//X2/sTq5 -jfmkPJdmpEGY/ewqWS4ZwePvaVWhj1HxNvLq9+VTaI3jApNiG9k0iJWuldI/qokg -38SNYNmnLPNjM+IiVgHqhHmeScQXRTU9dEoxHIAnpgdcJvMX3b32jfh3ZYD6qQ9m -EINbT/x+L0nRFLj6MzJyvwydlxP38koTLyLcPKEZFpVQkIVn74kEzGEUl4PzzUnf -28l+IbXYN0fZwsfq05QFiscx85rGXE7IkhDkF/gkJxrQVDJqjIOW0v0KzRFv075b -cuEvnAirJB1Un5OdFfTNMobjw/r9XDdC/A8ZeXnKrQKBgQDrGxwpn7Nkwx1nHIY0 -WiAwDhnSzq3DOzxMC4YWMMIHeEi4DC/HzS77OmCEjtL0UgtlnjrKTW9hK1QE/DQk -FkvPOyD7/47X2p2T9oIC6yZMKfN6KldHIhQyRR7Hb7/ke8Qd+ddXOyHza2GYsZsK -/AXAKAL4pgEiX9m7neZm/zgN1wKBgQDRqTZNGh0+0eRyju8No+jnoPflJIle9G8U -EYXeMC+oKlnk5c98hThFgxxrnHriC0FHS3QvR0Xk8B92Rf6hmf6Tm/lmkVpknXxT -uVxPAs/Vog9oDROfrymNTU/Sm/JZGCOcteOsq+ux0kAFs5pu09Qx1A5h8n/ui6lK -pJpo9uRqwwKBgQDFLh6HlmZJqw7c7OJtw+zdAOaNlEPNyr9+c+fIcqo4w5wRqD7m -juLJV6OdaX/p42mll3htNValo0Y7TB6a6Yw5SLkYQLTXuoWQlB1kPz4GgOSwYBSF -F0LjCm+PCt1gzqCkF2eQxIpr8nKPMt3673YPPD+JtQicgNFG9l5HoeOsTwKBgG9I -EhNQdg9e1pNbfFTQGBHBZXJRNzyYHtEXD+fDybfHatlMhRmBmEGE+rO/ZZXPBYHy -8aMagGWocfqT4jgiBXaRhgnDwqe+0zuZGf6x7mBk2SqQLkdGcJaYX3LY5QQXBOfr -vwFqavqCLwsXrjN+6ZTdChlA3lhd9qgwv+hQiyKDAoGAc3ceSPFNFEfXjcAltARk -uJxH6tgDGwRaxvAgkqNy5yW4PVUYttipVA6lUlSI/BoCsRaKA10tmX9953VLtOQn -RT0ffDpaiUcea+ZcfboFRAl1qeW9nqY+o5duS/ZusoG17K30Fjaulh2mWV79+kjP -+u0OWrAQ82oICBolbMGIPz0= ------END PRIVATE KEY----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.master-ca.crt b/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.master-ca.crt deleted file mode 100644 index c53fe9aa3..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.master-ca.crt +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDsTCCApmgAwIBAgIBAzANBgkqhkiG9w0BAQUFADB+MSQwIgYDVQQDExtJbnRl -cm1lZGlhdGUgQ0EgKG1hc3Rlci1jYSkxHzAdBgkqhkiG9w0BCQEWEHRlc3RAZXhh -bXBsZS5vcmcxGTAXBgNVBAoTEEV4YW1wbGUgT3JnLCBMTEMxGjAYBgNVBAsTEVNl -cnZlciBPcGVyYXRpb25zMB4XDTE0MDQwODAxMjUzOFoXDTM0MDQwMzAxMjUzOFow -HTEbMBkGA1UEAwwSYWdlbnQxLmV4YW1wbGUub3JnMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEA6EjKALrLYvsuUlBYm5+0Ig24R4axrhFPv3h8n9iL3/33 -Fl1tdxFGMi9jtRcNIajEo4XboD9tSvxWVJQHOOMdPh4Fo05ygcWn9k93W7xZmEiP -X+suzEi6LvfoaTsmWN/a8CVLRbfB/xsPLGUhCB7qOS0nmDcIp2A72nBXCMbXUnez -at5Hsmdb9DJPzuKuv5bgA2nL44uPDKXwG0n3AUVqyIab3uXN52q8nFGg62AVSFcy -8ergApXR6F6Nmy+HdzAJZeaxxN93pi6GrT9Bxh194iffeN1Dl2SVSWB4zGsjt1NN -+4z0Y6MhAt/1g+ZIOOitW/6U3T4KOsamGd6ZVsiGbwIDAQABo4GaMIGXMFsGA1Ud -IwRUMFKhTaRLMEkxEDAOBgNVBAMMB1Jvb3QgQ0ExGjAYBgNVBAsMEVNlcnZlciBP -cGVyYXRpb25zMRkwFwYDVQQKDBBFeGFtcGxlIE9yZywgTExDggECMAwGA1UdEwEB -/wQCMAAwCwYDVR0PBAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcD -AjANBgkqhkiG9w0BAQUFAAOCAQEAJB2a8oabIxE0mn8tINQtUbjE1UPI2HU4HxnX -eAO225BogLCbo5RgUo+V1VZp8oksWggn7ztavcY/lpR/0lEiC/rrr2A10HCybAkZ -zBudei7Wi2ztBC8CTnO61K1/jvxHgUElufGuu+Aa7YlAJFby1ROKWJP7UhAS4uR0 -mMj4yqApXsp4+/Qio64MNCjj6MuCyUqcRoq+QM7m+/Po8i1DWesIJ0N8l68/uFiY -ByZ8Y9q3VPn49LUf/h+jTRus6PDoCzY7Zbh/L8R1g3p93ahLiwXJ422ubG9WJh90 -IAG3jJaGEfLCxPQ80Td2ZnOP3Xkf0lcK11NX7IuXeGNSoK7flQ== ------END CERTIFICATE----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.master-ca.key b/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.master-ca.key deleted file mode 100644 index b459d0ed2..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/agent1.example.org.issued_by.master-ca.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDoSMoAusti+y5S -UFibn7QiDbhHhrGuEU+/eHyf2Ivf/fcWXW13EUYyL2O1Fw0hqMSjhdugP21K/FZU -lAc44x0+HgWjTnKBxaf2T3dbvFmYSI9f6y7MSLou9+hpOyZY39rwJUtFt8H/Gw8s -ZSEIHuo5LSeYNwinYDvacFcIxtdSd7Nq3keyZ1v0Mk/O4q6/luADacvji48MpfAb -SfcBRWrIhpve5c3narycUaDrYBVIVzLx6uACldHoXo2bL4d3MAll5rHE33emLoat -P0HGHX3iJ9943UOXZJVJYHjMayO3U037jPRjoyEC3/WD5kg46K1b/pTdPgo6xqYZ -3plWyIZvAgMBAAECggEAW8xIaLlpn5h82fL+0aHv4nVhmoLUvWICDj1joxhFTyRi -/ee2VxPwley8jtipS+AStj00asQmQTgwNgS6RfUbnWzn9X4PKtIeau1E0nBBSDmE -z/d16y3ixqUaqFvD7+On9rgGY2sXs+XRvU3KHBd7oVUDDNjTBrK1dMJo4wMSHXiI -JOJGujhrzHcDwERsCRHR6lCg80bwP57420FgOt6iA+uEtAa/JS/RL1SNzc0/ZfpR -xoym+7uWsTBxdSHROcv9yObip62C8uPySNW/13kkXZnP5IFl6yWh5xVuQJaSRI4g -zyLc8p2JlVg8SSjpXvP3Y5cmOrPCqPUBQsDPIS3C4QKBgQD0n78CZSK3Pr7w+DPl -08QpYiFWdtaz9FC6syRuW3+CW59j3WqrqczwWFrP7Uq1ltZ/tc+gQJaCMyBPTxS1 -fSMrWK9cU6qVz+DNAKAq+KbRjPDG1shSRy4AaUj3BHwazjCz7JcfFf9zC3N+Arbl -AwtoP/mDv6dUoaVLxT0o9rFe0wKBgQDzFiOLZTxcOrN1ELiMI3jvhZ8rffIQNQEw -PrrKMmqRxnpoXRfJSKhKjddLX/I2vbPc7/luF0rDTjgWyNmj9bqOYFrr0H0Cukh0 -jnRh/UDxxY6TfX9kFTqameGa8iaYW7+CZyt70TFghnMNprGOi0AWqIIQWJjo8wAe -wE7eJikQdQKBgCVuPB/1sbYwV68vi2FjYeSjK067qGaov6GRv8VTItOjiWQSgTv7 -I2yzWFHwkTnv9qpb+4Ud3OnXQN5hz11l5HfBfjO2aae6wz8bFWb93Si7VCxYuRY9 -5gASHCQP/51qZ3Fghk8vYoMMAYQKjknEiX5OK7PJI6WDhnNtnsoh1UoZAoGBAOcm -gzA3WPlevG0yNDrWNFaXWm7x+W9d575nuBkzbdEmyhlZhJfbpmQWksZS+zEAnPsX -mrkMHwSu6XkJDqPxs69Vgr/AZk9ksidbmuHe/5WnxVcMvEmAQlTmxPghEYBJpkcr -MdcwamKeFuPBQhAI7C1fmSZQCT9iaxfSyGxIHz5NAoGBAKrPfTFX74+Po7Uo+qEc -81VMFJEwTwVJUX0+EIuskG6LIDAdRo2KWr/Rl8XvFcAj+BfSF7Y5eOA8IeqGSJHG -n1zyTmZjMQDyb6ECu0QiA8sshM3ICsrEySvTdGgw7pMySIen9Ku066bvdq+FOIY1 -zH44viWG+2efHCt5r2CehPU5 ------END PRIVATE KEY----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/agent2.example.org.issued_by.agent-ca.crt b/acceptance/tests/external_ca_support/fixtures/leaves/agent2.example.org.issued_by.agent-ca.crt deleted file mode 100644 index 50c064ce3..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/agent2.example.org.issued_by.agent-ca.crt +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDsDCCApigAwIBAgIBAjANBgkqhkiG9w0BAQUFADB9MSMwIQYDVQQDExpJbnRl -cm1lZGlhdGUgQ0EgKGFnZW50LWNhKTEfMB0GCSqGSIb3DQEJARYQdGVzdEBleGFt -cGxlLm9yZzEZMBcGA1UEChMQRXhhbXBsZSBPcmcsIExMQzEaMBgGA1UECxMRU2Vy -dmVyIE9wZXJhdGlvbnMwHhcNMTQwNDA4MDEyNTM4WhcNMzQwNDAzMDEyNTM4WjAd -MRswGQYDVQQDDBJhZ2VudDIuZXhhbXBsZS5vcmcwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQDHweG4FqoG5dYD84YmGpGUKFIBy+ISXaZLnjD3JhOb6d5H -GFFFhBIuWeM8ieaY67crBpVdjKWuQAkWayWYdCa8npC7YxxHKphLbN81eL2WLraW -2N2kji3TwwA6J+QQVPAUCgPUQcC/ob0x9faor+zKrxQPTKQ6xtuSI+FIkWiw3+e2 -W54ONXx2QrKDwbeXXXNG09QOJVJxW3DueycbCH4sWa2n/ODySeC2t1hU6A5e6Z0b -UhMtaixdbQsKfsid2TpEC66ILW2MlCYwv4EdaOjC9FbizEXR4F7GAg2C5kPnQvhA -iRP6MAeFW5hFCkjOGBQXBCNxBSf9xPzmV4WGLjA1AgMBAAGjgZowgZcwWwYDVR0j -BFQwUqFNpEswSTEQMA4GA1UEAwwHUm9vdCBDQTEaMBgGA1UECwwRU2VydmVyIE9w -ZXJhdGlvbnMxGTAXBgNVBAoMEEV4YW1wbGUgT3JnLCBMTEOCAQEwDAYDVR0TAQH/ -BAIwADALBgNVHQ8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMC -MA0GCSqGSIb3DQEBBQUAA4IBAQAVDnNbC88i9mZeGy5KTbV4Xp0qZcPY5+w3MP6S -65DOxCSjw9ZIHF8E0EgGhG8bHidf7+z5YdyVald9lDV8PItjXzam+VUMmMuPdJIR -cwLdRjd30NmHaDQEjqsXMS+KaZDKUCIxaOcYHb4D2XU2LRXhmA0JMteQHLo0Ugua -2WoanhjV+7KMdY74h7aPc4j9KFEOzfRLFWQYpIR3ENucRLkPX4Aeb/qrDlQaSfw/ -BXma+8+4F/P4JjlE2wRNI8nSvflQGJ6fBnDgSyb07M5RqM/oDjMz58c/TEv5jzX6 -X4GizfT4l0mNtjxe3k7+tmlLsDaN2aiY3jCQ5D8kzAhdM+rL ------END CERTIFICATE----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/agent2.example.org.issued_by.agent-ca.key b/acceptance/tests/external_ca_support/fixtures/leaves/agent2.example.org.issued_by.agent-ca.key deleted file mode 100644 index 5c1506f75..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/agent2.example.org.issued_by.agent-ca.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQDHweG4FqoG5dYD -84YmGpGUKFIBy+ISXaZLnjD3JhOb6d5HGFFFhBIuWeM8ieaY67crBpVdjKWuQAkW -ayWYdCa8npC7YxxHKphLbN81eL2WLraW2N2kji3TwwA6J+QQVPAUCgPUQcC/ob0x -9faor+zKrxQPTKQ6xtuSI+FIkWiw3+e2W54ONXx2QrKDwbeXXXNG09QOJVJxW3Du -eycbCH4sWa2n/ODySeC2t1hU6A5e6Z0bUhMtaixdbQsKfsid2TpEC66ILW2MlCYw -v4EdaOjC9FbizEXR4F7GAg2C5kPnQvhAiRP6MAeFW5hFCkjOGBQXBCNxBSf9xPzm -V4WGLjA1AgMBAAECggEBAImIQaJ/aD0rjThXOKuPa1/4is3V1CcU92Pk3I2tV57n -XDTS11HnZqUnGj8aKvxqfkhPVhN8vK3GRPt8dfwLLIh9G+UIjfWprAVyRhQIt29p -Zilh0uhzQ7Yi8ksYH/vmnw0NACnpw42tDBgT4umthnjeJg+KkyAsvgxWS8us4cm0 -h+wT6jMhKTGJKys83Py7CYIH4IiJ/1NHqkyXOdJjmx4cipys+3RYLeqnVpYhdKab -KV9B4WOmsb3NVQvtcQ1PDTohFeCZZgMurCLGx4/eGSvy26YyFKjiqFi+rqjQPiRB -YFlnePXE7EXlPzfimLGE+zYG7SMM89Z/ou3yevT8k9kCgYEA46DW2pzTHLno9qxL -AhhXrMkAoSluJXtekrOvQFqeYfCnPQPSfpN4D1i1UhFmizZ1+hJqjRaxf3boOTwd -hsy0pxljknoNtBNu0rIPmMNqO0wKmB0LapMqdsYbj1PWPP+MoyyVLj1AX1P6Y2Ee -vFU3FuBvKzpb9YQKFIWzicCoKv8CgYEA4Ke8tsj5ut76xD9bVrSdR4MpXWWgPnwa -lpsZ7rVDfON/pYuln5pKmA9gmETMmjnkpFNyecTABTYifivpG/48PeAyH5AtGWLh -Cy74G1R7a7g579S7occ4Enx5MMQZvA6xJLCZagxsM5vogIjQ5CwvrTA3KD7dQ3n4 -rDq1+Ycj6MsCgYEAio88WeR+aY0NLyJfok3ZCLdt56xFfRFk1x4DfsPqhymrU2vB -NQVlXsobzXIEHpevJuMQ8wMuVq213CkovAZdrR26S856CvSNUDnNXqsNPj0icce0 -TFJ61cPvwMZCsezI2gboZDYquhxvXREgWXnxx74kTYb/tSqDzEw6po6cj1cCgYEA -zQUnOuSky36s+aYcVD+WfWncuSiCmiOmHCXF/8waoAH6Pvj3mHU1eBoofC3lTyZg -W/rvsOL2nort5ZlrLqnRDmLpO1bXYaCUYiFmOYLa8853yUCqT5TAvlYsP23nUnFS -BnrINzjJEjxJbevuPx14ESS8YZUlVmwcngkig2tqQQsCgYEAyx6hnpLjhd3K0v5x -d78HarimcTRoHyldztubdVDV081KFTIrrWjQn1ag9eFOfctkhjngxlGHBtIQnLRM -pdYkCsymxTDju30EvD8bvOE9+SVgOFOpTRuenbepxltygtKQmGY/5w2PHQFJZjwI -tklzLp5QZNYfJeaPZ+frNRL7wxQ= ------END PRIVATE KEY----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/agent3.example.org.issued_by.agent-ca.crt b/acceptance/tests/external_ca_support/fixtures/leaves/agent3.example.org.issued_by.agent-ca.crt deleted file mode 100644 index c254ce91a..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/agent3.example.org.issued_by.agent-ca.crt +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDsDCCApigAwIBAgIBAzANBgkqhkiG9w0BAQUFADB9MSMwIQYDVQQDExpJbnRl -cm1lZGlhdGUgQ0EgKGFnZW50LWNhKTEfMB0GCSqGSIb3DQEJARYQdGVzdEBleGFt -cGxlLm9yZzEZMBcGA1UEChMQRXhhbXBsZSBPcmcsIExMQzEaMBgGA1UECxMRU2Vy -dmVyIE9wZXJhdGlvbnMwHhcNMTQwNDA4MDEyNTM4WhcNMzQwNDAzMDEyNTM4WjAd -MRswGQYDVQQDDBJhZ2VudDMuZXhhbXBsZS5vcmcwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQCvaJCmw0/fy9rmPGtda/9wOlaqiozKac51fJbfDcdiTV9k -Adoln28td4vAXqCckIWhdeSAyF1MhIpnGSsJuklsHTJ2ZfospNwDY0NqYkejAzT6 -RM/jblY+D8/Cyp37UjoLi1Ri8PEbnjbgYMVKn51nZlBexHp1CpFBvjm1nd7rt3Ll -wZ6Hgbg9aLSJYKWucvsFNteeDuqte6fV+ypO/VtDGaLJS9e/3X9kNt7lU1tTBLyD -KfUOhpDBR2+fuoWJ9YADFiyK7AadAV+d+nlep2UG6MN8L0H0ZgBp73Rpxb9tgIWr -istMboUvQghFfZ4n/KTa4s6ooUe2tzMxFGsqaus1AgMBAAGjgZowgZcwWwYDVR0j -BFQwUqFNpEswSTEQMA4GA1UEAwwHUm9vdCBDQTEaMBgGA1UECwwRU2VydmVyIE9w -ZXJhdGlvbnMxGTAXBgNVBAoMEEV4YW1wbGUgT3JnLCBMTEOCAQEwDAYDVR0TAQH/ -BAIwADALBgNVHQ8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMC -MA0GCSqGSIb3DQEBBQUAA4IBAQBXOZ+j8MRJgS1XBriZxL5y5GTCxZTmgdv7akvy -RnDHN6CPSPDG3HX0Db7Ey1kcQU/d/N9PCDyNGFUxihfq4CjqJpQAarZ+oYBCO+k0 -367Xw+iKm6JHK3CZLT9GG7ikz9wAb5E+O3PMWePAtqSOdHmEF+K+8O+WNHe/Slzz -BvY1m0WXXxEtbkKOxVCZ9oPxO0dZd+CsiaBTuMp4TX6218NIWNGYixaVNCOTKT/i -nuE3naOGRZ++y/clYrrni18WZC4jqTdZn57Bho7gf6nR9hFt2FaIUPagS37oWKF3 -KwpsbWEVMcdjbMUGuG04WclzATUbqJt+m1ueiK4slb63O5Z1 ------END CERTIFICATE----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/agent3.example.org.issued_by.agent-ca.key b/acceptance/tests/external_ca_support/fixtures/leaves/agent3.example.org.issued_by.agent-ca.key deleted file mode 100644 index 4bf1e7715..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/agent3.example.org.issued_by.agent-ca.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCvaJCmw0/fy9rm -PGtda/9wOlaqiozKac51fJbfDcdiTV9kAdoln28td4vAXqCckIWhdeSAyF1MhIpn -GSsJuklsHTJ2ZfospNwDY0NqYkejAzT6RM/jblY+D8/Cyp37UjoLi1Ri8PEbnjbg -YMVKn51nZlBexHp1CpFBvjm1nd7rt3LlwZ6Hgbg9aLSJYKWucvsFNteeDuqte6fV -+ypO/VtDGaLJS9e/3X9kNt7lU1tTBLyDKfUOhpDBR2+fuoWJ9YADFiyK7AadAV+d -+nlep2UG6MN8L0H0ZgBp73Rpxb9tgIWristMboUvQghFfZ4n/KTa4s6ooUe2tzMx -FGsqaus1AgMBAAECggEBAKQDEtZLY8EvnNORBRcKZ4MpmWXHPRP60Qh74ZpZCOi6 -zgn1zWNGa69Iy4ypLmaWn8y0Ll/YeZyVhdAW8W4cGJEVz9xzR/Q8hlhIlX3AvZkH -455rfzL6NXu8TxilWgjn/sxSkCoffmLDki5FbdRz4LsRKO8jqhkMM3wUgWN3ZTxi -9HfvO9cqKX49TRECs8i6o0vjSBY871nBXS0PQb0IRyEPnidk3fMl6KkYzAy4VQB+ -vlFUnGTFUx9wStAEIG04v+X2yBXiP5KeCqAwikCB1dHZU0iXliadnjn1LD6An86p -1kkUtZ54crR4fz/SELYLivApYLDPidVcAApS3kZCN8ECgYEA2tSxzx+4BjjnPIga -2hzVX4QE0qsB+rCsxBKFPRvLWu3coBdTor+t4S5Umft9nZtyRRa72JOZUuG7yjpi -rDxqPo7s/3hR42aelH2oYKTlz51oD2gVj7S+NoIZGynyo8EJZvN4PmAcOU4cQoYK -Xyq2LPpdM4ng1KbhGKENYX5ToGUCgYEAzTPCEeUIYLLb+92p4zMkLkmATtQOhcGb -v2VHWeeK95NEwlSlUDnmfEnJzOA5jcV1p367iC1u4+SAqX4poUrMbQtO6YjaLJ3n -lQM9WDM4Tk5n+K3xCWFbcYaaBvfoVmJ6IdxmqN3O44osRzX1nEZnQRbADBT+/ncP -y4EMBOjCqpECgYEAvt3JgQj/b53uQqPMF/YSPc9ejYlOnqO+7P3ibNxzUIorZw8x -icB6HvBUJkJu3CsbTht4GH0UvG/bZZXrPqMrYAk1udXuRtPY+Vdop3LsZ1u5ycZV -GBTj25M55rF9y0qxsrQlavJVa74vc+6J2VvdrflplWxrR8+OgfbnPuP6eOkCgYBB -Jgicc9G4GbEcAuE4H/mBtJZG8K53quNO3dHMamXFen0fEY62rNtPZIHsSNgc+a8D -8YmKj5ogQmDS7xo6eivzBt8T5/4UokFvHuswAHsE6YG7A0Z+iulkXq6yPa0HGBbc -f0QcoudXeHvcU/ZZmkSX9qgcbeITWiuqmZr+SAPd8QKBgCmQbKVYf0DZ45duXrl/ -UaAg4TNOgbXKP5sCBMA3Wl4gOItL9umJFmh2QHZRaieFt7qlYCYsLul2CzOOaqqC -nA6US7SMpq5uoxiimwjY9PUF9WDzwWFFXxYyphOZI5fXKgXCBOSwBMBPioYWxhQK -amoP2hwuVMpudtS2nZOtnPSJ ------END PRIVATE KEY----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.agent-ca.crt b/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.agent-ca.crt deleted file mode 100644 index 17c35320b..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.agent-ca.crt +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8DCCAtigAwIBAgIBBDANBgkqhkiG9w0BAQUFADB9MSMwIQYDVQQDExpJbnRl -cm1lZGlhdGUgQ0EgKGFnZW50LWNhKTEfMB0GCSqGSIb3DQEJARYQdGVzdEBleGFt -cGxlLm9yZzEZMBcGA1UEChMQRXhhbXBsZSBPcmcsIExMQzEaMBgGA1UECxMRU2Vy -dmVyIE9wZXJhdGlvbnMwHhcNMTQwNDA4MDEyNTM4WhcNMzQwNDAzMDEyNTM4WjAe -MRwwGgYDVQQDDBNtYXN0ZXIxLmV4YW1wbGUub3JnMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEA5K+/ngO2GiDGyd33t8jROHqeHEFrEtm3+T7ap6BQNj7+ -GcOf5GB13SiBLoyWaS2wFCBOJbqlXwwjfKPbYyWxCMk6xKYAhmOC7he1auNC5WUa -TAkze0lqnyOuJCfIgGEJm7AGZZ72WIP60u60+YFaXcGkWMCZnK+7gpHtfaMdkV+P -/6Int1DRikUGYCFBqZoEi7S8aaOO5S9/426+AYeUCSv7huIRY2i5kzfbo47MhpNI -uQEIroKDH35cpXkkAqV+/bttfkGBGNPdv5ccRfsoWs08HeU/WyZGPeLBzYUi74YC -GjNsKwfn65sJSnYyQbSbtEcUSvXr8SOPNaX/WCMcPQIDAQABo4HZMIHWMFsGA1Ud -IwRUMFKhTaRLMEkxEDAOBgNVBAMMB1Jvb3QgQ0ExGjAYBgNVBAsMEVNlcnZlciBP -cGVyYXRpb25zMRkwFwYDVQQKDBBFeGFtcGxlIE9yZywgTExDggEBMAwGA1UdEwEB -/wQCMAAwCwYDVR0PBAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcD -AjA9BgNVHREENjA0ghNtYXN0ZXIxLmV4YW1wbGUub3JnggdtYXN0ZXIxggZwdXBw -ZXSCDHB1cHBldG1hc3RlcjANBgkqhkiG9w0BAQUFAAOCAQEAZHIF2DB1ogCiTfcT -mM50IxDsUGWit3916FdIZEpgUcp+mMd0vpKejzNy/G1iriBErHujwxUPJPCFkyZx -5Uly8PoTykMGZPFDI3OaDnfsWtX+JV7P23PKgKYsUea2ewj+kUVWkKI2GhLV6+We -pWrzbUFFfATjMpda2k9f8AaGT5kU3L16KrCa6X8tuE6FTeMrkYHZxe72rufZOWw6 -XjSJ2wqxHDp+iiZ627Qn6Z1DA3b2XowCPPIaVnmhlawhQKDGrrh4HfuqQSI5LpwP -7Wx5oNNSC7qGJCVFWAamkQiy7JsPrrM/egNDxSV52Zkhp8AjDrYn4CTrdbd1CINO -eS/Dtw== ------END CERTIFICATE----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.agent-ca.key b/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.agent-ca.key deleted file mode 100644 index 42ea4c828..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.agent-ca.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDkr7+eA7YaIMbJ -3fe3yNE4ep4cQWsS2bf5PtqnoFA2Pv4Zw5/kYHXdKIEujJZpLbAUIE4luqVfDCN8 -o9tjJbEIyTrEpgCGY4LuF7Vq40LlZRpMCTN7SWqfI64kJ8iAYQmbsAZlnvZYg/rS -7rT5gVpdwaRYwJmcr7uCke19ox2RX4//oie3UNGKRQZgIUGpmgSLtLxpo47lL3/j -br4Bh5QJK/uG4hFjaLmTN9ujjsyGk0i5AQiugoMfflyleSQCpX79u21+QYEY092/ -lxxF+yhazTwd5T9bJkY94sHNhSLvhgIaM2wrB+frmwlKdjJBtJu0RxRK9evxI481 -pf9YIxw9AgMBAAECggEAHs39xc9CLGrV3ENmJv+KD02VFsFJJxTkz1JEKehSZbw+ -hkHvu9eyiMP4Ask1SZ255jwjyrlFpXQBI7z+xHBDVKemnu6ti2zEKkZPTcKnNDdW -P3/Ny4GsNxubTYt+Wqy3mp0vf2jWTj4Y/2jgP+vIvHBlLv9isdSKMaBumUnrpbU0 -fnWJ5fz5yyNoSaaH8+UxOJz/EMOV/Crc2KuwULCpPWbJXVVFhgQ2o0oCjBC6RGUx -C9RyjQCOiEWI7Rt9IeQAqmBqIP1TFZeWlCiJEXIQi7P7y2LtpbCSu2LXU7bsTKxS -uXVGmiix5yNiyzljsGMDCwBiAzoKvA8x+kEv/Q9qgQKBgQD4zF5vyuBN+Palgcep -aAn9a/og6kWLYslPNEvWYkkSWi8R+hlWgC1W5LUXpply7Pj8ZdR82McPrRjDXzsk -wz5MofEWkB3O/qgOjY8BR7N1pMddBRV+eVvLZMTnyaCdkaKCqo/L1a18ITywpasl -AML6JnUJLMUdspeQPRJGdyf/hQKBgQDrTlkqxZ0tnME6yqpHzS/WAYGMIpxWzPWH -sY6E5lINvsMuy5OjPtE7Qgl/fbu/wjdt0VUw+BeuHbgJP55S1vmfrCSvRwHSumXq -7Oyx9fQfz4bBiV0BPbXSE8OlKd+mFsQUq2BZA12NFfWpw6R1BG6wkyxB/qN3psUf -SpwCPPtbWQKBgGzb5todN2WGcEzcawMJfY1/qDKsrn8dWx2nsSL9YCGCiiPgfSOm -86+YZFAT2gI6A3tUBtQVeYu3XiVlzpf4QZMALF+F8TT3oYq0j4Ss3a20ynI93ji3 -Wt20mp8cToWDCksH2+EA/mZYmJhl9Gs9WRJgr0azaw/ia4R15EAmtL6NAoGBANN1 -Wj5Mzn5iA2ghHrtd0qJAQjo8FEEQ+YlS8B/Ql2aQyvivq+KlHgRhyQVQabve/k7r -MuLJ4QXw4SU2jcImPLfYTDNT3XiRV+uxtNgMjrFTnucn2XO3EEFUz5oKslig1t84 -T2JO2vBiDp3cGluqewqlh71a524sabNAKkj8omopAoGBAOPfjxvmQprID0pID9xE -Qe4+ll+BAUQN1W9wwOazwMSON2WOOm+2IL7RPgyNgFWeMzBM0CpBq8Pve+G3N+xr -RrOmsAJdofK3xM0UCnoWLazNuoJZvuzyRyqppIiG2DT6aBVpZ9Rgcy7ufdQmj6tU -YgvO+lsMalyGDMSP21hWtgxN ------END PRIVATE KEY----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.master-ca.crt b/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.master-ca.crt deleted file mode 100644 index e79ab8bfd..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.master-ca.crt +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MSQwIgYDVQQDExtJbnRl -cm1lZGlhdGUgQ0EgKG1hc3Rlci1jYSkxHzAdBgkqhkiG9w0BCQEWEHRlc3RAZXhh -bXBsZS5vcmcxGTAXBgNVBAoTEEV4YW1wbGUgT3JnLCBMTEMxGjAYBgNVBAsTEVNl -cnZlciBPcGVyYXRpb25zMB4XDTE0MDQwODAxMjUzN1oXDTM0MDQwMzAxMjUzN1ow -HjEcMBoGA1UEAwwTbWFzdGVyMS5leGFtcGxlLm9yZzCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBANtT0Se0OBG+bU3ZbZ2IxiSKNs7ZxDBoyXVeVGvOvEQW -56TkHnYdoJ3bn3zLctAoWMggv4DxO0nncmVJYbFoeZo9n7viUQdsO8+hTWVJCjov -uZYNO88Q5NE4zP/Pi9IWigOzjNMl959ItGI0Sr/aPZUpsc/V6eEpyY0eREGG6Ixa -eeO2z/kU4mqO9CK4VzNxfZQqAi0kJEEp2gQ8Ax0gCXee4gbBF7zvyi6467Q3hJTf -413cL0jMIPHbNiyXdLlzjtmkYDL9mjnXbL1W339twBgPzs/ZjDqR4IBK4Fzqakoz -WvWbp1aTYkRqSBiNRHtiQleCXG7JU6FDeF/wzXXWkWECAwEAAaOB2TCB1jBbBgNV -HSMEVDBSoU2kSzBJMRAwDgYDVQQDDAdSb290IENBMRowGAYDVQQLDBFTZXJ2ZXIg -T3BlcmF0aW9uczEZMBcGA1UECgwQRXhhbXBsZSBPcmcsIExMQ4IBAjAMBgNVHRMB -Af8EAjAAMAsGA1UdDwQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUH -AwIwPQYDVR0RBDYwNIITbWFzdGVyMS5leGFtcGxlLm9yZ4IHbWFzdGVyMYIGcHVw -cGV0ggxwdXBwZXRtYXN0ZXIwDQYJKoZIhvcNAQEFBQADggEBAFUas+1NvtqTsT8X -CHiwL/njj7at7V6BsF5yw/MnJ2oEwkJpfsp7J3aB/R1s5bxjtxOJ5fVzED3L0uIf -we29p16rdSeINn9D/LShF7SUFIB3GokT/L5gHgYPLGH4itmz+GKul6qBdt0bOydM -1CqfKTmMEvH0sicEDRFIxji+dfrS6lPhdDHkdKGJeEWpNuATYmw24NYOIpO+4Bv7 -oVXn5hoZp5VzbokCzVha1hlsUeG+wp3GnOoN2aaAm3LZNqKLhm5dKoNeRtECFEOu -+GViwgc9RG4GN4jNDGU03+z+SMozlt3cc+osIxeOKExiK2dfhJwA9Uj1uvYYnSuy -/hHeAt4= ------END CERTIFICATE----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.master-ca.key b/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.master-ca.key deleted file mode 100644 index e708e042a..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/master1.example.org.issued_by.master-ca.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDbU9EntDgRvm1N -2W2diMYkijbO2cQwaMl1XlRrzrxEFuek5B52HaCd2598y3LQKFjIIL+A8TtJ53Jl -SWGxaHmaPZ+74lEHbDvPoU1lSQo6L7mWDTvPEOTROMz/z4vSFooDs4zTJfefSLRi -NEq/2j2VKbHP1enhKcmNHkRBhuiMWnnjts/5FOJqjvQiuFczcX2UKgItJCRBKdoE -PAMdIAl3nuIGwRe878ouuOu0N4SU3+Nd3C9IzCDx2zYsl3S5c47ZpGAy/Zo512y9 -Vt9/bcAYD87P2Yw6keCASuBc6mpKM1r1m6dWk2JEakgYjUR7YkJXglxuyVOhQ3hf -8M111pFhAgMBAAECggEBAJxG78wTnLP/9NA4seNC9rRIi17+Sc2YjJuFmC+tAfae -P3X9WTseRzjTqaN5L5jkdsY6l1mgCXfSY2+KRwLrB2KAsFVmoAfi9gcuzv/xeEkX -gmxJh6k2R2RQzbkkwGL0zmhuwlQdRICJhIZI7k4fiivDpsAJkvluFf/oZgguwXpn -F62e7nM2rV4ApH8wN9wixFeAONv9GxiTxjLCYWIMeDP9ETnIsMPTuzpbjHn1cXDt -kobmRma93jUzJK2wtsyrvsj7hvYPV+EzHhO8N+VK7FfZ90FBbWQDM+nrxOePVmsY -t6KYpVh+B02UtEuVwg+qc7E2bhSxQZzhuuTy27DszWUCgYEA7iIDJtxR8rcNAr5p -nMrnJ/ZFtzUMxk1K77hPWN3dLhT5nr70WDUmg2xaHyS8VDk9sIyERCOt+fyngj9Q -AWeukD7xwpLzZ0oivK2btT9OG9OCNZYeu4NoWX3ocI2GoHsV3TdLVkSKsWv9Z7EQ -EXBkFAGgrclMpWiyGw6sbuKBq68CgYEA68iYUhq13+oTrX2nMBjkah5YsBpInNng -B4IOuvcfUf6gsewLpbkcpg4UfUqQxoGsla4mK/5Gd9uIWRENsBZB/ZYKqjQW0bfo -kyTXXJy5Phkh/oo4bgSVWGIIiTI3F6tuXu6X75HTiXghm3m/87X3p8AhZk8MURQW -dLePVDAih+8CgYEAvylqok2HM3Ki7SryGT4A5mGagYICqUXu/BVXDR29qnqIEFl2 -SUERk7rtdcbFsE7rKMkEfLavuNiLl9E/ZoFW7tC4vtu8rZQj4pbzQkJ5b3kRM/c4 -4IqSwBSE/aV/B2EHojf7MFuBgwAPwqevIHC6xhywYhIQh1BOec4Dulf2hF0CgYB9 -2R+UEzWoQiQmob6u6VphWbk0pZLERXZSC5UZLfXFqgbTcI328orcBv/gr//+NBCO -A9nT+XBbYQ2xnGyV5Ats8rzWg976KRM2Fp/siqpE/t0qI1RjRIcCGbE8qVTGiXXr -raXi9Q7XfQtTFPTje+in3OD23pJQZExoF+GkqdyEeQKBgEBm6ZzuXYn9hkoBySK8 -O2sFOUJLE3ptdEdzBHGu1oZNgrTIVIwSykmMwzRtLdJz12gvHs5+hqdvROzZGdHy -HAXsEzv8s5RTr1cUGUcCueBiFeiOfvIu6YsFl08WpSIya4bGgOLNRojxvqcfpjn0 -nyYXiflNy9ffvLvyXKdq0nyW ------END PRIVATE KEY----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/master2.example.org.issued_by.master-ca.crt b/acceptance/tests/external_ca_support/fixtures/leaves/master2.example.org.issued_by.master-ca.crt deleted file mode 100644 index 2e75b22fe..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/master2.example.org.issued_by.master-ca.crt +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIBAjANBgkqhkiG9w0BAQUFADB+MSQwIgYDVQQDExtJbnRl -cm1lZGlhdGUgQ0EgKG1hc3Rlci1jYSkxHzAdBgkqhkiG9w0BCQEWEHRlc3RAZXhh -bXBsZS5vcmcxGTAXBgNVBAoTEEV4YW1wbGUgT3JnLCBMTEMxGjAYBgNVBAsTEVNl -cnZlciBPcGVyYXRpb25zMB4XDTE0MDQwODAxMjUzN1oXDTM0MDQwMzAxMjUzN1ow -HjEcMBoGA1UEAwwTbWFzdGVyMi5leGFtcGxlLm9yZzCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBALADxMRg/KiG3QDVO9RbJ8NlEF+DovPrc1GmjYlSewEj -3mYf5v1a/TTHZOeB+iA51qFW7HGhDJltBZ/0J71y2A2x0nVbGAW4EkTfryKaCBBl -fwE5fv2Xm6fJB3YAYlPUw+WAZ1HMLrBtqkpIy4xirAy4MCirLBnKxBAjT8kk1f6n -8fV7l3Sz1frtl5ONSaiLsCzDBDfGyp9HDI9X2ABzRIh64SnDCWDq9OZ5UkM3gJmh -vZGT4VhwSJzPJohMPOEgzdKHjW5aFhx4FIHhmNJ0jucEXjNtF270lHjBqjfnsrKF -xHah2dvhkr6PjAOUR4SM1hCXSru5Msa2huBD0Q5vh0sCAwEAAaOB2TCB1jBbBgNV -HSMEVDBSoU2kSzBJMRAwDgYDVQQDDAdSb290IENBMRowGAYDVQQLDBFTZXJ2ZXIg -T3BlcmF0aW9uczEZMBcGA1UECgwQRXhhbXBsZSBPcmcsIExMQ4IBAjAMBgNVHRMB -Af8EAjAAMAsGA1UdDwQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUH -AwIwPQYDVR0RBDYwNIITbWFzdGVyMi5leGFtcGxlLm9yZ4IHbWFzdGVyMoIGcHVw -cGV0ggxwdXBwZXRtYXN0ZXIwDQYJKoZIhvcNAQEFBQADggEBAB7pmCkatEPj2UTL -OO0/xcYXog3NO+90ZEKkUoQpe+cVEkOdj1hZQ8OLK7sennVqww8Gc6vRjLve7t8W -ApJevYCcLAx/fNdIMpya+8ZPn+ybm1JY6cAwUauJ4BdrqhQM1zdKwbleSCcXW2RQ -TtsFBtcnlNhd+f3lcEIjM9oI/+UlituQ0dZRiWTYbswFer06DwJWQywiWMr0oZip -P+fzwwewb4ri5L3i683ZIpl9MuShEqpM0SPNl+XdmnZn0jDNK4bxOezt7qwZl6T4 -JbRshdQ3ClWa2CcAdJgawfd9VRZC8GWQ5PZYNr5rWwLtrDBX2Uf102O67TXbNOnn -yg4Ci+8= ------END CERTIFICATE----- diff --git a/acceptance/tests/external_ca_support/fixtures/leaves/master2.example.org.issued_by.master-ca.key b/acceptance/tests/external_ca_support/fixtures/leaves/master2.example.org.issued_by.master-ca.key deleted file mode 100644 index 7c24a91f7..000000000 --- a/acceptance/tests/external_ca_support/fixtures/leaves/master2.example.org.issued_by.master-ca.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCwA8TEYPyoht0A -1TvUWyfDZRBfg6Lz63NRpo2JUnsBI95mH+b9Wv00x2TngfogOdahVuxxoQyZbQWf -9Ce9ctgNsdJ1WxgFuBJE368imggQZX8BOX79l5unyQd2AGJT1MPlgGdRzC6wbapK -SMuMYqwMuDAoqywZysQQI0/JJNX+p/H1e5d0s9X67ZeTjUmoi7AswwQ3xsqfRwyP -V9gAc0SIeuEpwwlg6vTmeVJDN4CZob2Rk+FYcEiczyaITDzhIM3Sh41uWhYceBSB -4ZjSdI7nBF4zbRdu9JR4wao357KyhcR2odnb4ZK+j4wDlEeEjNYQl0q7uTLGtobg -Q9EOb4dLAgMBAAECggEAOUlgt1GhqfAK6gR8robkkDHKfGvJk33kUITWuAUCR8K2 -1aI4eektVAo5iyfAktCATI6P8gOqqBzVodPDQ2Oncf2YM93sGaBpQcVTqP1c9oky -JuHhtQOtA5ToOr2xQvuSrpV2CydbYsyuifLbXNuYh6NC+VmMxvA5k88KXrsAcxsH -wOl0DxTw0/enPCdxK1HzV37Vgq0yaJtkm1+NkvYQREcbZz0TpnUX3qSaFRv+XI3t -lHbLgCZfW5syUgibZKYmc2KHJ7WUpnjc7joYooc+cjQ/eJ3skcPu0JqaJMH3Lzmf -4dfgUJ9CIyyneuxoB4kxDPKYnsJ7l8ttKd4tR155UQKBgQDgMzXUwfmskGtgF7mq -+xcSZrQ4mNp4qcyScs1ALX9M41Tv0r3HzottvXjtt97Nfw7CyWIUsk2Z11xqp3S4 -NQv2t2GK0O8Axzte5nt2pG4E8phigj8i8cqxDyeRqJEJzaZ7d0ycDFcMsY9yBuzB -beu+BZnbfxLaGTAdouTmcqp9/QKBgQDI+u5NoBy/C2Zn7PK8oAYkoiVlFSg4cfz+ -rM1P5xKOslVzMjFpkU7djYYJdBwk/rnvo7p0BAooIm6bK6BdUKHx8qR0mxroD64c -O+ZTw5gobyUIMAvtb3/c4IYFE5kOCBN0vRXkxlpQoyJlH61eh+mN4CvpNSvgAfU/ -uMIJxVK45wKBgAo1SrYtPtkEml79tY57cEl+M6aADzJ/SLlCUOYjLDCsCSoCRnHa -ja6peeAZByQELP/he33FwJLIo4SXq1DX2XuaTe6sJLW8XI+tnuGACyJeiWGy3H0S -1U/KiNqw+imgG3xzqiFQzoXdb9KZTh5giuNUDfVYi9syWmZ/DD0R64FhAoGBAIsg -6obiKAQ4qBOZfBAH1zjU5n4rP0ST5EeI6DhABiCyY2TzgjFKXgYRSpCQyErz61Nx -TEmz4jQWYesZMFJo1zLefeoa1W2ALU9uR+wEoviauFAKsrcTULhe1Wf+QR3tiUpu -+xD8HtljlRPb8fBWtd95J+yw2kagFF6gT/LjnnhRAoGAW6kgmk82hUCIqX/uEqW7 -DEsLy9mbbFuWjoqt2ma+6Urx66muX+SMQj5pwd6JnRRSexWVAxxNuKuYUq1ZOhom -e4+/+VfkiFzPzVCA0VQ1YRNHt26Uxvr3ovZ5Y50u4FH2hypNSHLMFZV6T2EWt4Nd -b5Lr8vvMoJlCVp+O3AvF154= ------END PRIVATE KEY----- diff --git a/acceptance/tests/external_ca_support/fixtures/master-ca/ca-master-ca.crl b/acceptance/tests/external_ca_support/fixtures/master-ca/ca-master-ca.crl deleted file mode 100644 index 2213db673..000000000 --- a/acceptance/tests/external_ca_support/fixtures/master-ca/ca-master-ca.crl +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN X509 CRL----- -MIIB2jCBwzANBgkqhkiG9w0BAQUFADB+MSQwIgYDVQQDExtJbnRlcm1lZGlhdGUg -Q0EgKG1hc3Rlci1jYSkxHzAdBgkqhkiG9w0BCQEWEHRlc3RAZXhhbXBsZS5vcmcx -GTAXBgNVBAoTEEV4YW1wbGUgT3JnLCBMTEMxGjAYBgNVBAsTEVNlcnZlciBPcGVy -YXRpb25zFw0xNDA0MDgwMTI1MzlaFw0zNDA0MDMwMTI1MzlaMBQwEgIBARcNMTQw -NDA4MDEyNTM5WjANBgkqhkiG9w0BAQUFAAOCAQEAYMRAzRxGX0SaCUYZKNn25JyK -uNoT91hdmUuSYnIiHkNxft/8x6EKSllrc1nzn0/sBBfzZ1VAK6tZTPHhWZ3m/JDy -B40ovaz/jgQEowKf+LL8lI8wVqa3ycwAclpACmvMpwhVIWTGOSI5kDA3+rI24J+k -z8mlTWJ56JcdWlbniZ9TPR73LixUvBq8t1dZGsj8Xez+BHcgcdT79M7HMuGgXws1 -JHbHc4N8s5Ursp6np6o56YRSU/24kH/Dzp+4ddSGV+nTEX8y/tQsIgSLlZ9fJoQi -HSDe5/yTzhYVvOyW7ZLDvuy409kyNuESsur3iTKLPLQNFQwMsM++yt2nKWOzcQ== ------END X509 CRL----- diff --git a/acceptance/tests/external_ca_support/fixtures/master-ca/ca-master-ca.crt b/acceptance/tests/external_ca_support/fixtures/master-ca/ca-master-ca.crt deleted file mode 100644 index 45a03709d..000000000 --- a/acceptance/tests/external_ca_support/fixtures/master-ca/ca-master-ca.crt +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID3zCCAsegAwIBAgIBAjANBgkqhkiG9w0BAQUFADBJMRAwDgYDVQQDDAdSb290 -IENBMRowGAYDVQQLDBFTZXJ2ZXIgT3BlcmF0aW9uczEZMBcGA1UECgwQRXhhbXBs -ZSBPcmcsIExMQzAeFw0xNDA0MDgwMTI1MzdaFw0zNDA0MDMwMTI1MzdaMH4xJDAi -BgNVBAMTG0ludGVybWVkaWF0ZSBDQSAobWFzdGVyLWNhKTEfMB0GCSqGSIb3DQEJ -ARYQdGVzdEBleGFtcGxlLm9yZzEZMBcGA1UEChMQRXhhbXBsZSBPcmcsIExMQzEa -MBgGA1UECxMRU2VydmVyIE9wZXJhdGlvbnMwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQDTgKLGBkExFRXrQJn/lHE4XHkN2nXwJpS+y8bWqHiBdq5eZ8D2 -UAILOBaALeQN/1d1J4yrh6w/YK+gRtCLn+CslR+9NW4AgShALi+r26DK9ZRk4F7V -Dk4yEjNpmTyVRyP8w7iZwasZdyK04xAhj+yEInz29SLxmh1jddts/rjqLMZW/s0S -T+E9XSEDYNVprC5VuYutUuHKah7AYSp07FHNsqDg+y+vCRezSqbrHrGpTwMupVmD -2ObsSJntghsLzPwjSGhbo6e8C/TDwrPtm6az9TPKbsUrqjdvyZcSfc5Q6OgExNhg -zWQkk5PqFOESsQSBfOOn2eqfqBXHUnH9PCNTAgMBAAGjgZwwgZkweQYDVR0jBHIw -cIAUFq+AJeP66ki/kTNmAf1R7yRnTGOhTaRLMEkxEDAOBgNVBAMMB1Jvb3QgQ0Ex -GjAYBgNVBAsMEVNlcnZlciBPcGVyYXRpb25zMRkwFwYDVQQKDBBFeGFtcGxlIE9y -ZywgTExDggkAsbkEcvsRJ+MwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAQYw -DQYJKoZIhvcNAQEFBQADggEBAC4keJ+jeGh7/EWwsCKollYW7H4aSjPu/Ufe38hH -pEER9FyCqJ0jo+MabOx8l1F5ySNWngB0qbJuA/kiV2gJ1bQ+mE2TN88x6Sz12eol -ifhFU0PazGdpNQRhpQxbwJ7tFC3Z8WrHEcVqP9iicNWqSI/QkqXsCk4Zyezpx28W -sqHylf1CiBOU45FJdDXRg80mk6WOpNZR8HIUdqQLQDXz0FfXeFKmVteatmc/yrGG -5iHzMkH4Vz5laBjin9s1p+O8Z7+cWtJNWfXaULAEecZQ6CZ3V1OVOjhsrL28iF7C -kx01rSrsxaFclDalJVmKmO2spHvNmQTlWD6jm5d94WaRyXU= ------END CERTIFICATE----- diff --git a/acceptance/tests/external_ca_support/fixtures/master-ca/ca-master-ca.key b/acceptance/tests/external_ca_support/fixtures/master-ca/ca-master-ca.key deleted file mode 100644 index daa4d6d74..000000000 --- a/acceptance/tests/external_ca_support/fixtures/master-ca/ca-master-ca.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDTgKLGBkExFRXr -QJn/lHE4XHkN2nXwJpS+y8bWqHiBdq5eZ8D2UAILOBaALeQN/1d1J4yrh6w/YK+g -RtCLn+CslR+9NW4AgShALi+r26DK9ZRk4F7VDk4yEjNpmTyVRyP8w7iZwasZdyK0 -4xAhj+yEInz29SLxmh1jddts/rjqLMZW/s0ST+E9XSEDYNVprC5VuYutUuHKah7A -YSp07FHNsqDg+y+vCRezSqbrHrGpTwMupVmD2ObsSJntghsLzPwjSGhbo6e8C/TD -wrPtm6az9TPKbsUrqjdvyZcSfc5Q6OgExNhgzWQkk5PqFOESsQSBfOOn2eqfqBXH -UnH9PCNTAgMBAAECggEAOduOq606WDr0bA6YEhqBfnGNjASfDrr/JdKI6l/b106o -FJs9ZiQs6vTE8vuaz1lyi1HuYV4T+KJyaN32Xru1soB41kGvfePXJvd7gv/p1Jup -pI7cYlwvd/MSrWiF8jAr4BGKhkU8kRLOI72ZxBSjFuJ4XPZiQMVwFK1BAWgNHcHy -CU13+4sMI7Er425g5pMkv6fWkp6HTRF8WE73e68w1NOvc/6WyiQS9iytNhOR8TUl -vJkFyhcAbg7alsEfQ0Ove/co0yCzbXF85sRYr1ANRTp/y6RoMRXA79qCB4BS2ke6 -UUUU8F+hnmNNVjFAMlojC/yConEyDj8fsh1QoqzNQQKBgQD+5+6cgT8xJpM/Woji -ZogjNoNmbx/G3J00TEhR3vp7Frl+Lvec0OkvQlrof+yfEFDiYpeR8vgjfW9otlbJ -PcnV2ZKRspy4wFqDnP4JQW0hz39uOvZeIbNcIFtI1QaLc29TZ9NpAwiAwD4mm0fr -l/MLVPHtBh0Pn8V6G89lN2cWfwKBgQDUaQQP/s0t/mF6GOAcwF62bxw9T7gMBuu9 -MOE3ehchBjAFdLKn4F5STfxgIsJ3DlMiQdj4EjzM9NsgAA4akRVGDNeypMdTTskr -WbL3188RU2Kfbr07NWce22720mTzNNPf4SZZ7S7BYNYdx3Pg+uFPGvT+L61BXKB+ -3XmktIFRLQKBgEZ3TUIchKCMvmXkHDUiDP5XAoodrBYoRJkBgXiIgIvoY0zbpP3H -zr6OxFzDiGEMfJ+oi6gAF9KPyW2UAnfNSe+BHwCB9Msp+ZuqmZtrZ8TR/LM3P4YU -IOYV18ZRhWaleZ//8rRz7zTQcB3yDTa2oax/RgW1C/GWxFuWNoYPg8L3AoGATtHV -RxY3Dw0pIMSgTSr5OltKsFmnoxbiXWcI+6wbbw67vRqLvQ3eEk6MCyR64vD22mxy -1cL2uttVgK9kjGkv6rmTROAucvR2Y9a6OYvkc7psi1rtb04mwOWObJqwCSueP6Jt -t8ryoaGMcqpzjpWqC8+l/7izYuC7UbhfjkXJAtUCgYAJBcEkCI8GF0+k2qaf2CNS -j8U597tvsrKCFFO7avJWAybZFoXd95/8Aa1SO1Qk+0rm2UVmSRd9YkmmN2UBrxHi -mFw5D92/PI4fLYh9pFOpWs+90CQt1BDtu+nIcGNP3JgW5AGMkv9Boqy+ENdLNJ9t -Ta283HvVvIkM+0Hrd1Zn6g== ------END PRIVATE KEY----- diff --git a/acceptance/tests/external_ca_support/fixtures/master-ca/openssl.conf b/acceptance/tests/external_ca_support/fixtures/master-ca/openssl.conf deleted file mode 100644 index e03712e95..000000000 --- a/acceptance/tests/external_ca_support/fixtures/master-ca/openssl.conf +++ /dev/null @@ -1,96 +0,0 @@ -SAN = DNS:puppet - -[ca] -default_ca = master_ca_config - -# Root CA -[root_ca_config] -certificate = /tmp/certchain.KDOYxTc2/master-ca/ca-master-ca.crt -private_key = /tmp/certchain.KDOYxTc2/master-ca/ca-master-ca.key -database = /tmp/certchain.KDOYxTc2/master-ca/inventory.txt -new_certs_dir = /tmp/certchain.KDOYxTc2/master-ca/certs -serial = /tmp/certchain.KDOYxTc2/master-ca/serial - -default_crl_days = 7300 -default_days = 7300 -default_md = sha1 - -policy = root_ca_policy -x509_extensions = root_ca_exts - -[root_ca_policy] -commonName = supplied -emailAddress = supplied -organizationName = supplied -organizationalUnitName = supplied - -[root_ca_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:true -keyUsage = keyCertSign, cRLSign - -# Master CA -[master_ca_config] -certificate = /tmp/certchain.KDOYxTc2/master-ca/ca-master-ca.crt -private_key = /tmp/certchain.KDOYxTc2/master-ca/ca-master-ca.key -database = /tmp/certchain.KDOYxTc2/master-ca/inventory.txt -new_certs_dir = /tmp/certchain.KDOYxTc2/master-ca/certs -serial = /tmp/certchain.KDOYxTc2/master-ca/serial - -default_crl_days = 7300 -default_days = 7300 -default_md = sha1 - -policy = master_ca_policy -x509_extensions = master_ca_exts - -# Master CA (Email) -[master_ca_email_config] -certificate = /tmp/certchain.KDOYxTc2/master-ca/ca-master-ca.crt -private_key = /tmp/certchain.KDOYxTc2/master-ca/ca-master-ca.key -database = /tmp/certchain.KDOYxTc2/master-ca/inventory.txt -new_certs_dir = /tmp/certchain.KDOYxTc2/master-ca/certs -serial = /tmp/certchain.KDOYxTc2/master-ca/serial - -default_crl_days = 7300 -default_days = 7300 -default_md = sha1 - -email_in_dn = yes - -policy = master_ca_email_policy -x509_extensions = master_ca_exts - -[master_ca_policy] -commonName = supplied - -[master_ca_email_policy] -commonName = supplied -emailAddress = supplied - -# default extensions for clients -[master_ca_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:false -keyUsage = keyEncipherment, digitalSignature -extendedKeyUsage = serverAuth, clientAuth - -[master_ssl_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:false -keyUsage = keyEncipherment, digitalSignature -extendedKeyUsage = serverAuth, clientAuth -subjectAltName = $ENV::SAN - -# extensions for the master certificate (specifically adding subjectAltName) -[master_self_ca_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:false -keyUsage = keyEncipherment, digitalSignature -extendedKeyUsage = serverAuth, clientAuth -# include the master's fqdn here, as well as in the CN, to work -# around https://bugs.ruby-lang.org/issues/6493 -# NOTE: Alt Names should be set in the request, so they know -# their FQDN -# subjectAltName = DNS:puppet,DNS:master-ca.example.org - diff --git a/acceptance/tests/external_ca_support/fixtures/master-ca/serial b/acceptance/tests/external_ca_support/fixtures/master-ca/serial deleted file mode 100644 index cd672a533..000000000 --- a/acceptance/tests/external_ca_support/fixtures/master-ca/serial +++ /dev/null @@ -1 +0,0 @@ -06 diff --git a/acceptance/tests/external_ca_support/fixtures/root/ca-root.crt b/acceptance/tests/external_ca_support/fixtures/root/ca-root.crt deleted file mode 100644 index 5f1c9dd46..000000000 --- a/acceptance/tests/external_ca_support/fixtures/root/ca-root.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDZTCCAk2gAwIBAgIJALG5BHL7ESfjMA0GCSqGSIb3DQEBBQUAMEkxEDAOBgNV -BAMMB1Jvb3QgQ0ExGjAYBgNVBAsMEVNlcnZlciBPcGVyYXRpb25zMRkwFwYDVQQK -DBBFeGFtcGxlIE9yZywgTExDMB4XDTE0MDQwODAxMjUzNloXDTM0MDQwMzAxMjUz -NlowSTEQMA4GA1UEAwwHUm9vdCBDQTEaMBgGA1UECwwRU2VydmVyIE9wZXJhdGlv -bnMxGTAXBgNVBAoMEEV4YW1wbGUgT3JnLCBMTEMwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQDFDXbR+00AwXM+HuMIpw8eVWBzQWBqDCYkX3IvYRGj+w9y -7AitrN+J0MZE3pbaRvlH5wU7MShFOmT0k/B/wrylW4W5G/iAtd2ZnXicBPrA9zDU -eHJftQxR7+Qjmsc1BqVf43PUlQITpn1APgXDzPJdk9XbRWEsIycuXkwTXzVND0U5 -z3dGS/oh9yMim0DnF2oQ+gTFA9n17xOD5hBN80U3fn4DXtcFGbtXOj6zBHsxgLCi -leif2AB1oAaZ0lqkwk6Se0rFd3zafYLDAwCPCWlZSfkQ0C/W7WYx07PDRxSYs1H6 -Viz2uHwqzyD6elxvJBGcrLdvDqTLL+w0ag3yMPWbAgMBAAGjUDBOMB0GA1UdDgQW -BBQWr4Al4/rqSL+RM2YB/VHvJGdMYzAfBgNVHSMEGDAWgBQWr4Al4/rqSL+RM2YB -/VHvJGdMYzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQC/sFnu1TIr -L6HhTft5aUaeLuO/329cDUHxlUppGRYrctkZvYK4b8TBi2BD+tcwRKS1kh4nrQhr -xaBO+oUmyJeNwEPk40trzusV9N9tfqw8drBBXEVZGxrYRYovq/RqLfUQ224EF3z0 -r74dAWL0R80PvVzeJfUsUw0KYgskfLzP5QSW1rrJnutfYP95EMV4yWyrNqnDko3M -v7XENh0TMEolMxPZ+X3TqT6Q0j4aM8njswObyeABslt+nC6nLfgBvgDaSvEULPL6 -u5aWNxp9WudGqGBvHoR6OXdZDRCzWSz52jnvXiZE4E0VnqsWxCmjDGECke4TRoMU -rtMLavKgCsIe ------END CERTIFICATE----- diff --git a/acceptance/tests/external_ca_support/fixtures/root/ca-root.key b/acceptance/tests/external_ca_support/fixtures/root/ca-root.key deleted file mode 100644 index 99de668e4..000000000 --- a/acceptance/tests/external_ca_support/fixtures/root/ca-root.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDFDXbR+00AwXM+ -HuMIpw8eVWBzQWBqDCYkX3IvYRGj+w9y7AitrN+J0MZE3pbaRvlH5wU7MShFOmT0 -k/B/wrylW4W5G/iAtd2ZnXicBPrA9zDUeHJftQxR7+Qjmsc1BqVf43PUlQITpn1A -PgXDzPJdk9XbRWEsIycuXkwTXzVND0U5z3dGS/oh9yMim0DnF2oQ+gTFA9n17xOD -5hBN80U3fn4DXtcFGbtXOj6zBHsxgLCileif2AB1oAaZ0lqkwk6Se0rFd3zafYLD -AwCPCWlZSfkQ0C/W7WYx07PDRxSYs1H6Viz2uHwqzyD6elxvJBGcrLdvDqTLL+w0 -ag3yMPWbAgMBAAECggEAPLxxqzcx/NGjm7oZcElNt6PJHr0/4m/sMbnZkBDzRv/T -OzDVW/K0092tvvx8srq9ixQB4MS+DNh61Yfj0P1M+ArFpNCiP8nOi9KlojFGuMN4 -IYUee7FqIrc2MmM6k3WA85U/1n43LadbY7m6PSembIFsoTE5Sklrgjc+a5ok66MG -1m2bZuQnfQs146T5/tZ7cFpvLKL0EUTSFLblXUeugnesQI/z17XcveEm40T0RleU -oKHYeldNYTzcRCRu5riZoOCeAiBeKvmc2Yk8Dx2ump8u2Ir5G6ST0oVP0tZ9On++ -wBfmhkJzN7wmRURk/Ivu1/Kq9/PGsJI4v4TBQbUZAQKBgQDhIw/55KmFbwKUBku3 -Gegf6R7NQjn/HccBlN/zUCfV9IJs2V4J96/7B7S3JYfwoCQp9uhZJ1Qe/aWIY9IY -UmwZLb9QhXWQbuMJtfqgrWy4FoRqAe469Mr+ol44v4j45ZfiMF+BY1sQjZuIdUNv -YrUGkFzj+ETeUUPDPcZHXLDCawKBgQDgEM+wOGBFcBuONm6XpJ/Mp4dGbSqRfRm7 -bo4lqF0UFpm9HKsS6WY/ZsQGOrTq8bsU6aTttPGvenwYm/ySEpI5iBbvXe/fgH3i -Wehd81UkiHO4uzdNgyo30aZRpa1644G4LkBlPKrcU+hKiVZtshZJjd05BQyBLKeb -NByETARFkQKBgC/O/0yEt08DlNuUPq3iTX3BRm42GxTG4QS/9ZK4uczggHXW7vZU -58T6DPE7ghOiHivfJ9YO2Pk/ydAdynapwhTStybFQILsWUAtqcxHJ6gr9/B++nUA -mL7cAgAxBEg+kTNSLGXQkH0CZT3kEO7tWh3LuD4c8Zr4TNiAHMP4tfyDAoGBAKbb -Xg54rRiIl7ybxFeg/G9HAnHrsZuOca8mcSyR6F6hRfOSecMnlED6oleROFENmqfE -JlHuQVzP9cHNx5Rvx/yX35x5c7wYz6XUFjqAjpMaGjMjF9fdKX9P3G9I1ZuB+IPT -zZiWSRayVXXMOFSQHhDAWFGx9NHtExN9Bw9uHHBBAoGBAMfC/cikwe+JjiNRMeUy -5A+KMfKYZ/63UctCZXgx+MbcOmt4LW/JYBGJG9l8ekGZVxprAMTTePsscYHQxPct -O+JvTnDJc7q3Jqmk3+eZMoNkIY0JWMR9qKTy4gmz3NMQetTpP3W3QWswALP6pKOV -5whba0lHsqlXpZzsxV/rcpuk ------END PRIVATE KEY----- diff --git a/acceptance/tests/external_ca_support/fixtures/root/inventory.txt b/acceptance/tests/external_ca_support/fixtures/root/inventory.txt deleted file mode 100644 index 2334e4752..000000000 --- a/acceptance/tests/external_ca_support/fixtures/root/inventory.txt +++ /dev/null @@ -1,2 +0,0 @@ -V 340403012536Z 01 unknown /CN=Intermediate CA (agent-ca)/emailAddress=test@example.org/O=Example Org, LLC/OU=Server Operations -V 340403012537Z 02 unknown /CN=Intermediate CA (master-ca)/emailAddress=test@example.org/O=Example Org, LLC/OU=Server Operations diff --git a/acceptance/tests/external_ca_support/fixtures/root/openssl.conf b/acceptance/tests/external_ca_support/fixtures/root/openssl.conf deleted file mode 100644 index c5bf84bb7..000000000 --- a/acceptance/tests/external_ca_support/fixtures/root/openssl.conf +++ /dev/null @@ -1,96 +0,0 @@ -SAN = DNS:puppet - -[ca] -default_ca = root_ca_config - -# Root CA -[root_ca_config] -certificate = /tmp/certchain.KDOYxTc2/root/ca-root.crt -private_key = /tmp/certchain.KDOYxTc2/root/ca-root.key -database = /tmp/certchain.KDOYxTc2/root/inventory.txt -new_certs_dir = /tmp/certchain.KDOYxTc2/root/certs -serial = /tmp/certchain.KDOYxTc2/root/serial - -default_crl_days = 7300 -default_days = 7300 -default_md = sha1 - -policy = root_ca_policy -x509_extensions = root_ca_exts - -[root_ca_policy] -commonName = supplied -emailAddress = supplied -organizationName = supplied -organizationalUnitName = supplied - -[root_ca_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:true -keyUsage = keyCertSign, cRLSign - -# Master CA -[master_ca_config] -certificate = /tmp/certchain.KDOYxTc2/root/ca-root.crt -private_key = /tmp/certchain.KDOYxTc2/root/ca-root.key -database = /tmp/certchain.KDOYxTc2/root/inventory.txt -new_certs_dir = /tmp/certchain.KDOYxTc2/root/certs -serial = /tmp/certchain.KDOYxTc2/root/serial - -default_crl_days = 7300 -default_days = 7300 -default_md = sha1 - -policy = master_ca_policy -x509_extensions = master_ca_exts - -# Master CA (Email) -[master_ca_email_config] -certificate = /tmp/certchain.KDOYxTc2/root/ca-root.crt -private_key = /tmp/certchain.KDOYxTc2/root/ca-root.key -database = /tmp/certchain.KDOYxTc2/root/inventory.txt -new_certs_dir = /tmp/certchain.KDOYxTc2/root/certs -serial = /tmp/certchain.KDOYxTc2/root/serial - -default_crl_days = 7300 -default_days = 7300 -default_md = sha1 - -email_in_dn = yes - -policy = master_ca_email_policy -x509_extensions = master_ca_exts - -[master_ca_policy] -commonName = supplied - -[master_ca_email_policy] -commonName = supplied -emailAddress = supplied - -# default extensions for clients -[master_ca_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:false -keyUsage = keyEncipherment, digitalSignature -extendedKeyUsage = serverAuth, clientAuth - -[master_ssl_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:false -keyUsage = keyEncipherment, digitalSignature -extendedKeyUsage = serverAuth, clientAuth -subjectAltName = $ENV::SAN - -# extensions for the master certificate (specifically adding subjectAltName) -[master_self_ca_exts] -authorityKeyIdentifier = keyid,issuer:always -basicConstraints = critical,CA:false -keyUsage = keyEncipherment, digitalSignature -extendedKeyUsage = serverAuth, clientAuth -# include the master's fqdn here, as well as in the CN, to work -# around https://bugs.ruby-lang.org/issues/6493 -# NOTE: Alt Names should be set in the request, so they know -# their FQDN -# subjectAltName = DNS:puppet,DNS:root.example.org - diff --git a/acceptance/tests/external_ca_support/fixtures/root/serial b/acceptance/tests/external_ca_support/fixtures/root/serial deleted file mode 100644 index 75016ea36..000000000 --- a/acceptance/tests/external_ca_support/fixtures/root/serial +++ /dev/null @@ -1 +0,0 @@ -03 diff --git a/acceptance/tests/face/loadable_from_modules.rb b/acceptance/tests/face/loadable_from_modules.rb deleted file mode 100644 index aa00495f3..000000000 --- a/acceptance/tests/face/loadable_from_modules.rb +++ /dev/null @@ -1,85 +0,0 @@ -test_name "Exercise loading a face from a module" - -# Because the module tool does not work on windows, we can't run this test there -confine :except, :platform => 'windows' - -require 'puppet/acceptance/temp_file_utils' -extend Puppet::Acceptance::TempFileUtils -initialize_temp_dirs - -agents.each do |agent| - dev_modulepath = get_test_file_path(agent, 'dev/modules') - user_modulepath = get_test_file_path(agent, 'user/modules') - - # make sure that we use the modulepath from the dev environment - puppetconf = get_test_file_path(agent, 'puppet.conf') - on agent, puppet("config", "set", "environment", "dev", "--section", "user", "--config", puppetconf) - on agent, puppet("config", "set", "modulepath", user_modulepath, "--section", "user", "--config", puppetconf) - on agent, puppet("config", "set", "modulepath", dev_modulepath, "--section", "user", "--config", puppetconf) - - on agent, 'rm -rf puppetlabs-helloworld' - on agent, puppet("module", "generate", "puppetlabs-helloworld", "--skip-interview") - mkdirs agent, 'puppetlabs-helloworld/lib/puppet/application' - mkdirs agent, 'puppetlabs-helloworld/lib/puppet/face' - - # copy application, face, and utility module - create_remote_file(agent, "puppetlabs-helloworld/lib/puppet/application/helloworld.rb", <<'EOM') -require 'puppet/face' -require 'puppet/application/face_base' - -class Puppet::Application::Helloworld < Puppet::Application::FaceBase -end -EOM - - create_remote_file(agent, "puppetlabs-helloworld/lib/puppet/face/helloworld.rb", <<'EOM') -Puppet::Face.define(:helloworld, '0.1.0') do - summary "Hello world face" - description "This is the hello world face" - - action 'actionprint' do - summary "Prints hello world from an action" - when_invoked do |options| - puts "Hello world from an action" - end - end - - action 'moduleprint' do - summary "Prints hello world from a required module" - when_invoked do |options| - require 'puppet/helloworld.rb' - Puppet::Helloworld.print - end - end -end -EOM - - create_remote_file(agent, "puppetlabs-helloworld/lib/puppet/helloworld.rb", <<'EOM') -module Puppet::Helloworld - def print - puts "Hello world from a required module" - end - module_function :print -end -EOM - - on agent, puppet('module', 'build', 'puppetlabs-helloworld') - on agent, puppet('module', 'install', '--ignore-dependencies', '--target-dir', dev_modulepath, 'puppetlabs-helloworld/pkg/puppetlabs-helloworld-0.1.0.tar.gz') - - on(agent, puppet('help', '--config', puppetconf)) do - assert_match(/helloworld\s*Hello world face/, stdout, "Face missing from list of available subcommands") - end - - on(agent, puppet('help', 'helloworld', '--config', puppetconf)) do - assert_match(/This is the hello world face/, stdout, "Descripion help missing") - assert_match(/moduleprint\s*Prints hello world from a required module/, stdout, "help for moduleprint action missing") - assert_match(/actionprint\s*Prints hello world from an action/, stdout, "help for actionprint action missing") - end - - on(agent, puppet('helloworld', 'actionprint', '--config', puppetconf)) do - assert_match(/^Hello world from an action$/, stdout, "face did not print hello world") - end - - on(agent, puppet('helloworld', 'moduleprint', '--config', puppetconf)) do - assert_match(/^Hello world from a required module$/, stdout, "face did not load module to print hello world") - end -end diff --git a/acceptance/tests/file_hello_world.rb b/acceptance/tests/file_hello_world.rb deleted file mode 100644 index 940f0fc4a..000000000 --- a/acceptance/tests/file_hello_world.rb +++ /dev/null @@ -1,22 +0,0 @@ -# Verify that a trivial manifest can be run to completion. -test_name "The challenging 'Hello, World' manifest" - -agents.each do |agent| - filename = agent.tmpfile('hello-world.txt') - content = "Hello, World" - manifest = "file { '#{filename}': content => '#{content}' }" - - step "ensure we are clean before testing..." - on(agent, "rm -f #{filename}") - - step "run the manifest itself" - apply_manifest_on(agent, manifest) do - assert_match("File[#{filename}]/ensure: defined content as", stdout, "the expected notice of action was missing") - end - - step "verify the content of the generated files." - on agent, "grep '#{content}' #{filename}" - - step "clean up after our test run." - on(agent, "rm -f #{filename}") -end diff --git a/acceptance/tests/helpful_error_message_when_hostname_not_match_server_certificate.rb b/acceptance/tests/helpful_error_message_when_hostname_not_match_server_certificate.rb deleted file mode 100644 index 115e69e2c..000000000 --- a/acceptance/tests/helpful_error_message_when_hostname_not_match_server_certificate.rb +++ /dev/null @@ -1,18 +0,0 @@ -test_name "generate a helpful error message when hostname doesn't match server certificate" - -skip_test "Certs need to be signed with DNS Alt names." if @options[:is_jvm_puppet] -skip_test( 'Changing certnames of the master will break PE/Passenger installations' ) if master.is_using_passenger? - -# Start the master with a certname not matching its hostname -master_opts = { - 'master' => { - 'certname' => 'foobar_not_my_hostname', - 'dns_alt_names' => 'one_cert,two_cert,red_cert,blue_cert' - } -} -with_puppet_running_on master, master_opts do - run_agent_on(agents, "--test --server #{master}", :acceptable_exit_codes => (1..255)) do - msg = "Server hostname '#{master}' did not match server certificate; expected one of foobar_not_my_hostname, DNS:blue_cert, DNS:foobar_not_my_hostname, DNS:one_cert, DNS:red_cert, DNS:two_cert" - assert_match(msg, stderr) - end -end diff --git a/acceptance/tests/language/resource_refs_with_nested_arrays.rb b/acceptance/tests/language/resource_refs_with_nested_arrays.rb deleted file mode 100644 index 5b11854d9..000000000 --- a/acceptance/tests/language/resource_refs_with_nested_arrays.rb +++ /dev/null @@ -1,27 +0,0 @@ -test_name "#7681: Allow using array variables in resource references" - -agents.each do |agent| - test_manifest = <<MANIFEST -$exec_names = ["first", "second"] -exec { "first": - command => "#{agent.echo('the first command')}", - path => "#{agent.path}", - logoutput => true, -} -exec { "second": - command => "#{agent.echo('the second command')}", - path => "#{agent.path}", - logoutput => true, -} -exec { "third": - command => "#{agent.echo('the final command')}", - path => "#{agent.path}", - logoutput => true, - require => Exec[$exec_names], -} -MANIFEST - - apply_manifest_on agent, test_manifest do - assert_match(/Exec\[third\].*the final command/, stdout) - end -end diff --git a/acceptance/tests/modules/build/build_agent.rb b/acceptance/tests/modules/build/build_agent.rb deleted file mode 100644 index c65592db6..000000000 --- a/acceptance/tests/modules/build/build_agent.rb +++ /dev/null @@ -1,15 +0,0 @@ -test_name "puppet module build (agent)" - -agents.each do |agent| - teardown do - on agent, 'rm -rf foo-bar' - end - - step 'generate' - on(agent, puppet('module generate foo-bar --skip-interview')) - - step 'build' - on(agent, puppet('module build foo-bar')) do - assert_match(/Module built: .*\/foo-bar\/pkg\/foo-bar-.*\.tar\.gz/, stdout) - end -end diff --git a/acceptance/tests/modules/build/build_basic.rb b/acceptance/tests/modules/build/build_basic.rb deleted file mode 100644 index 5df78ca4c..000000000 --- a/acceptance/tests/modules/build/build_basic.rb +++ /dev/null @@ -1,47 +0,0 @@ -begin test_name "puppet module build (basic)" - -step 'Setup' -on master, "mkdir -p #{master['distmoduledir']}" -on master, "mkdir -p #{master['sitemoduledir']}" -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/nginx', - ]: ensure => directory; - '#{master['distmoduledir']}/nginx/Modulefile': - content => 'name "puppetlabs-nginx" -version "0.0.1" -source "git://github.com/puppetlabs/puppetlabs-nginx.git" -author "Puppet Labs" -license "Apache Version 2.0" -summary "Nginx Module" -description "Nginx" -project_page "http://github.com/puppetlabs/puppetlabs-ntp" -dependency "puppetlabs/stdlub", ">= 1.0.0" -'; -} -PP - -step "Try to build a module with an absolute path" -on master, puppet("module build #{master['distmoduledir']}/nginx") do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Building #{master['distmoduledir']}/nginx for release\e[0m -Module built: #{master['distmoduledir']}/nginx/pkg/puppetlabs-nginx-0.0.1.tar.gz - OUTPUT -end -on master, "[ -d #{master['distmoduledir']}/nginx/pkg/puppetlabs-nginx-0.0.1 ]" -on master, "[ -f #{master['distmoduledir']}/nginx/pkg/puppetlabs-nginx-0.0.1.tar.gz ]" - -step "Try to build a module without providing a path" -on master, ("cd #{master['distmoduledir']}/nginx && puppet module build") do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Building #{master['distmoduledir']}/nginx for release\e[0m -Module built: #{master['distmoduledir']}/nginx/pkg/puppetlabs-nginx-0.0.1.tar.gz - OUTPUT -end -on master, "[ -d #{master['distmoduledir']}/nginx/pkg/puppetlabs-nginx-0.0.1 ]" -on master, "[ -f #{master['distmoduledir']}/nginx/pkg/puppetlabs-nginx-0.0.1.tar.gz ]" - -ensure step "Teardown" - apply_manifest_on master, "file { '#{master['distmoduledir']}/nginx': ensure => absent, force => true }" -end diff --git a/acceptance/tests/modules/changes/invalid_module_install_path.rb b/acceptance/tests/modules/changes/invalid_module_install_path.rb deleted file mode 100644 index bb8cdb3e3..000000000 --- a/acceptance/tests/modules/changes/invalid_module_install_path.rb +++ /dev/null @@ -1,15 +0,0 @@ -test_name 'puppet module changes (on an invalid module install path)' - -step 'Setup' - -stub_forge_on(master) -testdir = master.tmpdir('module_changes_with_invalid_path') - -step 'Run module changes on an invalid module install path' -on master, puppet("module changes #{testdir}/nginx"), :acceptable_exit_codes => [1] do - pattern = Regexp.new([ -%Q{.*Error: Could not find a valid module at "#{testdir}/nginx".*}, -%Q{.*Error: Try 'puppet help module changes' for usage.*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.stderr) -end diff --git a/acceptance/tests/modules/changes/missing_metadata_json.rb b/acceptance/tests/modules/changes/missing_metadata_json.rb deleted file mode 100644 index 05d88c971..000000000 --- a/acceptance/tests/modules/changes/missing_metadata_json.rb +++ /dev/null @@ -1,22 +0,0 @@ -test_name 'puppet module changes (on a module which is missing metadata.json)' - -step 'Setup' - -stub_forge_on(master) -testdir = master.tmpdir('module_changes_on_invalid_metadata') - -apply_manifest_on master, %Q{ - file { '#{testdir}/nginx': ensure => directory; - '#{testdir}/nginx/Modulefile': ensure => present } -} - -step 'Run module changes on a module witch is missing metadata.json' -on( master, puppet("module changes #{testdir}/nginx"), - :acceptable_exit_codes => [1] ) do - - pattern = Regexp.new([ -%Q{.*Error: No file containing checksums found.*}, -%Q{.*Error: Try 'puppet help module changes' for usage.*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.stderr) -end diff --git a/acceptance/tests/modules/changes/module_with_modified_file.rb b/acceptance/tests/modules/changes/module_with_modified_file.rb deleted file mode 100644 index aa0f4889c..000000000 --- a/acceptance/tests/modules/changes/module_with_modified_file.rb +++ /dev/null @@ -1,23 +0,0 @@ -test_name 'puppet module changes (on a module with a modified file)' - -step 'Setup' - -stub_forge_on(master) -testdir = master.tmpdir('module_changes_with_modified_file') - -on master, puppet("module install pmtacceptance-nginx --modulepath #{testdir}") -on master, "echo >> #{testdir}/nginx/README" - -step 'Run module changes to check a module with a modified file' -on( master, puppet("module changes #{testdir}/nginx"), - :acceptable_exit_codes => [0] ) do - - pattern = Regexp.new([ -%Q{.*Warning: 1 files modified.*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.stderr) - - assert_equal <<-OUTPUT, stdout -README - OUTPUT -end diff --git a/acceptance/tests/modules/changes/module_with_removed_file.rb b/acceptance/tests/modules/changes/module_with_removed_file.rb deleted file mode 100644 index 33c2391a1..000000000 --- a/acceptance/tests/modules/changes/module_with_removed_file.rb +++ /dev/null @@ -1,24 +0,0 @@ -test_name 'puppet module changes (on a module with a removed file)' - -step 'Setup' - -stub_forge_on(master) -testdir = master.tmpdir('module_changes_with_removed_file') - -on master, puppet("module install pmtacceptance-nginx --modulepath #{testdir}") -on master, "rm -rf #{testdir}/nginx/README" - -step 'Run module changes to check a module with a removed file' -on( master, puppet("module changes #{testdir}/nginx"), - :acceptable_exit_codes => [0] ) do - - pattern = Regexp.new([ -%Q{.*Warning: 1 files modified.*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.stderr) - - assert_equal <<-OUTPUT, stdout -README - OUTPUT - -end diff --git a/acceptance/tests/modules/changes/unmodified_module.rb b/acceptance/tests/modules/changes/unmodified_module.rb deleted file mode 100644 index d53c78a2d..000000000 --- a/acceptance/tests/modules/changes/unmodified_module.rb +++ /dev/null @@ -1,15 +0,0 @@ -test_name 'puppet module changes (on an unmodified module)' - -step 'Setup' - -stub_forge_on(master) -testdir = master.tmpdir('module_changes_with_unmodified') - -on master, puppet("module install pmtacceptance-nginx --modulepath #{testdir}") - -step 'Run module changes to check an unmodified module' -on( master, puppet("module changes #{testdir}/nginx"), - :acceptable_exit_codes => [0] ) do - - assert_match /No modified files/, stdout -end diff --git a/acceptance/tests/modules/generate/basic_generate.rb b/acceptance/tests/modules/generate/basic_generate.rb deleted file mode 100644 index 6055dd367..000000000 --- a/acceptance/tests/modules/generate/basic_generate.rb +++ /dev/null @@ -1,24 +0,0 @@ -test_name "puppet module generate (agent)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "nginx" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -agents.each do |agent| - - step "Generate #{module_author}-#{module_name} module" - on agent, puppet("module generate #{module_author}-#{module_name} --skip-interview") - - step "Check for #{module_author}-#{module_name} scaffolding" - on agent,"test -f #{module_author}-#{module_name}/manifests/init.pp" - - step "Clean up" - on agent,"rm -fr #{module_author}-#{module_name}" -end diff --git a/acceptance/tests/modules/install/already_installed.rb b/acceptance/tests/modules/install/already_installed.rb deleted file mode 100644 index 203d34ed2..000000000 --- a/acceptance/tests/modules/install/already_installed.rb +++ /dev/null @@ -1,51 +0,0 @@ -test_name "puppet module install (already installed)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "nginx" -module_reference = "#{module_author}-#{module_name}" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step "Setup" do - stub_forge_on(master) -end - -step "Check that module is not installed" do - on master, %Q{[ ! -d "#{master['distmoduledir']}/#{module_name}" ]} -end - -step "Install module" do - on master, puppet("module install #{module_reference}") - assert_module_installed_on_disk(master, master['distmoduledir'], module_name) -end - -step "Try to install a module that is already installed" do - on master, puppet("module install #{module_reference}"), :acceptable_exit_codes => [0] do - assert_match(/#{module_reference}.*is already installed/, stdout, - "Error that module was already installed was not displayed") - end - assert_module_installed_on_disk(master, master['distmoduledir'], module_name) -end - -step "Try to install a specific version of a module that is already installed" do - on master, puppet("module install #{module_reference} --version 1.x"), :acceptable_exit_codes => [1] do - assert_match(/Could not install module '#{module_reference}' \(v1.x\)/, stderr, - "Error that specified module version could not be installed was not displayed") - assert_match(/#{module_reference}.*is already installed/, stderr, - "Error that module was already installed was not displayed") - end - assert_module_installed_on_disk(master, master['distmoduledir'], module_name) -end - -step "Install a module that is already installed (with --force)" do - on master, puppet("module install #{module_reference} --force") do - assert_module_installed_ui(stdout, module_author, module_name) - end - assert_module_installed_on_disk(master, master['distmoduledir'], module_name) -end diff --git a/acceptance/tests/modules/install/already_installed_elsewhere.rb b/acceptance/tests/modules/install/already_installed_elsewhere.rb deleted file mode 100644 index cc7a58dbc..000000000 --- a/acceptance/tests/modules/install/already_installed_elsewhere.rb +++ /dev/null @@ -1,64 +0,0 @@ -test_name "puppet module install (already installed elsewhere)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "nginx" -module_reference = "#{module_author}-#{module_name}" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}', - '#{master['sitemoduledir']}', - '#{master['sitemoduledir']}/#{module_name}', - ]: ensure => directory; - '#{master['sitemoduledir']}/#{module_name}/metadata.json': - content => '{ - "name": "#{module_author}/#{module_name}", - "version": "0.0.1", - "source": "", - "author": "#{module_author}", - "license": "MIT", - "dependencies": [] - }'; -} -PP - -step "Try to install a module that is already installed" -on master, puppet("module install #{module_author}-#{module_name}"), :acceptable_exit_codes => [0] do - assert_match(/#{module_reference}.*is already installed/, stdout, - "Error that module was already installed was not displayed") -end -assert_module_not_installed_on_disk(master, master['distmoduledir'], module_name) - -step "Try to install a specific version of a module that is already installed" -on master, puppet("module install #{module_author}-#{module_name} --version 1.x"), :acceptable_exit_codes => [1] do - assert_match(/Could not install module '#{module_author}-#{module_name}' \(v1.x\)/, stderr, - "Error that specified module version could not be installed was not displayed") - assert_match(/#{module_author}-#{module_name}.*is already installed/, stderr, - "Error that module was already installed was not displayed") -end -assert_module_not_installed_on_disk(master, master['distmoduledir'], module_name) - -step "Install a specifc module version that is already installed (with --force)" -on master, puppet("module install #{module_author}-#{module_name} --force --version 0.0.1") do - assert_module_installed_ui(stdout, module_author, module_name, '0.0.1', '==') -end -assert_module_installed_on_disk(master, master['distmoduledir'], module_name) - -step "Install a module that is already installed (with --force)" -on master, puppet("module install #{module_author}-#{module_name} --force") do - assert_module_installed_ui(stdout, module_author, module_name) -end -assert_module_installed_on_disk(master, master['distmoduledir'], module_name) diff --git a/acceptance/tests/modules/install/already_installed_with_local_changes.rb b/acceptance/tests/modules/install/already_installed_with_local_changes.rb deleted file mode 100644 index f173a110e..000000000 --- a/acceptance/tests/modules/install/already_installed_with_local_changes.rb +++ /dev/null @@ -1,51 +0,0 @@ -test_name "puppet module install (already installed with local changes)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "nginx" -module_reference = "#{module_author}-#{module_name}" -module_path = "#{master['distmoduledir']}/#{module_name}" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' do - stub_forge_on(master) -end - -step "Check that module is not installed" do - on master, %Q{[ ! -d "#{module_path}" ]} -end - -step "Install module" do - on master, puppet("module install #{module_reference}") - assert_module_installed_on_disk(master, master['distmoduledir'], module_name) -end - -step "Make local changes in installed module" do - on master, "echo 'changed' >> #{module_path}/README" -end - -step "Try to install a specific version of a module that is already installed" do - on master, puppet("module install #{module_reference} --version 1.x"), :acceptable_exit_codes => [1] do - assert_match(/Could not install module '#{module_reference}' \(v1.x\)/, stderr, - "Error that specified module version could not be installed was not displayed") - assert_match(/#{module_reference}.*is already installed/, stderr, - "Error that module was already installed was not displayed") - assert_match(/changes made locally/, stderr, - "Error that module has local changes was not displayed") - end - assert_module_installed_on_disk(master, master['distmoduledir'], module_name) -end - -step "Install a module that is already installed (with --force)" do - on master, puppet("module install #{module_reference} --force") do - assert_module_installed_ui(stdout, module_author, module_name) - end - assert_module_installed_on_disk(master, master['distmoduledir'], module_name) - #validate checksum -end diff --git a/acceptance/tests/modules/install/basic_install.rb b/acceptance/tests/modules/install/basic_install.rb deleted file mode 100644 index 98d2aa4c5..000000000 --- a/acceptance/tests/modules/install/basic_install.rb +++ /dev/null @@ -1,25 +0,0 @@ -test_name "puppet module install (agent)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "nginx" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -agents.each do |agent| - step 'setup' - stub_forge_on(agent) - - distmoduledir = on(agent, puppet("agent", "--configprint", "confdir")).stdout.chomp + "/modules" - - step "install module '#{module_author}-#{module_name}'" - on(agent, puppet("module install #{module_author}-#{module_name}")) do - assert_module_installed_ui(stdout, module_author, module_name) - end - assert_module_installed_on_disk(agent, distmoduledir, module_name) -end diff --git a/acceptance/tests/modules/install/force_ignores_dependencies.rb b/acceptance/tests/modules/install/force_ignores_dependencies.rb deleted file mode 100644 index 2ea57f1d8..000000000 --- a/acceptance/tests/modules/install/force_ignores_dependencies.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "puppet module install (force ignores dependencies)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "git" -module_dependencies = ["apache"] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -step "Try to install an unsatisfiable module" -on master, puppet("module install #{module_author}-#{module_name}"), :acceptable_exit_codes => [1] do - assert_match(/No version of '#{module_author}-#{module_name}' can satisfy all dependencies/, stderr, - "Error that module dependencies could not be met was not displayed") -end -assert_module_not_installed_on_disk(master, master['distmoduledir'], module_name) -module_dependencies.each do |dependency| - assert_module_not_installed_on_disk(master, master['distmoduledir'], dependency) -end - -step "Install an unsatisfiable module with force" -on master, puppet("module install #{module_author}-#{module_name} --force") do - assert_module_installed_ui(stdout, module_author, module_name) -end -assert_module_installed_on_disk(master, master['distmoduledir'], module_name) -module_dependencies.each do |dependency| - assert_module_not_installed_on_disk(master, master['distmoduledir'], dependency) -end diff --git a/acceptance/tests/modules/install/ignoring_dependencies.rb b/acceptance/tests/modules/install/ignoring_dependencies.rb deleted file mode 100644 index b4603f485..000000000 --- a/acceptance/tests/modules/install/ignoring_dependencies.rb +++ /dev/null @@ -1,24 +0,0 @@ -test_name "puppet module install (ignoring dependencies)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "java" -module_dependencies = ["stdlub"] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' -stub_forge_on(master) - -step "Install a module, but ignore dependencies" -on master, puppet("module install #{module_author}-#{module_name} --ignore-dependencies") do - assert_module_installed_ui(stdout, module_author, module_name) -end -assert_module_installed_on_disk(master, master['distmoduledir'], module_name) -module_dependencies.each do |dependency| - assert_module_not_installed_on_disk(master, master['distmoduledir'], dependency) -end diff --git a/acceptance/tests/modules/install/nonexistent_directory.rb b/acceptance/tests/modules/install/nonexistent_directory.rb deleted file mode 100644 index 0822f1dea..000000000 --- a/acceptance/tests/modules/install/nonexistent_directory.rb +++ /dev/null @@ -1,36 +0,0 @@ -test_name "puppet module install (nonexistent directory)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "nginx" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -apply_manifest_on master, <<-PP - file { '/tmp/modules': ensure => absent, recurse => true, force => true } -PP - -step "Try to install a module to a non-existent directory" -on master, puppet("module install #{module_author}-#{module_name} --target-dir /tmp/modules") do - assert_module_installed_ui(stdout, module_author, module_name) -end -assert_module_installed_on_disk(master, '/tmp/modules', module_name) - -step "Try to install a module to a non-existent implicit directory" -# This test relies on destroying the default module directory... -on master, "mv #{master['distmoduledir']} #{master['distmoduledir']}-bak" -on master, puppet("module install #{module_author}-#{module_name}") do - assert_module_installed_ui(stdout, module_author, module_name) -end -assert_module_installed_on_disk(master, master['distmoduledir'], module_name) -# Restore default module directory... -on master, "mv #{master['distmoduledir']}-bak #{master['distmoduledir']}" diff --git a/acceptance/tests/modules/install/nonexistent_module.rb b/acceptance/tests/modules/install/nonexistent_module.rb deleted file mode 100644 index 736fb9b6a..000000000 --- a/acceptance/tests/modules/install/nonexistent_module.rb +++ /dev/null @@ -1,42 +0,0 @@ -test_name "puppet module install (nonexistent module)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "nonexistent" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -step "Try to install a non-existent module" -on master, puppet("module install #{module_author}-#{module_name}"), :acceptable_exit_codes => [1] do - assert_match(/could not install '#{module_author}-#{module_name}'/i, stderr, - "Error that module could not be installed was not displayed") - - assert_match(/no releases are available from/i, stderr, - "Error that no releases were found was not displayed") -end - -step "Try to install a non-existent module (JSON rendering)" -on master, puppet("module --render-as json install #{module_author}-#{module_name}") do - require 'json' - str = stdout.lines.to_a.last - json = JSON.parse(str) - - oneline_expectation = /could not install '#{module_author}-#{module_name}'; no releases are available from/i - multiline_expectation = /could not install '#{module_author}-#{module_name}'.*no releases are available from.*have at least one published release.*\z/im - - assert_equal 'failure', json['result'] - assert_equal "#{module_author}-#{module_name}", json['module_name'] - assert_equal '>= 0.0.0', json['module_version'] - assert_equal master['distmoduledir'], json['install_dir'] - assert_match oneline_expectation, json['error']['oneline'] - assert_match multiline_expectation, json['error']['multiline'] -end diff --git a/acceptance/tests/modules/install/with_cycles.rb b/acceptance/tests/modules/install/with_cycles.rb deleted file mode 100644 index f398397bf..000000000 --- a/acceptance/tests/modules/install/with_cycles.rb +++ /dev/null @@ -1,38 +0,0 @@ -test_name "puppet module install (with cycles)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "php" -module_dependencies = ["apache"] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -# How does this test differ from a with_version test??? -step "Install a module with cycles" -on master, puppet("module install #{module_author}-#{module_name} --version 0.0.1") do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to install into #{master['distmoduledir']} ...\e[0m -\e[mNotice: Downloading from https://forgeapi.puppetlabs.com ...\e[0m -\e[mNotice: Installing -- do not interrupt ...\e[0m -#{master['distmoduledir']} -└─┬ #{module_author}-#{module_name} (\e[0;36mv0.0.1\e[0m) - └── #{module_author}-apache (\e[0;36mv0.0.1\e[0m) - OUTPUT -end - -# This isn't going to work -on master, puppet("module list --modulepath #{master['distmoduledir']}") do |res| - assert_equal <<-OUTPUT, stdout -#{master['distmoduledir']} -├── #{module_author}-apache (\e[0;36mv0.0.1\e[0m) -└── #{module_author}-#{module_name} (\e[0;36mv0.0.1\e[0m) - OUTPUT -end diff --git a/acceptance/tests/modules/install/with_debug.rb b/acceptance/tests/modules/install/with_debug.rb deleted file mode 100644 index 29223dcd3..000000000 --- a/acceptance/tests/modules/install/with_debug.rb +++ /dev/null @@ -1,22 +0,0 @@ -test_name "puppet module install (with debug)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "java" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -step "Install a module with debug output" -on master, puppet("module install #{module_author}-#{module_name} --debug") do - assert_match(/Debug: Executing/, stdout, - "No 'Debug' output displayed!") -end diff --git a/acceptance/tests/modules/install/with_dependencies.rb b/acceptance/tests/modules/install/with_dependencies.rb deleted file mode 100644 index 3e177ea3a..000000000 --- a/acceptance/tests/modules/install/with_dependencies.rb +++ /dev/null @@ -1,28 +0,0 @@ -test_name "puppet module install (with dependencies)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "java" -module_dependencies = ["stdlub"] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -step "Install a module with dependencies" -on master, puppet("module install #{module_author}-#{module_name}") do - assert_module_installed_ui(stdout, module_author, module_name) - module_dependencies.each do |dependency| - assert_module_installed_ui(stdout, module_author, dependency) - end -end -assert_module_installed_on_disk(master, master['distmoduledir'], module_name) -module_dependencies.each do |dependency| - assert_module_installed_on_disk(master, master['distmoduledir'], dependency) -end diff --git a/acceptance/tests/modules/install/with_environment.rb b/acceptance/tests/modules/install/with_environment.rb deleted file mode 100644 index 73257713a..000000000 --- a/acceptance/tests/modules/install/with_environment.rb +++ /dev/null @@ -1,70 +0,0 @@ -test_name 'puppet module install (with environment)' -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "nginx" - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -puppet_conf = generate_base_legacy_and_directory_environments(master['puppetpath']) - -check_module_install_in = lambda do |environment_path, module_install_args| - on master, "puppet module install #{module_author}-#{module_name} --config=#{puppet_conf} #{module_install_args}" do - assert_module_installed_ui(stdout, module_author, module_name) - assert_match(/#{environment_path}/, stdout, - "Notice of non default install path was not displayed") - end - assert_module_installed_on_disk(master, "#{environment_path}", module_name) -end - -step 'Install a module into a non default legacy environment' do - check_module_install_in.call("#{master['puppetpath']}/legacyenv/modules", - "--environment=legacyenv") -end - -step 'Enable directory environments' do - on master, puppet("config", "set", - "environmentpath", "#{master['puppetpath']}/environments", - "--section", "main", - "--config", puppet_conf) -end - -step 'Install a module into a non default directory environment' do - check_module_install_in.call("#{master['puppetpath']}/environments/direnv/modules", - "--environment=direnv") -end - -step 'Prepare a separate modulepath' -modulepath_dir = master.tmpdir("modulepath") -apply_manifest_on(master, <<-MANIFEST , :catch_failures => true) - file { - [ - '#{master['puppetpath']}/environments/production', - '#{modulepath_dir}', - ]: - - ensure => directory, - owner => #{master['user']}, - } -MANIFEST - -step "Install a module into --modulepath #{modulepath_dir} despite the implicit production directory env existing" do - check_module_install_in.call(modulepath_dir, "--modulepath=#{modulepath_dir}") -end - -step "Uninstall so we can try a different scenario" do - on master, "puppet module uninstall #{module_author}-#{module_name} --config=#{puppet_conf} --modulepath=#{modulepath_dir}" -end - -step "Install a module into --modulepath #{modulepath_dir} with a directory env specified" do - check_module_install_in.call(modulepath_dir, - "--modulepath=#{modulepath_dir} --environment=direnv") -end diff --git a/acceptance/tests/modules/install/with_existing_module_directory.rb b/acceptance/tests/modules/install/with_existing_module_directory.rb deleted file mode 100644 index dad0212dd..000000000 --- a/acceptance/tests/modules/install/with_existing_module_directory.rb +++ /dev/null @@ -1,76 +0,0 @@ -test_name "puppet module install (with existing module directory)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "nginx" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/#{module_name}', - '#{master['distmoduledir']}/apache', - ]: ensure => directory; - '#{master['distmoduledir']}/#{module_name}/metadata.json': - content => '{ - "name": "not#{module_author}/#{module_name}", - "version": "0.0.3", - "source": "", - "author": "not#{module_author}", - "license": "MIT", - "dependencies": [] - }'; - [ - '#{master['distmoduledir']}/#{module_name}/extra.json', - '#{master['distmoduledir']}/apache/extra.json', - ]: content => ''; -} -PP - -step "Try to install a module with a name collision" -module_name = "nginx" -on master, puppet("module install #{module_author}-#{module_name}"), :acceptable_exit_codes => [1] do - assert_match(/Installation would overwrite #{master['distmoduledir']}\/#{module_name}/, stderr, - "Error of module collision was not displayed") -end -on master, "[ -f #{master['distmoduledir']}/#{module_name}/extra.json ]" - -step "Try to install a module with a path collision" -module_name = "apache" -on master, puppet("module install #{module_author}-#{module_name}"), :acceptable_exit_codes => [1] do - assert_match(/Installation would overwrite #{master['distmoduledir']}\/#{module_name}/, stderr, - "Error of module collision was not displayed") -end -on master, "[ -f #{master['distmoduledir']}/#{module_name}/extra.json ]" - -step "Try to install a module with a dependency that has collides" -module_name = "php" -on master, puppet("module install #{module_author}-#{module_name} --version 0.0.1"), :acceptable_exit_codes => [1] do - assert_match(/Dependency .* would overwrite/, stderr, - "Error of dependency collision was not displayed") -end -on master, "[ -f #{master['distmoduledir']}/apache/extra.json ]" - -step "Install a module with a name collision by using --force" -module_name = "nginx" -on master, puppet("module install #{module_author}-#{module_name} --force"), :acceptable_exit_codes => [0] do - assert_module_installed_ui(stdout, module_author, module_name) -end -on master, "[ ! -f #{master['distmoduledir']}/#{module_name}/extra.json ]" - -step "Install an module with a name collision by using --force" -module_name = "apache" -on master, puppet("module install #{module_author}-#{module_name} --force"), :acceptable_exit_codes => [0] do - assert_module_installed_ui(stdout, module_author, module_name) -end -on master, "[ ! -f #{master['distmoduledir']}/#{module_name}/extra.json ]" diff --git a/acceptance/tests/modules/install/with_modulepath.rb b/acceptance/tests/modules/install/with_modulepath.rb deleted file mode 100644 index 7c577795d..000000000 --- a/acceptance/tests/modules/install/with_modulepath.rb +++ /dev/null @@ -1,39 +0,0 @@ -# encoding: UTF-8 - -test_name "puppet module install (with modulepath)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "nginx" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) - # TODO: make helper take modulepath - on master, "rm -rf #{master['puppetpath']}/modules2" -end - -step 'Setup' - -stub_forge_on(master) - -on master, "mkdir -p #{master['puppetpath']}/modules2" - -step "Install a module with relative modulepath" -on master, "cd #{master['puppetpath']}/modules2 && puppet module install #{module_author}-#{module_name} --modulepath=." do - assert_module_installed_ui(stdout, module_author, module_name) - assert_match(/#{master['puppetpath']}\/modules2/, stdout, - "Notice of non default install path was not displayed") -end -assert_module_installed_on_disk(master, "#{master['puppetpath']}/modules2", module_name) - -step "Install a module with absolute modulepath" -on master, "test -d #{master['puppetpath']}/modules2/#{module_name} && rm -rf #{master['puppetpath']}/modules2/#{module_name}" -on master, puppet("module install #{module_author}-#{module_name} --modulepath=#{master['puppetpath']}/modules2") do - assert_module_installed_ui(stdout, module_author, module_name) - assert_match(/#{master['puppetpath']}\/modules2/, stdout, - "Notice of non default install path was not displayed") -end -assert_module_installed_on_disk(master, "#{master['puppetpath']}/modules2", module_name) diff --git a/acceptance/tests/modules/install/with_necessary_upgrade.rb b/acceptance/tests/modules/install/with_necessary_upgrade.rb deleted file mode 100644 index aa272f4d6..000000000 --- a/acceptance/tests/modules/install/with_necessary_upgrade.rb +++ /dev/null @@ -1,34 +0,0 @@ -test_name "puppet module install (with necessary dependency upgrade)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "java" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -step "Install an older module version" -module_version = '1.6.0' -on master, puppet("module install #{module_author}-#{module_name} --version #{module_version}") do - assert_match(/#{module_author}-#{module_name} \(.*v#{module_version}.*\)/, stdout, - "Notice of specific version installed was not displayed") -end -on master, "grep \"version '#{module_version}'\" #{master['distmoduledir']}/#{module_name}/Modulefile" - - -step "Install a module that requires the older module dependency be upgraded" -on master, puppet("module install #{module_author}-apollo") do - assert_module_installed_ui(stdout, module_author, module_name, module_version, '>') -end - -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_module_installed_ui(stdout, module_author, module_name, module_version, '>') -end diff --git a/acceptance/tests/modules/install/with_no_dependencies.rb b/acceptance/tests/modules/install/with_no_dependencies.rb deleted file mode 100644 index f2e73ddb5..000000000 --- a/acceptance/tests/modules/install/with_no_dependencies.rb +++ /dev/null @@ -1,22 +0,0 @@ -test_name "puppet module install (with no dependencies)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "nginx" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -step "Install a module with no dependencies" -on master, puppet("module install #{module_author}-#{module_name}") do - assert_module_installed_ui(stdout, module_author, module_name) -end -assert_module_installed_on_disk(master, master['distmoduledir'], module_name) diff --git a/acceptance/tests/modules/install/with_unnecessary_upgrade.rb b/acceptance/tests/modules/install/with_unnecessary_upgrade.rb deleted file mode 100644 index c7513b3b7..000000000 --- a/acceptance/tests/modules/install/with_unnecessary_upgrade.rb +++ /dev/null @@ -1,36 +0,0 @@ -test_name "puppet module install (with unnecessary dependency upgrade)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "java" -module_dependencies = ["stdlub"] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -step "Install an older module version" -module_version = '1.7.0' -on master, puppet("module install #{module_author}-#{module_name} --version #{module_version}") do - assert_match(/#{module_author}-#{module_name} \(.*v#{module_version}.*\)/, stdout, - "Notice of specific version installed was not displayed") -end -on master, "grep \"version '#{module_version}'\" #{master['distmoduledir']}/#{module_name}/Modulefile" - - -step "Install a module that depends on a dependency that could be upgraded, but already satisfies constraints" -module_name = "apollo" -on master, puppet("module install #{module_author}-#{module_name}") do - assert_module_installed_ui(stdout, module_author, module_name) -end - -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - module_name = "java" - assert_module_installed_ui(stdout, module_author, module_name, module_version, '==') -end diff --git a/acceptance/tests/modules/install/with_unsatisfied_constraints.rb b/acceptance/tests/modules/install/with_unsatisfied_constraints.rb deleted file mode 100644 index 4e38d1436..000000000 --- a/acceptance/tests/modules/install/with_unsatisfied_constraints.rb +++ /dev/null @@ -1,72 +0,0 @@ -test_name "puppet module install (with unsatisfied constraints)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "git" -module_reference = "#{module_author}-#{module_name}" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/crakorn', - ]: ensure => directory; - '#{master['distmoduledir']}/crakorn/metadata.json': - content => '{ - "name": "jimmy/crakorn", - "version": "0.0.1", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "#{module_author}/stdlub", "version_requirement": "1.x" } - ] - }'; -} -PP - -step "Try to install a module that has an unsatisfiable dependency" -on master, puppet("module install #{module_author}-#{module_name}"), :acceptable_exit_codes => [1] do - assert_match(/No version.*can satisfy all dependencies/, stderr, - "Unsatisfiable dependency error was not displayed") - assert_match(/Use `puppet module install --ignore-dependencies/, stderr, - "Use --ignore-dependencies error was not displayed") -end -on master, "[ ! -d #{master['distmoduledir']}/#{module_name} ]" - -# FIXME I don't understand what behaviour this looking for? -step "Install the module with an unsatisfiable dependency" -on master, puppet("module install #{module_author}-#{module_name} --ignore-dependencies") do - assert_module_installed_ui(stdout, module_author, module_name) -end -on master, "[ -d #{master['distmoduledir']}/#{module_name} ]" - -step "Try to install a specific version of the unsatisfiable dependency" -on master, puppet("module install #{module_author}-stdlub --version 1.x"), :acceptable_exit_codes => [1] do - assert_match(/No version.* can satisfy all dependencies/, stderr, - "Unsatisfiable dependency was not displayed") -end -on master, "[ ! -d #{master['distmoduledir']}/stdlub ]" - -step "Try to install any version of the unsatisfiable dependency" -on master, puppet("module install #{module_author}-stdlub"), :acceptable_exit_codes => [1] do - assert_match(/No version.* can satisfy all dependencies/, stderr, - "Unsatisfiable dependency was not displayed") -end -on master, "[ ! -d #{master['distmoduledir']}/stdlub ]" - -step "Install the unsatisfiable dependency with --force" -on master, puppet("module install #{module_author}-stdlub --force") do - assert_module_installed_ui(stdout, module_author, 'stdlub') -end -on master, "[ -d #{master['distmoduledir']}/stdlub ]" diff --git a/acceptance/tests/modules/install/with_version.rb b/acceptance/tests/modules/install/with_version.rb deleted file mode 100644 index dca9ff281..000000000 --- a/acceptance/tests/modules/install/with_version.rb +++ /dev/null @@ -1,31 +0,0 @@ -test_name "puppet module install (with version)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "java" -module_version = "1.7.0" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -agents.each do |agent| - step 'setup' - stub_forge_on(agent) - - distmoduledir = on(agent, puppet("agent", "--configprint", "confdir")).stdout.chomp + "/modules" - - step " install module '#{module_author}-#{module_name}'" - - command = agent['platform'] =~ /windows/ ? - Command.new("cmd.exe /c 'puppet module install --version \"<#{module_version}\" #{module_author}-#{module_name}'") : - puppet("module install --version \"<#{module_version}\" #{module_author}-#{module_name}") - - on(agent, command) do - assert_module_installed_ui(stdout, module_author, module_name, module_version, '<') - end - assert_module_installed_on_disk(agent, distmoduledir, module_name) -end diff --git a/acceptance/tests/modules/list/with_circular_dependencies.rb b/acceptance/tests/modules/list/with_circular_dependencies.rb deleted file mode 100644 index c73bfab2f..000000000 --- a/acceptance/tests/modules/list/with_circular_dependencies.rb +++ /dev/null @@ -1,59 +0,0 @@ -test_name "puppet module list (with circular dependencies)" - -teardown do - on master, "rm -rf #{master['distmoduledir']}/appleseed" - on master, "rm -rf #{master['sitemoduledir']}/crakorn" -end - -step "Setup" - -on master, "mkdir -p #{master['distmoduledir']}" -on master, "mkdir -p #{master['sitemoduledir']}" - -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/appleseed', - '#{master['sitemoduledir']}/crakorn', - ]: ensure => directory, - recurse => true, - purge => true, - force => true; - '#{master['sitemoduledir']}/crakorn/metadata.json': - content => '{ - "name": "jimmy/crakorn", - "version": "0.4.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/appleseed", "version_requirement": "1.1.0" } - ] - }'; - '#{master['distmoduledir']}/appleseed/metadata.json': - content => '{ - "name": "jimmy/appleseed", - "version": "1.1.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": "0.4.0" } - ] - }'; -} -PP -on master, "[ -d #{master['distmoduledir']}/appleseed ]" -on master, "[ -d #{master['sitemoduledir']}/crakorn ]" - -step "List the installed modules" -on master, puppet("module list") do - assert_match /jimmy-crakorn/, stdout, 'Could not find jimmy crakorn' - assert_match /jimmy-appleseed/, stdout, 'Could not find jimmy appleseed, but then again... wasnt it johnny appleseed?' -end - -step "List the installed modules as a dependency tree" -on master, puppet("module list --tree") do - assert_match /jimmy-crakorn.*\[#{master['sitemoduledir']}\]/, stdout, 'Could not find jimmy crakorn' - assert_match /jimmy-appleseed.*\[#{master['distmoduledir']}\]/, stdout, 'Could not find jimmy appleseed, but then again... wasnt it johnny appleseed?' -end diff --git a/acceptance/tests/modules/list/with_environment.rb b/acceptance/tests/modules/list/with_environment.rb deleted file mode 100644 index bbbfed2fc..000000000 --- a/acceptance/tests/modules/list/with_environment.rb +++ /dev/null @@ -1,43 +0,0 @@ -test_name 'puppet module list (with environment)' -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -step 'Setup' - -stub_forge_on(master) - -puppet_conf = generate_base_legacy_and_directory_environments(master['puppetpath']) - -install_test_module_in = lambda do |environment| - on master, puppet("module", "install", - "pmtacceptance-nginx", - "--config", puppet_conf, - "--environment", environment) -end - -check_module_list_in = lambda do |environment, environment_path| - on master, puppet("module", "list", - "--config", puppet_conf, - "--environment", environment) do - - assert_match(/#{environment_path}/, stdout) - assert_match(/pmtacceptance-nginx/, stdout) - end -end - -step 'List modules in a non default legacy environment' do - install_test_module_in.call('legacyenv') - check_module_list_in.call('legacyenv', "#{master['puppetpath']}/legacyenv/modules") -end - -step 'Enable directory environments' do - on master, puppet("config", "set", - "environmentpath", "#{master['puppetpath']}/environments", - "--section", "main", - "--config", puppet_conf) -end - -step 'List modules in a non default directory environment' do - install_test_module_in.call('direnv') - check_module_list_in.call('direnv', "#{master['puppetpath']}/environments/direnv/modules") -end diff --git a/acceptance/tests/modules/list/with_installed_modules.rb b/acceptance/tests/modules/list/with_installed_modules.rb deleted file mode 100644 index abe27721e..000000000 --- a/acceptance/tests/modules/list/with_installed_modules.rb +++ /dev/null @@ -1,109 +0,0 @@ -test_name "puppet module list (with installed modules)" - -teardown do - on master, "rm -rf #{master['distmoduledir']}/thelock" - on master, "rm -rf #{master['distmoduledir']}/appleseed" - on master, "rm -rf #{master['distmoduledir']}/crakorn" - on master, "rm -rf #{master['sitemoduledir']}/crick" -end - -step "Setup" -on master, "mkdir -p #{master['distmoduledir']}" -on master, "mkdir -p #{master['sitemoduledir']}" - -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/crakorn', - '#{master['distmoduledir']}/appleseed', - '#{master['distmoduledir']}/thelock', - '#{master['sitemoduledir']}/crick', - ]: ensure => directory, - recurse => true, - purge => true, - force => true; - '#{master['distmoduledir']}/crakorn/metadata.json': - content => '{ - "name": "jimmy/crakorn", - "version": "0.4.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [] - }'; - '#{master['distmoduledir']}/appleseed/metadata.json': - content => '{ - "name": "jimmy/appleseed", - "version": "1.1.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": "0.4.0" } - ] - }'; - '#{master['distmoduledir']}/thelock/metadata.json': - content => '{ - "name": "jimmy/thelock", - "version": "1.0.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/appleseed", "version_requirement": "1.x" } - ] - }'; - '#{master['sitemoduledir']}/crick/metadata.json': - content => '{ - "name": "jimmy/crick", - "version": "1.0.1", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": "0.4.x" } - ] - }'; -} -PP - -on master, "[ -d #{master['distmoduledir']}/crakorn ]" -on master, "[ -d #{master['distmoduledir']}/appleseed ]" -on master, "[ -d #{master['distmoduledir']}/thelock ]" -on master, "[ -d #{master['sitemoduledir']}/crick ]" - -step "List the installed modules" -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_equal <<-STDOUT, stdout -#{master['distmoduledir']} -├── jimmy-appleseed (\e[0;36mv1.1.0\e[0m) -├── jimmy-crakorn (\e[0;36mv0.4.0\e[0m) -└── jimmy-thelock (\e[0;36mv1.0.0\e[0m) -STDOUT -end - -on master, puppet("module list --modulepath #{master['sitemoduledir']}") do |res| - assert_match( /jimmy-crick/, - res.stdout, - 'Did not find module jimmy-crick in module site path') -end - -step "List the installed modules as a dependency tree" -on master, puppet("module list --tree --modulepath #{master['distmoduledir']}") do - assert_equal <<-STDOUT, stdout -#{master['distmoduledir']} -└─┬ jimmy-thelock (\e[0;36mv1.0.0\e[0m) - └─┬ jimmy-appleseed (\e[0;36mv1.1.0\e[0m) - └── jimmy-crakorn (\e[0;36mv0.4.0\e[0m) -STDOUT -end - -on master, puppet("module list --tree --modulepath #{master['sitemoduledir']}") do |res| - assert_match( /jimmy-crakorn/, - res.stdout, - 'Did not find module jimmy-crakorn in module site path') - - assert_match( /jimmy-crick/, - res.stdout, - 'Did not find module jimmy-crick in module site path') -end diff --git a/acceptance/tests/modules/list/with_invalid_dependencies.rb b/acceptance/tests/modules/list/with_invalid_dependencies.rb deleted file mode 100644 index 089b8590c..000000000 --- a/acceptance/tests/modules/list/with_invalid_dependencies.rb +++ /dev/null @@ -1,96 +0,0 @@ -test_name "puppet module list (with invalid dependencies)" - -teardown do - on master, "rm -rf #{master['distmoduledir']}/thelock" - on master, "rm -rf #{master['distmoduledir']}/appleseed" - on master, "rm -rf #{master['distmoduledir']}/crakorn" - on master, "rm -rf #{master['sitemoduledir']}/crick" -end - -step "Setup" -on master, "mkdir -p #{master['distmoduledir']}" -on master, "mkdir -p #{master['sitemoduledir']}" - -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/appleseed', - '#{master['distmoduledir']}/crakorn', - '#{master['distmoduledir']}/thelock', - '#{master['sitemoduledir']}/crick', - ]: ensure => directory, - recurse => true, - purge => true, - force => true; - '#{master['distmoduledir']}/crakorn/metadata.json': - content => '{ - "name": "jimmy/crakorn", - "version": "0.3.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [] - }'; - '#{master['distmoduledir']}/appleseed/metadata.json': - content => '{ - "name": "jimmy/appleseed", - "version": "1.1.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": "0.x" } - ] - }'; - '#{master['distmoduledir']}/thelock/metadata.json': - content => '{ - "name": "jimmy/thelock", - "version": "1.0.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/appleseed", "version_requirement": "1.x" } - ] - }'; - '#{master['sitemoduledir']}/crick/metadata.json': - content => '{ - "name": "jimmy/crick", - "version": "1.0.1", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": "0.4.x" } - ] - }'; -} -PP - -on master, "[ -d #{master['distmoduledir']}/appleseed ]" -on master, "[ -d #{master['distmoduledir']}/crakorn ]" -on master, "[ -d #{master['distmoduledir']}/thelock ]" -on master, "[ -d #{master['sitemoduledir']}/crick ]" - -step "List the installed modules" -on master, puppet("module list") do |res| - pattern = Regexp.new([ - %Q{.*Warning: Module 'jimmy-crakorn' \\(v0.3.0\\) fails to meet some dependencies:}, - %Q{ 'jimmy-crick' \\(v1.0.1\\) requires 'jimmy-crakorn' \\(v0.4.x\\).*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.stderr) - - assert_match /jimmy-crakorn.*invalid/, res.stdout, 'Did not find module jimmy-crick in module site path' -end - -step "List the installed modules as a dependency tree" -on master, puppet("module list --tree") do |res| - - pattern = Regexp.new([ - %Q{.*Warning: Module 'jimmy-crakorn' \\(v0.3.0\\) fails to meet some dependencies:}, - %Q{ 'jimmy-crick' \\(v1.0.1\\) requires 'jimmy-crakorn' \\(v0.4.x\\).*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.stderr) - - assert_match /jimmy-crakorn.*\[#{master['distmoduledir']}\].*invalid/, res.stdout -end diff --git a/acceptance/tests/modules/list/with_missing_dependencies.rb b/acceptance/tests/modules/list/with_missing_dependencies.rb deleted file mode 100644 index ce1b6cd13..000000000 --- a/acceptance/tests/modules/list/with_missing_dependencies.rb +++ /dev/null @@ -1,91 +0,0 @@ -test_name "puppet module list (with missing dependencies)" - -teardown do - on master, "rm -rf #{master['distmoduledir']}/thelock" - on master, "rm -rf #{master['distmoduledir']}/appleseed" - on master, "rm -rf #{master['sitemoduledir']}/crick" -end - -step "Setup" - -on master, "mkdir -p #{master['distmoduledir']}" -on master, "mkdir -p #{master['sitemoduledir']}" - -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/appleseed', - '#{master['distmoduledir']}/thelock', - '#{master['sitemoduledir']}/crick', - ]: ensure => directory, - recurse => true, - purge => true, - force => true; - '#{master['distmoduledir']}/appleseed/metadata.json': - content => '{ - "name": "jimmy/appleseed", - "version": "1.1.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": "0.4.0" } - ] - }'; - '#{master['distmoduledir']}/thelock/metadata.json': - content => '{ - "name": "jimmy/thelock", - "version": "1.0.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/appleseed", "version_requirement": "1.x" }, - { "name": "jimmy/sprinkles", "version_requirement": "2.x" } - ] - }'; - '#{master['sitemoduledir']}/crick/metadata.json': - content => '{ - "name": "jimmy/crick", - "version": "1.0.1", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": "0.4.x" } - ] - }'; -} -PP - -on master, "[ -d #{master['distmoduledir']}/appleseed ]" -on master, "[ -d #{master['distmoduledir']}/thelock ]" -on master, "[ -d #{master['sitemoduledir']}/crick ]" - -step "List the installed modules" -on master, puppet('module list') do - pattern = Regexp.new([ - %Q{.*Warning: Missing dependency 'jimmy-crakorn':}, - %Q{ 'jimmy-appleseed' \\(v1.1.0\\) requires 'jimmy-crakorn' \\(v0.4.0\\)}, - %Q{ 'jimmy-crick' \\(v1.0.1\\) requires 'jimmy-crakorn' \\(v0.4.x\\).*}, - %Q{.*Warning: Missing dependency 'jimmy-sprinkles':}, - %Q{ 'jimmy-thelock' \\(v1.0.0\\) requires 'jimmy-sprinkles' \\(v2.x\\).*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.stderr) -end - -step "List the installed modules as a dependency tree" -on master, puppet('module list --tree') do - pattern = Regexp.new([ - %Q{.*Warning: Missing dependency 'jimmy-crakorn':}, - %Q{ 'jimmy-appleseed' \\(v1.1.0\\) requires 'jimmy-crakorn' \\(v0.4.0\\)}, - %Q{ 'jimmy-crick' \\(v1.0.1\\) requires 'jimmy-crakorn' \\(v0.4.x\\).*}, - %Q{.*Warning: Missing dependency 'jimmy-sprinkles':}, - %Q{ 'jimmy-thelock' \\(v1.0.0\\) requires 'jimmy-sprinkles' \\(v2.x\\).*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.stderr) - - assert_match /UNMET DEPENDENCY.*jimmy-sprinkles/, stdout, 'Did not find unmeet dependency for jimmy-sprinkles warning' - - assert_match /UNMET DEPENDENCY.*jimmy-crakorn/, stdout, 'Did not find unmeet dependency for jimmy-crakorn warning' -end diff --git a/acceptance/tests/modules/list/with_modulepath.rb b/acceptance/tests/modules/list/with_modulepath.rb deleted file mode 100644 index adaeb7ddb..000000000 --- a/acceptance/tests/modules/list/with_modulepath.rb +++ /dev/null @@ -1,75 +0,0 @@ -test_name "puppet module list (with modulepath)" - -step "Setup" -apply_manifest_on master, <<-PP -file { - [ - '#{master['puppetpath']}/modules2', - '#{master['puppetpath']}/modules2/crakorn', - '#{master['puppetpath']}/modules2/appleseed', - '#{master['puppetpath']}/modules2/thelock', - ]: ensure => directory, - recurse => true, - purge => true, - force => true; - '#{master['puppetpath']}/modules2/crakorn/metadata.json': - content => '{ - "name": "jimmy/crakorn", - "version": "0.4.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [] - }'; - '#{master['puppetpath']}/modules2/appleseed/metadata.json': - content => '{ - "name": "jimmy/appleseed", - "version": "1.1.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": "0.4.0" } - ] - }'; - '#{master['puppetpath']}/modules2/thelock/metadata.json': - content => '{ - "name": "jimmy/thelock", - "version": "1.0.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/appleseed", "version_requirement": "1.x" } - ] - }'; -} -PP - -teardown do - on master, "rm -rf #{master['puppetpath']}/modules2" -end - -on master, "[ -d #{master['puppetpath']}/modules2/crakorn ]" -on master, "[ -d #{master['puppetpath']}/modules2/appleseed ]" -on master, "[ -d #{master['puppetpath']}/modules2/thelock ]" - -step "List the installed modules with relative modulepath" -on master, "cd #{master['puppetpath']}/modules2 && puppet module list --modulepath=." do - assert_equal <<-STDOUT, stdout -#{master['puppetpath']}/modules2 -├── jimmy-appleseed (\e[0;36mv1.1.0\e[0m) -├── jimmy-crakorn (\e[0;36mv0.4.0\e[0m) -└── jimmy-thelock (\e[0;36mv1.0.0\e[0m) -STDOUT -end - -step "List the installed modules with absolute modulepath" -on master, puppet("module list --modulepath=#{master['puppetpath']}/modules2") do - assert_equal <<-STDOUT, stdout -#{master['puppetpath']}/modules2 -├── jimmy-appleseed (\e[0;36mv1.1.0\e[0m) -├── jimmy-crakorn (\e[0;36mv0.4.0\e[0m) -└── jimmy-thelock (\e[0;36mv1.0.0\e[0m) -STDOUT -end diff --git a/acceptance/tests/modules/list/with_no_installed_modules.rb b/acceptance/tests/modules/list/with_no_installed_modules.rb deleted file mode 100644 index f2481dcf3..000000000 --- a/acceptance/tests/modules/list/with_no_installed_modules.rb +++ /dev/null @@ -1,9 +0,0 @@ -test_name "puppet module list (with no installed modules)" - - -step "List the installed modules" -modulesdir = master.tmpdir('puppet_module') -on master, puppet("module list --modulepath #{modulesdir}") do - assert_match(/no modules installed/, stdout, - "Declaration of 'no modules installed' not found") -end diff --git a/acceptance/tests/modules/list/with_repeated_dependencies.rb b/acceptance/tests/modules/list/with_repeated_dependencies.rb deleted file mode 100644 index 7cab94441..000000000 --- a/acceptance/tests/modules/list/with_repeated_dependencies.rb +++ /dev/null @@ -1,112 +0,0 @@ -test_name "puppet module list (with repeated dependencies)" - -teardown do - on master, "rm -rf #{master['distmoduledir']}/crakorn" - on master, "rm -rf #{master['distmoduledir']}/steward" - on master, "rm -rf #{master['distmoduledir']}/appleseed" - on master, "rm -rf #{master['distmoduledir']}/thelock" - on master, "rm -rf #{master['sitemoduledir']}/crick" -end - -step "Setup" - -on master, "mkdir -p #{master['distmoduledir']}" -on master, "mkdir -p #{master['sitemoduledir']}" - -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/crakorn', - '#{master['distmoduledir']}/steward', - '#{master['distmoduledir']}/appleseed', - '#{master['distmoduledir']}/thelock', - '#{master['sitemoduledir']}/crick', - ]: ensure => directory, - recurse => true, - purge => true, - force => true; - '#{master['distmoduledir']}/crakorn/metadata.json': - content => '{ - "name": "jimmy/crakorn", - "version": "0.4.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/steward", "version_requirement": ">= 0.0.0" } - ] - }'; - '#{master['distmoduledir']}/steward/metadata.json': - content => '{ - "name": "jimmy/steward", - "version": "0.9.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [] - }'; - '#{master['distmoduledir']}/appleseed/metadata.json': - content => '{ - "name": "jimmy/appleseed", - "version": "1.1.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": "0.4.0" } - ] - }'; - '#{master['distmoduledir']}/thelock/metadata.json': - content => '{ - "name": "jimmy/thelock", - "version": "1.0.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": ">= 0.0.0" }, - { "name": "jimmy/appleseed", "version_requirement": "1.x" } - ] - }'; - '#{master['sitemoduledir']}/crick/metadata.json': - content => '{ - "name": "jimmy/crick", - "version": "1.0.1", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": "0.4.x" } - ] - }'; -} -PP - -on master, "[ -d #{master['distmoduledir']}/crakorn ]" -on master, "[ -d #{master['distmoduledir']}/steward ]" -on master, "[ -d #{master['distmoduledir']}/appleseed ]" -on master, "[ -d #{master['distmoduledir']}/thelock ]" -on master, "[ -d #{master['sitemoduledir']}/crick ]" - -step "List the installed modules" -on master, puppet('module list') # assertion is exit code 0 - -step "List the installed modules as a dependency tree" -on master, puppet("module list --tree --modulepath #{master['distmoduledir']}") do - assert_equal <<-STDOUT, stdout -#{master['distmoduledir']} -└─┬ jimmy-thelock (\e[0;36mv1.0.0\e[0m) - ├─┬ jimmy-crakorn (\e[0;36mv0.4.0\e[0m) - │ └── jimmy-steward (\e[0;36mv0.9.0\e[0m) - └── jimmy-appleseed (\e[0;36mv1.1.0\e[0m) -STDOUT -end - -on master, puppet("module list --tree") do - assert_match( /jimmy-crakorn.*\[#{master['distmoduledir']}\]/, - stdout, - 'Did not find cross modulepath reference to jimmy-crakorn' ) - assert_match( /jimmy-steward.*\[#{master['distmoduledir']}\]/, - stdout, - 'Did not find cross modulepath reference to jimmy-steward' ) -end diff --git a/acceptance/tests/modules/search/communication_error.rb b/acceptance/tests/modules/search/communication_error.rb deleted file mode 100644 index 0df08a1ef..000000000 --- a/acceptance/tests/modules/search/communication_error.rb +++ /dev/null @@ -1,18 +0,0 @@ -test_name 'puppet module search should print a reasonable message on communication errors' - -confine :except, :platform => 'solaris' - -step 'Setup' -stub_hosts_on(master, 'forgeapi.puppetlabs.com' => '127.0.0.2') - -step "Search against a non-existent Forge" -on master, puppet("module search yup"), :acceptable_exit_codes => [1] do - - assert_match <<-STDOUT, stdout -\e[mNotice: Searching https://forgeapi.puppetlabs.com ...\e[0m -STDOUT - -assert_no_match /yup/, - stdout, - 'Found a reference to a fake module when errors should have prevented us from getting here' -end diff --git a/acceptance/tests/modules/search/formatting.rb b/acceptance/tests/modules/search/formatting.rb deleted file mode 100644 index 244a192b6..000000000 --- a/acceptance/tests/modules/search/formatting.rb +++ /dev/null @@ -1,16 +0,0 @@ -test_name 'puppet module search output should be well structured' - -step 'Setup' -stub_forge_on(master) - -step 'Search results should line up by column' -on master, puppet("module search apache") do - - assert_match(/Searching/, stdout.lines.first) - columns = stdout.lines.to_a[1].split(/\s{2}(?=\S)/) - pattern = /^#{ columns.map { |c| c.chomp.gsub(/./, '.') }.join(' ') }$/ - - stdout.gsub(/\e.*?m/, '').lines.to_a[1..-1].each do |line| - assert_match(pattern, line.chomp, 'columns were misaligned') - end -end diff --git a/acceptance/tests/modules/search/multiple_search_terms.rb b/acceptance/tests/modules/search/multiple_search_terms.rb deleted file mode 100644 index 76b975d89..000000000 --- a/acceptance/tests/modules/search/multiple_search_terms.rb +++ /dev/null @@ -1,20 +0,0 @@ -test_name 'puppet module search should handle multiple search terms sensibly' - -#step 'Setup' -#stub_forge_on(master) - -# FIXME: The Forge doesn't properly handle multi-term searches. -# step 'Search for a module by description' -# on master, puppet("module search 'notice here'") do -# assert stdout !~ /'notice here'/ -# end -# -# step 'Search for a module by name' -# on master, puppet("module search 'ance-geo ance-std'") do -# assert stdout !~ /'ance-geo ance-std'/ -# end -# -# step 'Search for multiple keywords' -# on master, puppet("module search 'star trek'") do -# assert stdout !~ /'star trek'/ -# end diff --git a/acceptance/tests/modules/search/no_results.rb b/acceptance/tests/modules/search/no_results.rb deleted file mode 100644 index a250fcda2..000000000 --- a/acceptance/tests/modules/search/no_results.rb +++ /dev/null @@ -1,12 +0,0 @@ -test_name 'puppet module search should print a reasonable message for no results' - -module_name = "module_not_appearing_in_this_forge" - -step 'Setup' -stub_forge_on(master) - -step "Search for a module that doesn't exist" -on master, puppet("module search #{module_name}") do |res| - assert_match(/Searching/, res.stdout) - assert_match(/No results found for '#{module_name}'/, res.stdout) -end diff --git a/acceptance/tests/modules/search/ssl_errors.rb b/acceptance/tests/modules/search/ssl_errors.rb deleted file mode 100644 index 2d374d6e2..000000000 --- a/acceptance/tests/modules/search/ssl_errors.rb +++ /dev/null @@ -1,24 +0,0 @@ -begin test_name 'puppet module search should print a reasonable message on ssl errors' - -step "Search against a website where the certificate is not signed by a public authority" - -# This might seem silly, but a master has a self-signed certificate and is a -# cheap way of testing against a web server without a publicly signed cert -with_puppet_running_on master, {} do - on master, puppet("module search yup --module_repository=https://#{master}:8140"), :acceptable_exit_codes => [1] do - assert_match <<-STDOUT, stdout -\e[mNotice: Searching https://#{master}:8140 ...\e[0m -STDOUT - assert_match <<-STDERR.chomp, stderr -Error: Could not connect via HTTPS to https://#{master}:8140 - Unable to verify the SSL certificate - The certificate may not be signed by a valid CA - The CA bundle included with OpenSSL may not be valid or up to date -STDERR -end - -end - -ensure step 'Remove fake forge hostname' -apply_manifest_on master, "host { 'fake.fakeforge.com': ensure => absent }" -end diff --git a/acceptance/tests/modules/uninstall/using_directory_name.rb b/acceptance/tests/modules/uninstall/using_directory_name.rb deleted file mode 100644 index 505e6e166..000000000 --- a/acceptance/tests/modules/uninstall/using_directory_name.rb +++ /dev/null @@ -1,49 +0,0 @@ -test_name "puppet module uninstall (using directory name)" - -teardown do - on master, "rm -rf #{master['distmoduledir']}/apache" - on master, "rm -rf #{master['distmoduledir']}/crakorn" -end - -step "Setup" -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/apache', - '#{master['distmoduledir']}/crakorn', - ]: ensure => directory; - '#{master['distmoduledir']}/crakorn/metadata.json': - content => '{ - "name": "jimmy/crakorn", - "version": "0.4.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [] - }'; -} -PP - -on master, "[ -d #{master['distmoduledir']}/apache ]" -on master, "[ -d #{master['distmoduledir']}/crakorn ]" - -step "Try to uninstall the module apache" -on master, puppet('module uninstall apache') do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to uninstall 'apache' ...\e[0m -Removed 'apache' from #{master['distmoduledir']} - OUTPUT -end -on master, "[ ! -d #{master['distmoduledir']}/apache ]" - -step "Try to uninstall the module crakorn" -on master, puppet('module uninstall crakorn'), :acceptable_exit_codes => [1] do - pattern = Regexp.new([ - %Q{.*Notice: Preparing to uninstall 'crakorn' ....*}, - %Q{.*Error: Could not uninstall module 'crakorn'}, - %Q{ Module 'crakorn' is not installed}, - %Q{ You may have meant `puppet module uninstall jimmy-crakorn`.*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.output) -end -on master, "[ -d #{master['distmoduledir']}/crakorn ]" diff --git a/acceptance/tests/modules/uninstall/using_version_filter.rb b/acceptance/tests/modules/uninstall/using_version_filter.rb deleted file mode 100644 index 0469f8ee4..000000000 --- a/acceptance/tests/modules/uninstall/using_version_filter.rb +++ /dev/null @@ -1,84 +0,0 @@ -test_name "puppet module uninstall (with module installed)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "jimmy" -module_name = "crakorn" -module_dependencies = [] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step "Setup" -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/#{module_name}', - '#{master['sitemoduledir']}/#{module_name}', - '#{master['sitemoduledir']}/appleseed', - ]: ensure => directory; - '#{master['distmoduledir']}/#{module_name}/metadata.json': - content => '{ - "name": "#{module_author}/#{module_name}", - "version": "0.4.0", - "source": "", - "author": "#{module_author}", - "license": "MIT", - "dependencies": [] - }'; - '#{master['sitemoduledir']}/#{module_name}/metadata.json': - content => '{ - "name": "#{module_author}/#{module_name}", - "version": "0.5.1", - "source": "", - "author": "#{module_author}", - "license": "MIT", - "dependencies": [] - }'; - '#{master['sitemoduledir']}/appleseed/metadata.json': - content => '{ - "name": "#{module_author}/appleseed", - "version": "0.4.0", - "source": "", - "author": "#{module_author}", - "license": "MIT", - "dependencies": [] - }'; -} -PP - -step "Uninstall #{module_author}-#{module_name} version 0.5.x" -on master, puppet("module uninstall #{module_author}-#{module_name} --version 0.5.x") do - assert_match(/Removed '#{module_author}-#{module_name}'/, stdout, - "Notice that module was uninstalled was not displayed") -end -on master, "[ -d #{master['distmoduledir']}/#{module_name} ]" -on master, "[ ! -d #{master['sitemoduledir']}/#{module_name} ]" - -step "Try to uninstall #{module_author}-#{module_name} v0.4.0 with `--version 0.5.x`" -on master, puppet("module uninstall #{module_author}-#{module_name} --version 0.5.x"), :acceptable_exit_codes => [1] do - assert_match(/Could not uninstall module '#{module_author}-#{module_name}'/, stderr, - "Error that module could not be uninstalled was not displayed") - assert_match(/No installed version of '#{module_author}-#{module_name}' matches/, stderr, - "Error that module version could not be found was not displayed") -end -on master, "[ -d #{master['distmoduledir']}/#{module_name} ]" - -module_name = 'appleseed' -step "Try to uninstall #{module_author}-#{module_name} v0.4.0 with `--version >9.9.9`" -on master, puppet("module uninstall #{module_author}-#{module_name} --version \">9.9.9\""), :acceptable_exit_codes => [1] do - assert_match(/Could not uninstall module '#{module_author}-#{module_name}'/, stderr, - "Error that module could not be uninstalled was not displayed") - assert_match(/No installed version of '#{module_author}-#{module_name}' matches/, stderr, - "Error that module version could not be found was not displayed") -end -on master, "[ -d #{master['sitemoduledir']}/#{module_name} ]" - -step "Uninstall #{module_author}-#{module_name} v0.4.0 with `--version >0.0.0`" -on master, puppet("module uninstall #{module_author}-#{module_name} --version \">0.0.0\"") do - assert_match(/Removed '#{module_author}-#{module_name}'/, stdout, - "Notice that module was uninstalled was not displayed") -end -on master, "[ ! -d #{master['sitemoduledir']}/#{module_name} ]" diff --git a/acceptance/tests/modules/uninstall/with_active_dependency.rb b/acceptance/tests/modules/uninstall/with_active_dependency.rb deleted file mode 100644 index f4fc185af..000000000 --- a/acceptance/tests/modules/uninstall/with_active_dependency.rb +++ /dev/null @@ -1,77 +0,0 @@ -test_name "puppet module uninstall (with active dependency)" - -step "Setup" -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/crakorn', - '#{master['distmoduledir']}/appleseed', - ]: ensure => directory; - '#{master['distmoduledir']}/crakorn/metadata.json': - content => '{ - "name": "jimmy/crakorn", - "version": "0.4.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [] - }'; - '#{master['distmoduledir']}/appleseed/metadata.json': - content => '{ - "name": "jimmy/appleseed", - "version": "1.1.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [ - { "name": "jimmy/crakorn", "version_requirement": "0.4.0" } - ] - }'; -} -PP - -teardown do - on master, "rm -rf #{master['distmoduledir']}/crakorn" - on master, "rm -rf #{master['distmoduledir']}/appleseed" -end - -on master, "[ -d #{master['distmoduledir']}/crakorn ]" -on master, "[ -d #{master['distmoduledir']}/appleseed ]" - -step "Try to uninstall the module jimmy-crakorn" -on master, puppet('module uninstall jimmy-crakorn'), :acceptable_exit_codes => [1] do - pattern = Regexp.new([ - %Q{.*Notice: Preparing to uninstall 'jimmy-crakorn' .*}, - %Q{.*Error: Could not uninstall module 'jimmy-crakorn'}, - %Q{ Other installed modules have dependencies on 'jimmy-crakorn' \\(v0.4.0\\)}, - %Q{ 'jimmy/appleseed' \\(v1.1.0\\) requires 'jimmy-crakorn' \\(v0.4.0\\)}, - %Q{ Use `puppet module uninstall --force` to uninstall this module anyway.*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.output) -end -on master, "[ -d #{master['distmoduledir']}/crakorn ]" -on master, "[ -d #{master['distmoduledir']}/appleseed ]" - -step "Try to uninstall the module jimmy-crakorn with a version range" -on master, puppet('module uninstall jimmy-crakorn --version 0.x'), :acceptable_exit_codes => [1] do - pattern = Regexp.new([ - %Q{.*Notice: Preparing to uninstall 'jimmy-crakorn' \\(.*v0.x.*\\) .*}, - %Q{.*Error: Could not uninstall module 'jimmy-crakorn' \\(v0.x\\)}, - %Q{ Other installed modules have dependencies on 'jimmy-crakorn' \\(v0.4.0\\)}, - %Q{ 'jimmy/appleseed' \\(v1.1.0\\) requires 'jimmy-crakorn' \\(v0.4.0\\)}, - %Q{ Use `puppet module uninstall --force` to uninstall this module anyway.*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.output) -end -on master, "[ -d #{master['distmoduledir']}/crakorn ]" -on master, "[ -d #{master['distmoduledir']}/appleseed ]" - -step "Uninstall the module jimmy-crakorn forcefully" -on master, puppet('module uninstall jimmy-crakorn --force') do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to uninstall 'jimmy-crakorn' ...\e[0m -Removed 'jimmy-crakorn' (\e[0;36mv0.4.0\e[0m) from #{master['distmoduledir']} - OUTPUT -end -on master, "[ ! -d #{master['distmoduledir']}/crakorn ]" -on master, "[ -d #{master['distmoduledir']}/appleseed ]" diff --git a/acceptance/tests/modules/uninstall/with_environment.rb b/acceptance/tests/modules/uninstall/with_environment.rb deleted file mode 100644 index 58228014e..000000000 --- a/acceptance/tests/modules/uninstall/with_environment.rb +++ /dev/null @@ -1,65 +0,0 @@ -test_name 'puppet module uninstall (with environment)' -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -step 'Setup' - -stub_forge_on(master) - -puppet_conf = generate_base_legacy_and_directory_environments(master['puppetpath']) - -crakorn_metadata = <<-EOS -{ - "name": "jimmy/crakorn", - "version": "0.4.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [] -} -EOS - -# Configure a non-default environment -apply_manifest_on master, %Q{ - file { - [ - '#{master['puppetpath']}/legacyenv/modules/crakorn', - '#{master['puppetpath']}/environments/direnv/modules', - '#{master['puppetpath']}/environments/direnv/modules/crakorn', - ]: - ensure => directory, - } - file { - '#{master['puppetpath']}/legacyenv/modules/crakorn/metadata.json': - content => '#{crakorn_metadata}', - } - file { - '#{master['puppetpath']}/environments/direnv/modules/crakorn/metadata.json': - content => '#{crakorn_metadata}', - } -} - -check_module_uninstall_in = lambda do |environment, environment_path| - on master, "puppet module uninstall jimmy-crakorn --config=#{puppet_conf} --environment=#{environment}" do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to uninstall 'jimmy-crakorn' ...\e[0m -Removed 'jimmy-crakorn' (\e[0;36mv0.4.0\e[0m) from #{environment_path} - OUTPUT - end - on master, "[ ! -d #{environment_path}/crakorn ]" -end - -step 'Uninstall a module from a non default legacy environment' do - check_module_uninstall_in.call('legacyenv', "#{master['puppetpath']}/legacyenv/modules") -end - -step 'Enable directory environments' do - on master, puppet("config", "set", - "environmentpath", "#{master['puppetpath']}/environments", - "--section", "main", - "--config", puppet_conf) -end - -step 'Uninstall a module from a non default directory environment' do - check_module_uninstall_in.call('direnv', "#{master['puppetpath']}/environments/direnv/modules") -end diff --git a/acceptance/tests/modules/uninstall/with_module_installed.rb b/acceptance/tests/modules/uninstall/with_module_installed.rb deleted file mode 100644 index c81bc9ece..000000000 --- a/acceptance/tests/modules/uninstall/with_module_installed.rb +++ /dev/null @@ -1,34 +0,0 @@ -test_name "puppet module uninstall (with module installed)" - -teardown do - on master, "rm -rf #{master['distmoduledir']}/crakorn" -end - -step "Setup" -apply_manifest_on master, <<-PP -file { - [ - '#{master['distmoduledir']}/crakorn', - ]: ensure => directory; - '#{master['distmoduledir']}/crakorn/metadata.json': - content => '{ - "name": "jimmy/crakorn", - "version": "0.4.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [] - }'; -} -PP - -on master, "[ -d #{master['distmoduledir']}/crakorn ]" - -step "Uninstall the module jimmy-crakorn" -on master, puppet('module uninstall jimmy-crakorn') do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to uninstall 'jimmy-crakorn' ...\e[0m -Removed 'jimmy-crakorn' (\e[0;36mv0.4.0\e[0m) from #{master['distmoduledir']} - OUTPUT -end -on master, "[ ! -d #{master['distmoduledir']}/crakorn ]" diff --git a/acceptance/tests/modules/uninstall/with_modulepath.rb b/acceptance/tests/modules/uninstall/with_modulepath.rb deleted file mode 100644 index 7915f0c6d..000000000 --- a/acceptance/tests/modules/uninstall/with_modulepath.rb +++ /dev/null @@ -1,56 +0,0 @@ -test_name "puppet module uninstall (with modulepath)" - -teardown do - on master, "rm -rf #{master['puppetpath']}/modules2" -end - -step "Setup" -apply_manifest_on master, <<-PP -file { - [ - '#{master['puppetpath']}/modules2', - '#{master['puppetpath']}/modules2/crakorn', - '#{master['puppetpath']}/modules2/absolute', - ]: ensure => directory; - '#{master['puppetpath']}/modules2/crakorn/metadata.json': - content => '{ - "name": "jimmy/crakorn", - "version": "0.4.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [] - }'; - '#{master['puppetpath']}/modules2/absolute/metadata.json': - content => '{ - "name": "jimmy/absolute", - "version": "0.4.0", - "source": "", - "author": "jimmy", - "license": "MIT", - "dependencies": [] - }'; -} -PP - -on master, "[ -d #{master['puppetpath']}/modules2/crakorn ]" -on master, "[ -d #{master['puppetpath']}/modules2/absolute ]" - -step "Try to uninstall the module jimmy-crakorn using relative modulepath" -on master, "cd #{master['puppetpath']}/modules2 && puppet module uninstall jimmy-crakorn --modulepath=." do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to uninstall 'jimmy-crakorn' ...\e[0m -Removed 'jimmy-crakorn' (\e[0;36mv0.4.0\e[0m) from #{master['puppetpath']}/modules2 - OUTPUT -end - -on master, "[ ! -d #{master['puppetpath']}/modules2/crakorn ]" - -step "Try to uninstall the module jimmy-absolute using an absolute modulepath" -on master, "cd #{master['puppetpath']}/modules2 && puppet module uninstall jimmy-absolute --modulepath=#{master['puppetpath']}/modules2" do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to uninstall 'jimmy-absolute' ...\e[0m -Removed 'jimmy-absolute' (\e[0;36mv0.4.0\e[0m) from #{master['puppetpath']}/modules2 - OUTPUT -end -on master, "[ ! -d #{master['puppetpath']}/modules2/absolute ]" diff --git a/acceptance/tests/modules/uninstall/with_multiple_modules_installed.rb b/acceptance/tests/modules/uninstall/with_multiple_modules_installed.rb deleted file mode 100644 index 2223c9d42..000000000 --- a/acceptance/tests/modules/uninstall/with_multiple_modules_installed.rb +++ /dev/null @@ -1,64 +0,0 @@ -test_name "puppet module uninstall (with multiple modules installed)" - -step 'Setup' -testdir = master.tmpdir('unistallmultiple') - -stub_forge_on(master) - -teardown do - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/stdlub" -end - -on master, "mkdir -p #{testdir}/modules" -on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" - -master_opts = { - 'main' => { - 'modulepath' => "#{testdir}/modules:#{master['sitemoduledir']}:#{master['distmoduledir']}" - } -} - -with_puppet_running_on master, master_opts, testdir do - on master, puppet("module install pmtacceptance-java --version 1.6.0 --modulepath #{master['distmoduledir']}") - on master, puppet("module install pmtacceptance-java --version 1.7.0 --modulepath #{testdir}/modules") - on master, puppet("module list --modulepath #{master['distmoduledir']}") do - pattern = Regexp.new([ - "#{master['distmoduledir']}", - "├── pmtacceptance-java \\(.*v1.6.0.*\\)", - "└── pmtacceptance-stdlub \\(.*v1.0.0.*\\)" - ].join("\n")) - assert_match(pattern, result.output) - end - - on master, puppet("module list --modulepath #{testdir}/modules") do - pattern = Regexp.new([ - "#{testdir}/modules", - "├── pmtacceptance-java \\(.*v1.7.0.*\\)", - "└── pmtacceptance-stdlub \\(.*v1.0.0.*\\)", - ].join("\n")) - assert_match(pattern, result.output) - end - - step "Try to uninstall a module that exists multiple locations in the module path" - on master, puppet("module uninstall pmtacceptance-java"), :acceptable_exit_codes => [1] do - pattern = Regexp.new([ - ".*Notice: Preparing to uninstall 'pmtacceptance-java' .*", - ".*Error: Could not uninstall module 'pmtacceptance-java'", - " Module 'pmtacceptance-java' appears multiple places in the module path", - " 'pmtacceptance-java' \\(v1.7.0\\) was found in #{testdir}/modules", - " 'pmtacceptance-java' \\(v1.6.0\\) was found in #{master['distmoduledir']}", - " Use the `--modulepath` option to limit the search to specific directories.*" - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.output) - end - - step "Uninstall a module that exists multiple locations by restricting the --modulepath" - on master, puppet("module uninstall pmtacceptance-java --modulepath #{master['distmoduledir']}") do - pattern = Regexp.new([ - ".*Notice: Preparing to uninstall 'pmtacceptance-java' .*", - "Removed 'pmtacceptance-java' \\(.*v1.6.0.*\\) from #{master['distmoduledir']}" - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.output) - end -end diff --git a/acceptance/tests/modules/upgrade/in_a_secondary_directory.rb b/acceptance/tests/modules/upgrade/in_a_secondary_directory.rb deleted file mode 100644 index 3b3a79c8a..000000000 --- a/acceptance/tests/modules/upgrade/in_a_secondary_directory.rb +++ /dev/null @@ -1,32 +0,0 @@ -test_name "puppet module upgrade (in a secondary directory)" - -step 'Setup' - -stub_forge_on(master) - -teardown do - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/stdlib" -end - -on master, "mkdir -p #{master['distmoduledir']}" -on master, puppet("module install pmtacceptance-java --version 1.6.0 --target-dir #{master['distmoduledir']}") -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_equal <<-OUTPUT, stdout -#{master['distmoduledir']} -├── pmtacceptance-java (\e[0;36mv1.6.0\e[0m) -└── pmtacceptance-stdlub (\e[0;36mv1.0.0\e[0m) - OUTPUT -end - -step "Upgrade a module that has a more recent version published" -on master, puppet("module upgrade pmtacceptance-java") do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to upgrade 'pmtacceptance-java' ...\e[0m -\e[mNotice: Found 'pmtacceptance-java' (\e[0;36mv1.6.0\e[m) in #{master['distmoduledir']} ...\e[0m -\e[mNotice: Downloading from https://forgeapi.puppetlabs.com ...\e[0m -\e[mNotice: Upgrading -- do not interrupt ...\e[0m -#{master['distmoduledir']} -└── pmtacceptance-java (\e[0;36mv1.6.0 -> v1.7.1\e[0m) - OUTPUT -end diff --git a/acceptance/tests/modules/upgrade/introducing_new_dependencies.rb b/acceptance/tests/modules/upgrade/introducing_new_dependencies.rb deleted file mode 100644 index 47c3cfdc9..000000000 --- a/acceptance/tests/modules/upgrade/introducing_new_dependencies.rb +++ /dev/null @@ -1,37 +0,0 @@ -test_name "puppet module upgrade (introducing new dependencies)" - -step 'Setup' - -stub_forge_on(master) - -teardown do - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/postql" - on master, "rm -rf #{master['distmoduledir']}/stdlub" - on master, "rm -rf #{master['distmoduledir']}/geordi" -end - -on master, puppet("module install pmtacceptance-stdlub --version 1.0.0") -on master, puppet("module install pmtacceptance-java --version 1.7.0") -on master, puppet("module install pmtacceptance-postql --version 0.0.2") -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_equal <<-OUTPUT, stdout -#{master['distmoduledir']} -├── pmtacceptance-java (\e[0;36mv1.7.0\e[0m) -├── pmtacceptance-postql (\e[0;36mv0.0.2\e[0m) -└── pmtacceptance-stdlub (\e[0;36mv1.0.0\e[0m) - OUTPUT -end - -step "Upgrade a module to a version that introduces new dependencies" -on master, puppet("module upgrade pmtacceptance-postql") do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to upgrade 'pmtacceptance-postql' ...\e[0m -\e[mNotice: Found 'pmtacceptance-postql' (\e[0;36mv0.0.2\e[m) in #{master['distmoduledir']} ...\e[0m -\e[mNotice: Downloading from https://forgeapi.puppetlabs.com ...\e[0m -\e[mNotice: Upgrading -- do not interrupt ...\e[0m -#{master['distmoduledir']} -└─┬ pmtacceptance-postql (\e[0;36mv0.0.2 -> v1.0.0\e[0m) - └── pmtacceptance-geordi (\e[0;36mv0.0.1\e[0m) - OUTPUT -end diff --git a/acceptance/tests/modules/upgrade/not_upgradable.rb b/acceptance/tests/modules/upgrade/not_upgradable.rb deleted file mode 100644 index 679b05f6c..000000000 --- a/acceptance/tests/modules/upgrade/not_upgradable.rb +++ /dev/null @@ -1,84 +0,0 @@ -test_name "puppet module upgrade (not upgradable)" - -step 'Setup' - -stub_forge_on(master) - -teardown do - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/unicorns" - on master, "rm -rf #{master['distmoduledir']}/stdlub" - on master, "rm -rf #{master['distmoduledir']}/nginx" -end - -on master, "mkdir -p #{master['distmoduledir']}" -apply_manifest_on master, <<-PP - file { - [ - '#{master['distmoduledir']}/nginx', - '#{master['distmoduledir']}/unicorns', - ]: ensure => directory; - '#{master['distmoduledir']}/unicorns/metadata.json': - content => '{ - "name": "notpmtacceptance/unicorns", - "version": "0.0.3", - "source": "", - "author": "notpmtacceptance", - "license": "MIT", - "dependencies": [] - }'; - } -PP - -on master, puppet("module install pmtacceptance-java --version 1.6.0") -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_equal <<-OUTPUT, stdout -#{master['distmoduledir']} -├── nginx (\e[0;36m???\e[0m) -├── notpmtacceptance-unicorns (\e[0;36mv0.0.3\e[0m) -├── pmtacceptance-java (\e[0;36mv1.6.0\e[0m) -└── pmtacceptance-stdlub (\e[0;36mv1.0.0\e[0m) - OUTPUT -end - -step "Try to upgrade a module that is not installed" -on master, puppet("module upgrade pmtacceptance-nginx"), :acceptable_exit_codes => [1] do - pattern = Regexp.new([ - %Q{.*Notice: Preparing to upgrade 'pmtacceptance-nginx' .*}, - %Q{.*Error: Could not upgrade module 'pmtacceptance-nginx'}, - %Q{ Module 'pmtacceptance-nginx' is not installed}, - %Q{ Use `puppet module install` to install this module.*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.output) -end - -# TODO: Determine the appropriate response for this test. -# step "Try to upgrade a local module" -# on master, puppet("module upgrade nginx"), :acceptable_exit_codes => [1] do -# pattern = Regexp.new([ -# %Q{.*Notice: Preparing to upgrade 'nginx' .*}, -# %Q{.*Notice: Found 'nginx' \\(.*\\?\\?\\?.*\\) in #{master['distmoduledir']} .*}, -# %Q{.*Notice: Downloading from https://forgeapi.puppetlabs.com .*}, -# %Q{.*Error: Could not upgrade module 'nginx' \\(\\?\\?\\? -> latest\\)}, -# %Q{ Module 'nginx' does not exist on https://forgeapi.puppetlabs.com.*}, -# ].join("\n"), Regexp::MULTILINE) -# assert_match(pattern, result.output) -# end - -step "Try to upgrade a module that doesn't exist in module_repository" -on master, puppet("module upgrade notpmtacceptance-unicorns"), :acceptable_exit_codes => [1] do - assert_match(/could not upgrade 'notpmtacceptance-unicorns'/i, stderr, - 'Could not upgrade error not shown') - - assert_match(/no releases are available from/i, stderr, - 'Upgrade failure reason not shown') -end - -step "Try to upgrade an installed module to a version that doesn't exist in module_repository" -on master, puppet("module upgrade pmtacceptance-java --version 2.0.0"), :acceptable_exit_codes => [1] do - assert_match(/could not upgrade 'pmtacceptance-java'/i, stderr, - 'Could not upgrade error not shown') - - assert_match(/no releases matching '2.0.0' are available from/i, stderr, - 'Upgrade failure reason not shown') -end diff --git a/acceptance/tests/modules/upgrade/that_was_installed_twice.rb b/acceptance/tests/modules/upgrade/that_was_installed_twice.rb deleted file mode 100644 index 3f503bce7..000000000 --- a/acceptance/tests/modules/upgrade/that_was_installed_twice.rb +++ /dev/null @@ -1,64 +0,0 @@ -test_name "puppet module upgrade (that was installed twice)" -skip_test "This test does not seem to properly respect the given modulepath" - -step 'Setup' - -stub_forge_on(master) -testdir = master.tmpdir('upgrademultimods') - -teardown do - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/stdlub" - on master, "rm -rf #{testdir}/modules/java" - on master, "rm -rf #{testdir}/modules/stdlub" -end - -master_opts = { - 'main' => { - 'modulepath' => "#{master['distmoduledir']}:#{testdir}/modules" - } -} - - - -with_puppet_running_on master, master_opts, testdir do - on master, puppet("module install pmtacceptance-java --version 1.6.0 --modulepath #{master['distmoduledir']}") - on master, puppet("module install pmtacceptance-java --version 1.7.0 --modulepath #{testdir}/modules") - on master, puppet("module list") do - pattern = Regexp.new([ - "#{master['distmoduledir']}", - "├── pmtacceptance-java \\(.*v1.6.0\e.*\\)", - "└── pmtacceptance-stdlub \\(.*v1.0.0.*\\)", - "#{testdir}/modules", - "├── pmtacceptance-java \\(.*v1.7.0.*\\)", - "└── pmtacceptance-stdlub \\(.*v1.0.0.*\\)", - ].join("\n")) - assert_match(pattern, result.output) - end - - step "Try to upgrade a module that exists multiple locations in the module path" - on master, puppet("module upgrade pmtacceptance-java"), :acceptable_exit_codes => [1] do - pattern = Regexp.new([ - ".*Notice: Preparing to upgrade 'pmtacceptance-java' .*", - ".*Error: Could not upgrade module 'pmtacceptance-java'", - " Module 'pmtacceptance-java' appears multiple places in the module path", - " 'pmtacceptance-java' \\(v1.6.0\\) was found in #{master['distmoduledir']}", - " 'pmtacceptance-java' \\(v1.7.0\\) was found in #{testdir}/modules", - " Use the `--modulepath` option to limit the search to specific directories", - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.output) - end - - step "Upgrade a module that exists multiple locations by restricting the --modulepath" - on master, puppet("module upgrade pmtacceptance-java --modulepath #{master['distmoduledir']}") do - pattern = Regexp.new([ - ".*Notice: Preparing to upgrade 'pmtacceptance-java' .*", - ".*Notice: Found 'pmtacceptance-java' \\(.*v1.6.0.*\\) in #{master['distmoduledir']} .*", - ".*Notice: Downloading from https://forgeapi.puppetlabs.com .*", - ".*Notice: Upgrading -- do not interrupt .*", - "#{master['distmoduledir']}", - "└── pmtacceptance-java \\(.*v1.6.0 -> v1.7.1.*\\)", - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.output) - end -end diff --git a/acceptance/tests/modules/upgrade/to_a_specific_version.rb b/acceptance/tests/modules/upgrade/to_a_specific_version.rb deleted file mode 100644 index 301e7dc98..000000000 --- a/acceptance/tests/modules/upgrade/to_a_specific_version.rb +++ /dev/null @@ -1,32 +0,0 @@ -test_name "puppet module upgrade (to a specific version)" - -step 'Setup' - -stub_forge_on(master) -on master, "mkdir -p #{master['distmoduledir']}" - -teardown do - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/stdlub" -end - -on master, puppet("module install pmtacceptance-java --version 1.6.0") -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_equal <<-OUTPUT, stdout -#{master['distmoduledir']} -├── pmtacceptance-java (\e[0;36mv1.6.0\e[0m) -└── pmtacceptance-stdlub (\e[0;36mv1.0.0\e[0m) - OUTPUT -end - -step "Upgrade a module to a specific (greater) version" -on master, puppet("module upgrade pmtacceptance-java --version 1.7.0") do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to upgrade 'pmtacceptance-java' ...\e[0m -\e[mNotice: Found 'pmtacceptance-java' (\e[0;36mv1.6.0\e[m) in #{master['distmoduledir']} ...\e[0m -\e[mNotice: Downloading from https://forgeapi.puppetlabs.com ...\e[0m -\e[mNotice: Upgrading -- do not interrupt ...\e[0m -#{master['distmoduledir']} -└── pmtacceptance-java (\e[0;36mv1.6.0 -> v1.7.0\e[0m) - OUTPUT -end diff --git a/acceptance/tests/modules/upgrade/to_installed_version.rb b/acceptance/tests/modules/upgrade/to_installed_version.rb deleted file mode 100644 index d64e2b1e6..000000000 --- a/acceptance/tests/modules/upgrade/to_installed_version.rb +++ /dev/null @@ -1,62 +0,0 @@ -test_name "puppet module upgrade (to installed version)" - -step 'Setup' -on master, "mkdir -p #{master['distmoduledir']}" - -stub_forge_on(master) - -teardown do - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/stdlub" -end - -on master, puppet("module install pmtacceptance-java --version 1.6.0") -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_equal <<-OUTPUT, stdout -#{master['distmoduledir']} -├── pmtacceptance-java (\e[0;36mv1.6.0\e[0m) -└── pmtacceptance-stdlub (\e[0;36mv1.0.0\e[0m) - OUTPUT -end - -step "Try to upgrade a module to the current version" -on master, puppet("module upgrade pmtacceptance-java --version 1.6.x"), :acceptable_exit_codes => [0] do - assert_match(/The installed version is already the latest version matching/, stdout, - "Error that specified version was already satisfied was not displayed") -end - -step "Upgrade a module to the current version with --force" -on master, puppet("module upgrade pmtacceptance-java --version 1.6.x --force") do - assert_match(/#{master['distmoduledir']}/, stdout, - 'Error that distmoduledir was not displayed') - - assert_match(/\'pmtacceptance-java\' \(.*v1\.6\.0.*\)/, stdout, - 'Error that package name and version were not displayed') -end - -step "Upgrade to the latest version" -on master, puppet("module upgrade pmtacceptance-java") do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to upgrade 'pmtacceptance-java' ...\e[0m -\e[mNotice: Found 'pmtacceptance-java' (\e[0;36mv1.6.0\e[m) in #{master['distmoduledir']} ...\e[0m -\e[mNotice: Downloading from https://forgeapi.puppetlabs.com ...\e[0m -\e[mNotice: Upgrading -- do not interrupt ...\e[0m -#{master['distmoduledir']} -└── pmtacceptance-java (\e[0;36mv1.6.0 -> v1.7.1\e[0m) - OUTPUT -end - -step "Try to upgrade a module to the latest version with the latest version installed" -on master, puppet("module upgrade pmtacceptance-java"), :acceptable_exit_codes => [0] do - assert_match(/The installed version is already the latest version matching.*latest/, stdout, - "Error that latest version was already installed was not displayed") -end - -step "Upgrade a module to the latest version with --force" -on master, puppet("module upgrade pmtacceptance-java --force") do - assert_match(/#{master['distmoduledir']}/, stdout, - 'Error that distmoduledir was not displayed') - - assert_match(/pmtacceptance-java \(.*v1\.7\.1.*\)/, stdout, - 'Error that package name and version were not displayed') -end diff --git a/acceptance/tests/modules/upgrade/with_constraints_on_it.rb b/acceptance/tests/modules/upgrade/with_constraints_on_it.rb deleted file mode 100644 index 4216b8322..000000000 --- a/acceptance/tests/modules/upgrade/with_constraints_on_it.rb +++ /dev/null @@ -1,34 +0,0 @@ -test_name "puppet module upgrade (with constraints on it)" - -step 'Setup' - -stub_forge_on(master) - -teardown do - on master, "rm -rf #{master['distmoduledir']}/apollo" - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/stdlub" -end - -on master, puppet("module install pmtacceptance-java --version 1.7.0") -on master, puppet("module install pmtacceptance-apollo") -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_equal <<-OUTPUT, stdout -#{master['distmoduledir']} -├── pmtacceptance-apollo (\e[0;36mv0.0.1\e[0m) -├── pmtacceptance-java (\e[0;36mv1.7.0\e[0m) -└── pmtacceptance-stdlub (\e[0;36mv1.0.0\e[0m) - OUTPUT -end - -step "Upgrade a version-constrained module that has an upgrade" -on master, puppet("module upgrade pmtacceptance-java") do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to upgrade 'pmtacceptance-java' ...\e[0m -\e[mNotice: Found 'pmtacceptance-java' (\e[0;36mv1.7.0\e[m) in #{master['distmoduledir']} ...\e[0m -\e[mNotice: Downloading from https://forgeapi.puppetlabs.com ...\e[0m -\e[mNotice: Upgrading -- do not interrupt ...\e[0m -#{master['distmoduledir']} -└── pmtacceptance-java (\e[0;36mv1.7.0 -> v1.7.1\e[0m) - OUTPUT -end diff --git a/acceptance/tests/modules/upgrade/with_constraints_on_its_dependencies.rb b/acceptance/tests/modules/upgrade/with_constraints_on_its_dependencies.rb deleted file mode 100644 index 07a517301..000000000 --- a/acceptance/tests/modules/upgrade/with_constraints_on_its_dependencies.rb +++ /dev/null @@ -1,80 +0,0 @@ -test_name "puppet module upgrade (with constraints on its dependencies)" - -step 'Setup' - -stub_forge_on(master) - -teardown do - on master, "rm -rf #{master['distmoduledir']}/unicorns" - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/stdlub" -end - -apply_manifest_on master, <<-PP - file { - [ - '#{master['distmoduledir']}/unicorns', - ]: ensure => directory; - '#{master['distmoduledir']}/unicorns/metadata.json': - content => '{ - "name": "notpmtacceptance/unicorns", - "version": "0.0.3", - "source": "", - "author": "notpmtacceptance", - "license": "MIT", - "dependencies": [ - { "name": "pmtacceptance/stdlub", "version_requirement": "0.0.2" } - ] - }'; - } -PP -on master, puppet("module install pmtacceptance-stdlub --version 0.0.2") -on master, puppet("module install pmtacceptance-java --version 1.6.0") -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_equal <<-OUTPUT, stdout -#{master['distmoduledir']} -├── notpmtacceptance-unicorns (\e[0;36mv0.0.3\e[0m) -├── pmtacceptance-java (\e[0;36mv1.6.0\e[0m) -└── pmtacceptance-stdlub (\e[0;36mv0.0.2\e[0m) - OUTPUT -end - -step "Try to upgrade a module with constraints on its dependencies that cannot be met" -on master, puppet("module upgrade pmtacceptance-java --version 1.7.1"), :acceptable_exit_codes => [1] do - assert_match(/No version.* can satisfy all dependencies/, stderr, - "Unsatisfiable dependency was not displayed") -end - -step "Relax constraints" -on master, puppet("module uninstall notpmtacceptance-unicorns") -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_equal <<-OUTPUT, stdout -#{master['distmoduledir']} -├── pmtacceptance-java (\e[0;36mv1.6.0\e[0m) -└── pmtacceptance-stdlub (\e[0;36mv0.0.2\e[0m) - OUTPUT -end - -step "Upgrade a single module, ignoring its dependencies" -on master, puppet("module upgrade pmtacceptance-java --version 1.7.0 --ignore-dependencies") do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to upgrade 'pmtacceptance-java' ...\e[0m -\e[mNotice: Found 'pmtacceptance-java' (\e[0;36mv1.6.0\e[m) in #{master['distmoduledir']} ...\e[0m -\e[mNotice: Downloading from https://forgeapi.puppetlabs.com ...\e[0m -\e[mNotice: Upgrading -- do not interrupt ...\e[0m -#{master['distmoduledir']} -└── pmtacceptance-java (\e[0;36mv1.6.0 -> v1.7.0\e[0m) - OUTPUT -end - -step "Attempt to upgrade a module where dependency requires upgrade across major version" -on master, puppet("module upgrade pmtacceptance-java"), :acceptable_exit_codes => [1] do - assert_match(/There are 1 newer versions/, stderr, - 'Number of newer releases was not displayed') - - assert_match(/Dependencies will not be automatically upgraded across major versions/, stderr, - 'Dependency upgrade restriction message was not displayed') - - assert_match(/pmtacceptance-stdlub/, stderr, - 'Potential culprit depdendency was not displayed') -end diff --git a/acceptance/tests/modules/upgrade/with_environment.rb b/acceptance/tests/modules/upgrade/with_environment.rb deleted file mode 100644 index 2e2a39cb1..000000000 --- a/acceptance/tests/modules/upgrade/with_environment.rb +++ /dev/null @@ -1,49 +0,0 @@ -test_name "puppet module upgrade (with environment)" -require 'puppet/acceptance/module_utils' -extend Puppet::Acceptance::ModuleUtils - -module_author = "pmtacceptance" -module_name = "java" -module_dependencies = ["stdlub"] - -orig_installed_modules = get_installed_modules_for_hosts hosts -teardown do - rm_installed_modules_from_hosts orig_installed_modules, (get_installed_modules_for_hosts hosts) -end - -step 'Setup' - -stub_forge_on(master) - -puppet_conf = generate_base_legacy_and_directory_environments(master['puppetpath']) - -install_test_module_in = lambda do |environment| - on master, puppet("module install #{module_author}-#{module_name} --config=#{puppet_conf} --version 1.6.0 --environment=#{environment}") do - assert_module_installed_ui(stdout, module_author, module_name) - end -end - -check_module_upgrade_in = lambda do |environment, environment_path| - on master, puppet("module upgrade #{module_author}-#{module_name} --config=#{puppet_conf} --environment=#{environment}") do - assert_module_installed_ui(stdout, module_author, module_name) - on master, "[ -f #{environment_path}/#{module_name}/Modulefile ]" - on master, "grep 1.7.1 #{environment_path}/#{module_name}/Modulefile" - end -end - -step "Upgrade a module that has a more recent version published in a legacy environment" do - install_test_module_in.call('legacyenv') - check_module_upgrade_in.call('legacyenv', "#{master['puppetpath']}/legacyenv/modules") -end - -step 'Enable directory environments' do - on master, puppet("config", "set", - "environmentpath", "#{master['puppetpath']}/environments", - "--section", "main", - "--config", puppet_conf) -end - -step "Upgrade a module that has a more recent version published in a directory environment" do - install_test_module_in.call('direnv') - check_module_upgrade_in.call('direnv', "#{master['puppetpath']}/environments/direnv/modules") -end diff --git a/acceptance/tests/modules/upgrade/with_local_changes.rb b/acceptance/tests/modules/upgrade/with_local_changes.rb deleted file mode 100644 index 4163665a0..000000000 --- a/acceptance/tests/modules/upgrade/with_local_changes.rb +++ /dev/null @@ -1,54 +0,0 @@ -test_name "puppet module upgrade (with local changes)" - -step 'Setup' - -stub_forge_on(master) -on master, "mkdir -p #{master['distmoduledir']}" - -teardown do - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/stdlub" -end - -on master, puppet("module install pmtacceptance-java --version 1.6.0") -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_equal <<-OUTPUT, stdout -#{master['distmoduledir']} -├── pmtacceptance-java (\e[0;36mv1.6.0\e[0m) -└── pmtacceptance-stdlub (\e[0;36mv1.0.0\e[0m) - OUTPUT -end -apply_manifest_on master, <<-PP - file { - '#{master['distmoduledir']}/java/README': content => "I CHANGE MY READMES"; - '#{master['distmoduledir']}/java/NEWFILE': content => "I don't exist.'"; - } -PP - -step "Try to upgrade a module with local changes" -on master, puppet("module upgrade pmtacceptance-java"), :acceptable_exit_codes => [1] do - pattern = Regexp.new([ - %Q{.*Notice: Preparing to upgrade 'pmtacceptance-java' ....*}, - %Q{.*Notice: Found 'pmtacceptance-java' \\(.*v1.6.0.*\\) in #{master['distmoduledir']} ....*}, - %Q{.*Error: Could not upgrade module 'pmtacceptance-java' \\(v1.6.0 -> latest\\)}, - %Q{ Installed module has had changes made locally}, - %Q{ Use `puppet module upgrade --ignore-changes` to upgrade this module anyway.*}, - ].join("\n"), Regexp::MULTILINE) - assert_match(pattern, result.output) -end -on master, %{[[ "$(cat #{master['distmoduledir']}/java/README)" == "I CHANGE MY READMES" ]]} -on master, "[ -f #{master['distmoduledir']}/java/NEWFILE ]" - -step "Upgrade a module with local changes with --force" -on master, puppet("module upgrade pmtacceptance-java --force") do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to upgrade 'pmtacceptance-java' ...\e[0m -\e[mNotice: Found 'pmtacceptance-java' (\e[0;36mv1.6.0\e[m) in #{master['distmoduledir']} ...\e[0m -\e[mNotice: Downloading from https://forgeapi.puppetlabs.com ...\e[0m -\e[mNotice: Upgrading -- do not interrupt ...\e[0m -#{master['distmoduledir']} -└── pmtacceptance-java (\e[0;36mv1.6.0 -> v1.7.1\e[0m) - OUTPUT -end -on master, %{[[ "$(cat #{master['distmoduledir']}/java/README)" != "I CHANGE MY READMES" ]]} -on master, "[ ! -f #{master['distmoduledir']}/java/NEWFILE ]" diff --git a/acceptance/tests/modules/upgrade/with_scattered_dependencies.rb b/acceptance/tests/modules/upgrade/with_scattered_dependencies.rb deleted file mode 100644 index 363721c60..000000000 --- a/acceptance/tests/modules/upgrade/with_scattered_dependencies.rb +++ /dev/null @@ -1,32 +0,0 @@ -test_name "puppet module upgrade (with scattered dependencies)" - -step 'Setup' - -stub_forge_on(master) -testdir = master.tmpdir('scattereddeps') -on master, "mkdir -p #{master['distmoduledir']}" -on master, "mkdir -p #{master['sitemoduledir']}" -on master, "mkdir -p #{testdir}/modules" - -teardown do - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/postql" -end - -master_opts = { - 'main' => { - 'modulepath' => "#{testdir}/modules:#{master['distmoduledir']}:#{master['sitemoduledir']}" - } -} - -with_puppet_running_on master, master_opts, testdir do - on master, puppet("module install pmtacceptance-stdlub --version 0.0.2 --target-dir #{testdir}/modules") - on master, puppet("module install pmtacceptance-java --version 1.6.0 --target-dir #{master['distmoduledir']} --ignore-dependencies") - on master, puppet("module install pmtacceptance-postql --version 0.0.1 --target-dir #{master['distmoduledir']} --ignore-dependencies") - on master, puppet("module list") do - assert_match /pmtacceptance-java.*1\.6\.0/, stdout, 'Could not find pmtacceptance/java' - assert_match /pmtacceptance-postql.*0\.0\.1/, stdout, 'Could not find pmtacceptance/postql' - assert_match /pmtacceptance-stdlub.*0\.0\.2/, stdout, 'Could not find pmtacceptance/stdlub' - end - -end diff --git a/acceptance/tests/modules/upgrade/with_update_available.rb b/acceptance/tests/modules/upgrade/with_update_available.rb deleted file mode 100644 index fd99f267e..000000000 --- a/acceptance/tests/modules/upgrade/with_update_available.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "puppet module upgrade (with update available)" - -step 'Setup' - -stub_forge_on(master) -on master, "mkdir -p #{master['distmoduledir']}" - -teardown do - on master, "rm -rf #{master['distmoduledir']}/java" - on master, "rm -rf #{master['distmoduledir']}/stdlub" -end - -on master, puppet("module install pmtacceptance-java --version 1.6.0") -on master, puppet("module list --modulepath #{master['distmoduledir']}") do - assert_equal <<-OUTPUT, stdout -#{master['distmoduledir']} -├── pmtacceptance-java (\e[0;36mv1.6.0\e[0m) -└── pmtacceptance-stdlub (\e[0;36mv1.0.0\e[0m) - OUTPUT -end - -step "Upgrade a module that has a more recent version published" -on master, puppet("module upgrade pmtacceptance-java") do - assert_equal <<-OUTPUT, stdout -\e[mNotice: Preparing to upgrade 'pmtacceptance-java' ...\e[0m -\e[mNotice: Found 'pmtacceptance-java' (\e[0;36mv1.6.0\e[m) in #{master['distmoduledir']} ...\e[0m -\e[mNotice: Downloading from https://forgeapi.puppetlabs.com ...\e[0m -\e[mNotice: Upgrading -- do not interrupt ...\e[0m -#{master['distmoduledir']} -└── pmtacceptance-java (\e[0;36mv1.6.0 -> v1.7.1\e[0m) - OUTPUT - on master, "[ -d #{master['distmoduledir']}/java ]" - on master, "[ -f #{master['distmoduledir']}/java/Modulefile ]" - on master, "grep 1.7.1 #{master['distmoduledir']}/java/Modulefile" -end diff --git a/acceptance/tests/node/check_woy_cache_works.rb b/acceptance/tests/node/check_woy_cache_works.rb deleted file mode 100644 index 57d7b89ac..000000000 --- a/acceptance/tests/node/check_woy_cache_works.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'securerandom' -require 'puppet/acceptance/temp_file_utils' -require 'yaml' -extend Puppet::Acceptance::TempFileUtils - -test_name "ticket #16753 node data should be cached in yaml to allow it to be queried" - -node_name = "woy_node_#{SecureRandom.hex}" -auth_contents = <<AUTHCONF -path /catalog/#{node_name} -auth yes -allow * - -path /node/#{node_name} -auth yes -allow * - -path /report/#{node_name} -auth yes -allow * -AUTHCONF - -initialize_temp_dirs - -create_test_file master, "auth.conf", auth_contents, {} - -authfile = get_test_file_path master, "auth.conf" -on master, "chmod 644 #{authfile}" - -master_opts = { - 'master' => { - 'rest_authconfig' => authfile - } -} - -with_puppet_running_on master, master_opts do - - # only one agent is needed because we only care about the file written on the master - run_agent_on(agents[0], "--no-daemonize --verbose --onetime --node_name_value #{node_name} --server #{master}") - - - yamldir = on(master, puppet('master', '--configprint', 'yamldir')).stdout.chomp - on master, puppet('node', 'search', '"*"', '--node_terminus', 'yaml', '--clientyamldir', yamldir, '--render-as', 'json') do - assert_match(/"name":["\s]*#{node_name}/, stdout, - "Expect node name '#{node_name}' to be present in node yaml content written by the WriteOnlyYaml terminus") - end -end diff --git a/acceptance/tests/ordering/master_agent_application.rb b/acceptance/tests/ordering/master_agent_application.rb deleted file mode 100644 index 7279a318b..000000000 --- a/acceptance/tests/ordering/master_agent_application.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "Puppet applies resources without dependencies in file order over the network" - -testdir = master.tmpdir('application_order') - -create_remote_file(master, "#{testdir}/site.pp", <<-PP) -notify { "first": } -notify { "second": } -notify { "third": } -notify { "fourth": } -notify { "fifth": } -notify { "sixth": } -notify { "seventh": } -notify { "eighth": } -PP - -user = master.execute('puppet config print user') -group = master.execute('puppet config print group') - -on master, "chown -R #{user}:#{group} #{testdir}" -on master, "chmod -R g+rwX #{testdir}" - -master_opts = { - :master => { - :manifest => "#{testdir}/site.pp", - } -} - -with_puppet_running_on(master, master_opts) do - agents.each do |agent| - on(agent, puppet('agent', "--no-daemonize --onetime --verbose --server #{master} --ordering manifest")) - if stdout !~ /Notice: first.*Notice: second.*Notice: third.*Notice: fourth.*Notice: fifth.*Notice: sixth.*Notice: seventh.*Notice: eighth/m - fail_test "Output did not include the notify resources in the correct order" - end - end -end diff --git a/acceptance/tests/parser_functions/hiera/lookup_data.rb b/acceptance/tests/parser_functions/hiera/lookup_data.rb deleted file mode 100644 index 9574fd1d8..000000000 --- a/acceptance/tests/parser_functions/hiera/lookup_data.rb +++ /dev/null @@ -1,84 +0,0 @@ -begin test_name "Lookup data using the hiera parser function" - -testdir = master.tmpdir('hiera') - -step 'Setup' -on master, "mkdir -p #{testdir}/hieradata" -on master, "if [ -f #{master['puppetpath']}/hiera.yaml ]; then cp #{master['puppetpath']}/hiera.yaml #{master['puppetpath']}/hiera.yaml.bak; fi" - -apply_manifest_on master, <<-PP -file { '#{master['puppetpath']}/hiera.yaml': - ensure => present, - content => '--- - :backends: - - "yaml" - :logger: "console" - :hierarchy: - - "%{fqdn}" - - "%{environment}" - - "global" - - :yaml: - :datadir: "#{testdir}/hieradata" - ' -} -PP - -apply_manifest_on master, <<-PP -file { '#{testdir}/hieradata/global.yaml': - ensure => present, - content => "--- - port: 8080 - " -} -PP - -on master, "mkdir -p #{testdir}/modules/apache/manifests" - -agent_names = agents.map { |agent| "'#{agent.to_s}'" }.join(', ') -create_remote_file(master, "#{testdir}/site.pp", <<-PP) -node default { - include apache -} -PP - -create_remote_file(master, "#{testdir}/modules/apache/manifests/init.pp", <<-PP) -class apache { - $port = hiera('port') - - notify { "port from hiera": - message => "apache server port: ${port}" - } -} -PP - -on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" -on master, "chmod -R g+rwX #{testdir}" - - -step "Try to lookup string data" - -master_opts = { - 'main' => { - 'manifest' => "#{testdir}/site.pp", - 'modulepath' => "#{testdir}/modules", - }, - 'master' => { - 'node_terminus' => 'plain', - } -} - -with_puppet_running_on master, master_opts, testdir do - agents.each do |agent| - on(agent, puppet('agent', "--no-daemonize --onetime --verbose --server #{master}")) - - assert_match("apache server port: 8080", stdout) - end -end - - -ensure step "Teardown" - -on master, "if [ -f #{master['puppetpath']}/hiera.conf.bak ]; then mv -f #{master['puppetpath']}/hiera.conf.bak #{master['puppetpath']}/hiera.yaml; fi" - -end diff --git a/acceptance/tests/parser_functions/hiera_array/lookup_data.rb b/acceptance/tests/parser_functions/hiera_array/lookup_data.rb deleted file mode 100644 index b17bddfba..000000000 --- a/acceptance/tests/parser_functions/hiera_array/lookup_data.rb +++ /dev/null @@ -1,106 +0,0 @@ -begin test_name "Lookup data using the hiera parser function" - -testdir = master.tmpdir('hiera') - -step 'Setup' -on master, "mkdir -p #{testdir}/hieradata" -on master, "if [ -f #{master['puppetpath']}/hiera.yaml ]; then cp #{master['puppetpath']}/hiera.yaml #{master['puppetpath']}/hiera.yaml.bak; fi" - -apply_manifest_on master, <<-PP -file { '#{testdir}/hiera.yaml': - ensure => present, - content => '--- - :backends: - - "yaml" - :logger: "console" - :hierarchy: - - "%{fqdn}" - - "%{environment}" - - "global" - - :yaml: - :datadir: "#{testdir}/hieradata" - ' -} - -file { '#{testdir}/hieradata': - ensure => directory, - recurse => true, - purge => true, - force => true, -} -PP - -apply_manifest_on master, <<-PP -file { '#{testdir}/hieradata/global.yaml': - ensure => present, - content => "--- - port: '8080' - ntpservers: ['global.ntp.puppetlabs.com'] - " -} - -file { '#{testdir}/hieradata/production.yaml': - ensure => present, - content => "--- - ntpservers: ['production.ntp.puppetlabs.com'] - " -} - -PP - -on master, "mkdir -p #{testdir}/modules/ntp/manifests" - -agent_names = agents.map { |agent| "'#{agent.to_s}'" }.join(', ') -create_remote_file(master, "#{testdir}/site.pp", <<-PP) -node default { - include ntp -} -PP - -create_remote_file(master, "#{testdir}/modules/ntp/manifests/init.pp", <<-PP) -class ntp { - $ntpservers = hiera_array('ntpservers') - - define print { - $server = $name - notify { "ntpserver ${server}": } - } - - print { $ntpservers: } -} -PP - -on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" -on master, "chmod -R g+rwX #{testdir}" -on master, "cat #{testdir}/hiera.yaml > #{master['puppetpath']}/hiera.yaml" - - -step "Try to lookup array data" - -master_opts = { - 'master' => { - 'manifest' => "#{testdir}/site.pp", - 'modulepath' => "#{testdir}/modules", - 'node_terminus' => 'plain' - } -} - -with_puppet_running_on master, master_opts, testdir do - agents.each do |agent| - on(agent, puppet('agent', "--no-daemonize --onetime --verbose --server #{master}")) - - assert_match("ntpserver global.ntp.puppetlabs.com", stdout) - assert_match("ntpserver production.ntp.puppetlabs.com", stdout) - end -end - - -ensure step "Teardown" - -on master, "if [ -f #{master['puppetpath']}/hiera.conf.bak ]; then " + - "cat #{master['puppetpath']}/hiera.conf.bak > #{master['puppetpath']}/hiera.yaml; " + - "rm -rf #{master['puppetpath']}/hiera.conf.bak; " + - "fi" - -end diff --git a/acceptance/tests/parser_functions/hiera_hash/lookup_data.rb b/acceptance/tests/parser_functions/hiera_hash/lookup_data.rb deleted file mode 100644 index 2738d78e2..000000000 --- a/acceptance/tests/parser_functions/hiera_hash/lookup_data.rb +++ /dev/null @@ -1,105 +0,0 @@ -begin test_name "Lookup data using the hiera parser function" - -testdir = master.tmpdir('hiera') - -step 'Setup' -on master, "mkdir -p #{testdir}/hieradata" -on master, "if [ -f #{master['puppetpath']}/hiera.yaml ]; then cp #{master['puppetpath']}/hiera.yaml #{master['puppetpath']}/hiera.yaml.bak; fi" - -apply_manifest_on master, <<-PP -file { '#{testdir}/hiera.yaml': - ensure => present, - content => '--- - :backends: - - "yaml" - :logger: "console" - :hierarchy: - - "%{fqdn}" - - "%{environment}" - - "global" - - :yaml: - :datadir: "#{testdir}/hieradata" - ' -} - -file { '#{testdir}/hieradata': - ensure => directory, - recurse => true, - purge => true, - force => true, -} -PP - -apply_manifest_on master, <<-PP -file { '#{testdir}/hieradata/global.yaml': - ensure => present, - content => "--- - database_user: - name: postgres - uid: 500 - gid: 500 - " -} - -file { '#{testdir}/hieradata/production.yaml': - ensure => present, - content => "--- - database_user: - shell: '/bin/bash' - " -} - -PP - -on master, "mkdir -p #{testdir}/modules/ntp/manifests" - -agent_names = agents.map { |agent| "'#{agent.to_s}'" }.join(', ') -create_remote_file(master, "#{testdir}/site.pp", <<-PP) -node default { - include ntp -} -PP - -create_remote_file(master, "#{testdir}/modules/ntp/manifests/init.pp", <<-PP) -class ntp { - $database_user = hiera_hash('database_user') - - notify { "the database user": - message => "name: ${database_user['name']} shell: ${database_user['shell']}" - } -} -PP - -on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" -on master, "chmod -R g+rwX #{testdir}" -on master, "cat #{testdir}/hiera.yaml > #{master['puppetpath']}/hiera.yaml" - - -step "Try to lookup hash data" - -master_opts = { - 'master' => { - 'manifest' => "#{testdir}/site.pp", - 'modulepath' => "#{testdir}/modules", - 'node_terminus' => 'plain', - } -} - -with_puppet_running_on master, master_opts, testdir do - agents.each do |agent| - on(agent, puppet('agent', "--no-daemonize --onetime --verbose --server #{master}")) - - assert_match("name: postgres shell: /bin/bash", stdout) - end -end - - -ensure step "Teardown" - -on master, "if [ -f #{master['puppetpath']}/hiera.conf.bak ]; then " + - "cat #{master['puppetpath']}/hiera.conf.bak > #{master['puppetpath']}/hiera.yaml; " + - "rm -rf #{master['puppetpath']}/hiera.yaml.bak; " + - "fi" - -end diff --git a/acceptance/tests/pluginsync/7316_apps_should_be_available_via_pluginsync.rb b/acceptance/tests/pluginsync/7316_apps_should_be_available_via_pluginsync.rb deleted file mode 100644 index 6896142f4..000000000 --- a/acceptance/tests/pluginsync/7316_apps_should_be_available_via_pluginsync.rb +++ /dev/null @@ -1,148 +0,0 @@ -test_name "the pluginsync functionality should sync app definitions, and they should be runnable afterwards" - -# -# This test is intended to ensure that pluginsync syncs app definitions to the agents. -# Further, the apps should be runnable on the agent after the sync has occurred. -# - -require 'puppet/acceptance/temp_file_utils' - -extend Puppet::Acceptance::TempFileUtils - -initialize_temp_dirs() - -all_tests_passed = false - -############################################################################### -# BEGIN TEST LOGIC -############################################################################### - -# create some vars to point to the directories that we're going to point the master/agents at -master_module_dir = "master_modules" -agent_lib_dir = "agent_lib" - -app_name = "superbogus" -app_desc = "a simple %1$s for testing %1$s delivery via plugin sync" -app_output = "Hello from the #{app_name} %s" - -master_module_file_content = {} - -master_module_file_content["application"] = <<-HERE -require 'puppet/application' - -class Puppet::Application::#{app_name.capitalize} < Puppet::Application - - def help - <<-HELP - -puppet-#{app_name}(8) -- #{app_desc % "application"} -======== - HELP - end - - def main() - puts("#{app_output % "application"}") - end -end -HERE - - -# this begin block is here for handling temp file cleanup via an "ensure" block -# at the very end of the test. -begin - - modes = ["application"] - - modes.each do |mode| - - # here we create a custom app, which basically doesn't do anything except - # for print a hello-world message - agent_module_app_file = "#{agent_lib_dir}/puppet/#{mode}/#{app_name}.rb" - master_module_app_file = "#{master_module_dir}/#{app_name}/lib/puppet/#{mode}/#{app_name}.rb" - - - # copy all the files to the master - step "write our simple module out to the master" do - create_test_file(master, master_module_app_file, master_module_file_content[mode], :mkdirs => true) - end - - step "verify that the app file exists on the master" do - unless test_file_exists?(master, master_module_app_file) then - fail_test("Failed to create app file '#{get_test_file_path(master, master_module_app_file)}' on master") - end - end - - master_opts = { - 'master' => { - 'modulepath' => "#{get_test_file_path(master, master_module_dir)}", - 'node_terminus' => 'plain', - } - } - step "start the master" do - with_puppet_running_on master, master_opts do - - # the module files shouldn't exist on the agent yet because they haven't been synced - step "verify that the module files don't exist on the agent path" do - agents.each do |agent| - if test_file_exists?(agent, agent_module_app_file) then - fail_test("app file already exists on agent: '#{get_test_file_path(agent, agent_module_app_file)}'") - end - end - end - - step "run the agent" do - agents.each do |agent| - on(agent, puppet('agent', - "--libdir=\"#{get_test_file_path(agent, agent_lib_dir)}\" ", - "--test --trace --server #{master}") - ) - end - end - - end - end - - step "verify that the module files were synced down to the agent" do - agents.each do |agent| - unless test_file_exists?(agent, agent_module_app_file) then - fail_test("The app file we expect was not not synced to agent: '#{get_test_file_path(agent, agent_module_app_file)}'") - end - end - end - - step "verify that the application shows up in help" do - agents.each do |agent| - on(agent, PuppetCommand.new(:help, "--libdir=\"#{get_test_file_path(agent, agent_lib_dir)}\"")) do - assert_match(/^\s+#{app_name}\s+#{app_desc % mode}/, result.stdout) - end - end - end - - step "verify that we can run the application" do - agents.each do |agent| - on(agent, PuppetCommand.new(:"#{app_name}", "--libdir=\"#{get_test_file_path(agent, agent_lib_dir)}\"")) do - assert_match(/^#{app_output % mode}/, result.stdout) - end - end - end - - step "clear out the libdir on the agents in preparation for the next test" do - agents.each do |agent| - on(agent, "rm -rf #{get_test_file_path(agent, agent_lib_dir)}/*") - end - end - - end - - all_tests_passed = true - -ensure - ########################################################################################## - # Clean up all of the temp files created by this test. It would be nice if this logic - # could be handled outside of the test itself; I envision a stanza like this one appearing - # in a very large number of the tests going forward unless it is handled by the framework. - ########################################################################################## - if all_tests_passed then - remove_temp_dirs() - end -end diff --git a/acceptance/tests/pluginsync/7316_faces_with_app_stubs_should_be_available_via_pluginsync.rb b/acceptance/tests/pluginsync/7316_faces_with_app_stubs_should_be_available_via_pluginsync.rb deleted file mode 100644 index 1604d12fc..000000000 --- a/acceptance/tests/pluginsync/7316_faces_with_app_stubs_should_be_available_via_pluginsync.rb +++ /dev/null @@ -1,166 +0,0 @@ -test_name "the pluginsync functionality should sync app definitions, and they should be runnable afterwards" - -# -# This test is intended to ensure that pluginsync syncs face definitions to the agents. -# Further, the face should be runnable on the agent after the sync has occurred. -# -# (NOTE: When this test is passing, it should resolve both #7316 re: verifying that apps/faces can -# be run on the agent node after a plugin sync, and #6753 re: being able to run a face without -# having a placeholder stub file in the "applications" directory.) -# - -require 'puppet/acceptance/temp_file_utils' - -extend Puppet::Acceptance::TempFileUtils - -initialize_temp_dirs() -all_tests_passed = false - -############################################################################### -# BEGIN TEST LOGIC -############################################################################### - -# create some vars to point to the directories that we're going to point the master/agents at -master_module_dir = "master_modules" -agent_lib_dir = "agent_lib" - -app_name = "superbogus" -app_desc = "a simple %1$s for testing %1$s delivery via plugin sync" -app_output = "Hello from the #{app_name} %s" - -master_module_file_content = {} - - -master_module_face_content = <<-HERE -Puppet::Face.define(:#{app_name}, '0.0.1') do - copyright "Puppet Labs", 2011 - license "Apache 2 license; see COPYING" - - summary "#{app_desc % "face"}" - - action(:foo) do - summary "a test action defined in the test face in the main puppet lib dir" - - default - when_invoked do |*args| - puts "#{app_output % "face"}" - end - end - -end -HERE - -master_module_app_content = <<-HERE -require 'puppet/application/face_base' - -class Puppet::Application::#{app_name.capitalize} < Puppet::Application::FaceBase -end - -HERE - -# this begin block is here for handling temp file cleanup via an "ensure" block -# at the very end of the test. -begin - - # here we create a custom app, which basically doesn't do anything except for - # print a hello-world message - agent_module_face_file = "#{agent_lib_dir}/puppet/face/#{app_name}.rb" - master_module_face_file = "#{master_module_dir}/#{app_name}/lib/puppet/face/#{app_name}.rb" - - agent_module_app_file = "#{agent_lib_dir}/puppet/application/#{app_name}.rb" - master_module_app_file = "#{master_module_dir}/#{app_name}/lib/puppet/application/#{app_name}.rb" - - # copy all the files to the master - step "write our simple module out to the master" do - create_test_file(master, master_module_app_file, master_module_app_content, :mkdirs => true) - create_test_file(master, master_module_face_file, master_module_face_content, :mkdirs => true) - end - - step "verify that the app file exists on the master" do - unless test_file_exists?(master, master_module_app_file) then - fail_test("Failed to create app file '#{get_test_file_path(master, master_module_app_file)}' on master") - end - unless test_file_exists?(master, master_module_face_file) then - fail_test("Failed to create face file '#{get_test_file_path(master, master_module_face_file)}' on master") - end - end - - master_opts = { - 'master' => { - 'modulepath' => "#{get_test_file_path(master, master_module_dir)}", - 'node_terminus' => 'plain', - } - } - - step "start the master" do - with_puppet_running_on master, master_opts do - - # the module files shouldn't exist on the agent yet because they haven't been synced - step "verify that the module files don't exist on the agent path" do - agents.each do |agent| - if test_file_exists?(agent, agent_module_app_file) then - fail_test("app file already exists on agent: '#{get_test_file_path(agent, agent_module_app_file)}'") - end - if test_file_exists?(agent, agent_module_app_file) then - fail_test("face file already exists on agent: '#{get_test_file_path(agent, agent_module_face_file)}'") - end - end - end - - step "run the agent" do - agents.each do |agent| - on(agent, puppet('agent', - "--libdir=\"#{get_test_file_path(agent, agent_lib_dir)}\" ", - "--trace --test --server #{master}") - ) - end - end - - end - end - - step "verify that the module files were synced down to the agent" do - agents.each do |agent| - unless test_file_exists?(agent, agent_module_app_file) then - fail_test("The app file we expected was not synced to the agent: '#{get_test_file_path(agent, agent_module_app_file)}'") - end - unless test_file_exists?(agent, agent_module_face_file) then - fail_test("The face file we expected was not not synced to the agent: '#{get_test_file_path(agent, agent_module_face_file)}'") - end - end - end - - step "verify that the application shows up in help" do - agents.each do |agent| - on(agent, PuppetCommand.new(:help, "--libdir=\"#{get_test_file_path(agent, agent_lib_dir)}\"")) do - assert_match(/^\s+#{app_name}\s+#{app_desc % "face"}/, result.stdout) - end - end - end - - step "verify that we can run the application" do - agents.each do |agent| - on(agent, PuppetCommand.new(:"#{app_name}", "--libdir=\"#{get_test_file_path(agent, agent_lib_dir)}\"")) do - assert_match(/^#{app_output % "face"}/, result.stdout) - end - end - end - - step "clear out the libdir on the agents in preparation for the next test" do - agents.each do |agent| - on(agent, "rm -rf #{get_test_file_path(agent, agent_lib_dir)}/*") - end - end - - all_tests_passed = true - -ensure - ########################################################################################## - # Clean up all of the temp files created by this test. It would be nice if this logic - # could be handled outside of the test itself; I envision a stanza like this one appearing - # in a very large number of the tests going forward unless it is handled by the framework. - ########################################################################################## - if all_tests_passed then - remove_temp_dirs() - end -end diff --git a/acceptance/tests/pluginsync/feature/pluginsync_should_sync_features.rb b/acceptance/tests/pluginsync/feature/pluginsync_should_sync_features.rb deleted file mode 100644 index dbf9bd85f..000000000 --- a/acceptance/tests/pluginsync/feature/pluginsync_should_sync_features.rb +++ /dev/null @@ -1,195 +0,0 @@ -test_name "the pluginsync functionality should sync feature definitions" - -# -# This test is intended to ensure that pluginsync syncs feature definitions to -# the agents. It checks the feature twice; once to make sure that it gets -# loaded successfully during the run in which it was synced, and once to ensure -# that it still gets loaded successfully during the subsequent run (in which it -# should not be synced because the files haven't changed.) -# - - -require 'puppet/acceptance/temp_file_utils' - -extend Puppet::Acceptance::TempFileUtils - -initialize_temp_dirs() - -all_tests_passed = false - - -############################################################################### -# BEGIN TEST LOGIC -############################################################################### - -# create some vars to point to the directories that we're going to point the master/agents at -test_identifier = "pluginsync_should_sync_features" -master_module_dir = "master_modules" -agent_lib_dir = "agent_lib" - -module_name = "superbogus" - -# here we create a custom type, which basically doesn't do anything except for test the value of -# our custom feature and write the result to a file -agent_module_type_file = "#{agent_lib_dir}/puppet/type/#{module_name}.rb" -master_module_type_file = "#{master_module_dir}/#{module_name}/lib/puppet/type/#{module_name}.rb" -master_module_type_content = <<HERE -module Puppet - newtype(:#{module_name}) do - newparam(:name) do - isnamevar - end - - newproperty(:testfeature) do - def sync - Puppet.info("The value of the #{module_name} feature is: \#{Puppet.features.#{module_name}?}") - end - def retrieve - :absent - end - def insync?(is) - false - end - end - end -end -HERE - -# here is our custom feature... it always returns true -agent_module_feature_file = "#{agent_lib_dir}/puppet/feature/#{module_name}.rb" -master_module_feature_file = "#{master_module_dir}/#{module_name}/lib/puppet/feature/#{module_name}.rb" -master_module_feature_content = <<HERE -Puppet.features.add(:#{module_name}) do - Puppet.info("#{module_name} feature being queried") - true -end -HERE - - -# manifest file for the master, does nothing but instantiate our custom type -master_manifest_dir = "master_manifest" -master_manifest_file = "#{master_manifest_dir}/site.pp" -master_manifest_content = <<HERE -#{module_name} { "This is the title of the #{module_name} type instance in site.pp": - testfeature => "Hi. I'm setting the testfeature property of #{module_name} here in site.pp", -} -HERE - - -# for convenience we build up a list of all of the files we are expecting to deploy on the master -all_master_files = [ - [master_module_feature_file, 'feature'], - [master_module_type_file, 'type'], - [master_manifest_file, 'manifest'] -] - -# for convenience we build up a list of all of the files we are expecting to deploy on the agents -all_agent_files = [ - [agent_module_feature_file, 'feature'], - [agent_module_type_file, 'type'] -] - -# the command line args we'll pass to the agent each time we call it -agent_args = "--trace --libdir=\"%s\" --pluginsync --no-daemonize --verbose " + - "--onetime --test --server #{master}" -# legal exit codes whenever we run the agent -# we need to allow exit code 2, which means "changes were applied" on the agent -agent_exit_codes = [0, 2] - -# this begin block is here for handling temp file cleanup via an "ensure" block at the very end of the -# test. -begin - - # copy all the files to the master - step "write our simple module out to the master" do - create_test_file(master, master_module_type_file, master_module_type_content, :mkdirs => true) - create_test_file(master, master_module_feature_file, master_module_feature_content, :mkdirs => true) - create_test_file(master, master_manifest_file, master_manifest_content, :mkdirs => true) - end - - step "verify that the module and manifest files exist on the master" do - all_master_files.each do |file_path, desc| - unless test_file_exists?(master, file_path) then - fail_test("Failed to create #{desc} file '#{get_test_file_path(master, file_path)}' on master") - end - end - end - - step "start the master" do - - master_opts = { - 'master' => { - 'manifest' => "#{get_test_file_path(master, master_manifest_file)}", - 'modulepath' => "#{get_test_file_path(master, master_module_dir)}", - 'node_terminus' => 'plain', - } - } - - with_puppet_running_on master, master_opts do - - # the module files shouldn't exist on the agent yet because they haven't been synced - step "verify that the module files don't exist on the agent path" do - agents.each do |agent| - all_agent_files.each do |file_path, desc| - if test_file_exists?(agent, file_path) then - fail_test("#{desc} file already exists on agent: '#{get_test_file_path(agent, file_path)}'") - end - end - end - end - - - step "run the agent and verify that it loaded the feature" do - agents.each do |agent| - on(agent, puppet('agent', agent_args % get_test_file_path(agent, agent_lib_dir)), - :acceptable_exit_codes => agent_exit_codes) do - assert_match(/The value of the #{module_name} feature is: true/, result.stdout, - "Expected agent stdout to include confirmation that the feature was 'true'") - end - end - end - - step "verify that the module files were synced down to the agent" do - agents.each do |agent| - all_agent_files.each do |file_path, desc| - unless test_file_exists?(agent, file_path) then - fail_test("Expected #{desc} file not synced to agent: '#{get_test_file_path(agent, file_path)}'") - end - end - end - end - - step "run the agent again" do - agents.each do |agent| - on(agent, puppet('agent', agent_args % get_test_file_path(agent, agent_lib_dir)), - :acceptable_exit_codes => agent_exit_codes) do - assert_match(/The value of the #{module_name} feature is: true/, result.stdout, - "Expected agent stdout to include confirmation that the feature was 'true'") - end - end - end - - #TODO: was thinking about putting in a check for the timestamps on the files (maybe add a method for that to - # the framework?) to verify that they didn't get re-synced, but it seems like more trouble than it's worth - # at the moment. - #step "verify that the module files were not re-synced" do - # fail_test("NOT YET IMPLEMENTED: verify that the module files were not re-synced") - #end - - end - - all_tests_passed = true - - end -ensure - ########################################################################################## - # Clean up all of the temp files created by this test. It would be nice if this logic - # could be handled outside of the test itself; I envision a stanza like this one appearing - # in a very large number of the tests going forward unless it is handled by the framework. - ########################################################################################## - if all_tests_passed then - remove_temp_dirs() - end -end - - diff --git a/acceptance/tests/pluginsync/files_earlier_in_modulepath_take_precendence.rb b/acceptance/tests/pluginsync/files_earlier_in_modulepath_take_precendence.rb deleted file mode 100644 index 62cc95121..000000000 --- a/acceptance/tests/pluginsync/files_earlier_in_modulepath_take_precendence.rb +++ /dev/null @@ -1,49 +0,0 @@ -test_name "earlier modules take precendence over later modules in the modulepath" - -step "Create some modules in the modulepath" -basedir = master.tmpdir("module_precedence") -module1libdir = "#{basedir}/1" -module2libdir = "#{basedir}/2" - -apply_manifest_on(master, <<MANIFEST) -file { "#{basedir}": - owner => #{master['group']}, - recurse => true, - require => File[mod1, mod2] -} - -Exec { path => "/bin:/usr/bin" } - -exec { "mod1path": command => "mkdir -p #{module1libdir}/a/lib" } -exec { "mod2path": command => "mkdir -p #{module2libdir}/a/lib" } - -file { "mod1": - path => "#{module1libdir}/a/lib/foo.rb", - content => "'from the first module'", - owner => #{master['group']}, - require => Exec[mod1path] -} - -file { "mod2": - path => "#{module2libdir}/a/lib/foo.rb", - content => "'from the second module'", - owner => #{master['group']}, - require => Exec[mod2path] -} -MANIFEST - -master_opts = { - 'master' => { - 'modulepath' => "#{module1libdir}:#{module2libdir}", - 'node_terminus' => 'plain', - } -} - -with_puppet_running_on master, master_opts, basedir do - agents.each do |agent| - on(agent, puppet('agent', "-t --server #{master}")) - on agent, "cat \"#{agent.puppet['vardir']}/lib/foo.rb\"" do - assert_match(/from the first module/, stdout, "The synced plugin was not found or the wrong version was synced") - end - end -end diff --git a/acceptance/tests/puppet_apply_a_file_should_create_a_file_and_report_the_md5.rb b/acceptance/tests/puppet_apply_a_file_should_create_a_file_and_report_the_md5.rb deleted file mode 100644 index 0358d1195..000000000 --- a/acceptance/tests/puppet_apply_a_file_should_create_a_file_and_report_the_md5.rb +++ /dev/null @@ -1,17 +0,0 @@ -test_name "puppet apply should create a file and report an MD5" - -agents.each do |agent| - file = agent.tmpfile('hello-world') - manifest = "file{'#{file}': content => 'test'}" - - step "clean up #{file} for testing" - on(agent, "rm -f #{file}") - - step "Run the manifest and verify MD5 was printed" - apply_manifest_on(agent, manifest) do - assert_match(/defined content as '{md5}098f6bcd4621d373cade4e832627b4f6'/, stdout, "#{agent}: didn't find the content MD5 on output") - end - - step "clean up #{file} after testing" - on(agent, "rm -f #{file}") -end diff --git a/acceptance/tests/puppet_apply_basics.rb b/acceptance/tests/puppet_apply_basics.rb deleted file mode 100644 index c11546ebf..000000000 --- a/acceptance/tests/puppet_apply_basics.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Ported from a collection of small spec tests in acceptance. -# -# Unified into a single file because they are literally one-line tests! - -test_name "Trivial puppet tests" - -step "check that puppet apply displays notices" -agents.each do |host| - apply_manifest_on(host, "notice 'Hello World'") do - assert_match(/Hello World/, stdout, "#{host}: missing notice!") - end -end - -step "verify help displays something for puppet master" -on master, puppet_master("--help") do - assert_match(/puppet master/, stdout, "improper help output") -end diff --git a/acceptance/tests/puppet_apply_should_show_a_notice.rb b/acceptance/tests/puppet_apply_should_show_a_notice.rb deleted file mode 100644 index df3922f44..000000000 --- a/acceptance/tests/puppet_apply_should_show_a_notice.rb +++ /dev/null @@ -1,7 +0,0 @@ -test_name "puppet apply should show a notice" - -agents.each do |host| - apply_manifest_on(host, "notice 'Hello World'") do - assert_match(/.*: Hello World/, stdout, "#{host}: the notice didn't show") - end -end diff --git a/acceptance/tests/puppet_master_help_should_mention_puppet_master.rb b/acceptance/tests/puppet_master_help_should_mention_puppet_master.rb deleted file mode 100644 index ba7b39cb0..000000000 --- a/acceptance/tests/puppet_master_help_should_mention_puppet_master.rb +++ /dev/null @@ -1,4 +0,0 @@ -test_name "puppet master help should mention puppet master" -on master, puppet_master('--help') do - fail_test "puppet master wasn't mentioned" unless stdout.include? 'puppet master' -end diff --git a/acceptance/tests/reports/submission.rb b/acceptance/tests/reports/submission.rb deleted file mode 100644 index 8036f2c32..000000000 --- a/acceptance/tests/reports/submission.rb +++ /dev/null @@ -1,54 +0,0 @@ -test_name "Report submission" - -if master.is_pe? - require "time" - - def query_last_report_time_on(agent) - time_query_script = <<-EOS - require "net/http" - require "json" - - puppetdb_url = URI("http://localhost:8080/v3/reports") - puppetdb_url.query = URI.escape(%Q{query=["=","certname","#{agent}"]}) - result = Net::HTTP.get(puppetdb_url) - json = JSON.load(result) - puts json.first["receive-time"] - EOS - puppetdb = hosts.detect { |h| h['roles'].include?('database') } - on(puppetdb, "#{master[:puppetbindir]}/ruby -e '#{time_query_script}'").output.chomp - end - - last_times = {} - - agents.each do |agent| - last_times[agent] = query_last_report_time_on(agent) - end - - with_puppet_running_on(master, {}) do - agents.each do |agent| - on(agent, puppet('agent', "-t --server #{master}")) - - current_time = Time.parse(query_last_report_time_on(agent)) - last_time = Time.parse(last_times[agent]) - - assert(current_time > last_time, "Most recent report time #{current_time} is not newer than last report time #{last_time}") - end - end - -else - - testdir = create_tmpdir_for_user master, 'report_submission' - - teardown do - on master, "rm -rf #{testdir}" - end - - with_puppet_running_on(master, :main => { :reportdir => testdir, :reports => 'store' }) do - agents.each do |agent| - on(agent, puppet('agent', "-t --server #{master}")) - - on master, "grep -q #{agent} #{testdir}/*/*" - end - end - -end diff --git a/acceptance/tests/resource/cron/should_allow_changing_parameters.rb b/acceptance/tests/resource/cron/should_allow_changing_parameters.rb deleted file mode 100644 index 224d1407f..000000000 --- a/acceptance/tests/resource/cron/should_allow_changing_parameters.rb +++ /dev/null @@ -1,66 +0,0 @@ -test_name "Cron: should allow changing parameters after creation" -confine :except, :platform => 'windows' -require 'puppet/acceptance/common_utils' -extend Puppet::Acceptance::CronUtils - -teardown do - step "Cron: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ensure the user exist via puppet" - setup agent - - step "Cron: basic - verify that it can be created" - apply_manifest_on(agent, 'cron { "myjob": command => "/bin/false", user => "tstuser", hour => "*", minute => [1], ensure => present,}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - run_cron_on(agent,:list,'tstuser') do - assert_match(/.bin.false/, result.stdout, "err: #{agent}") - end - - step "Cron: allow changing command" - apply_manifest_on(agent, 'cron { "myjob": command => "/bin/true", user => "tstuser", hour => "*", minute => [1], ensure => present,}') do - assert_match(/command changed '.bin.false'.* to '.bin.true'/, result.stdout, "err: #{agent}") - end - run_cron_on(agent,:list,'tstuser') do - assert_match(/1 . . . . .bin.true/, result.stdout, "err: #{agent}") - end - - step "Cron: allow changing time" - apply_manifest_on(agent, 'cron { "myjob": command => "/bin/true", user => "tstuser", hour => "1", minute => [1], ensure => present,}') do - assert_match(/hour: defined 'hour' as '1'/, result.stdout, "err: #{agent}") - end - run_cron_on(agent,:list,'tstuser') do - assert_match(/1 1 . . . .bin.true/, result.stdout, "err: #{agent}") - end - - step "Cron: allow changing time(array)" - apply_manifest_on(agent, 'cron { "myjob": command => "/bin/true", user => "tstuser", hour => ["1","2"], minute => [1], ensure => present,}') do - assert_match(/hour: hour changed '1'.* to '1,2'/, result.stdout, "err: #{agent}") - end - run_cron_on(agent,:list,'tstuser') do - assert_match(/1 1,2 . . . .bin.true/, result.stdout, "err: #{agent}") - end - - step "Cron: allow changing time(array modification)" - apply_manifest_on(agent, 'cron { "myjob": command => "/bin/true", user => "tstuser", hour => ["3","2"], minute => [1], ensure => present,}') do - assert_match(/hour: hour changed '1,2'.* to '3,2'/, result.stdout, "err: #{agent}") - end - run_cron_on(agent,:list,'tstuser') do - assert_match(/1 3,2 . . . .bin.true/, result.stdout, "err: #{agent}") - end - step "Cron: allow changing time(array modification to *)" - apply_manifest_on(agent, 'cron { "myjob": command => "/bin/true", user => "tstuser", hour => "*", minute => "*", ensure => present,}') do - assert_match(/minute: undefined 'minute' from '1'/,result.stdout, "err: #{agent}") - assert_match(/hour: undefined 'hour' from '3,2'/,result.stdout, "err: #{agent}") - end - run_cron_on(agent,:list,'tstuser') do - assert_match(/\* \* . . . .bin.true/, result.stdout, "err: #{agent}") - end - -end diff --git a/acceptance/tests/resource/cron/should_be_idempotent.rb b/acceptance/tests/resource/cron/should_be_idempotent.rb deleted file mode 100644 index ea738385a..000000000 --- a/acceptance/tests/resource/cron/should_be_idempotent.rb +++ /dev/null @@ -1,31 +0,0 @@ -test_name "Cron: check idempotency" -confine :except, :platform => 'windows' - -require 'puppet/acceptance/common_utils' -extend Puppet::Acceptance::CronUtils - -teardown do - step "Cron: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ensure the user exist via puppet" - setup agent - - step "Cron: basic - verify that it can be created" - apply_manifest_on(agent, 'cron { "myjob": command => "/bin/true", user => "tstuser", hour => "*", minute => [1], ensure => present,}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - run_cron_on(agent,:list,'tstuser') do - assert_match(/. . . . . .bin.true/, result.stdout, "err: #{agent}") - end - - step "Cron: basic - should not create again" - apply_manifest_on(agent, 'cron { "myjob": command => "/bin/true", user => "tstuser", hour => "*", minute => [1], ensure => present,}') do - assert_no_match( /ensure: created/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/cron/should_create_cron.rb b/acceptance/tests/resource/cron/should_create_cron.rb deleted file mode 100644 index 2f68ef4be..000000000 --- a/acceptance/tests/resource/cron/should_create_cron.rb +++ /dev/null @@ -1,29 +0,0 @@ -test_name "should create cron" -confine :except, :platform => 'windows' - -require 'puppet/acceptance/common_utils' -extend Puppet::Acceptance::CronUtils - -teardown do - step "Cron: cleanup" - agents.each do |agent| - clean agent - end -end - -agents.each do |host| - step "ensure the user exist via puppet" - setup host - - step "apply the resource on the host using puppet resource" - on(host, puppet_resource("cron", "crontest", "user=tstuser", - "command=/bin/true", "ensure=present")) do - assert_match(/created/, stdout, "Did not create crontab for tstuser on #{host}") - end - - step "verify that crontab -l contains what you expected" - run_cron_on(host, :list, 'tstuser') do - assert_match(/\* \* \* \* \* \/bin\/true/, stdout, "Incorrect crontab for tstuser on #{host}") - end - -end diff --git a/acceptance/tests/resource/cron/should_match_existing.rb b/acceptance/tests/resource/cron/should_match_existing.rb deleted file mode 100755 index f7f64233a..000000000 --- a/acceptance/tests/resource/cron/should_match_existing.rb +++ /dev/null @@ -1,31 +0,0 @@ -test_name "puppet should match existing job" -confine :except, :platform => 'windows' - -require 'puppet/acceptance/common_utils' -extend Puppet::Acceptance::CronUtils - -teardown do - step "Cron: cleanup" - agents.each do |agent| - clean agent - end -end - -agents.each do |host| - step "ensure the user exist via puppet" - setup host - - step "Create the existing cron job by hand..." - run_cron_on(host,:add,'tstuser',"* * * * * /bin/true") - - step "Apply the resource on the host using puppet resource" - on(host, puppet_resource("cron", "crontest", "user=tstuser", - "command=/bin/true", "ensure=present")) do - assert_match(/present/, stdout, "Failed creating crontab for tstuser on #{host}") - end - - step "Verify that crontab -l contains what you expected" - run_cron_on(host, :list, 'tstuser') do - assert_match(/\* \* \* \* \* \/bin\/true/, stdout, "Did not find crontab for tstuser on #{host}") - end -end diff --git a/acceptance/tests/resource/cron/should_remove_cron.rb b/acceptance/tests/resource/cron/should_remove_cron.rb deleted file mode 100755 index 777411f2d..000000000 --- a/acceptance/tests/resource/cron/should_remove_cron.rb +++ /dev/null @@ -1,32 +0,0 @@ -test_name "puppet should remove a crontab entry as expected" -confine :except, :platform => 'windows' - -require 'puppet/acceptance/common_utils' -extend Puppet::Acceptance::CronUtils - -teardown do - step "Cron: cleanup" - agents.each do |agent| - clean agent - end -end - -agents.each do |host| - step "ensure the user exist via puppet" - setup host - - step "create the existing job by hand..." - run_cron_on(host,:add,'tstuser',"* * * * * /bin/true") - - step "apply the resource on the host using puppet resource" - on(host, puppet_resource("cron", "crontest", "user=tstuser", - "command=/bin/true", "ensure=absent")) do - assert_match(/crontest\D+ensure:\s+removed/, stdout, "Didn't remove crobtab entry for tstuser on #{host}") - end - - step "verify that crontab -l contains what you expected" - run_cron_on(host, :list, 'tstuser') do - assert_no_match(/\/bin\/true/, stderr, "Error: Found entry for tstuser on #{host}") - end - -end diff --git a/acceptance/tests/resource/cron/should_remove_leading_and_trailing_whitespace.rb b/acceptance/tests/resource/cron/should_remove_leading_and_trailing_whitespace.rb deleted file mode 100644 index 49c9e58c9..000000000 --- a/acceptance/tests/resource/cron/should_remove_leading_and_trailing_whitespace.rb +++ /dev/null @@ -1,37 +0,0 @@ -test_name "(#656) leading and trailing whitespace in cron entries should should be stripped" -confine :except, :platform => 'windows' - -require 'puppet/acceptance/common_utils' -extend Puppet::Acceptance::CronUtils - -teardown do - step "Cron: cleanup" - agents.each do |agent| - clean agent - end -end - -agents.each do |host| - step "create user account for testing cron entries" - setup host - - step "apply the resource on the host using puppet resource" - on(host, puppet_resource("cron", "crontest", "user=tstuser", "command=' date > /dev/null '", "ensure=present")) do - assert_match(/created/, stdout, "Did not create crontab for tstuser on #{host}") - end - - step "verify the added crontab entry has stripped whitespace" - run_cron_on(host, :list, 'tstuser') do - assert_match(/\* \* \* \* \* date > .dev.null/, stdout, "Incorrect crontab for tstuser on #{host}") - end - - step "apply the resource with trailing whitespace and check nothing happened" - on(host, puppet_resource("cron", "crontest", "user=tstuser", "command='date > /dev/null '", "ensure=present")) do - assert_no_match(/ensure: created/, stdout, "Rewrote the line with trailing space in crontab for tstuser on #{host}") - end - - step "apply the resource with leading whitespace and check nothing happened" - on(host, puppet_resource("cron", "crontest", "user=tstuser", "command=' date > /dev/null'", "ensure=present")) do - assert_no_match(/ensure: created/, stdout, "Rewrote the line with trailing space in crontab for tstuser on #{host}") - end -end diff --git a/acceptance/tests/resource/cron/should_remove_matching.rb b/acceptance/tests/resource/cron/should_remove_matching.rb deleted file mode 100755 index fd83182a8..000000000 --- a/acceptance/tests/resource/cron/should_remove_matching.rb +++ /dev/null @@ -1,33 +0,0 @@ -test_name "puppet should remove a crontab entry based on command matching" -confine :except, :platform => 'windows' - -require 'puppet/acceptance/common_utils' -extend Puppet::Acceptance::CronUtils - -teardown do - step "Cron: cleanup" - agents.each do |agent| - clean agent - end -end - -agents.each do |host| - step "ensure the user exist via puppet" - setup host - - step "create the existing job by hand..." - run_cron_on(host,:add,'tstuser',"* * * * * /bin/true") - - step "Remove cron resource" - on(host, puppet_resource("cron", "bogus", "user=tstuser", - "command=/bin/true", "ensure=absent")) do - assert_match(/bogus\D+ensure: removed/, stdout, "Removing cron entry failed for tstuser on #{host}") - end - - step "verify that crontab -l contains what you expected" - run_cron_on(host,:list,'tstuser') do - count = stdout.scan("/bin/true").length - fail_test "found /bin/true the wrong number of times (#{count})" unless count == 0 - end - -end diff --git a/acceptance/tests/resource/cron/should_update_existing.rb b/acceptance/tests/resource/cron/should_update_existing.rb deleted file mode 100755 index a10516511..000000000 --- a/acceptance/tests/resource/cron/should_update_existing.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "puppet should update existing crontab entry" -confine :except, :platform => 'windows' - -require 'puppet/acceptance/common_utils' -extend Puppet::Acceptance::CronUtils - -teardown do - step "Cron: cleanup" - agents.each do |agent| - clean agent - end -end - -agents.each do |host| - step "ensure the user exist via puppet" - setup host - - step "create the existing job by hand..." - run_cron_on(host,:add,'tstuser',"* * * * * /bin/true") - - step "verify that crontab -l contains what you expected" - run_cron_on(host,:list,'tstuser') do - assert_match(/\* \* \* \* \* \/bin\/true/, stdout, "Didn't find correct crobtab entry for tstuser on #{host}") - end - - step "apply the resource change on the host" - on(host, puppet_resource("cron", "crontest", "user=tstuser", "command=/bin/true", "ensure=present", "hour='0-6'")) do - assert_match(/hour\s+=>\s+\['0-6'\]/, stdout, "Modifying cron entry failed for tstuser on #{host}") - end - - step "verify that crontab -l contains what you expected" - run_cron_on(host,:list,'tstuser') do - assert_match(/\* 0-6 \* \* \* \/bin\/true/, stdout, "Didn't find correctly modified time entry in crobtab entry for tstuser on #{host}") - end -end diff --git a/acceptance/tests/resource/exec/accept_multi-line_commands.rb b/acceptance/tests/resource/exec/accept_multi-line_commands.rb deleted file mode 100644 index 443c7d2ca..000000000 --- a/acceptance/tests/resource/exec/accept_multi-line_commands.rb +++ /dev/null @@ -1,28 +0,0 @@ -test_name "Be able to execute multi-line commands (#9996)" -confine :except, :platform => 'windows' - -agents.each do |agent| - temp_file_name = agent.tmpfile('9996-multi-line-commands') - - test_manifest = <<HERE -exec { "test exec": - command => "/bin/echo '#Test' > #{temp_file_name}; - /bin/echo 'bob' >> #{temp_file_name};" -} -HERE - - expected_results = <<HERE -#Test -bob -HERE - - on(agent, "rm -f #{temp_file_name}") - - apply_manifest_on agent, test_manifest - - on(agent, "cat #{temp_file_name}") do - assert_equal(expected_results, stdout, "Unexpected result for host '#{agent}'") - end - - on(agent, "rm -f #{temp_file_name}") -end diff --git a/acceptance/tests/resource/exec/should_not_run_command_creates.rb b/acceptance/tests/resource/exec/should_not_run_command_creates.rb deleted file mode 100644 index 3518d24b0..000000000 --- a/acceptance/tests/resource/exec/should_not_run_command_creates.rb +++ /dev/null @@ -1,36 +0,0 @@ -test_name "should not run command creates" - -agents.each do |agent| - touch = agent.tmpfile('touched') - donottouch = agent.tmpfile('not-touched') - -manifest = %Q{ - exec { "test#{Time.new.to_i}": command => '#{agent.touch(donottouch)}', creates => "#{touch}"} -} - - step "prepare the agents for the test" - on agent, "touch #{touch} && rm -f #{donottouch}" - - step "test using puppet apply" - apply_manifest_on(agent, manifest) do - fail_test "looks like the thing executed, which it shouldn't" if - stdout.include? 'executed successfully' - end - - step "verify the file didn't get created" - on agent, "test -f #{donottouch}", :acceptable_exit_codes => [1] - - step "prepare the agents for the second part of the test" - on agent, "touch #{touch} ; rm -f #{donottouch}" - - step "test using puppet resource" - on(agent, puppet_resource('exec', "test#{Time.new.to_i}", - "command='#{agent.touch(donottouch)}'", - "creates='#{touch}'")) do - fail_test "looks like the thing executed, which it shouldn't" if - stdout.include? 'executed successfully' - end - - step "verify the file didn't get created the second time" - on agent, "test -f #{donottouch}", :acceptable_exit_codes => [1] -end diff --git a/acceptance/tests/resource/exec/should_run_command.rb b/acceptance/tests/resource/exec/should_run_command.rb deleted file mode 100644 index eff86ccb4..000000000 --- a/acceptance/tests/resource/exec/should_run_command.rb +++ /dev/null @@ -1,33 +0,0 @@ -test_name "tests that puppet correctly runs an exec." -# original author: Dan Bode --daniel 2010-12-23 - -def before(agent) - step "file to be touched should not exist." - touched = agent.tmpfile('test-exec') -end - -def after(agent, touched) - step "checking the output worked" - on agent, "test -f #{touched}" - - step "clean up the system" - on agent, "rm -f #{touched}" -end - -agents.each do |agent| - touched = before(agent) - apply_manifest_on(agent, "exec {'test': command=>'#{agent.touch(touched)}'}") do - fail_test "didn't seem to run the command" unless - stdout.include? 'executed successfully' - end - after(agent, touched) - - touched = before(agent) - on(agent, puppet_resource('-d', 'exec', 'test', "command='#{agent.touch(touched)}'}")) do - fail_test "didn't seem to run the command" unless - stdout.include? 'executed successfully' - end - after(agent, touched) -end - - diff --git a/acceptance/tests/resource/exec/should_set_path.rb b/acceptance/tests/resource/exec/should_set_path.rb deleted file mode 100644 index e1b5aa09d..000000000 --- a/acceptance/tests/resource/exec/should_set_path.rb +++ /dev/null @@ -1,18 +0,0 @@ -test_name "the path statement should work to locate commands" - -agents.each do |agent| - file = agent.tmpfile('touched-should-set-path') - - step "clean up the system for the test" - on agent, "rm -f #{file}" - - step "invoke the exec resource with a path set" - on(agent, puppet_resource('exec', 'test', - "command='#{agent.touch(file, false)}'", "path='#{agent.path}'")) - - step "verify that the files were created" - on agent, "test -f #{file}" - - step "clean up the system after testing" - on agent, "rm -f #{file}" -end diff --git a/acceptance/tests/resource/file/content_attribute.rb b/acceptance/tests/resource/file/content_attribute.rb deleted file mode 100644 index 768cdb059..000000000 --- a/acceptance/tests/resource/file/content_attribute.rb +++ /dev/null @@ -1,51 +0,0 @@ -test_name "Content Attribute" - -agents.each do |agent| - target = agent.tmpfile('content_file_test') - - step "Ensure the test environment is clean" - on agent, "rm -f #{target}" - - step "Content Attribute: using raw content" - - manifest = "file { '#{target}': content => 'This is the test file content', ensure => present }" - apply_manifest_on agent, manifest - - on agent, "cat #{target}" do - assert_match(/This is the test file content/, stdout, "File content not matched on #{agent}") - end - - step "Ensure the test environment is clean" - on agent, "rm -f #{target}" - - step "Content Attribute: using a checksum from filebucket" - on agent, "echo 'This is the checksum file contents' > #{target}" - - step "Backup file into the filebucket" - on agent, puppet_filebucket("backup --local #{target}") - - bucketdir="not set" - on agent, puppet_filebucket("--configprint bucketdir") do - bucketdir = stdout.chomp - end - - manifest = %Q| - filebucket { 'local': - path => '#{bucketdir}', - } - - file { '#{target}': - content => '{md5}18571d3a04b2bb7ccfdbb2c44c72caa9', - ensure => present, - backup => local, - } - | - - step "Applying Manifest on Agent" - apply_manifest_on agent, manifest - - step "Validate filebucket checksum file contents" - on agent, "cat #{target}" do - assert_match(/This is the checksum file content/, stdout, "File content not matched on #{agent}") - end -end diff --git a/acceptance/tests/resource/file/should_create_directory.rb b/acceptance/tests/resource/file/should_create_directory.rb deleted file mode 100755 index ebe8441cb..000000000 --- a/acceptance/tests/resource/file/should_create_directory.rb +++ /dev/null @@ -1,17 +0,0 @@ -test_name "should create directory" - -agents.each do |agent| - target = agent.tmpfile("create-dir") - - step "clean up the system before we begin" - on(agent, "rm -rf #{target}") - - step "verify we can create a directory" - on(agent, puppet_resource("file", target, 'ensure=directory')) - - step "verify the directory was created" - on(agent, "test -d #{target}") - - step "clean up after the test run" - on(agent, "rm -rf #{target}") -end diff --git a/acceptance/tests/resource/file/should_create_empty.rb b/acceptance/tests/resource/file/should_create_empty.rb deleted file mode 100755 index 4c16c06aa..000000000 --- a/acceptance/tests/resource/file/should_create_empty.rb +++ /dev/null @@ -1,17 +0,0 @@ -test_name "should create empty file for 'present'" - -agents.each do |agent| - target = agent.tmpfile("empty") - - step "clean up the system before we begin" - on(agent, "rm -rf #{target}") - - step "verify we can create an empty file" - on(agent, puppet_resource("file", target, 'ensure=present')) - - step "verify the target was created" - on(agent, "test -f #{target} && test ! -s #{target}") - - step "clean up after the test run" - on(agent, "rm -rf #{target}") -end diff --git a/acceptance/tests/resource/file/should_create_symlink.rb b/acceptance/tests/resource/file/should_create_symlink.rb deleted file mode 100755 index fd24cb614..000000000 --- a/acceptance/tests/resource/file/should_create_symlink.rb +++ /dev/null @@ -1,37 +0,0 @@ -test_name "should create symlink" - -message = 'hello world' -agents.each do |agent| - confine_block :to, :platform => 'windows' do - # symlinks are supported only on Vista+ (version 6.0 and higher) - on agents, facter('kernelmajversion') do - skip_test "Test not supported on this plaform" if stdout.chomp.to_f < 6.0 - end - end - - link = agent.tmpfile("symlink-link") - target = agent.tmpfile("symlink-target") - - step "clean up the system before we begin" - on agent, "rm -rf #{target} #{link}" - on agent, "echo '#{message}' > #{target}" - - step "verify we can create a symlink" - on(agent, puppet_resource("file", link, "ensure=#{target}")) - - step "verify the symlink was created" - on agent, "test -L #{link} && test -f #{link}" - step "verify the symlink points to a file" - on agent, "test -f #{target}" - - step "verify the content is identical on both sides" - on(agent, "cat #{link}") do - fail_test "link missing content" unless stdout.include? message - end - on(agent, "cat #{target}") do - fail_test "target missing content" unless stdout.include? message - end - - step "clean up after the test run" - on agent, "rm -rf #{target} #{link}" -end diff --git a/acceptance/tests/resource/file/should_default_mode.rb b/acceptance/tests/resource/file/should_default_mode.rb deleted file mode 100644 index ac5815961..000000000 --- a/acceptance/tests/resource/file/should_default_mode.rb +++ /dev/null @@ -1,42 +0,0 @@ -test_name "file resource: set default modes" - -def regexp_mode(mode) - Regexp.new("mode\s*=>\s*'0?#{mode}'") -end - -agents.each do |agent| - step "setup" - parent = agent.tmpdir('default-mode-parent') - on(agent, "rm -rf #{parent}") - - step "puppet should set execute bit on readable directories" - on(agent, puppet_resource("file", parent, "ensure=directory", "mode=0644")) do - assert_match(regexp_mode(755), stdout) - end - - step "include execute bit on newly created directories" - dir = "#{parent}/dir" - on(agent, "mkdir #{dir} && cd #{dir} && cd ..") - - step "exclude execute bit from newly created files" - file = "#{parent}/file.txt" - on(agent, "echo foobar > #{file}") - on(agent, "#{file}", :acceptable_exit_codes => (1..255)) do - assert_no_match(/foobar/, stdout) - end - - step "set execute git on file if explicitly specified" - file_750 = "#{parent}/file_750.txt" - on(agent, puppet_resource("file", file_750, "ensure=file", "mode=0750")) do - assert_match(regexp_mode(750), stdout) - end - - step "don't set execute bit if directory not readable" - dir_600 = "#{parent}/dir_600" - on(agent, puppet_resource("file", dir_600, "ensure=directory", "mode=0600")) do - assert_match(regexp_mode(700), stdout) # readable by owner, but not group - end - - on(agent, "rm -rf #{parent}") -end - diff --git a/acceptance/tests/resource/file/should_remove_dir.rb b/acceptance/tests/resource/file/should_remove_dir.rb deleted file mode 100755 index ca8a003bb..000000000 --- a/acceptance/tests/resource/file/should_remove_dir.rb +++ /dev/null @@ -1,23 +0,0 @@ -test_name "should remove directory, but force required" - -agents.each do |agent| - target = agent.tmpdir("delete-dir") - - step "clean up the system before we begin" - on agent, "rm -rf #{target} ; mkdir -p #{target}" - - step "verify we can't remove a directory without 'force'" - on(agent, puppet_resource("file", target, 'ensure=absent')) do - fail_test "didn't tell us that force was required" unless - stdout.include? "Not removing directory; use 'force' to override" - end - - step "verify the directory still exists" - on agent, "test -d #{target}" - - step "verify we can remove a directory with 'force'" - on(agent, puppet_resource("file", target, 'ensure=absent', 'force=true')) - - step "verify that the directory is gone" - on agent, "test -d #{target}", :acceptable_exit_codes => [1] -end diff --git a/acceptance/tests/resource/file/should_remove_file.rb b/acceptance/tests/resource/file/should_remove_file.rb deleted file mode 100755 index 60cf63251..000000000 --- a/acceptance/tests/resource/file/should_remove_file.rb +++ /dev/null @@ -1,14 +0,0 @@ -test_name "should remove file" - -agents.each do |agent| - target = agent.tmpfile('delete-file') - - step "clean up the system before we begin" - on agent, "rm -rf #{target} && touch #{target}" - - step "verify we can remove a file" - on(agent, puppet_resource("file", target, 'ensure=absent')) - - step "verify that the file is gone" - on agent, "test -e #{target}", :acceptable_exit_codes => [1] -end diff --git a/acceptance/tests/resource/file/source_attribute.rb b/acceptance/tests/resource/file/source_attribute.rb deleted file mode 100644 index 8f249bfa3..000000000 --- a/acceptance/tests/resource/file/source_attribute.rb +++ /dev/null @@ -1,98 +0,0 @@ -test_name "The source attribute" - -step "when using a puppet:/// URI with a master/agent setup" -testdir = master.tmpdir('file_source_attr') - -source_path = "#{testdir}/modules/source_test_module/files/source_file" -on master, "mkdir -p #{File.dirname(source_path)}" -create_remote_file master, source_path, <<EOF -the content is present -EOF - -target_file_on_windows = 'C:/windows/temp/source_attr_test' -target_file_on_nix = '/tmp/source_attr_test' - -teardown do - hosts.each do |host| - file_to_rm = host['platform'] =~ /windows/ ? target_file_on_windows : target_file_on_nix - on(host, "rm #{file_to_rm}", :acceptable_exit_codes => [0,1]) - end -end - -mod_manifest = "#{testdir}/modules/source_test_module/manifests/init.pp" -on master, "mkdir -p #{File.dirname(mod_manifest)}" -create_remote_file master, mod_manifest, <<EOF -class source_test_module { - $target_file = $::kernel ? { - 'windows' => '#{target_file_on_windows}', - default => '#{target_file_on_nix}' - } - - file { $target_file: - source => 'puppet:///modules/source_test_module/source_file', - ensure => present - } -} -EOF - -manifest = "#{testdir}/site.pp" -create_remote_file master, manifest, <<EOF -node default { - include source_test_module -} -EOF - -on master, "chmod -R 777 #{testdir}" -on master, "chmod -R 644 #{mod_manifest} #{source_path} #{manifest}" -on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" - -master_opts = { - 'master' => { - 'manifest' => manifest, - 'node_terminus' => 'plain', - 'modulepath' => "#{testdir}/modules" - } -} -with_puppet_running_on master, master_opts, testdir do - agents.each do |agent| - on(agent, puppet('agent', "--test --server #{master}"), :acceptable_exit_codes => [2]) do - file_to_check = agent['platform'] =~ /windows/ ? target_file_on_windows : target_file_on_nix - on agent, "cat #{file_to_check}" do - assert_match(/the content is present/, stdout, "Result file not created") - end - end - end -end - - -# TODO: Add tests for puppet:// URIs with multi-master/agent setups. -# step "when using a puppet://$server/ URI with a master/agent setup" -agents.each do |agent| - step "Setup testing local file sources" - a_testdir = agent.tmpdir('local_source_file_test') - - source = "#{a_testdir}/source_mod/files/source" - target = "#{a_testdir}/target" - - on agent, "mkdir -p #{File.dirname(source)}" - create_remote_file agent, source, 'Yay, this is the local file.' - - - step "Using a local file path" - - apply_manifest_on agent, "file { '#{target}': source => '#{source}', ensure => present }" - on agent, "cat #{target}" do - assert_match(/Yay, this is the local file./, stdout, "FIRST: File contents not matched on #{agent}") - end - - - step "Using a puppet:/// URI with puppet apply" - on agent, "rm -rf #{target}" - - manifest = %{"file { '#{target}': source => 'puppet:///modules/source_mod/source', ensure => 'present' }"} - on agent, puppet( %{apply --modulepath=#{a_testdir} -e #{manifest}}) - on agent, "cat #{target}" do - assert_match(/Yay, this is the local file./, stdout, "FIRST: File contents not matched on #{agent}") - end - -end diff --git a/acceptance/tests/resource/file/symbolic_modes.rb b/acceptance/tests/resource/file/symbolic_modes.rb deleted file mode 100644 index f15a5dc10..000000000 --- a/acceptance/tests/resource/file/symbolic_modes.rb +++ /dev/null @@ -1,260 +0,0 @@ -test_name "file resource: symbolic modes" - -require 'test/unit/assertions' - -module FileModeAssertions - include Test::Unit::Assertions - - def assert_create(agent, manifest, path, expected_mode) - testcase.apply_manifest_on(agent, manifest) do - assert_match(/File\[#{Regexp.escape(path)}\]\/ensure: created/, testcase.stdout, "Failed to create #{path}") - end - - assert_mode(agent, path, expected_mode) - end - - def assert_mode(agent, path, expected_mode) - current_mode = testcase.on(agent, "stat --format '%a' #{path}").stdout.chomp.to_i(8) - assert_equal(expected_mode, current_mode, "current mode #{current_mode.to_s(8)} doesn't match expected mode #{expected_mode.to_s(8)}") - end - - def assert_mode_change(agent, manifest, path, symbolic_mode, start_mode, expected_mode) - testcase.apply_manifest_on(agent, manifest) do - assert_match(/mode changed '#{'%04o' % start_mode}'.* to '#{'%04o' % expected_mode}'/, testcase.stdout, - "couldn't set mode to #{symbolic_mode}") - end - - assert_mode(agent, path, expected_mode) - end - - def assert_no_mode_change(agent, manifest) - testcase.apply_manifest_on(agent, manifest) do - assert_no_match(/mode changed/, testcase.stdout, "reapplied the symbolic mode change") - end - end -end - -class ActionModeTest - include FileModeAssertions - - attr_reader :testcase - - def initialize(testcase, agent, basedir, symbolic_mode) - @testcase = testcase - @agent = agent - @basedir = basedir - @symbolic_mode = symbolic_mode - - @file = "#{basedir}/file" - @dir = "#{basedir}/dir" - - testcase.on(agent, "rm -rf #{@file} #{@dir}") - end - - def get_manifest(path, type, symbolic_mode) - "file { #{path.inspect}: ensure => #{type}, mode => '#{symbolic_mode}' }" - end -end - -class CreatesModeTest < ActionModeTest - def initialize(testcase, agent, basedir, symbolic_mode) - super(testcase, agent, basedir, symbolic_mode) - end - - def assert_file_mode(expected_mode) - manifest = get_manifest(@file, 'file', @symbolic_mode) - assert_create(@agent, manifest, @file, expected_mode) - assert_no_mode_change(@agent, manifest) - end - - def assert_dir_mode(expected_mode) - manifest = get_manifest(@dir, 'directory', @symbolic_mode) - assert_create(@agent, manifest, @dir, expected_mode) - assert_no_mode_change(@agent, manifest) - end -end - -class ModifiesModeTest < ActionModeTest - def initialize(testcase, agent, basedir, symbolic_mode, start_mode) - super(testcase, agent, basedir, symbolic_mode) - - @start_mode = start_mode - - user = agent['user'] - group = agent['group'] || user - - testcase.on(agent, "touch #{@file} && chown #{user}:#{group} #{@file} && chmod #{start_mode.to_s(8)} #{@file}") - testcase.on(agent, "mkdir -p #{@dir} && chown #{user}:#{group} #{@dir} && chmod #{start_mode.to_s(8)} #{@dir}") - end - - def assert_file_mode(expected_mode) - manifest = get_manifest(@file, 'file', @symbolic_mode) - if @start_mode != expected_mode - assert_mode_change(@agent, manifest, @file, @symbolic_mode, @start_mode, expected_mode) - end - assert_no_mode_change(@agent, manifest) - end - - def assert_dir_mode(expected_mode) - manifest = get_manifest(@dir, 'directory', @symbolic_mode) - if @start_mode != expected_mode - assert_mode_change(@agent, manifest, @dir, @symbolic_mode, @start_mode, expected_mode) - end - assert_no_mode_change(@agent, manifest) - end -end - -class ModeTest - def initialize(testcase, agent, basedir) - @testcase = testcase - @agent = agent - @basedir = basedir - end - - def assert_creates(symbolic_mode, file_mode, dir_mode) - creates = CreatesModeTest.new(@testcase, @agent, @basedir, symbolic_mode) - creates.assert_file_mode(file_mode) - creates.assert_dir_mode(dir_mode) - end - - def assert_modifies(symbolic_mode, start_mode, file_mode, dir_mode) - modifies = ModifiesModeTest.new(@testcase, @agent, @basedir, symbolic_mode, start_mode) - modifies.assert_file_mode(file_mode) - modifies.assert_dir_mode(dir_mode) - end -end - -# For your reference: -# 4000 the set-user-ID-on-execution bit -# 2000 the set-group-ID-on-execution bit -# 1000 the sticky bit -# 0400 Allow read by owner. -# 0200 Allow write by owner. -# 0100 For files, allow execution by owner. For directories, allow the -# owner to search in the directory. -# 0040 Allow read by group members. -# 0020 Allow write by group members. -# 0010 For files, allow execution by group members. For directories, allow -# group members to search in the directory. -# 0004 Allow read by others. -# 0002 Allow write by others. -# 0001 For files, allow execution by others. For directories allow others -# to search in the directory. -# -# On Solaris 11 (from man chmod): -# -# 20#0 Set group ID on execution if # is 7, 5, 3, or 1. -# Enable mandatory locking if # is 6, 4, 2, or 0. -# ... -# For directories, the set-gid bit can -# only be set or cleared by using symbolic mode. - -# From http://www.gnu.org/software/coreutils/manual/html_node/Symbolic-Modes.html#Symbolic-Modes -# Users -# u the user who owns the file; -# g other users who are in the file's group; -# o all other users; -# a all users; the same as 'ugo'. -# -# Operations -# + to add the permissions to whatever permissions the users already have for the file; -# - to remove the permissions from whatever permissions the users already have for the file; -# = to make the permissions the only permissions that the users have for the file. -# -# Permissions -# r the permission the users have to read the file; -# w the permission the users have to write to the file; -# x the permission the users have to execute the file, or search it if it is a directory. -# s the meaning depends on which user (uga) the permission is associated with: -# to set set-user-id-on-execution, use 'u' in the users part of the symbolic mode and 's' in the permissions part. -# to set set-group-id-on-execution, use 'g' in the users part of the symbolic mode and 's' in the permissions part. -# to set both user and group-id-on-execution, omit the users part of the symbolic mode (or use 'a') and use 's' in the permissions part. -# t the restricted deletion flag (sticky bit), omit the users part of the symbolic mode (or use 'a') and use 't' in the permissions part. -# X execute/search permission is affected only if the file is a directory or already had execute permission. -# -# Note we do not currently support the Solaris (l) permission: -# l mandatory file and record locking refers to a file's ability to have its reading or writing -# permissions locked while a program is accessing that file. -# -agents.each do |agent| - if agent['platform'].include?('windows') - Log.warn("Pending: this does not currently work on Windows") - next - end - is_solaris = agent['platform'].include?('solaris') - - basedir = agent.tmpdir('symbolic-modes') - on(agent, "mkdir -p #{basedir}") - - test = ModeTest.new(self, agent, basedir) - test.assert_creates('u=r', 00444, 00455) - test.assert_creates('u=w', 00244, 00255) - test.assert_creates('u=x', 00144, 00155) - test.assert_creates('u=rw', 00644, 00655) - test.assert_creates('u=rwx', 00744, 00755) - test.assert_creates('u=rwxt', 01744, 01755) - test.assert_creates('u=rwxs', 04744, 04755) - test.assert_creates('u=rwxts', 05744, 05755) - - test.assert_creates('ug=r', 00444, 00445) - test.assert_creates('ug=rw', 00664, 00665) - test.assert_creates('ug=rwx', 00774, 00775) - test.assert_creates('ug=rwxt', 01774, 01775) - test.assert_creates('ug=rwxs', 06774, 06775) - test.assert_creates('ug=rwxts', 07774, 07775) - - test.assert_creates('ugo=r', 00444, 00444) - test.assert_creates('ugo=rw', 00666, 00666) - test.assert_creates('ugo=rwx', 00777, 00777) - test.assert_creates('ugo=rwxt', 01777, 01777) - # # test.assert_creates('ugo=rwxs', 06777, 06777) ## BUG, puppet creates 07777 - test.assert_creates('ugo=rwxts', 07777, 07777) - - test.assert_creates('u=rwx,go=rx', 00755, 00755) - test.assert_creates('u=rwx,g=rx,o=r', 00754, 00754) - test.assert_creates('u=rwx,g=rx,o=', 00750, 00750) - test.assert_creates('a=rwx', 00777, 00777) - - test.assert_creates('u+r', 00644, 00755) - test.assert_creates('u+w', 00644, 00755) - test.assert_creates('u+x', 00744, 00755) - - test.assert_modifies('u+r', 00200, 00600, 00600) - test.assert_modifies('u+r', 00600, 00600, 00600) - test.assert_modifies('u+w', 00500, 00700, 00700) - test.assert_modifies('u+w', 00400, 00600, 00600) - test.assert_modifies('u+x', 00700, 00700, 00700) - test.assert_modifies('u+x', 00600, 00700, 00700) - test.assert_modifies('u+X', 00100, 00100, 00100) - test.assert_modifies('u+X', 00200, 00200, 00300) - test.assert_modifies('u+X', 00410, 00510, 00510) - test.assert_modifies('a+X', 00600, 00600, 00711) - test.assert_modifies('a+X', 00700, 00711, 00711) - - test.assert_modifies('u+s', 00744, 04744, 04744) - test.assert_modifies('g+s', 00744, 02744, 02744) - test.assert_modifies('u+t', 00744, 01744, 01744) - - test.assert_modifies('u-r', 00200, 00200, 00200) - test.assert_modifies('u-r', 00600, 00200, 00200) - test.assert_modifies('u-w', 00500, 00500, 00500) - test.assert_modifies('u-w', 00600, 00400, 00400) - test.assert_modifies('u-x', 00700, 00600, 00600) - test.assert_modifies('u-x', 00600, 00600, 00600) - - test.assert_modifies('u-s', 04744, 00744, 00744) - # using chmod 2744 on a directory to set the startmode fails on Solaris - test.assert_modifies('g-s', 02744, 00744, 00744) unless is_solaris - test.assert_modifies('u-t', 01744, 00744, 00744) - - # these raise - # test.assert_raises('') - # test.assert_raises(' ') - # test.assert_raises('u=X') - # test.assert_raises('u-X') - # test.assert_raises('+l') - # test.assert_raises('-l') - - step "clean up old test things" - on agent, "rm -rf #{basedir}" -end diff --git a/acceptance/tests/resource/file/ticket_7680-follow-symlinks.rb b/acceptance/tests/resource/file/ticket_7680-follow-symlinks.rb deleted file mode 100644 index e4faed55b..000000000 --- a/acceptance/tests/resource/file/ticket_7680-follow-symlinks.rb +++ /dev/null @@ -1,46 +0,0 @@ -test_name "#7680: 'links => follow' should use the file source content" - -agents.each do |agent| - confine_block :to, :platform => 'windows' do - # symlinks are supported only on Vista+ (version 6.0 and higher) - on agents, facter('kernelmajversion') do - skip_test "Test not supported on this plaform" if stdout.chomp.to_f < 6.0 - end - end - - step "Create file content" - real_source = agent.tmpfile('follow_links_source') - dest = agent.tmpfile('follow_links_dest') - symlink = agent.tmpfile('follow_links_symlink') - - on agent, "echo 'This is the real content' > #{real_source}" - if agent['platform'].include?('windows') - # cygwin ln doesn't behave properly, fallback to mklink, - # but that requires backslashes, that need to be escaped, - # and the link cannot exist prior. - on agent, "rm -f #{symlink}" - on agent, "cmd /c mklink #{symlink.gsub('/', '\\\\\\\\')} #{real_source.gsub('/', '\\\\\\\\')}" - else - on agent, "ln -sf #{real_source} #{symlink}" - end - - manifest = <<-MANIFEST - file { '#{dest}': - ensure => file, - source => '#{symlink}', - links => follow, - } - MANIFEST - apply_manifest_on(agent, manifest, :trace => true) - - on agent, "cat #{dest}" do - assert_match /This is the real content/, stdout - end - - step "Cleanup" - [real_source, dest, symlink].each do |file| - on agent, "rm -f '#{file}'" - end -end - - diff --git a/acceptance/tests/resource/file/ticket_8740_should_not_enumerate_root_directory.rb b/acceptance/tests/resource/file/ticket_8740_should_not_enumerate_root_directory.rb deleted file mode 100644 index 532a061f3..000000000 --- a/acceptance/tests/resource/file/ticket_8740_should_not_enumerate_root_directory.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "#8740: should not enumerate root directory" -confine :except, :platform => 'windows' - -target = "/test-socket-#{$$}" - -agents.each do |agent| - step "clean up the system before we begin" - on(agent, "rm -f #{target}") - - step "create UNIX domain socket" - on(agent, %Q{#{agent['puppetbindir']}/ruby -e "require 'socket'; UNIXServer::new('#{target}').close"}) - - step "query for all files, which should return nothing" - on(agent, puppet_resource('file'), :acceptable_exit_codes => [1]) do - assert_match(%r{Listing all file instances is not supported. Please specify a file or directory, e.g. puppet resource file /etc}, stderr) - end - - ["/", "/etc"].each do |file| - step "query '#{file}' directory, which should return single entry" - on(agent, puppet_resource('file', file)) do - files = stdout.scan(/^file \{ '([^']+)'/).flatten - - assert_equal(1, files.size, "puppet returned multiple files: #{files.join(', ')}") - assert_match(file, files[0], "puppet did not return file") - end - end - - step "query file that does not exist, which should report the file is absent" - on(agent, puppet_resource('file', '/this/does/notexist')) do - assert_match(/ensure\s+=>\s+'absent'/, stdout) - end - - step "remove UNIX domain socket" - on(agent, "rm -f #{target}") -end diff --git a/acceptance/tests/resource/group/should_create.rb b/acceptance/tests/resource/group/should_create.rb deleted file mode 100755 index 16a74c7dd..000000000 --- a/acceptance/tests/resource/group/should_create.rb +++ /dev/null @@ -1,17 +0,0 @@ -test_name "should create a group" - -name = "pl#{rand(999999).to_i}" - -agents.each do |agent| - step "ensure the group does not exist" - agent.group_absent(name) - - step "create the group" - on agent, puppet_resource('group', name, 'ensure=present') - - step "verify the group exists" - agent.group_get(name) - - step "delete the group" - agent.group_absent(name) -end diff --git a/acceptance/tests/resource/group/should_destroy.rb b/acceptance/tests/resource/group/should_destroy.rb deleted file mode 100755 index 6b887579f..000000000 --- a/acceptance/tests/resource/group/should_destroy.rb +++ /dev/null @@ -1,14 +0,0 @@ -test_name "should destroy a group" - -name = "pl#{rand(999999).to_i}" - -agents.each do |agent| - step "ensure the group is present" - agent.group_present(name) - - step "delete the group" - on agent, puppet_resource('group', name, 'ensure=absent') - - step "verify the group was deleted" - agent.group_absent(name) -end diff --git a/acceptance/tests/resource/group/should_modify_gid.rb b/acceptance/tests/resource/group/should_modify_gid.rb deleted file mode 100755 index 43ba6fa4f..000000000 --- a/acceptance/tests/resource/group/should_modify_gid.rb +++ /dev/null @@ -1,27 +0,0 @@ -test_name "should modify gid of existing group" -confine :except, :platform => 'windows' - -name = "pl#{rand(999999).to_i}" -gid1 = rand(999999).to_i -gid2 = rand(999999).to_i - -agents.each do |agent| - step "ensure that the group exists with gid #{gid1}" - on(agent, puppet_resource('group', name, 'ensure=present', "gid=#{gid1}")) do - fail_test "missing gid notice" unless stdout =~ /gid +=> +'#{gid1}'/ - end - - step "ensure that we can modify the GID of the group to #{gid2}" - on(agent, puppet_resource('group', name, 'ensure=present', "gid=#{gid2}")) do - fail_test "missing gid notice" unless stdout =~ /gid +=> +'#{gid2}'/ - end - - step "verify that the GID changed" - on(agent, "getent group #{name}") do - fail_test "gid is wrong through getent output" unless - stdout =~ /^#{name}:.*:#{gid2}:/ - end - - step "clean up the system after the test run" - on(agent, puppet_resource('group', name, 'ensure=absent')) -end diff --git a/acceptance/tests/resource/group/should_not_create_existing.rb b/acceptance/tests/resource/group/should_not_create_existing.rb deleted file mode 100755 index 351ca0c74..000000000 --- a/acceptance/tests/resource/group/should_not_create_existing.rb +++ /dev/null @@ -1,17 +0,0 @@ -test_name "group should not create existing group" - -name = "test-group-#{Time.new.to_i}" - -agents.each do |agent| - step "ensure the group exists on the target node" - agent.group_present(name) - - step "verify that we don't try and create the existing group" - on(agent, puppet_resource('group', name, 'ensure=present')) do - fail_test "looks like we created the group" if - stdout.include? "/Group[#{name}]/ensure: created" - end - - step "clean up the system after the test run" - agent.group_absent(name) -end diff --git a/acceptance/tests/resource/group/should_not_destoy_unexisting.rb b/acceptance/tests/resource/group/should_not_destoy_unexisting.rb deleted file mode 100755 index 53147f08d..000000000 --- a/acceptance/tests/resource/group/should_not_destoy_unexisting.rb +++ /dev/null @@ -1,15 +0,0 @@ -test_name "should not destroy a group that doesn't exist" - -name = "test-group-#{Time.new.to_i}" - -step "verify the group does not already exist" -agents.each do |agent| - agent.group_absent(name) -end - -step "verify that we don't remove the group when it doesn't exist" -on(agents, puppet_resource('group', name, 'ensure=absent')) do - fail_test "it looks like we tried to remove the group" if - stdout.include? "/Group[#{name}]/ensure: removed" -end - diff --git a/acceptance/tests/resource/group/should_query.rb b/acceptance/tests/resource/group/should_query.rb deleted file mode 100755 index 12da6ea1a..000000000 --- a/acceptance/tests/resource/group/should_query.rb +++ /dev/null @@ -1,16 +0,0 @@ -test_name "test that we can query and find a group that exists." - -name = "pl#{rand(999999).to_i}" - -agents.each do |agent| - step "ensure that our test group exists" - agent.group_present(name) - - step "query for the resource and verify it was found" - on(agent, puppet_resource('group', name)) do - fail_test "didn't find the group #{name}" unless stdout.include? 'present' - end - - step "clean up the group we added" - agent.group_absent(name) -end diff --git a/acceptance/tests/resource/group/should_query_all.rb b/acceptance/tests/resource/group/should_query_all.rb deleted file mode 100755 index 87ce781a8..000000000 --- a/acceptance/tests/resource/group/should_query_all.rb +++ /dev/null @@ -1,23 +0,0 @@ -test_name "should query all groups" - -agents.each do |agent| - step "query natively" - groups = agent.group_list - - fail_test("No groups found") unless groups - - step "query with puppet" - on(agent, puppet_resource('group')) do - stdout.each_line do |line| - name = ( line.match(/^group \{ '([^']+)'/) or next )[1] - - unless groups.delete(name) - fail_test "group #{name} found by puppet, not natively" - end - end - end - - if groups.length > 0 then - fail_test "#{groups.length} groups found natively, not puppet: #{groups.join(', ')}" - end -end diff --git a/acceptance/tests/resource/host/should_create.rb b/acceptance/tests/resource/host/should_create.rb deleted file mode 100755 index 6ad807f4e..000000000 --- a/acceptance/tests/resource/host/should_create.rb +++ /dev/null @@ -1,17 +0,0 @@ -test_name "host should create" - -agents.each do |agent| - target = agent.tmpfile('host-create') - - step "clean up for the test" - on agent, "rm -f #{target}" - - step "create the host record" - on(agent, puppet_resource("host", "test", "ensure=present", - "ip=127.0.0.1", "target=#{target}")) - - step "verify that the record was created" - on(agent, "cat #{target} ; rm -f #{target}") do - fail_test "record was not present" unless stdout =~ /^127\.0\.0\.1[[:space:]]+test/ - end -end diff --git a/acceptance/tests/resource/host/should_create_aliases.rb b/acceptance/tests/resource/host/should_create_aliases.rb deleted file mode 100755 index 91031e6be..000000000 --- a/acceptance/tests/resource/host/should_create_aliases.rb +++ /dev/null @@ -1,18 +0,0 @@ -test_name "host should create aliases" - -agents.each do |agent| - target = agent.tmpfile('host-create-aliases') - - step "clean up the system for testing" - on agent, "rm -f #{target}" - - step "create the record" - on(agent, puppet_resource('host', 'test', "ensure=present", - "ip=127.0.0.7", "target=#{target}", "host_aliases=alias")) - - step "verify that the aliases were added" - on(agent, "cat #{target} ; rm -f #{target}") do - fail_test "alias was missing" unless - stdout =~ /^127\.0\.0\.7[[:space:]]+test[[:space:]]alias/ - end -end diff --git a/acceptance/tests/resource/host/should_destroy.rb b/acceptance/tests/resource/host/should_destroy.rb deleted file mode 100755 index 75e8166b3..000000000 --- a/acceptance/tests/resource/host/should_destroy.rb +++ /dev/null @@ -1,21 +0,0 @@ -test_name "should be able to remove a host record" - -agents.each do |agent| - file = agent.tmpfile('host-destroy') - line = "127.0.0.7 test1" - - step "set up files for the test" - on agent, "printf '#{line}\n' > #{file}" - - step "delete the resource from the file" - on(agent, puppet_resource('host', 'test1', "target=#{file}", - 'ensure=absent', 'ip=127.0.0.7')) - - step "verify that the content was removed" - on(agent, "cat #{file}; rm -f #{file}") do - fail_test "the content was still present" if stdout.include? line - end - - step "clean up after the test" - on agent, "rm -f #{file}" -end diff --git a/acceptance/tests/resource/host/should_modify_alias.rb b/acceptance/tests/resource/host/should_modify_alias.rb deleted file mode 100755 index df3ceb8ab..000000000 --- a/acceptance/tests/resource/host/should_modify_alias.rb +++ /dev/null @@ -1,21 +0,0 @@ -test_name "should be able to modify a host alias" - -agents.each do |agent| - file = agent.tmpfile('host-modify-alias') - - step "set up files for the test" - on agent, "printf '127.0.0.8 test alias\n' > #{file}" - - step "modify the resource" - on(agent, puppet_resource('host', 'test', "target=#{file}", - 'ensure=present', 'ip=127.0.0.8', 'host_aliases=banzai')) - - step "verify that the content was updated" - on(agent, "cat #{file}; rm -f #{file}") do - fail_test "the alias was not updated" unless - stdout =~ /^127\.0\.0\.8[[:space:]]+test[[:space:]]+banzai[[:space:]]*$/ - end - - step "clean up after the test" - on agent, "rm -f #{file}" -end diff --git a/acceptance/tests/resource/host/should_modify_ip.rb b/acceptance/tests/resource/host/should_modify_ip.rb deleted file mode 100755 index 75eee018b..000000000 --- a/acceptance/tests/resource/host/should_modify_ip.rb +++ /dev/null @@ -1,21 +0,0 @@ -test_name "should be able to modify a host address" - -agents.each do |agent| - file = agent.tmpfile('host-modify-ip') - - step "set up files for the test" - on agent, "printf '127.0.0.9 test alias\n' > #{file}" - - step "modify the resource" - on(agent, puppet_resource('host', 'test', "target=#{file}", - 'ensure=present', 'ip=127.0.0.10', 'host_aliases=alias')) - - step "verify that the content was updated" - on(agent, "cat #{file}; rm -f #{file}") do - fail_test "the address was not updated" unless - stdout =~ /^127\.0\.0\.10[[:space:]]+test[[:space:]]+alias[[:space:]]*$/ - end - - step "clean up after the test" - on agent, "rm -f #{file}" -end diff --git a/acceptance/tests/resource/host/should_not_create_existing.rb b/acceptance/tests/resource/host/should_not_create_existing.rb deleted file mode 100755 index 89a052bfd..000000000 --- a/acceptance/tests/resource/host/should_not_create_existing.rb +++ /dev/null @@ -1,18 +0,0 @@ -test_name "should not create host if it exists" - -agents.each do |agent| - file = agent.tmpfile('host-not-create-existing') - - step "set up the system for the test" - on agent, "printf '127.0.0.2 test alias\n' > #{file}" - - step "tell puppet to ensure the host exists" - on(agent, puppet_resource('host', 'test', "target=#{file}", - 'ensure=present', 'ip=127.0.0.2', 'host_aliases=alias')) do - fail_test "darn, we created the host record" if - stdout.include? '/Host[test1]/ensure: created' - end - - step "clean up after we created things" - on agent, "rm -f #{file}" -end diff --git a/acceptance/tests/resource/host/should_query.rb b/acceptance/tests/resource/host/should_query.rb deleted file mode 100755 index a01889a9a..000000000 --- a/acceptance/tests/resource/host/should_query.rb +++ /dev/null @@ -1,17 +0,0 @@ -test_name "should query hosts out of a hosts file" - -agents.each do |agent| - file = agent.tmpfile('host-query') - - step "set up the system for the test" - on agent, "printf '127.0.0.1 localhost.local localhost\n' > #{file}" - - step "fetch the list of hosts from puppet" - on(agent, puppet_resource('host', 'localhost', "target=#{file}")) do - found = stdout.scan('present').length - fail_test "found #{found} hosts, not 1" if found != 1 - end - - step "clean up the system" - on agent, "rm -f #{file}" -end diff --git a/acceptance/tests/resource/host/should_query_all.rb b/acceptance/tests/resource/host/should_query_all.rb deleted file mode 100755 index 4506fcca7..000000000 --- a/acceptance/tests/resource/host/should_query_all.rb +++ /dev/null @@ -1,28 +0,0 @@ -test_name "should query all hosts from hosts file" - -content = %q{127.0.0.1 test1 test1.local -127.0.0.2 test2 test2.local -127.0.0.3 test3 test3.local -127.0.0.4 test4 test4.local -} - -agents.each do |agent| - backup = agent.tmpfile('host-query-all') - - step "configure the system for testing (including file backups)" - on agent, "cp /etc/hosts #{backup}" - on agent, "cat > /etc/hosts", :stdin => content - - step "query all host records using puppet" - on(agent, puppet_resource('host')) do - found = stdout.scan(/host \{ '([^']+)'/).flatten.sort - fail_test "the list of returned hosts was wrong: #{found.join(', ')}" unless - found == %w{test1 test2 test3 test4} - - count = stdout.scan(/ensure\s+=>\s+'present'/).length - fail_test "found #{count} records, wanted 4" unless count == 4 - end - - step "clean up the system afterwards" - on agent, "cat #{backup} > /etc/hosts && rm -f #{backup}" -end diff --git a/acceptance/tests/resource/host/ticket_4131_should_not_create_without_ip.rb b/acceptance/tests/resource/host/ticket_4131_should_not_create_without_ip.rb deleted file mode 100755 index 4c56ac0d2..000000000 --- a/acceptance/tests/resource/host/ticket_4131_should_not_create_without_ip.rb +++ /dev/null @@ -1,23 +0,0 @@ -test_name "#4131: should not create host without IP attribute" - -agents.each do |agent| - file = agent.tmpfile('4131-require-ip') - - step "configure the target system for the test" - on agent, "rm -rf #{file} ; touch #{file}" - - step "try to create the host, which should fail" - # REVISIT: This step should properly need to handle the non-zero exit code, - # and #5668 has been filed to record that. When it is fixed this test will - # start to fail, and this comment will tell you why. --daniel 2010-12-24 - on(agent, puppet_resource('host', 'test', "target=#{file}", - "host_aliases=alias")) do - fail_test "puppet didn't complain about the missing attribute" unless - stderr.include? 'ip is a required attribute for hosts' - end - - step "verify that the host was not added to the file" - on(agent, "cat #{file} ; rm -f #{file}") do - fail_test "the host was apparently added to the file" if stdout.include? 'test' - end -end diff --git a/acceptance/tests/resource/mailalias/create.rb b/acceptance/tests/resource/mailalias/create.rb deleted file mode 100644 index 718159149..000000000 --- a/acceptance/tests/resource/mailalias/create.rb +++ /dev/null @@ -1,26 +0,0 @@ -test_name "should create an email alias" - -confine :except, :platform => 'windows' - -name = "pl#{rand(999999).to_i}" -agents.each do |agent| - teardown do - #(teardown) restore the alias file - on(agent, "mv /tmp/aliases /etc/aliases", :acceptable_exit_codes => [0,1]) - end - - #------- SETUP -------# - step "(setup) backup alias file" - on(agent, "cp /etc/aliases /tmp/aliases", :acceptable_exit_codes => [0,1]) - - #------- TESTS -------# - step "create a mailalias with puppet" - args = ['ensure=present', - 'recipient="foo,bar,baz"'] - on(agent, puppet_resource('mailalias', name, args)) - - step "verify the alias exists" - on(agent, "cat /etc/aliases") do |res| - assert_match(/#{name}:.*foo,bar,baz/, res.stdout, "mailalias not in aliases file") - end -end diff --git a/acceptance/tests/resource/mailalias/destroy.rb b/acceptance/tests/resource/mailalias/destroy.rb deleted file mode 100644 index 65ac57507..000000000 --- a/acceptance/tests/resource/mailalias/destroy.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "should delete an email alias" - -confine :except, :platform => 'windows' - -name = "pl#{rand(999999).to_i}" -agents.each do |agent| - teardown do - #(teardown) restore the alias file - on(agent, "mv /tmp/aliases /etc/aliases", :acceptable_exit_codes => [0,1]) - end - - #------- SETUP -------# - step "(setup) backup alias file" - on(agent, "cp /etc/aliases /tmp/aliases", :acceptable_exit_codes => [0,1]) - - step "(setup) create a mailalias" - on(agent, "echo '#{name}: foo,bar,baz' >> /etc/aliases") - - step "(setup) verify the alias exists" - on(agent, "cat /etc/aliases") do |res| - assert_match(/#{name}:.*foo,bar,baz/, res.stdout, "mailalias not in aliases file") - end - - #------- TESTS -------# - step "delete the aliases database with puppet" - args = ['ensure=absent', - 'recipient="foo,bar,baz"'] - on(agent, puppet_resource('mailalias', name, args)) - - - step "verify the alias is absent" - on(agent, "cat /etc/aliases") do |res| - assert_no_match(/#{name}:.*foo,bar,baz/, res.stdout, "mailalias was not removed from aliases file") - end -end diff --git a/acceptance/tests/resource/mailalias/modify.rb b/acceptance/tests/resource/mailalias/modify.rb deleted file mode 100644 index 41c52f9db..000000000 --- a/acceptance/tests/resource/mailalias/modify.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "should modify an email alias" - -confine :except, :platform => 'windows' - -name = "pl#{rand(999999).to_i}" -agents.each do |agent| - teardown do - #(teardown) restore the alias file - on(agent, "mv /tmp/aliases /etc/aliases", :acceptable_exit_codes => [0,1]) - end - - #------- SETUP -------# - step "(setup) backup alias file" - on(agent, "cp /etc/aliases /tmp/aliases", :acceptable_exit_codes => [0,1]) - - step "(setup) create a mailalias" - on(agent, "echo '#{name}: foo,bar,baz' >> /etc/aliases") - - step "(setup) verify the alias exists" - on(agent, "cat /etc/aliases") do |res| - assert_match(/#{name}:.*foo,bar,baz/, res.stdout, "mailalias not in aliases file") - end - - #------- TESTS -------# - step "modify the aliases database with puppet" - args = ['ensure=present', - 'recipient="foo,bar,baz,blarvitz"'] - on(agent, puppet_resource('mailalias', name, args)) - - - step "verify the updated alias is present" - on(agent, "cat /etc/aliases") do |res| - assert_match(/#{name}:.*foo,bar,baz,blarvitz/, res.stdout, "updated mailalias not in aliases file") - end -end diff --git a/acceptance/tests/resource/mailalias/query.rb b/acceptance/tests/resource/mailalias/query.rb deleted file mode 100644 index afadc370a..000000000 --- a/acceptance/tests/resource/mailalias/query.rb +++ /dev/null @@ -1,29 +0,0 @@ -test_name "should be able to find an exisitng email alias" - -confine :except, :platform => 'windows' - -name = "pl#{rand(999999).to_i}" -agents.each do |agent| - teardown do - #(teardown) restore the alias file - on(agent, "mv /tmp/aliases /etc/aliases", :acceptable_exit_codes => [0,1]) - end - - #------- SETUP -------# - step "(setup) backup alias file" - on(agent, "cp /etc/aliases /tmp/aliases", :acceptable_exit_codes => [0,1]) - - step "(setup) create a mailalias" - on(agent, "echo '#{name}: foo,bar,baz' >> /etc/aliases") - - step "(setup) verify the alias exists" - on(agent, "cat /etc/aliases") do |res| - assert_match(/#{name}:.*foo,bar,baz/, res.stdout, "mailalias not in aliases file") - end - - #------- TESTS -------# - step "query for the mail alias with puppet" - on(agent, puppet_resource('mailalias', name)) do - fail_test "didn't find the scheduled_task #{name}" unless stdout.include? 'present' - end -end diff --git a/acceptance/tests/resource/package/does_not_exist.rb b/acceptance/tests/resource/package/does_not_exist.rb deleted file mode 100644 index a277dc6e8..000000000 --- a/acceptance/tests/resource/package/does_not_exist.rb +++ /dev/null @@ -1,32 +0,0 @@ -# Redmine (#22529) -test_name "Puppet returns only resource package declaration when querying an uninstalled package" do - - resource_declaration_regex = %r@package \{ 'not-installed-on-this-host': - ensure => '(?:purged|absent)', -\}@m - - package_apply_regex = %r@Notice: Compiled catalog for .* in environment production in \d+\.\d{2} seconds(?:\e\[0m)? -(?:\e\[m)?Notice: Finished catalog run in \d+\.\d{2} seconds@m - - agents.each do |agent| - - step "test puppet resource package" do - on(agent, puppet('resource', 'package', 'not-installed-on-this-host')) do - assert_match(resource_declaration_regex, stdout) - end - end - - end - - # Until #3707 is fixed and purged rpm/yum packages no longer give spurious creation notices - # Also skipping solaris, windows whose providers do not have purgeable implemented. - confine_block(:to, :platform => /debian|ubuntu/) do - agents.each do |agent| - step "test puppet apply" do - on(agent, puppet('apply', '-e', %Q|"package {'not-installed-on-this-host': ensure => purged }"|)) do - assert_match(package_apply_regex, stdout) - end - end - end - end -end diff --git a/acceptance/tests/resource/package/ips/basic_tests.rb b/acceptance/tests/resource/package/ips/basic_tests.rb deleted file mode 100644 index 02e1a4366..000000000 --- a/acceptance/tests/resource/package/ips/basic_tests.rb +++ /dev/null @@ -1,67 +0,0 @@ -test_name "Package:IPS basic tests" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::IPSUtils - -teardown do - step "cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "IPS: clean slate" - clean agent - step "IPS: setup" - setup agent - setup_fakeroot agent - send_pkg agent, :pkg => 'mypkg@0.0.1' - set_publisher agent - step "IPS: basic ensure we are clean" - apply_manifest_on(agent, 'package {mypkg : ensure=>absent}') do - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end - step "IPS: basic - it should create" - apply_manifest_on(agent, 'package {mypkg : ensure=>present}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "IPS: check it was created" - on agent, "puppet resource package mypkg" do - assert_match( /ensure => '0.0.1'/, result.stdout, "err: #{agent}") - end - step "IPS: do not upgrade until latest is mentioned" - send_pkg agent,:pkg => 'mypkg@0.0.2' - apply_manifest_on(agent, 'package {mypkg : ensure=>present}') do - assert_no_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "IPS: verify it was not upgraded" - on agent, "puppet resource package mypkg" do - assert_match( /ensure => '0.0.1'/, result.stdout, "err: #{agent}") - end - step "IPS: ask to be latest" - apply_manifest_on(agent, 'package {mypkg : ensure=>latest}') do - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end - step "IPS: ensure it was upgraded" - on agent, "puppet resource package mypkg" do - assert_match( /ensure => '0.0.2'/, result.stdout, "err: #{agent}") - end - - step "IPS: when there are more than one option, choose latest." - send_pkg agent,:pkg => 'mypkg@0.0.3' - send_pkg agent,:pkg => 'mypkg@0.0.4' - apply_manifest_on(agent, 'package {mypkg : ensure=>latest}') do - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end - on agent, "puppet resource package mypkg" do - assert_match( /ensure => '0.0.4'/, result.stdout, "err: #{agent}") - end - - step "IPS: ensure removed." - apply_manifest_on(agent, 'package {mypkg : ensure=>absent}') do - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/package/ips/should_be_holdable.rb b/acceptance/tests/resource/package/ips/should_be_holdable.rb deleted file mode 100644 index 66f5527eb..000000000 --- a/acceptance/tests/resource/package/ips/should_be_holdable.rb +++ /dev/null @@ -1,81 +0,0 @@ -test_name "Package:IPS versionable" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::IPSUtils - -teardown do - step "cleanup" - agents.each do |agent| - clean agent, :pkg => 'mypkg2' - clean agent, :pkg => 'mypkg' - end -end - - -agents.each do |agent| - step "IPS: setup" - setup agent - setup_fakeroot agent - send_pkg agent, :pkg => 'mypkg@0.0.1' - setup_fakeroot2 agent - send_pkg2 agent, :pkg => 'mypkg2@0.0.1' - set_publisher agent - step "IPS: basic - it should create a specific version and install dependent package" - apply_manifest_on(agent, 'package {mypkg2 : ensure=>"0.0.1"}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - on agent, "pkg list -v mypkg" do - assert_match( /mypkg@0.0.1/, result.stdout, "err: #{agent}") - end - on agent, "pkg list -v mypkg2" do - assert_match( /mypkg2@0.0.1/, result.stdout, "err: #{agent}") - end - - step "IPS: it should upgrade current and dependent package" - setup_fakeroot agent - send_pkg agent, :pkg => 'mypkg@0.0.2' - setup_fakeroot2 agent - send_pkg2 agent, :pkg => 'mypkg2@0.0.2', :pkgdep => 'mypkg@0.0.2' - apply_manifest_on(agent, 'package {mypkg2 : ensure=>"0.0.2"}') do - assert_match( /changed/, result.stdout, "err: #{agent}") - end - on agent, "pkg list -v mypkg" do - assert_match( /mypkg@0.0.2/, result.stdout, "err: #{agent}") - end - on agent, "pkg list -v mypkg2" do - assert_match( /mypkg2@0.0.2/, result.stdout, "err: #{agent}") - end - - step "IPS: it should not upgrade current and dependent package if dependent package is held" - apply_manifest_on(agent, 'package {mypkg : ensure=>"held", provider=>"pkg"}') do - assert_match( //, result.stdout, "err: #{agent}") - end - setup_fakeroot agent - send_pkg agent, :pkg => 'mypkg@0.0.3' - setup_fakeroot2 agent - send_pkg2 agent, :pkg => 'mypkg2@0.0.3', :pkgdep => 'mypkg@0.0.3' - apply_manifest_on(agent, 'package {mypkg2 : ensure=>"0.0.2"}') do - assert_no_match( /changed/, result.stdout, "err: #{agent}") - end - on agent, "pkg list -v mypkg" do - assert_match( /mypkg@0.0.2/, result.stdout, "err: #{agent}") - end - on agent, "pkg list -v mypkg2" do - assert_match( /mypkg2@0.0.2/, result.stdout, "err: #{agent}") - end - - step "IPS: it should upgrade if hold was released." - apply_manifest_on(agent, 'package {mypkg : ensure=>"0.0.3", provider=>"pkg"}') do - assert_match( //, result.stdout, "err: #{agent}") - end - apply_manifest_on(agent, 'package {mypkg2 : ensure=>"0.0.3"}') do - assert_match( /changed/, result.stdout, "err: #{agent}") - end - on agent, "pkg list -v mypkg" do - assert_match( /mypkg@0.0.3/, result.stdout, "err: #{agent}") - end - on agent, "pkg list -v mypkg2" do - assert_match( /mypkg2@0.0.3/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/package/ips/should_be_idempotent.rb b/acceptance/tests/resource/package/ips/should_be_idempotent.rb deleted file mode 100644 index 1f83b1121..000000000 --- a/acceptance/tests/resource/package/ips/should_be_idempotent.rb +++ /dev/null @@ -1,56 +0,0 @@ -test_name "Package:IPS idempotency" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::IPSUtils - -teardown do - step "cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "IPS: setup" - setup agent - setup_fakeroot agent - send_pkg agent, :pkg => 'mypkg@0.0.1' - set_publisher agent - step "IPS: it should create" - apply_manifest_on(agent, 'package {mypkg : ensure=>present}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "IPS: should be idempotent (present)" - apply_manifest_on(agent, 'package {mypkg : ensure=>present}') do - assert_no_match( /created/, result.stdout, "err: #{agent}") - assert_no_match( /changed/, result.stdout, "err: #{agent}") - end - send_pkg agent, :pkg => 'mypkg@0.0.2' - step "IPS: ask for latest version" - apply_manifest_on(agent, 'package {mypkg : ensure=>latest}') do - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end - step "IPS: should be idempotent (latest)" - apply_manifest_on(agent, 'package {mypkg : ensure=>latest}') do - assert_no_match( /created/, result.stdout, "err: #{agent}") - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end - - step "IPS: ask for specific version" - send_pkg agent,:pkg => 'mypkg@0.0.3' - apply_manifest_on(agent, 'package {mypkg : ensure=>"0.0.3"}') do - assert_match( /changed/, result.stdout, "err: #{agent}") - end - step "IPS: should be idempotent (version)" - apply_manifest_on(agent, 'package {mypkg : ensure=>"0.0.3"}') do - assert_no_match( /created/, result.stdout, "err: #{agent}") - assert_no_match( /changed/, result.stdout, "err: #{agent}") - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end - step "IPS: ensure removed." - apply_manifest_on(agent, 'package {mypkg : ensure=>absent}') do - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/package/ips/should_be_updatable.rb b/acceptance/tests/resource/package/ips/should_be_updatable.rb deleted file mode 100644 index 40059668d..000000000 --- a/acceptance/tests/resource/package/ips/should_be_updatable.rb +++ /dev/null @@ -1,45 +0,0 @@ -test_name "Package:IPS test for updatable (update, latest)" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::IPSUtils - -teardown do - step "cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "IPS: setup" - setup agent - setup_fakeroot agent - send_pkg agent, :pkg => 'mypkg@0.0.1' - set_publisher agent - step "IPS: basic - it should create" - apply_manifest_on(agent, 'package {mypkg : ensure=>present}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - step "IPS: ask to be latest" - send_pkg agent, :pkg => 'mypkg@0.0.2' - apply_manifest_on(agent, 'package {mypkg : ensure=>latest}') do - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end - step "IPS: ensure it was upgraded" - on agent, "pkg list -v mypkg" do - assert_match( /mypkg@0.0.2/, result.stdout, "err: #{agent}") - end - - step "IPS: when there are more than one option, choose latest." - send_pkg agent,:pkg => 'mypkg@0.0.3' - send_pkg agent,:pkg => 'mypkg@0.0.4' - apply_manifest_on(agent, 'package {mypkg : ensure=>latest}') do - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end - on agent, "pkg list -v mypkg" do - assert_match( /mypkg@0.0.4/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/package/ips/should_be_versionable.rb b/acceptance/tests/resource/package/ips/should_be_versionable.rb deleted file mode 100644 index 207638a4a..000000000 --- a/acceptance/tests/resource/package/ips/should_be_versionable.rb +++ /dev/null @@ -1,46 +0,0 @@ -test_name "Package:IPS versionable" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::IPSUtils - -teardown do - step "cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "IPS: setup" - setup agent - setup_fakeroot agent - send_pkg agent, :pkg => 'mypkg@0.0.1' - send_pkg agent, :pkg => 'mypkg@0.0.2' - set_publisher agent - step "IPS: basic - it should create a specific version" - apply_manifest_on(agent, 'package {mypkg : ensure=>"0.0.1"}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - on agent, "pkg list mypkg" do - assert_match( /0.0.1/, result.stdout, "err: #{agent}") - end - - step "IPS: it should upgrade if asked for next version" - apply_manifest_on(agent, 'package {mypkg : ensure=>"0.0.2"}') do - assert_match( /ensure changed/, result.stdout, "err: #{agent}") - end - on agent, "pkg list mypkg" do - assert_no_match( /0.0.1/, result.stdout, "err: #{agent}") - assert_match( /0.0.2/, result.stdout, "err: #{agent}") - end - step "IPS: it should downpgrade if asked for previous version" - apply_manifest_on(agent, 'package {mypkg : ensure=>"0.0.1"}') do - assert_match( /ensure changed/, result.stdout, "err: #{agent}") - end - on agent, "pkg list mypkg" do - assert_no_match( /0.0.2/, result.stdout, "err: #{agent}") - assert_match( /0.0.1/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/package/ips/should_create.rb b/acceptance/tests/resource/package/ips/should_create.rb deleted file mode 100644 index 34c083d60..000000000 --- a/acceptance/tests/resource/package/ips/should_create.rb +++ /dev/null @@ -1,34 +0,0 @@ -test_name "Package:IPS basic tests" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::IPSUtils - -teardown do - step "cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "IPS: clean slate" - clean agent - step "IPS: setup" - setup agent - setup_fakeroot agent - send_pkg agent, :pkg => 'mypkg@0.0.1' - set_publisher agent - step "IPS: basic - it should create" - apply_manifest_on(agent, 'package {mypkg : ensure=>present}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "IPS: check it was created" - on agent, "puppet resource package mypkg" do - assert_match( /ensure => '0.0.1'/, result.stdout, "err: #{agent}") - end - on agent, "pkg list -v mypkg" do - assert_match( /mypkg@0.0.1/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/package/ips/should_query.rb b/acceptance/tests/resource/package/ips/should_query.rb deleted file mode 100644 index b14e844d1..000000000 --- a/acceptance/tests/resource/package/ips/should_query.rb +++ /dev/null @@ -1,33 +0,0 @@ -test_name "Package:IPS query" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::IPSUtils - -teardown do - step "cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "IPS: setup" - setup agent - setup_fakeroot agent - send_pkg agent, :pkg => 'mypkg@0.0.1' - set_publisher agent - step "IPS: basic - it should create" - apply_manifest_on(agent, 'package {mypkg : ensure=>"present"}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - on agent, "puppet resource package mypkg" do - assert_match( /0.0.1/, result.stdout, "err: #{agent}") - end - - on agent, "puppet resource package" do - assert_match( /0.0.1/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/package/ips/should_remove.rb b/acceptance/tests/resource/package/ips/should_remove.rb deleted file mode 100644 index 139793667..000000000 --- a/acceptance/tests/resource/package/ips/should_remove.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "Package:IPS basic tests" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::IPSUtils - -teardown do - step "cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "IPS: setup" - setup agent - setup_fakeroot agent - send_pkg agent, :pkg => 'mypkg@0.0.1' - set_publisher agent - on agent, "pkg install mypkg" - on agent, "pkg list -v mypkg" do - assert_match( /mypkg@0.0.1/, result.stdout, "err: #{agent}") - end - - step "IPS: ensure removed." - apply_manifest_on(agent, 'package {mypkg : ensure=>absent}') do - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end - - on(agent, "pkg list -v mypkg", :acceptable_exit_codes => [1]) do - assert_no_match( /mypkg@0.0.1/, result.stdout, "err: #{agent}") - end - -end diff --git a/acceptance/tests/resource/scheduled_task/should_create.rb b/acceptance/tests/resource/scheduled_task/should_create.rb deleted file mode 100644 index 507273964..000000000 --- a/acceptance/tests/resource/scheduled_task/should_create.rb +++ /dev/null @@ -1,33 +0,0 @@ -test_name "should create a scheduled task" - -name = "pl#{rand(999999).to_i}" -confine :to, :platform => 'windows' - -agents.each do |agent| - # query only supports /tn parameter on Vista and later - query_cmd = "schtasks.exe /query /v /fo list /tn #{name}" - on agents, facter('kernelmajversion') do - query_cmd = "schtasks.exe /query /v /fo list | grep -q #{name}" if stdout.chomp.to_f < 6.0 - end - - step "create the task" - args = ['ensure=present', - 'command=c:\\\\windows\\\\system32\\\\notepad.exe', - 'arguments="foo bar baz"', - 'working_dir=c:\\\\windows'] - on agent, puppet_resource('scheduled_task', name, args) - - step "verify the task exists" - on agent, query_cmd - - step "verify task properties" - on agent, puppet_resource('scheduled_task', name) do - assert_match(/command\s*=>\s*'c:\\windows\\system32\\notepad.exe'/, stdout) - assert_match(/arguments\s*=>\s*'foo bar baz'/, stdout) - assert_match(/enabled\s*=>\s*'true'/, stdout) - assert_match(/working_dir\s*=>\s*'c:\\windows'/, stdout) - end - - step "delete the task" - on agent, "schtasks.exe /delete /tn #{name} /f" -end diff --git a/acceptance/tests/resource/scheduled_task/should_destroy.rb b/acceptance/tests/resource/scheduled_task/should_destroy.rb deleted file mode 100644 index 8fdbb959c..000000000 --- a/acceptance/tests/resource/scheduled_task/should_destroy.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "should delete a scheduled task" - -name = "pl#{rand(999999).to_i}" -confine :to, :platform => 'windows' - -agents.each do |agent| - # Have to use /v1 parameter for Vista and later, older versions - # don't accept the parameter - version = '/v1' - # query only supports /tn parameter on Vista and later - query_cmd = "schtasks.exe /query /v /fo list /tn #{name}" - on agent, facter('kernelmajversion') do - if stdout.chomp.to_f < 6.0 - version = '' - query_cmd = "schtasks.exe /query /v /fo list | grep #{name}" - end - end - - step "create the task" - on agent, "schtasks.exe /create #{version} /tn #{name} /tr c:\\\\windows\\\\system32\\\\notepad.exe /sc daily /ru system" - - step "delete the task" - on agent, puppet_resource('scheduled_task', name, 'ensure=absent') - - step "verify the task was deleted" - Timeout.timeout(5) do - loop do - step "Win32::TaskScheduler#delete call seems to be asynchronous, so we my need to test multiple times" - on agent, query_cmd, :acceptable_exit_codes => [0,1] - break if exit_code == 1 - sleep 1 - end - end - fail_test "Unable to verify that scheduled task was removed" unless exit_code == 1 -end diff --git a/acceptance/tests/resource/scheduled_task/should_modify.rb b/acceptance/tests/resource/scheduled_task/should_modify.rb deleted file mode 100644 index 35d9d3ef7..000000000 --- a/acceptance/tests/resource/scheduled_task/should_modify.rb +++ /dev/null @@ -1,28 +0,0 @@ -test_name "should modify a scheduled task" - -name = "pl#{rand(999999).to_i}" -confine :to, :platform => 'windows' - -agents.each do |agent| - # Have to use /v1 parameter for Vista and later, older versions - # don't accept the parameter - version = '/v1' - on agents, facter('kernelmajversion') do - version = '' if stdout.chomp.to_f < 6.0 - end - - step "create the task" - on agent, "schtasks.exe /create #{version} /tn #{name} /tr c:\\\\windows\\\\system32\\\\notepad.exe /sc daily /ru system" - - step "modify the task" - on agent, puppet_resource('scheduled_task', name, ['ensure=present', 'command=c:\\\\windows\\\\system32\\\\notepad2.exe', "arguments=args-#{name}"]) - - step "verify the arguments were updated" - on agent, puppet_resource('scheduled_task', name) do - assert_match(/command\s*=>\s*'c:\\windows\\system32\\notepad2.exe'/, stdout) - assert_match(/arguments\s*=>\s*'args-#{name}'/, stdout) - end - - step "delete the task" - on agent, "schtasks.exe /delete /tn #{name} /f" -end diff --git a/acceptance/tests/resource/scheduled_task/should_query.rb b/acceptance/tests/resource/scheduled_task/should_query.rb deleted file mode 100644 index 2b9250395..000000000 --- a/acceptance/tests/resource/scheduled_task/should_query.rb +++ /dev/null @@ -1,22 +0,0 @@ -test_name "test that we can query and find a scheduled task that exists." - -name = "pl#{rand(999999).to_i}" -confine :to, :platform => 'windows' - -agents.each do |agent| - # Have to use /v1 parameter for Vista and later, older versions - # don't accept the parameter - kernel_maj_version = on(agent, facter('kernelmajversion')).stdout.chomp.to_f - version = kernel_maj_version < 6.0 ? '' : '/v1' - - step "create the task" - on agent, "schtasks.exe /create #{version} /tn #{name} /tr c:\\\\windows\\\\system32\\\\notepad.exe /sc daily /ru system" - - step "query for the task and verify it was found" - on agent, puppet_resource('scheduled_task', name) do - fail_test "didn't find the scheduled_task #{name}" unless stdout.include? 'present' - end - - step "delete the task" - on agent, "schtasks.exe /delete /tn #{name} /f" -end diff --git a/acceptance/tests/resource/service/AIX_service_provider.rb b/acceptance/tests/resource/service/AIX_service_provider.rb deleted file mode 100644 index 403a87654..000000000 --- a/acceptance/tests/resource/service/AIX_service_provider.rb +++ /dev/null @@ -1,103 +0,0 @@ -test_name 'AIX Service Provider Testing' - -confine :to, :platform => 'aix' - -sloth_daemon_script = <<SCRIPT -#!/usr/bin/env sh -while true; do sleep 1; done -SCRIPT - -def assert_service_enable(host, service, expected_status) - case expected_status - when "true" - expected_output = service - when "false" - expected_output = '' - else - raise "This test doesn't know what to do with an expected enable status of #{expected_status}" - end - - on host, "lsitab #{service} | cut -f 1 -d :" do - actual_output = stdout.chomp - assert_equal(expected_output, actual_output, - "Service doesn't actually have enabled = #{expected_status}") - end -end - -def assert_service_status(host, service, expected_status) - case expected_status - when "running" - expected_output = 'active' - when "stopped" - expected_output = 'inoperative' - else - raise "This test doesn't know what to do with an expected status of #{expected_status}" - end - - # sometimes there's no group or PID which messes up the condense to a single - # delimiter - on host, "lssrc -s #{service} | tr -s ' ' ':' | tail -1 | cut -f 3- -d :" do - actual_output = stdout.chomp - assert_match(/#{expected_output}\Z/, actual_output, - "Service is not actually #{expected_status}") - end -end - -def ensure_service_on_host(host, service, property, value) - manifest =<<MANIFEST -service { '#{service}': - #{property} => '#{value}' -} -MANIFEST - # the process of creating the service will also start it - # to avoid a flickering test from the race condition, this test will ensure - # that the exit code is either - # 2 => something changed, or - # 0 => no change needed - on host, puppet_apply(['--detailed-exitcodes', '--verbose']), - {:stdin => manifest, :acceptable_exit_codes => [0, 2]} - # ensure idempotency - on host, puppet_apply(['--detailed-exitcodes', '--verbose']), - {:stdin => manifest, :acceptable_exit_codes => [0]} -end - -agents.each do |agent| - - ## Setup - step "Setup on #{agent}" - sloth_daemon_path = agent.tmpfile("sloth_daemon.sh") - create_remote_file(agent, sloth_daemon_path, sloth_daemon_script) - on agent, "chmod +x #{sloth_daemon_path}" - on agent, "mkssys -s sloth_daemon -p #{sloth_daemon_path} -u 0 -S -n 15 -f 9" - - teardown do - on agent, "rmssys -s sloth_daemon" - on agent, "rm #{sloth_daemon_path}" - end - - ## Query - step "Verify the service exists on #{agent}" - on(agent, puppet_resource('service', 'sloth_daemon')) do - assert_match(/sloth_daemon/, stdout, "Couldn't find service sloth_daemon") - end - - ## Start the service - step "Start the service on #{agent}" - ensure_service_on_host agent, 'sloth_daemon', 'ensure', 'running' - assert_service_status agent, 'sloth_daemon', 'running' - - ## Stop the service - step "Stop the service on #{agent}" - ensure_service_on_host agent, 'sloth_daemon', 'ensure', 'stopped' - assert_service_status agent, 'sloth_daemon', 'stopped' - - ## Enable the service - step "Enable the service on #{agent}" - ensure_service_on_host agent, 'sloth_daemon', 'enable', 'true' - assert_service_enable agent, 'sloth_daemon', 'true' - - ## Disable the service - step "Disable the service on #{agent}" - ensure_service_on_host agent, 'sloth_daemon', 'enable', 'false' - assert_service_enable agent, 'sloth_daemon', 'false' -end diff --git a/acceptance/tests/resource/service/should_not_change_the_system.rb b/acceptance/tests/resource/service/should_not_change_the_system.rb deleted file mode 100644 index 579a5ee0b..000000000 --- a/acceptance/tests/resource/service/should_not_change_the_system.rb +++ /dev/null @@ -1,24 +0,0 @@ -test_name "`puppet resource service` should list running services without changing the system" - -confine :except, :platform => 'windows' -confine :except, :platform => 'solaris' - - -hosts.each do |host| - step "list running services and make sure ssh reports running" - - on host, 'puppet resource service' - assert_match /service { 'ssh[^']*':\n\s*ensure\s*=>\s*'(?:true|running)'/, stdout, "ssh is not running" - expected_output = stdout - - step "make sure nothing on the system was changed and ssh is still running" - - on host, 'puppet resource service' - - # It's possible that `puppet resource service` changed the system before - # printing output the *first* time, so in addition to comparing the output, - # we also want to check that a known service is in a good state. We use ssh - # because our tests run over ssh, so it must be present. - assert_match /service { 'ssh[^']*':\n\s*ensure\s*=>\s*'(?:true|running)'/, stdout, "ssh is no longer running" - assert_equal expected_output, stdout, "`puppet resource service` changed the state of the system" -end diff --git a/acceptance/tests/resource/service/smf_basic_tests.rb b/acceptance/tests/resource/service/smf_basic_tests.rb deleted file mode 100644 index 0eda50c04..000000000 --- a/acceptance/tests/resource/service/smf_basic_tests.rb +++ /dev/null @@ -1,40 +0,0 @@ -test_name "SMF: basic tests" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::SMFUtils - -teardown do - step "SMF: cleanup" - agents.each do |agent| - clean agent, :service => 'tstapp' - end -end - - -agents.each do |agent| - clean agent, :service => 'tstapp' - manifest, method = setup agent, :service => 'tstapp' - step "SMF: clean slate" - apply_manifest_on(agent, 'service {tstapp : ensure=>stopped}') do - assert_match( /.*/, result.stdout, "err: #{agent}") - end - - step "SMF: ensure it is created with a manifest" - apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do - assert_match( / ensure changed 'stopped'.* to 'running'/, result.stdout, "err: #{agent}") - end - step "SMF: verify it with puppet" - on agent, "puppet resource service tstapp" do - assert_match( /ensure => 'running'/, result.stdout, "err: #{agent}") - end - - step "SMF: verify with svcs that the service is online" - on agent, "svcs -l application/tstapp" do - assert_match( /state\s+online/, result.stdout, "err: #{agent}") - end - step "SMF: stop the service" - apply_manifest_on(agent, 'service {tstapp : ensure=>stopped}') do - assert_match( /changed 'running'.* to 'stopped'/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/service/smf_should_be_idempotent.rb b/acceptance/tests/resource/service/smf_should_be_idempotent.rb deleted file mode 100644 index c86ec248f..000000000 --- a/acceptance/tests/resource/service/smf_should_be_idempotent.rb +++ /dev/null @@ -1,33 +0,0 @@ -test_name "SMF: should be idempotent" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::SMFUtils - -teardown do - step "SMF: cleanup" - agents.each do |agent| - clean agent, :service => 'tstapp' - end -end - - -agents.each do |agent| - clean agent, :service => 'tstapp' - manifest, method = setup agent, :service => 'tstapp' - - step "SMF: ensre it is created with a manifest" - apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do - assert_match( / ensure changed 'stopped'.* to 'running'/, result.stdout, "err: #{agent}") - end - - step "SMF: verify with svcs that the service is online" - on agent, "svcs -l application/tstapp" do - assert_match( /state\s+online/, result.stdout, "err: #{agent}") - end - - step "SMF: ensre it is not created again" - apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do - assert_no_match( /changed/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/service/smf_should_create.rb b/acceptance/tests/resource/service/smf_should_create.rb deleted file mode 100644 index 33cdeba64..000000000 --- a/acceptance/tests/resource/service/smf_should_create.rb +++ /dev/null @@ -1,26 +0,0 @@ -test_name "SMF: should create a service given a manifest" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::SMFUtils - -teardown do - step "SMF: cleanup" - agents.each do |agent| - clean agent, :service => 'tstapp' - end -end - - -agents.each do |agent| - manifest, method = setup agent, :service => 'tstapp' - step "SMF: ensure it is created with a manifest" - apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do - assert_match( / ensure changed 'stopped'.* to 'running'/, result.stdout, "err: #{agent}") - end - - step "SMF: verify with svcs that the service is online" - on agent, "svcs -l application/tstapp" do - assert_match( /state\s+online/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/service/smf_should_query.rb b/acceptance/tests/resource/service/smf_should_query.rb deleted file mode 100644 index 3da796ac9..000000000 --- a/acceptance/tests/resource/service/smf_should_query.rb +++ /dev/null @@ -1,29 +0,0 @@ -test_name "SMF: should query instances" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::SMFUtils - -teardown do - step "SMF: cleanup" - agents.each do |agent| - clean agent, :service => 'tstapp' - end -end - - -agents.each do |agent| - manifest, method = setup agent, :service => 'tstapp' - step "SMF: ensre it is created with a manifest" - apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do - assert_match( / ensure changed 'stopped'.* to 'running'/, result.stdout, "err: #{agent}") - end - step "SMF: query the resource" - on agent, "puppet resource service tstapp" do - assert_match( /ensure => 'running'/, result.stdout, "err: #{agent}") - end - step "SMF: query all the instances" - on agent, "puppet resource service" do - assert_match( /tstapp/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/service/smf_should_stop.rb b/acceptance/tests/resource/service/smf_should_stop.rb deleted file mode 100644 index 9f4ee0cfc..000000000 --- a/acceptance/tests/resource/service/smf_should_stop.rb +++ /dev/null @@ -1,31 +0,0 @@ -test_name "SMF: should stop a given service" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::SMFUtils - -teardown do - step "SMF: cleanup" - agents.each do |agent| - clean agent, :service => 'tstapp' - end -end - - -agents.each do |agent| - manifest, method = setup agent, :service => 'tstapp' - step "SMF: ensre it is created with a manifest" - apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do - assert_match( / ensure changed 'stopped'.* to 'running'/, result.stdout, "err: #{agent}") - end - - step "SMF: stop the service" - apply_manifest_on(agent, 'service {tstapp : ensure=>stopped}') do - assert_match( /changed 'running'.* to 'stopped'/, result.stdout, "err: #{agent}") - end - - step "SMF: verify with svcs that the service is not online" - on agent, "svcs -l application/tstapp", :acceptable_exit_codes => [0,1] do - assert_no_match( /state\s+online/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/service/ticket_14297_handle_upstart.rb b/acceptance/tests/resource/service/ticket_14297_handle_upstart.rb deleted file mode 100644 index 966705583..000000000 --- a/acceptance/tests/resource/service/ticket_14297_handle_upstart.rb +++ /dev/null @@ -1,52 +0,0 @@ -test_name 'Upstart Testing' - -# only run these on ubuntu vms -confine :to, :platform => 'ubuntu' - -# pick any ubuntu agent -agent = agents.first - -def check_service_for(pkg, type, agent) - if pkg == "apache2" - if type == "stop" - on agent, "service #{pkg} status", :acceptable_exit_codes => [1,2,3] - else - on agent, "service #{pkg} status", :acceptable_exit_codes => [0] - end - else - on agent, "service #{pkg} status | grep #{type} -q" - end -end - -begin -# in Precise these packages provide a mix of upstart with no linked init -# script (tty2), upstart linked to an init script (rsyslog), and no upstart -# script - only an init script (apache2) - %w(tty2 rsyslog apache2).each do |pkg| - on agent, puppet_resource("package #{pkg} ensure=present") - - step "Ensure #{pkg} has started" - on agent, "service #{pkg} start", :acceptable_exit_codes => [0,1] - - step "Check that status for running #{pkg}" - check_service_for(pkg, "start", agent) - - step "Stop #{pkg} with `puppet resource'" - on agent, puppet_resource("service #{pkg} ensure=stopped") - - step "Check that status for stopped #{pkg}" - check_service_for(pkg, "stop", agent) - - step "Start #{pkg} with `puppet resource'" - on agent, puppet_resource("service #{pkg} ensure=running") - - step "Check that status for started #{pkg}" - check_service_for(pkg, "start", agent) - end - - on agent, puppet_resource("service") do - assert_match(/service \{ 'ssh':\n.* ensure => 'running',/, stdout, "SSH isn't running, something is wrong with upstart.") - end -ensure - on agent, puppet_resource("package apache2 ensure=absent") -end diff --git a/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb b/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb deleted file mode 100755 index bf556d6c6..000000000 --- a/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb +++ /dev/null @@ -1,12 +0,0 @@ -test_name "#4123: should list all running services on Redhat/CentOS" -step "Validate services running agreement ralsh vs. OS service count" -# This will remotely exec: -# ticket_4123_should_list_all_running_redhat.sh - -hosts.each do |host| - if host['platform'] =~ /el-5/ - run_script_on(host, File.join(File.dirname(__FILE__), 'ticket_4123_should_list_all_running_redhat.sh')) - else - skip_test "Test not supported on this plaform" - end -end diff --git a/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.sh b/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.sh deleted file mode 100755 index d8576667a..000000000 --- a/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# A platform must be specified the only command line arg -# This will facilitate expansion of this tests to include -# the ability to test other OSes - -RALSH_FILE=/tmp/ralsh-running-list-$$ -SERVICE_FILE=/tmp/service-running-list-$$ - -puppet resource service | egrep -B1 "ensure.*=>.*'running" | grep 'service {' | gawk -F"'" '{print $2}' | sort > $RALSH_FILE - -if [ -e $SERVICE_FILE ]; then - rm $SERVICE_FILE -fi - -SERVICEDIR='/etc/init.d' -for SERVICE in $( ls $SERVICEDIR | sort | egrep -v "(functions|halt|killall|single|linuxconf)" ) ; do - if env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" status; then - echo $SERVICE >> $SERVICE_FILE - fi -done - -if diff $RALSH_FILE $SERVICE_FILE ; then - echo "Ralsh and system service count agree" - exit 0 -else - echo "Ralsh and system service count NOT in agreement" - exit 1 -fi diff --git a/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.rb b/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.rb deleted file mode 100755 index 750f142be..000000000 --- a/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.rb +++ /dev/null @@ -1,12 +0,0 @@ -test_name "#4124: should list all disabled services on Redhat/CentOS" -step "Validate disabled services agreement ralsh vs. OS service count" -# This will remotely exec: -# ticket_4124_should_list_all_disabled.sh - -hosts.each do |host| - if host['platform'] =~ /el-5/ - run_script_on(host, File.join(File.dirname(__FILE__), 'ticket_4124_should_list_all_disabled.sh')) - else - skip_test "Test not supported on this plaform" - end -end diff --git a/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.sh b/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.sh deleted file mode 100755 index 7e884aff2..000000000 --- a/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# A platform must be specified the only command line arg -# This will facilitate expansion of this tests to include -# the ability to test other OSes - -RALSH_FILE=/tmp/ralsh-disabled-list-$$ -SERVICE_FILE=/tmp/service-disabled-list-$$ - -puppet resource service | egrep -B2 "enable.*=>.*'false" | grep "service {" | awk -F"'" '{print $2}' | sort > $RALSH_FILE - -if [ -e $SERVICE_FILE ]; then - rm $SERVICE_FILE -fi - -SERVICEDIR='/etc/init.d' -for SERVICE in $( ls $SERVICEDIR | sort | egrep -v "(functions|halt|killall|single|linuxconf)" ) ; do - if ! chkconfig $SERVICE; then - echo $SERVICE >> $SERVICE_FILE - fi -done - -if diff $RALSH_FILE $SERVICE_FILE ; then - echo "Ralsh and system service count agree" - exit 0 -else - echo "Ralsh and system service count NOT in agreement" - exit 1 -fi diff --git a/acceptance/tests/resource/ssh_authorized_key/create.rb b/acceptance/tests/resource/ssh_authorized_key/create.rb deleted file mode 100644 index c775f5e44..000000000 --- a/acceptance/tests/resource/ssh_authorized_key/create.rb +++ /dev/null @@ -1,32 +0,0 @@ -test_name "should create an entry for an SSH authorized key" - -confine :except, :platform => ['windows'] - -auth_keys = '~/.ssh/authorized_keys' -name = "pl#{rand(999999).to_i}" - -agents.each do |agent| - teardown do - #(teardown) restore the #{auth_keys} file - on(agent, "mv /tmp/auth_keys #{auth_keys}", :acceptable_exit_codes => [0,1]) - end - - #------- SETUP -------# - step "(setup) backup #{auth_keys} file" - on(agent, "cp #{auth_keys} /tmp/auth_keys", :acceptable_exit_codes => [0,1]) - - #------- TESTS -------# - step "create an authorized key entry with puppet (present)" - args = ['ensure=present', - "user='root'", - "type='rsa'", - "key='mykey'", - ] - on(agent, puppet_resource('ssh_authorized_key', "#{name}", args)) - - step "verify entry in #{auth_keys}" - on(agent, "cat #{auth_keys}") do |res| - fail_test "didn't find the ssh_authorized_key for #{name}" unless stdout.include? "#{name}" - end - -end diff --git a/acceptance/tests/resource/ssh_authorized_key/destroy.rb b/acceptance/tests/resource/ssh_authorized_key/destroy.rb deleted file mode 100644 index a402a2fe7..000000000 --- a/acceptance/tests/resource/ssh_authorized_key/destroy.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "should delete an entry for an SSH authorized key" - -confine :except, :platform => ['windows'] - -auth_keys = '~/.ssh/authorized_keys' -name = "pl#{rand(999999).to_i}" - -agents.each do |agent| - teardown do - #(teardown) restore the #{auth_keys} file - on(agent, "mv /tmp/auth_keys #{auth_keys}", :acceptable_exit_codes => [0,1]) - end - - #------- SETUP -------# - step "(setup) backup #{auth_keys} file" - on(agent, "cp #{auth_keys} /tmp/auth_keys", :acceptable_exit_codes => [0,1]) - - step "(setup) create an authorized key in the #{auth_keys} file" - on(agent, "echo 'ssh-rsa mykey #{name}' >> #{auth_keys}") - - #------- TESTS -------# - step "delete an authorized key entry with puppet (absent)" - args = ['ensure=absent', - "user='root'", - "type='rsa'", - "key='mykey'", - ] - on(agent, puppet_resource('ssh_authorized_key', "#{name}", args)) - - step "verify entry deleted from #{auth_keys}" - on(agent, "cat #{auth_keys}") do |res| - fail_test "found the ssh_authorized_key for #{name}" if stdout.include? "#{name}" - end - -end diff --git a/acceptance/tests/resource/ssh_authorized_key/modify.rb b/acceptance/tests/resource/ssh_authorized_key/modify.rb deleted file mode 100644 index 2a87761c8..000000000 --- a/acceptance/tests/resource/ssh_authorized_key/modify.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "should update an entry for an SSH authorized key" - -confine :except, :platform => ['windows'] - -auth_keys = '~/.ssh/authorized_keys' -name = "pl#{rand(999999).to_i}" - -agents.each do |agent| - teardown do - #(teardown) restore the #{auth_keys} file - on(agent, "mv /tmp/auth_keys #{auth_keys}", :acceptable_exit_codes => [0,1]) - end - - #------- SETUP -------# - step "(setup) backup #{auth_keys} file" - on(agent, "cp #{auth_keys} /tmp/auth_keys", :acceptable_exit_codes => [0,1]) - - step "(setup) create an authorized key in the #{auth_keys} file" - on(agent, "echo 'ssh-rsa mykey #{name}' >> #{auth_keys}") - - #------- TESTS -------# - step "update an authorized key entry with puppet (present)" - args = ['ensure=present', - "user='root'", - "type='rsa'", - "key='mynewshinykey'", - ] - on(agent, puppet_resource('ssh_authorized_key', "#{name}", args)) - - step "verify entry updated in #{auth_keys}" - on(agent, "cat #{auth_keys}") do |res| - fail_test "didn't find the updated key for #{name}" unless stdout.include? "mynewshinykey #{name}" - end - -end diff --git a/acceptance/tests/resource/ssh_authorized_key/query.rb b/acceptance/tests/resource/ssh_authorized_key/query.rb deleted file mode 100644 index 83bf22cc1..000000000 --- a/acceptance/tests/resource/ssh_authorized_key/query.rb +++ /dev/null @@ -1,29 +0,0 @@ -test_name "should be able to find an existing SSH authorized key" - -skip_test("This test is blocked by PUP-1605") - -confine :except, :platform => ['windows'] - -auth_keys = '~/.ssh/authorized_keys' -name = "pl#{rand(999999).to_i}" - -agents.each do |agent| - teardown do - #(teardown) restore the #{auth_keys} file - on(agent, "mv /tmp/auth_keys #{auth_keys}", :acceptable_exit_codes => [0,1]) - end - - #------- SETUP -------# - step "(setup) backup #{auth_keys} file" - on(agent, "cp #{auth_keys} /tmp/auth_keys", :acceptable_exit_codes => [0,1]) - - step "(setup) create an authorized key in the #{auth_keys} file" - on(agent, "echo 'ssh-rsa mykey #{name}' >> #{auth_keys}") - - #------- TESTS -------# - step "verify SSH authorized key query with puppet" - on(agent, puppet_resource('ssh_authorized_key', "/#{name}")) do |res| - fail_test "found the ssh_authorized_key for #{name}" unless stdout.include? "#{name}" - end - -end diff --git a/acceptance/tests/resource/tidy/should_remove_old_files.rb b/acceptance/tests/resource/tidy/should_remove_old_files.rb deleted file mode 100644 index cb1430ff1..000000000 --- a/acceptance/tests/resource/tidy/should_remove_old_files.rb +++ /dev/null @@ -1,37 +0,0 @@ -test_name "Tidying files by date" - -agents.each do |agent| - step "Create a directory of old and new files" - dir = agent.tmpdir('tidy-test') - on agent, "mkdir -p #{dir}" - - # YYMMddhhmm, so 03:04 Jan 2 1970 - old = %w[one two three four five] - new = %w[a b c d e] - - on agent, "touch -t 7001020304 #{dir}/{#{old.join(',')}}" - on agent, "touch #{dir}/{#{new.join(',')}}" - - step "Run a tidy resource to remove the old files" - -manifest = <<-MANIFEST - tidy { "#{dir}": - age => '1d', - recurse => true, - } -MANIFEST - - apply_manifest_on agent, manifest - - step "Ensure the old files are gone" - - old_test = old.map {|name| "-f #{File.join(dir, name)}"}.join(' -o ') - - on agent, "[ #{old_test} ]", :acceptable_exit_codes => [1] - - step "Ensure the new files are still present" - - new_test = new.map {|name| "-f #{File.join(dir, name)}"}.join(' -a ') - - on agent, "[ #{new_test} ]" -end diff --git a/acceptance/tests/resource/user/should_create.rb b/acceptance/tests/resource/user/should_create.rb deleted file mode 100755 index 4889c062f..000000000 --- a/acceptance/tests/resource/user/should_create.rb +++ /dev/null @@ -1,26 +0,0 @@ -test_name "should create a user" - -name = "pl#{rand(999999).to_i}" - -agents.each do |agent| - step "ensure the user and group do not exist" - agent.user_absent(name) - agent.group_absent(name) - - step "create the user" - on agent, puppet_resource('user', name, 'ensure=present') - - step "verify the user exists" - agent.user_get(name) - - case agent['platform'] - when /sles/, /solaris/, /windows/ - # no private user groups by default - else - agent.group_get(name) - end - - step "delete the user, and group, if any" - agent.user_absent(name) - agent.group_absent(name) -end diff --git a/acceptance/tests/resource/user/should_create_with_gid.rb b/acceptance/tests/resource/user/should_create_with_gid.rb deleted file mode 100755 index 1cafe8f74..000000000 --- a/acceptance/tests/resource/user/should_create_with_gid.rb +++ /dev/null @@ -1,31 +0,0 @@ -test_name "verifies that puppet resource creates a user and assigns the correct group" -confine :except, :platform => 'windows' - -user = "pl#{rand(999999).to_i}" -group = "gp#{rand(999999).to_i}" - -agents.each do |host| - step "user should not exist" - on host, "if getent passwd #{user}; then userdel #{user}; fi" - - step "group should exist" - on host, "getent group #{group} || groupadd #{group}" - - step "create user with group" - on(host, puppet_resource('user', user, 'ensure=present', "gid=#{group}")) - - step "verify the group exists and find the gid" - on(host, "getent group #{group}") do - gid = stdout.split(':')[2] - - step "verify that the user has that as their gid" - on(host, "getent passwd #{user}") do - got = stdout.split(':')[3] - fail_test "wanted gid #{gid} but found #{got}" unless gid == got - end - end - - step "clean up after the test is done" - on(host, puppet_resource('user', user, 'ensure=absent')) - on(host, puppet_resource('group', group, 'ensure=absent')) -end diff --git a/acceptance/tests/resource/user/should_destroy.rb b/acceptance/tests/resource/user/should_destroy.rb deleted file mode 100755 index 73d73dbb7..000000000 --- a/acceptance/tests/resource/user/should_destroy.rb +++ /dev/null @@ -1,14 +0,0 @@ -test_name "should delete a user" - -name = "pl#{rand(999999).to_i}" - -agents.each do |agent| - step "ensure the user is present" - agent.user_present(name) - - step "delete the user" - on agent, puppet_resource('user', name, 'ensure=absent') - - step "verify the user was deleted" - agent.user_absent(name) -end diff --git a/acceptance/tests/resource/user/should_manage_shell.rb b/acceptance/tests/resource/user/should_manage_shell.rb deleted file mode 100755 index 584a92937..000000000 --- a/acceptance/tests/resource/user/should_manage_shell.rb +++ /dev/null @@ -1,33 +0,0 @@ -test_name "should manage user shell" - -name = "pl#{rand(999999).to_i}" - -confine :except, :platform => 'windows' - -agents.each do |agent| - step "ensure the user and group do not exist" - agent.user_absent(name) - agent.group_absent(name) - - step "create the user with shell" - shell = '/bin/sh' - on agent, puppet_resource('user', name, ["ensure=present", "shell=#{shell}"]) - - step "verify the user shell matches the managed shell" - agent.user_get(name) do |result| - fail_test "didn't set the user shell for #{name}" unless result.stdout.include? shell - end - - step "modify the user with shell" - shell = '/bin/bash' - on agent, puppet_resource('user', name, ["ensure=present", "shell=#{shell}"]) - - step "verify the user shell matches the managed shell" - agent.user_get(name) do |result| - fail_test "didn't set the user shell for #{name}" unless result.stdout.include? shell - end - - step "delete the user, and group, if any" - agent.user_absent(name) - agent.group_absent(name) -end diff --git a/acceptance/tests/resource/user/should_modify.rb b/acceptance/tests/resource/user/should_modify.rb deleted file mode 100644 index 24e901659..000000000 --- a/acceptance/tests/resource/user/should_modify.rb +++ /dev/null @@ -1,20 +0,0 @@ -test_name "should modify a user" - -name = "pl#{rand(999999).to_i}" - -agents.each do |agent| - step "ensure the user is present" - agent.user_present(name) - - step "modify the user" - on agent, puppet_resource('user', name, ["ensure=present", "comment=comment#{name}"]) - - step "verify the user was modified" - agent.user_get(name) do |result| - fail_test "didn't modify the user #{name}" unless result.stdout.include? "comment#{name}" - end - - step "delete the user" - agent.user_absent(name) - agent.group_absent(name) -end diff --git a/acceptance/tests/resource/user/should_modify_gid.rb b/acceptance/tests/resource/user/should_modify_gid.rb deleted file mode 100755 index 850a3a75b..000000000 --- a/acceptance/tests/resource/user/should_modify_gid.rb +++ /dev/null @@ -1,42 +0,0 @@ -test_name "verify that we can modify the gid" -confine :except, :platform => 'windows' - -user = "pl#{rand(99999).to_i}" -group1 = "#{user}old" -group2 = "#{user}new" - -agents.each do |host| - step "ensure that the groups both exist" - on(host, puppet_resource('group', group1, 'ensure=present')) - on(host, puppet_resource('group', group2, 'ensure=present')) - - step "ensure the user exists and has the old group" - on(host, puppet_resource('user', user, 'ensure=present', "gid=#{group1}")) - - step "verify that the user has the correct gid" - on(host, "getent group #{group1}") do - gid = stdout.split(':')[2] - on(host, "getent passwd #{user}") do - got = stdout.split(':')[3] - fail_test "didn't have the expected old GID, but #{got}" unless got == gid - end - end - - step "modify the GID of the user" - on(host, puppet_resource('user', user, 'ensure=present', "gid=#{group2}")) - - - step "verify that the user has the updated gid" - on(host, "getent group #{group2}") do - gid = stdout.split(':')[2] - on(host, "getent passwd #{user}") do - got = stdout.split(':')[3] - fail_test "didn't have the expected old GID, but #{got}" unless got == gid - end - end - - step "ensure that we remove the things we made" - on(host, puppet_resource('user', user, 'ensure=absent')) - on(host, puppet_resource('group', group1, 'ensure=absent')) - on(host, puppet_resource('group', group2, 'ensure=absent')) -end diff --git a/acceptance/tests/resource/user/should_modify_when_not_managing_home.rb b/acceptance/tests/resource/user/should_modify_when_not_managing_home.rb deleted file mode 100644 index 24f3bd547..000000000 --- a/acceptance/tests/resource/user/should_modify_when_not_managing_home.rb +++ /dev/null @@ -1,54 +0,0 @@ -test_name "should modify a user when no longer managing home (#20726)" - -require 'puppet/acceptance/windows_utils' -extend Puppet::Acceptance::WindowsUtils - -name = "pl#{rand(999999).to_i}" -pw = "Passwrd-#{rand(999999).to_i}"[0..11] - -def get_home_dir(host, user_name) - home_dir = nil - on host, puppet_resource('user', user_name) do |result| - home_dir = result.stdout.match(/home\s*=>\s*'([^']+)'/m)[1] - end - home_dir -end - -agents.each do |agent| - home_prop = nil - case agent['platform'] - when /windows/ - # Sadly Windows ADSI won't tell us the default home directory - # for a user. You can get it via WMI Win32_UserProfile, but that - # doesn't exist in a base 2003 install. So we simply specify an - # initial home directory, that matches what the default will be. - # This way we are guaranteed that `puppet resource user name` - # will include the home directory in its output. - home_prop = "home='#{profile_base(agent)}\\#{name}'" - when /solaris/ - pending_test("managehome needs work on solaris") - end - - teardown do - step "delete the user" - agent.user_absent(name) - agent.group_absent(name) - end - - step "ensure the user is present with managehome" - on agent, puppet_resource('user', name, ["ensure=present", "managehome=true", "password=#{pw}", home_prop].compact) - - step "find the current home dir" - home_dir = get_home_dir(agent, name) - on agent, "test -d '#{home_dir}'" - - step "modify the user" - new_home_dir = "#{home_dir}_foo" - on agent, puppet_resource('user', name, ["ensure=present", "home='#{new_home_dir}'"]) do |result| - found_home_dir = result.stdout.match(/home\s*=>\s*'([^']+)'/m)[1] - assert_equal new_home_dir, found_home_dir, "Failed to change home property of user" - end - - step "verify that home directory still exists since we did not specify managehome" - on agent, "test -d '#{home_dir}'" -end diff --git a/acceptance/tests/resource/user/should_modify_while_managing_home.rb b/acceptance/tests/resource/user/should_modify_while_managing_home.rb deleted file mode 100644 index 667b70dc4..000000000 --- a/acceptance/tests/resource/user/should_modify_while_managing_home.rb +++ /dev/null @@ -1,45 +0,0 @@ -test_name "should modify a user without changing home directory (pending #19542)" - -require 'puppet/acceptance/windows_utils' -extend Puppet::Acceptance::WindowsUtils - -name = "pl#{rand(999999).to_i}" -pw = "Passwrd-#{rand(999999).to_i}"[0..11] - -def get_home_dir(host, user_name) - home_dir = nil - on host, puppet_resource('user', user_name) do |result| - home_dir = result.stdout.match(/home\s*=>\s*'([^']+)'/m)[1] - end - home_dir -end - -agents.each do |agent| - home_prop = nil - case agent['platform'] - when /windows/ - home_prop = "home='#{profile_base(agent)}\\#{name}'" - when /solaris/ - pending_test("managehome needs work on solaris") - end - - teardown do - step "delete the user" - agent.user_absent(name) - agent.group_absent(name) - end - - step "ensure the user is present with managehome" - on agent, puppet_resource('user', name, ["ensure=present", "managehome=true", "password=#{pw}", home_prop].compact) - - step "find the current home dir" - home_dir = get_home_dir(agent, name) - - step "modify the user" - on agent, puppet_resource('user', name, ["ensure=present", "managehome=true", "home='#{home_dir}_foo'"]) do |result| - # SHOULD: user resource output should contain the new home directory - pending_test "when #19542 is reimplemented correctly" - end - # SHOULD: old home directory should not exist in the filesystem - # SHOULD: new home directory should exist in the filesystem -end diff --git a/acceptance/tests/resource/user/should_not_create_existing.rb b/acceptance/tests/resource/user/should_not_create_existing.rb deleted file mode 100755 index 994832284..000000000 --- a/acceptance/tests/resource/user/should_not_create_existing.rb +++ /dev/null @@ -1,8 +0,0 @@ -test_name "tests that user resource will not add users that already exist." - -step "verify that we don't try to create a user account that already exists" -agents.each do |agent| - on(agent, puppet_resource('user', agent['user'], 'ensure=present')) do - fail_test "tried to create '#{agent['user']}' user" if stdout.include? 'created' - end -end diff --git a/acceptance/tests/resource/user/should_not_destoy_unexisting.rb b/acceptance/tests/resource/user/should_not_destoy_unexisting.rb deleted file mode 100755 index 5e6bcd2fa..000000000 --- a/acceptance/tests/resource/user/should_not_destoy_unexisting.rb +++ /dev/null @@ -1,13 +0,0 @@ -test_name "ensure that puppet does not report removing a user that does not exist" - -name = "pl#{rand(999999).to_i}" - -step "verify that user #{name} does not exist" -agents.each do |agent| - agent.user_absent(name) -end - -step "ensure absent doesn't try and do anything" -on(agents, puppet_resource('user', name, 'ensure=absent')) do - fail_test "tried to remove the user, apparently" if stdout.include? 'removed' -end diff --git a/acceptance/tests/resource/user/should_query.rb b/acceptance/tests/resource/user/should_query.rb deleted file mode 100755 index de9425b8a..000000000 --- a/acceptance/tests/resource/user/should_query.rb +++ /dev/null @@ -1,17 +0,0 @@ -test_name "test that we can query and find a user that exists." - -name = "pl#{rand(999999).to_i}" - -agents.each do |agent| - step "ensure that our test user exists" - agent.user_present(name) - - step "query for the resource and verify it was found" - on(agent, puppet_resource('user', name)) do - fail_test "didn't find the user #{name}" unless stdout.include? 'present' - end - - step "clean up the user and group we added" - agent.user_absent(name) - agent.group_absent(name) -end diff --git a/acceptance/tests/resource/user/should_query_all.rb b/acceptance/tests/resource/user/should_query_all.rb deleted file mode 100755 index db7037cdd..000000000 --- a/acceptance/tests/resource/user/should_query_all.rb +++ /dev/null @@ -1,23 +0,0 @@ -test_name "should query all users" - -agents.each do |agent| - step "query natively" - users = agent.user_list - - fail_test("No users found") unless users - - step "query with puppet" - on(agent, puppet_resource('user')) do - stdout.each_line do |line| - name = ( line.match(/^user \{ '([^']+)'/) or next )[1] - - unless users.delete(name) - fail_test "user #{name} found by puppet, not natively" - end - end - end - - if users.length > 0 then - fail_test "#{users.length} users found natively, not puppet: #{users.join(', ')}" - end -end diff --git a/acceptance/tests/resource/zfs/basic_tests.rb b/acceptance/tests/resource/zfs/basic_tests.rb deleted file mode 100644 index a91d0a486..000000000 --- a/acceptance/tests/resource/zfs/basic_tests.rb +++ /dev/null @@ -1,53 +0,0 @@ -test_name "ZFS: configuration" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZFSUtils - -teardown do - step "ZFS: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ZFS: cleanup" - clean agent - step "ZFS: setup" - setup agent - step "ZFS: ensure clean slate" - apply_manifest_on(agent, 'zfs { "tstpool/tstfs": ensure=>absent}') do - assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") - end - step "ZFS: basic - ensure it is created" - apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "ZFS: idempotence - create" - apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do - assert_no_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - step "ZFS: cleanup for next test" - apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>absent}') do - assert_match( /ensure: removed/, result.stdout, "err: #{agent}") - end - - step "ZFS: create with a mount point" - apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt"}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - step "ZFS: change mount point and verify" - apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do - assert_match( /mountpoint changed '.ztstpool.mnt'.* to '.ztstpool.mnt2'/, result.stdout, "err: #{agent}") - end - - step "ZFS: ensure can be removed." - apply_manifest_on(agent, 'zfs { "tstpool/tstfs": ensure=>absent}') do - assert_match( /ensure: removed/, result.stdout, "err: #{agent}") - end - -end diff --git a/acceptance/tests/resource/zfs/should_be_idempotent.rb b/acceptance/tests/resource/zfs/should_be_idempotent.rb deleted file mode 100644 index b56f742d2..000000000 --- a/acceptance/tests/resource/zfs/should_be_idempotent.rb +++ /dev/null @@ -1,37 +0,0 @@ -test_name "ZFS: configuration" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZFSUtils - -teardown do - step "ZFS: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ZFS: setup" - setup agent - step "ZFS: create with a mount point" - apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt"}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - step "ZFS: idempotence - create" - apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do - assert_no_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - step "ZFS: change mount point and verify" - apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do - assert_match( /mountpoint changed '.ztstpool.mnt'.* to '.ztstpool.mnt2'/, result.stdout, "err: #{agent}") - end - - step "ZFS: change mount point and verify idempotence" - apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do - assert_no_match( /changed/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zfs/should_create.rb b/acceptance/tests/resource/zfs/should_create.rb deleted file mode 100644 index 09087b00e..000000000 --- a/acceptance/tests/resource/zfs/should_create.rb +++ /dev/null @@ -1,26 +0,0 @@ -test_name "ZFS: should create" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZFSUtils - -teardown do - step "ZFS: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ZFS: setup" - setup agent - step "ZFS: ensure it is created" - apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "verify" - on(agent, 'zfs list') do - assert_match( /tstpool.tstfs/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zfs/should_query.rb b/acceptance/tests/resource/zfs/should_query.rb deleted file mode 100644 index f251e1930..000000000 --- a/acceptance/tests/resource/zfs/should_query.rb +++ /dev/null @@ -1,31 +0,0 @@ -test_name "ZFS: configuration" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZFSUtils - -teardown do - step "ZFS: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ZFS: setup" - setup agent - step "ZFS: basic - ensure it is created" - apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "query one." - on(agent, 'puppet resource zfs tstpool/tstfs') do - assert_match( /ensure *=> *'present'/, result.stdout, "err: #{agent}") - end - step "query all." - on(agent, 'puppet resource zfs') do - assert_match( /tstpool.tstfs/, result.stdout, "err: #{agent}") - end - -end diff --git a/acceptance/tests/resource/zfs/should_remove.rb b/acceptance/tests/resource/zfs/should_remove.rb deleted file mode 100644 index 950e20390..000000000 --- a/acceptance/tests/resource/zfs/should_remove.rb +++ /dev/null @@ -1,25 +0,0 @@ -test_name "ZFS: configuration" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZFSUtils - -teardown do - step "ZFS: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ZFS: setup" - setup agent - - step "ZFS: create" - on agent, 'zfs create tstpool/tstfs' - step "ZFS: ensure can be removed." - apply_manifest_on(agent, 'zfs { "tstpool/tstfs": ensure=>absent}') do - assert_match( /ensure: removed/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zone/dataset.rb b/acceptance/tests/resource/zone/dataset.rb deleted file mode 100755 index e775f2ef9..000000000 --- a/acceptance/tests/resource/zone/dataset.rb +++ /dev/null @@ -1,68 +0,0 @@ -test_name "Zone: dataset configuration" - -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZoneUtils - -def moresetup(agent) - # This should fail if /tstzones already exists. - on agent,"mkdir /tstzones" - on agent,"mkfile 64m /tstzones/dsk" - on agent,"zpool create tstpool /tstzones/dsk" - - on agent,"zfs create tstpool/xx" - on agent,"zfs create tstpool/yy" - on agent,"zfs create tstpool/zz" -end - -def moreclean(agent) - on agent, "zfs destroy -r tstpool" - on agent, "zpool destroy tstpool" - on agent, "rm -f /tstzones/dsk" -end - -teardown do - step "Zone: dataset - cleanup" - agents.each do |agent| - clean agent - moreclean agent - end -end - - -agents.each do |agent| - step "Zone: dataset - setup" - setup agent - moresetup agent - #----------------------------------- - step "Zone: dataset - make it configured" - # Make it configured - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, path=>"/tstzones/mnt" }') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "Zone: dataset - basic test, a single data set" - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>"tstpool/xx", path=>"/tstzones/mnt" }') do - assert_match(/defined 'dataset' as .'tstpool.xx'./, result.stdout, "err: #{agent}") - end - step "Zone: dataset - basic test, a single data set should change to another" - apply_manifest_on(agent,'zone {tstzone : ensure=>configured, dataset=>"tstpool/yy", path=>"/tstzones/mnt" }') do - assert_match(/dataset changed 'tstpool.xx'.* to .'tstpool.yy'./, result.stdout, "err: #{agent}") - end - step "Zone: dataset - basic test, idempotency" - apply_manifest_on(agent,'zone {tstzone : ensure=>configured, dataset=>"tstpool/yy", path=>"/tstzones/mnt" }') do - assert_no_match(/dataset changed 'tstpool.xx'.* to .'tstpool.yy'./, result.stdout, "err: #{agent}") - end - step "Zone: dataset - array test, should change to an array" - apply_manifest_on(agent,'zone {tstzone : ensure=>configured, dataset=>["tstpool/yy","tstpool/zz"], path=>"/tstzones/mnt" }') do - assert_match(/dataset changed 'tstpool.yy'.* to .'tstpool.yy', 'tstpool.zz'./, result.stdout, "err: #{agent}") - end - step "Zone: dataset - array test, should change one single element" - apply_manifest_on(agent,'zone {tstzone : ensure=>configured, dataset=>["tstpool/xx","tstpool/zz"], path=>"/tstzones/mnt" }') do - assert_match(/dataset changed 'tstpool.yy,tstpool.zz'.* to .'tstpool.xx', 'tstpool.zz'./, result.stdout, "err: #{agent}") - end - step "Zone: dataset - array test, should remove elements" - apply_manifest_on(agent,'zone {tstzone : ensure=>configured, dataset=>[], path=>"/tstzones/mnt" }') do - assert_match(/dataset changed 'tstpool.zz,tstpool.xx'.* to ../, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zone/set_ip.rb b/acceptance/tests/resource/zone/set_ip.rb deleted file mode 100755 index aad2463ef..000000000 --- a/acceptance/tests/resource/zone/set_ip.rb +++ /dev/null @@ -1,64 +0,0 @@ -test_name "Zone:IP ip-type and ip configuration" -confine :to, :platform => 'solaris' -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZoneUtils - -teardown do - step "Zone: ip - cleanup" - agents.each do |agent| - clean agent - end -end - -agents.each do |agent| - step "Zone: ip - setup" - setup agent - # See - # https://hg.openindiana.org/upstream/illumos/illumos-gate/file/03d5725cda56/usr/src/lib/libinetutil/common/ifspec.c - # for the funciton ifparse_ifspec. This is the only documentation that exists - # as to what the zone interface can be. - #----------------------------------- - # Make sure that the zone is absent. - step "Zone: ip - make it configured" - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt" }') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "Zone: ip - ip switch: verify that the change from shared to exclusive works." - # -------------------------------------------------------------------- - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>exclusive, path=>"/tstzones/mnt" }') do - assert_match(/iptype changed 'shared'.* to 'exclusive'/, result.stdout, "err: #{agent}") - end - step "Zone: ip - ip switch: verify that we can change it back" - # -------------------------------------------------------------------- - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>exclusive, path=>"/tstzones/mnt" }') do - assert_no_match(/iptype changed 'shared'.* to 'exclusive'/, result.stdout, "err: #{agent}") - end - - step "Zone: ip - switch to shared for remaining cases" - # we have to use shared for remaining test cases. - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt" }') do - assert_match(/iptype changed 'exclusive'.* to 'shared'/, result.stdout, "err: #{agent}") - end - - step "Zone: ip - assign: ensure that our ip assignment works." - # -------------------------------------------------------------------- - apply_manifest_on(agent,'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt", ip=>"ip.if.1" }', :acceptable_exit_codes => [1] ) do - assert_match(/ip must contain interface name and ip address separated by a \W*?:/, result.output, "err: #{agent}") - end - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt", ip=>"ip.if.1:1.1.1.1" }') do - assert_match(/defined 'ip' as .'ip.if.1:1.1.1.1'./ , result.stdout, "err: #{agent}") - end - step "Zone: ip - assign: arrays should be created" - # -------------------------------------------------------------------- - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt", ip=>["ip.if.1:1.1.1.1", "ip.if.2:1.1.1.2"] }') do - assert_match( /ip changed 'ip.if.1:1.1.1.1'.* to .'ip.if.1:1.1.1.1', 'ip.if.2:1.1.1.2'./, result.stdout, "err: #{agent}") - end - step "Zone: ip - assign: arrays should be modified" - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt", ip=>["ip.if.1:1.1.1.1", "ip.if.2:1.1.1.3"] }') do - assert_match(/ip changed 'ip.if.1:1.1.1.1,ip.if.2:1.1.1.2'.* to .'ip.if.1:1.1.1.1', 'ip.if.2:1.1.1.3'./, result.stdout, "err: #{agent}") - end - step "Zone: ip - idempotency: arrays" - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt", ip=>["ip.if.1:1.1.1.1", "ip.if.2:1.1.1.3"] }') do - assert_no_match(/ip changed/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zone/set_path.rb b/acceptance/tests/resource/zone/set_path.rb deleted file mode 100644 index 7a172421f..000000000 --- a/acceptance/tests/resource/zone/set_path.rb +++ /dev/null @@ -1,49 +0,0 @@ -test_name "Zone:Path configuration" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZoneUtils - -teardown do - step "Zone: path - cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "Zone: path - setup" - setup agent - #----------------------------------- - step "Zone: path - required parameter (-)" - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared }') do - assert_match( /Error: Path is required/, result.output, "err: #{agent}") - end - - step "Zone: path - required parameter (+)" - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt" }') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - step "Zone: path - should change the path if it is switched before install" - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt2" }') do - assert_match(/path changed '.tstzones.mnt'.* to '.tstzones.mnt2'/, result.stdout, "err: #{agent}") - end - - step "Zone: path - verify the path is correct" - on agent,"/usr/sbin/zonecfg -z tstzone export" do - assert_match(/set zonepath=.*mnt2/, result.stdout, "err: #{agent}") - end - - step "Zone: path - revert to original path" - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt" }') do - assert_match(/path changed '.tstzones.mnt2'.* to '.tstzones.mnt'/, result.stdout, "err: #{agent}") - end - - step "Zone: path - verify that we have correct path" - on agent,"/usr/sbin/zonecfg -z tstzone export" do - assert_match(/set zonepath=.tstzones.mnt/, result.stdout, "err: #{agent}") - end -end - diff --git a/acceptance/tests/resource/zone/should_be_created_and_removed.rb b/acceptance/tests/resource/zone/should_be_created_and_removed.rb deleted file mode 100755 index 3d6f48fda..000000000 --- a/acceptance/tests/resource/zone/should_be_created_and_removed.rb +++ /dev/null @@ -1,39 +0,0 @@ -test_name "Zone: should be created and removed" - -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZoneUtils - -teardown do - step "Zone: removal - cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "Zone: setup" - setup agent - #----------------------------------- - step "Zone: make it running" - step "progress would be logged to agent:/var/log/zones/zoneadm.<date>.<zonename>.install" - step "install log would be at agent:/system/volatile/install.<id>/install_log" - - apply_manifest_on(agent, 'zone {tstzone : ensure=>running, path=>"/tstzones/mnt" }') do - assert_match( /created/, result.stdout, "err: #{agent}") - end - on(agent, "zoneadm list -cp") do - assert_match( /tstzone/, result.stdout, "err: #{agent}") - end - on(agent, "zoneadm -z tstzone verify") - step "Zone: ensure can remove" - step "progress would be logged to agent:/var/log/zones/zoneadm.<date>.<zonename>.uninstall" - apply_manifest_on(agent, 'zone {tstzone : ensure=>absent}') do - assert_match( /ensure: removed/, result.stdout, "err: #{agent}") - end - on(agent, "zoneadm list -cp") do - assert_no_match( /tstzone/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zone/should_be_idempotent.rb b/acceptance/tests/resource/zone/should_be_idempotent.rb deleted file mode 100755 index 68c06b062..000000000 --- a/acceptance/tests/resource/zone/should_be_idempotent.rb +++ /dev/null @@ -1,46 +0,0 @@ -test_name "Zone: should be idempotent" - -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZoneUtils - -teardown do - step "Zone: idempotency - cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "Zone: idempotency - setup" - setup agent - #----------------------------------- - step "Zone: idempotency - make it configured" - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, path=>"/tstzones/mnt" }') do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "Zone: idempotency, should not create again." - apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, path=>"/tstzones/mnt" }') do - assert_no_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "Zone: idempotency - make it installed" - step "progress would be logged to agent:/var/log/zones/zoneadm.<date>.<zonename>.install" - step "install log would be at agent:/system/volatile/install.<id>/install_log" - apply_manifest_on(agent, 'zone {tstzone : ensure=>installed, path=>"/tstzones/mnt" }') do - assert_match( /changed/, result.stdout, "err: #{agent}") - end - step "Zone: idempotency, should not install again." - apply_manifest_on(agent, 'zone {tstzone : ensure=>installed, path=>"/tstzones/mnt" }') do - assert_no_match( /changed/, result.stdout, "err: #{agent}") - end - step "Zone: idempotency - make it running" - apply_manifest_on(agent, 'zone {tstzone : ensure=>running, path=>"/tstzones/mnt" }') do - assert_match( /changed/, result.stdout, "err: #{agent}") - end - step "Zone: idempotency, should not make it running again." - apply_manifest_on(agent, 'zone {tstzone : ensure=>running, path=>"/tstzones/mnt" }') do - assert_no_match( /changed/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zone/statemachine.rb b/acceptance/tests/resource/zone/statemachine.rb deleted file mode 100644 index 2a374732d..000000000 --- a/acceptance/tests/resource/zone/statemachine.rb +++ /dev/null @@ -1,43 +0,0 @@ -test_name "Zone:Statemachine configuration" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZoneUtils - -teardown do - step "Zone: statemachine - cleanup" - agents.each do |agent| - clean agent - end -end - -agents.each do |agent| - step "Zone: statemachine - setup" - setup agent - - step "Zone: statemachine - create zone and make it running" - step "progress would be logged to agent:/var/log/zones/zoneadm.<date>.<zonename>.install" - step "install log would be at agent:/system/volatile/install.<id>/install_log" - apply_manifest_on(agent, "zone {tstzone : ensure=>running, iptype=>shared, path=>'/tstzones/mnt' }") do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - step "Zone: statemachine - ensure zone is correct" - on agent, "zoneadm -z tstzone verify" do - assert_no_match( /could not verify/, result.stdout, "err: #{agent}") - end - - step "Zone: statemachine - ensure zone is running" - on agent, "zoneadm -z tstzone list -v" do - assert_match( /running/, result.stdout, "err: #{agent}") - end - - step "Zone: statemachine - stop and uninstall zone" - apply_manifest_on(agent, "zone {tstzone : ensure=>configured, iptype=>shared, path=>'/tstzones/mnt' }") do - assert_match( /ensure changed 'running' to 'configured'/ , result.stdout, "err: #{agent}") - end - - on agent, "zoneadm -z tstzone list -v" do - assert_match( /configured/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zone/stepstates.rb b/acceptance/tests/resource/zone/stepstates.rb deleted file mode 100644 index 0f529c983..000000000 --- a/acceptance/tests/resource/zone/stepstates.rb +++ /dev/null @@ -1,48 +0,0 @@ -test_name "Zone:statemachine single states" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZoneUtils - -teardown do - step "Zone: steps - cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "Zone: steps - setup" - setup agent - step "Zone: steps - create" - apply_manifest_on(agent, "zone {tstzone : ensure=>configured, iptype=>shared, path=>'/tstzones/mnt' }" ) do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - step "Zone: steps - verify (create)" - on agent, "zoneadm -z tstzone verify" do - assert_no_match( /could not verify/, result.stdout, "err: #{agent}") - end - - step "Zone: steps - configured -> installed" - step "progress would be logged to agent:/var/log/zones/zoneadm.<date>.<zonename>.install" - step "install log would be at agent:/system/volatile/install.<id>/install_log" - apply_manifest_on(agent,"zone {tstzone : ensure=>installed, iptype=>shared, path=>'/tstzones/mnt' }") do - assert_match(/ensure changed 'configured' to 'installed'/, result.stdout, "err: #{agent}") - end - - step "Zone: steps - installed -> running" - apply_manifest_on(agent,"zone {tstzone : ensure=>running, iptype=>shared, path=>'/tstzones/mnt' }") do - assert_match(/ensure changed 'installed' to 'running'/, result.stdout, "err: #{agent}") - end - - step "Zone: steps - running -> installed" - apply_manifest_on(agent,"zone {tstzone : ensure=>installed, iptype=>shared, path=>'/tstzones/mnt' }") do - assert_match(/ensure changed 'running' to 'installed'/, result.stdout, "err: #{agent}") - end - - step "Zone: steps - installed -> configured" - apply_manifest_on(agent,"zone {tstzone : ensure=>configured, iptype=>shared, path=>'/tstzones/mnt' }") do - assert_match(/ensure changed 'installed' to 'configured'/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zone/ticket_4840_should_create_zone_with_zpool.rb b/acceptance/tests/resource/zone/ticket_4840_should_create_zone_with_zpool.rb deleted file mode 100644 index 77bfc5ab8..000000000 --- a/acceptance/tests/resource/zone/ticket_4840_should_create_zone_with_zpool.rb +++ /dev/null @@ -1,37 +0,0 @@ -test_name "Zone: ticket #4840 - verify that the given manifest works." -confine :to, :platform => 'solaris:pending' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZoneUtils - -teardown do - agents.each do |agent| - clean agent - end -end - -agents.each do |agent| - setup agent - #----------------------------------- - # Make sure that the zone is absent. - apply_manifest_on(agent,%[ - zfs { "tstpool/tstfs": - mountpoint => "/ztstpool/mnt", - ensure => present, - } - file { "/ztstpool/mnt": - ensure => directory, - mode => 0700, - require => Zfs["tstpool/tstfs"], - } - zone { tstzone: - autoboot => true, - path => "/ztstpool/mnt", - sysidcfg => "/tmp/myzone.cfg", - iptype => exclusive, - ip => "ip.if.1", - require => File["/ztstpool/mnt"], - }]) do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zpool/basic_tests.rb b/acceptance/tests/resource/zpool/basic_tests.rb deleted file mode 100644 index 07fde2f42..000000000 --- a/acceptance/tests/resource/zpool/basic_tests.rb +++ /dev/null @@ -1,92 +0,0 @@ -test_name "ZPool: configuration" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZPoolUtils - -teardown do - step "ZPool: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ZPool: setup" - setup agent - #----------------------------------- - step "ZPool: ensure create" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>'/ztstpool/dsk1' }") do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - step "ZPool: idempotency - create" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>'/ztstpool/dsk1' }") do - assert_no_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - step "ZPool: remove" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>absent }") do - assert_match( /ensure: removed/ , result.stdout, "err: #{agent}") - end - - step "ZPool: disk array" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>['/ztstpool/dsk1','/ztstpool/dsk2'] }") do - assert_match( /ensure: created/ , result.stdout, "err: #{agent}") - end - - step "ZPool: disk array: verify" - on agent, "zpool list -H" do - assert_match( /tstpool/ , result.stdout, "err: #{agent}") - end - - step "ZPool: disk array: verify with puppet" - on agent, "puppet resource zpool tstpool" do - assert_match(/ensure => 'present'/, result.stdout, "err: #{agent}") - assert_match(/disk +=> .'.+dsk1 .+dsk2'./, result.stdout, "err: #{agent}") - end - - step "ZPool: remove again for mirror tests" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>absent }") do - assert_match( /ensure: removed/ , result.stdout, "err: #{agent}") - end - - step "ZPool: mirror: ensure can create" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, mirror=>['/ztstpool/dsk1','/ztstpool/dsk2', '/ztstpool/dsk3'] }") do - assert_match( /ensure: created/ , result.stdout, "err: #{agent}") - end - - step "ZPool: mirror: ensure can create: verify" - on agent, "zpool status -v tstpool" do - assert_match( /tstpool/ , result.stdout, "err: #{agent}") - assert_match( /mirror/ , result.stdout, "err: #{agent}") - end - - step "ZPool: mirror: ensure can create: vefify (puppet)" - on agent, "puppet resource zpool tstpool" do - assert_match(/ensure => 'present'/, result.stdout, "err: #{agent}") - assert_match(/mirror => .'.+dsk1 .+dsk2 .+dsk3'./, result.stdout, "err: #{agent}") - end - step "ZPool: remove for raidz test)" - apply_manifest_on(agent,"zpool{ tstpool: ensure=>absent }") do - assert_match(/ensure: removed/, result.stdout, "err: #{agent}") - end - - step "ZPool: raidz: ensure can create" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, raidz=>['/ztstpool/dsk1','/ztstpool/dsk2', '/ztstpool/dsk3'] }") do - assert_match( /ensure: created/ , result.stdout, "err: #{agent}") - end - - step "ZPool: raidz: ensure can create: verify" - on agent, "zpool status -v tstpool" do - assert_match( /tstpool/ , result.stdout, "err: #{agent}") - assert_match( /raidz/ , result.stdout, "err: #{agent}") - end - - step "ZPool: raidz: ensure can create: verify (puppet)" - on agent, "puppet resource zpool tstpool" do - assert_match(/ensure => 'present'/, result.stdout, "err: #{agent}") - assert_match(/raidz +=> .'.+dsk1 .+dsk2 .+dsk3'./, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zpool/should_be_idempotent.rb b/acceptance/tests/resource/zpool/should_be_idempotent.rb deleted file mode 100644 index fc7c45047..000000000 --- a/acceptance/tests/resource/zpool/should_be_idempotent.rb +++ /dev/null @@ -1,28 +0,0 @@ -test_name "ZPool: configuration" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZPoolUtils - -teardown do - step "ZPool: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ZPool: setup" - setup agent - #----------------------------------- - step "ZPool: ensure create" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>'/ztstpool/dsk1' }") do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - step "ZPool: idempotency - create" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>'/ztstpool/dsk1' }") do - assert_no_match( /ensure: created/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zpool/should_create.rb b/acceptance/tests/resource/zpool/should_create.rb deleted file mode 100644 index f246cc533..000000000 --- a/acceptance/tests/resource/zpool/should_create.rb +++ /dev/null @@ -1,26 +0,0 @@ -test_name "ZPool: configuration" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZPoolUtils - -teardown do - step "ZPool: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ZPool: setup" - setup agent - #----------------------------------- - step "ZPool: ensure create" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>'/ztstpool/dsk1' }") do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - on(agent, "zpool list") do - assert_match( /tstpool/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zpool/should_query.rb b/acceptance/tests/resource/zpool/should_query.rb deleted file mode 100644 index ae169e016..000000000 --- a/acceptance/tests/resource/zpool/should_query.rb +++ /dev/null @@ -1,33 +0,0 @@ -test_name "ZPool: configuration" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZPoolUtils - -teardown do - step "ZPool: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ZPool: setup" - setup agent - #----------------------------------- - step "ZPool: ensure create" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>'/ztstpool/dsk1' }") do - assert_match( /ensure: created/, result.stdout, "err: #{agent}") - end - - step "ZPool: query one" - on agent, "puppet resource zpool tstpool" do - assert_match(/ensure *=> *'present'/, result.stdout, "err: #{agent}") - end - - step "ZPool: query all" - on agent, "puppet resource zpool" do - assert_match(/tstpool'/, result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/resource/zpool/should_remove.rb b/acceptance/tests/resource/zpool/should_remove.rb deleted file mode 100644 index 5b77de6c8..000000000 --- a/acceptance/tests/resource/zpool/should_remove.rb +++ /dev/null @@ -1,32 +0,0 @@ -test_name "ZPool: configuration" -confine :to, :platform => 'solaris' - -require 'puppet/acceptance/solaris_util' -extend Puppet::Acceptance::ZPoolUtils - -teardown do - step "ZPool: cleanup" - agents.each do |agent| - clean agent - end -end - - -agents.each do |agent| - step "ZPool: setup" - setup agent - #----------------------------------- - step "ZPool: create" - on(agent, "zpool create tstpool /ztstpool/dsk1") - on(agent, "zpool list") do - assert_match( /tstpool/ , result.stdout, "err: #{agent}") - end - - step "ZPool: remove" - apply_manifest_on(agent, "zpool{ tstpool: ensure=>absent }") do - assert_match( /ensure: removed/ , result.stdout, "err: #{agent}") - end - on(agent, "zpool list") do - assert_no_match( /tstpool/ , result.stdout, "err: #{agent}") - end -end diff --git a/acceptance/tests/security/cve-2013-1640_facter_string.rb b/acceptance/tests/security/cve-2013-1640_facter_string.rb deleted file mode 100644 index ac0522645..000000000 --- a/acceptance/tests/security/cve-2013-1640_facter_string.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Setting a custom fact to "string" will overwrite a local variable during -# template compilation on the master allowing remote code execution by -# any authenticated client. -test_name "CVE 2013-1640 Remote Code Execution" do - confine :except, :platform => 'windows' - - on agents, %q[ FACTER_string="<%= %x{ /bin/echo hax0rd } %>" ] + - %q[ puppet apply -e ] + - %q[ 'notice(inline_template("<%= \"I am Safe\" %>"))' ] do |test| - - assert_match /I am Safe/, test.stdout - assert_no_match /hax0rd/, test.stdout - end -end diff --git a/acceptance/tests/security/cve-2013-1652_improper_query_params.rb b/acceptance/tests/security/cve-2013-1652_improper_query_params.rb deleted file mode 100644 index 4c805c761..000000000 --- a/acceptance/tests/security/cve-2013-1652_improper_query_params.rb +++ /dev/null @@ -1,39 +0,0 @@ -require 'json' - -test_name "CVE 2013-1652 Improper query parameter validation" do - confine :except, :platform => 'windows' - - with_puppet_running_on master, {} do - # Ensure each agent has a signed cert - on agents, puppet('agent', "-t --server #{master}" ) - - agents.each do |agent| - next if agent['roles'].include?( 'master' ) - - certname = on(agent, puppet('agent', "--configprint certname")).stdout.chomp - - payload = "https://#{master}:8140/production/catalog/#{certname}?use_node=" + - "---%20!ruby/object:Puppet::Node%0A%20%20" + - "name:%20#{master}%0A%20%20classes:%20\[\]%0A%20%20" + - "parameters:%20%7B%7D%0A%20%20facts:%20%7B%7D" - - cert_path = on(agent, puppet('agent', "--configprint hostcert")).stdout.chomp - key_path = on(agent, puppet('agent', "--configprint hostprivkey")).stdout.chomp - curl_base = "curl --tlsv1 -g --cert \"#{cert_path}\" --key \"#{key_path}\" -k -H 'Accept: pson'" - - curl_call = "#{curl_base} '#{payload}'" - - step "Attempt to retrieve another nodes catalog" do - on agent, curl_call do |test| - begin - res = JSON.parse( test.stdout ) - fail_test( "Retrieved catalog for #{master} from #{agent}" ) if - res['data']['name'] == master.name - rescue JSON::ParserError - # good, continue - end - end - end - end - end -end diff --git a/acceptance/tests/security/cve-2013-1652_poison_other_node_cache.rb b/acceptance/tests/security/cve-2013-1652_poison_other_node_cache.rb deleted file mode 100644 index 550b67367..000000000 --- a/acceptance/tests/security/cve-2013-1652_poison_other_node_cache.rb +++ /dev/null @@ -1,40 +0,0 @@ -test_name "CVE 2013-1652 Poison node cache" do - - step "Determine suitability of the test" do - skip_test( "This test will only run on Puppet 3.x" ) if - on(master, puppet('--version')).stdout =~ /\A2\./ - end - - with_puppet_running_on( master, {} ) do - # Ensure agent has a signed cert - on master, puppet('agent', '-t', "--server #{master}" ) - - certname = on( - master, puppet('agent', "--configprint certname")).stdout.chomp - cert_path = on( - master, puppet('agent', "--configprint hostcert")).stdout.chomp - key_path = on( - master, puppet('agent', "--configprint hostprivkey")).stdout.chomp - - curl_base = "curl --tlsv1 -g --cert \"#{cert_path}\" " + - "--key \"#{key_path}\" -k -H 'Accept: pson'" - - step "Attempt to poison the master's node cache" do - yamldir = on( - master, puppet('master', '--configprint yamldir' )).stdout.chomp - exploited = "#{yamldir}/node/you.lose.yaml" - on master, "rm -rf #{exploited}" - on master, "rm -rf #{yamldir}/node/*" - payload2 = "https://#{master}:8140/production/node/#{certname}?instance=" + - "---+%21ruby%2Fobject%3APuppet%3A%3ANode%0A+classes" + - "%3A%0A+-+foo%0A+name%3A+you.lose%0A+parameters" + - "%3A+%7B%7D%0A+time%3A+2013-02-28+15%3A12%3A30.367008+-08%3A00" - - on master, "#{curl_base} '#{payload2}'" - - fail_test( "Found exploit file #{exploited}" ) if - on( master, "[ ! -f #{exploited} ]", - :acceptable_exit_codes => [0,1] ).exit_code == 1 - end - end -end diff --git a/acceptance/tests/security/cve-2013-1653_puppet_kick.rb b/acceptance/tests/security/cve-2013-1653_puppet_kick.rb deleted file mode 100644 index 6320f8b32..000000000 --- a/acceptance/tests/security/cve-2013-1653_puppet_kick.rb +++ /dev/null @@ -1,113 +0,0 @@ -test_name "CVE 2013-1653: Puppet Kick Remote Code Exploit" do - - step "Determine suitability of the test" do - confine :except, :platform => 'windows' - - versions = on( hosts, puppet( '--version' )) - skip_test( "This test will not run on Puppet 2.6" ) if - versions.any? {|r| r.stdout =~ /\A2\.6\./ } - end - - def exploit_code( exploiter, exploitee, endpoint, port, file_to_create ) - - certfile = on( exploiter, puppet_agent( '--configprint hostcert' )).stdout.chomp - keyfile = on( exploiter, puppet_agent( '--configprint hostprivkey' )).stdout.chomp - - exploit = %Q[#!#{exploiter['puppetbindir']}/ruby - require 'rubygems' - require 'puppet' - require 'openssl' - require 'net/https' - - yaml = <<EOM ---- !ruby/object:ERB - safe_level: - src: |- - #coding:US-ASCII - _erbout = ''; _erbout.concat(( File.open( '#{file_to_create}', 'w') ).to_s) - filename: -EOM - - headers = {'Content-Type' => 'text/yaml', 'Accept' => 'yaml'} - conn = Net::HTTP.new('#{exploitee}', #{port}) - conn.use_ssl = true - conn.cert = OpenSSL::X509::Certificate.new(File.read('#{certfile}')) - conn.key = OpenSSL::PKey::RSA.new(File.read('#{keyfile}')) - conn.verify_mode = OpenSSL::SSL::VERIFY_NONE - - conn.request_put("/production/#{endpoint}/#{exploiter}", yaml, headers) do |response| - response.read_body do |chunk| - puts chunk - end - end ] - - return exploit - end - - exploited = '/tmp/cve-2013-1653-has-worked' - restauth_conf = %q[ -path /run -auth yes -allow * -] - - teardown do - agents.each do |agent| - pidfile = on( agent, puppet_agent("--configprint pidfile") ).stdout.chomp - on agent, "[ -f #{pidfile} ] && kill `cat #{pidfile}` || true" - on agent, "rm -rf #{exploited}" - end - end - - agents.each do |agent| - # We have to skip this case because of bug PP-436. When that gets fixed, we - # can test on all nodes again. - if agent == master - Log.warn("This test does not support nodes that are both master and agents") - next - end - - atestdir = agent.tmpdir('puppet-kick-auth') - mtestdir = master.tmpdir('puppet-kick-auth') - - step "Daemonize the agent" do - # Lay down a tempory auth.conf that will allow the agent to be kicked - create_remote_file(agent, "#{atestdir}/auth.conf", restauth_conf) - - # Start the agent - on(agent, puppet_agent("--debug --daemonize --server #{master} --listen --no-client --rest_authconfig #{atestdir}/auth.conf")) - - step "Wait for agent to start listening" do - timeout = 15 - begin - Timeout.timeout(timeout) do - loop do - # 7 is "Could not connect to host", which will happen before it's running - result = on(agent, "curl --tlsv1 -k https://#{agent}:8139", :acceptable_exit_codes => [0,7]) - break if result.exit_code == 0 - sleep 1 - end - end - rescue Timeout::Error - fail_test "Puppet agent #{agent} failed to start after #{timeout} seconds" - end - end - end - - step "Attempt to exploit #{agent}" do - # Ensure there's no stale data - on agent, "rm -rf #{exploited}" - on master, "rm -rf #{mtestdir}/exploit.rb" - - # Copy over our exploit and execute - create_remote_file( master, "#{mtestdir}/exploit.rb", exploit_code( master, agent, 'run', 8139, exploited )) - on master, "chmod +x #{mtestdir}/exploit.rb" - on master, "#{mtestdir}/exploit.rb" - - # Did it work? - fail_test( "Found exploit file #{exploited}" ) if - on( agent, "[ ! -f #{exploited} ]", - :acceptable_exit_codes => [0,1] ).exit_code == 1 - end - end -end diff --git a/acceptance/tests/security/cve-2013-1654_sslv2_downgrade_agent.rb b/acceptance/tests/security/cve-2013-1654_sslv2_downgrade_agent.rb deleted file mode 100644 index 08475aa1a..000000000 --- a/acceptance/tests/security/cve-2013-1654_sslv2_downgrade_agent.rb +++ /dev/null @@ -1,98 +0,0 @@ -test_name "CVE 2013-1654 SSL2 Downgrade of Agent connection" do - -require 'puppet/acceptance/windows_utils' -extend Puppet::Acceptance::WindowsUtils - - def which_ruby(host) - if host['platform'] =~ /windows/ - ruby_cmd(host) - else - host['puppetbindir'] ? "#{host['puppetbindir']}/ruby" : 'ruby' - end - end - - def suitable?(host) - cmd = <<END -#{which_ruby(host)} -ropenssl -e "puts OpenSSL::SSL::SSLContext::METHODS.include?(:SSLv2)" -END - on(host, cmd).stdout.chomp == "true" - end - - agents.each do |agent| - if suitable?( agent ) - certfile = on(agent, puppet_agent("--configprint hostcert")).stdout.chomp - keyfile = on(agent, puppet_agent("--configprint hostprivkey")).stdout.chomp - cafile = on(agent, puppet_agent("--configprint localcacert")).stdout.chomp - port = 8150 - - sslserver = <<END -#!/usr/bin/env ruby -require 'webrick' -require 'webrick/https' - -class Servlet < WEBrick::HTTPServlet::AbstractServlet - def do_GET(request, response) - response.status = 200 - response['Content-Type'] = 'text/pson' - response.body = 'FOOBAR' - end -end - -class SSLServer - def run - config = {} - config[:Port] = #{port} - config[:SSLCACertificateFile] = '#{cafile}' - config[:SSLCertificate] = OpenSSL::X509::Certificate.new(File.read('#{certfile}')) - config[:SSLPrivateKey] = OpenSSL::PKey::RSA.new(File.read('#{keyfile}')) - config[:SSLStartImmediately] = true - config[:SSLEnable] = true - config[:SSLVerifyClient] = OpenSSL::SSL::VERIFY_NONE - - server = WEBrick::HTTPServer.new(config) - server.mount('/', Servlet) - server.ssl_context.ssl_version = 'SSLv2' - trap :TERM do - exit!(0) - end - server.start - end -end - -if $0 == __FILE__ - SSLServer.new.run -end -END - testdir = agent.tmpdir('puppet-sslv2') - teardown do - sslserver_in_process_list = agent["platform"] =~ /win/ ? 'ruby' : 'sslserver.rb' - on(agent, "ps -ef | grep #{sslserver_in_process_list} | grep -v grep | awk '{ print $2 }' | xargs kill || echo \"ruby sslserver.rb not running\"") - on(agent, "rm -rf #{testdir}") - end - - create_remote_file(agent, "#{testdir}/sslserver.rb", sslserver) - on agent, "#{which_ruby(agent)} #{testdir}/sslserver.rb &>/dev/null &" - - timeout = 15 - begin - Timeout.timeout(timeout) do - loop do - # 7 is "Could not connect to host", which will happen before it's running - # 28 is "Operation timeout", which could happen if the vm was running slowly - result = on(agent, "curl --tlsv1 -m1 -k https://#{agent}:#{port}", :acceptable_exit_codes => [0,7,28,35]) - break if result.exit_code == 0 or result.exit_code == 35 - sleep 1 - end - end - rescue Timeout::Error - fail_test "Insecure Mock Server on #{agent} failed to start after #{timeout} seconds" - end - - on(agent, puppet("agent --debug --test --server #{agent} --masterport #{port}"), :acceptable_exit_codes => [1]) do |test| - assert_no_match(/'FOOBAR'/, test.stdout) - end - else - logger.debug( "skipping #{agent} since SSLv2 is not available" ) - end - end -end diff --git a/acceptance/tests/security/cve-2013-1654_sslv2_downgrade_master.rb b/acceptance/tests/security/cve-2013-1654_sslv2_downgrade_master.rb deleted file mode 100644 index 13f045a12..000000000 --- a/acceptance/tests/security/cve-2013-1654_sslv2_downgrade_master.rb +++ /dev/null @@ -1,38 +0,0 @@ -test_name "CVE 2013-1654 SSL2 Downgrade of Master connection" do - - def suitable?(host) - ruby = host['puppetbindir'] ? "#{host['puppetbindir']}/ruby" : 'ruby' - cmd = <<END -#{ruby} -ropenssl -e "puts OpenSSL::SSL::SSLContext::METHODS.include?(:SSLv2)" -END - on(host, cmd).stdout.chomp == "true" - end - - def suitable_agent?(agent) - res = on( agent, - 'openssl -v', :acceptable_exit_codes => (0..255).to_a ) - res.exit_code == 0 - end - - suitable_agent = agents.select {|agent| suitable_agent?( agent ) }.first - - if suitable?( master ) - with_puppet_running_on( master, {} ) do - - certfile = on(suitable_agent, puppet_agent("--configprint hostcert")).stdout.chomp - keyfile = on(suitable_agent, puppet_agent("--configprint hostprivkey")).stdout.chomp - cafile = on(suitable_agent, puppet_agent("--configprint localcacert")).stdout.chomp - - openssl_call = "openssl s_client -connect #{master}:8140 " + - "-cert \"#{certfile}\" -key \"#{keyfile}\" " + - "-CAfile \"#{cafile}\" -ssl2 -msg < /dev/null" - - on(suitable_agent, openssl_call, :acceptable_exit_codes => (0..255)) do |test| - assert_match /CLIENT-HELLO/, test.stdout - assert_no_match /SERVER-HELLO/, test.stdout - end - end - else - logger.debug( "Not testing master as SSLv2 isn't available to it" ) - end -end diff --git a/acceptance/tests/security/cve-2013-2275_report_acl.rb b/acceptance/tests/security/cve-2013-2275_report_acl.rb deleted file mode 100644 index 48c158442..000000000 --- a/acceptance/tests/security/cve-2013-2275_report_acl.rb +++ /dev/null @@ -1,30 +0,0 @@ -test_name "(#19531) report save access control" -step "Verify puppet only allows saving reports from the node matching the certificate" - -fake_report = <<-EOYAML ---- !ruby/object:Puppet::Transaction::Report - host: mccune - metrics: {} - logs: [] - kind: inspect - puppet_version: "2.7.20" - status: failed - report_format: 3 -EOYAML - -with_puppet_running_on(master, {}) do - submit_fake_report_cmd = [ - "curl --tlsv1 -k -X PUT", - "--cacert \"$(puppet master --configprint cacert)\"", - "--cert \"$(puppet master --configprint hostcert)\"", - "--key \"$(puppet master --configprint hostprivkey)\"", - "-H 'Content-Type: text/yaml'", - "-d '#{fake_report}'", - "\"https://#{master}:8140/production/report/mccune\"", - ].join(" ") - - on master, submit_fake_report_cmd, :acceptable_exit_codes => [0] do - msg = "(#19531) (CVE-2013-2275) Puppet master accepted a report for a node that does not match the certname" - assert_match(/Forbidden request/, stdout, msg) - end -end diff --git a/acceptance/tests/security/cve-2013-3567_yaml_deserialization_again.rb b/acceptance/tests/security/cve-2013-3567_yaml_deserialization_again.rb deleted file mode 100644 index ebdfa32a0..000000000 --- a/acceptance/tests/security/cve-2013-3567_yaml_deserialization_again.rb +++ /dev/null @@ -1,40 +0,0 @@ -test_name "CVE-2013-3567 Arbitrary YAML Deserialization" - -reportdir = create_tmpdir_for_user master, 'yaml_deserialization' - -dangerous_yaml = "--- !ruby/object:Puppet::Transaction::Report { metrics: { resources: !ruby/object:ERB { src: 'exit 0' } }, logs: [], resource_statuses: [], host: '$(puppet master --configprint certname)' }" - -submit_bad_yaml = [ - "curl --tlsv1 -k -X PUT", - "--cacert $(puppet master --configprint cacert)", - "--cert $(puppet master --configprint hostcert)", - "--key $(puppet master --configprint hostprivkey)", - "-H 'Content-Type: text/yaml'", - "-d \"#{dangerous_yaml}\"", - "\"https://#{master}:8140/production/report/$(puppet master --configprint certname)\"" -].join(' ') - -master_opts = { - 'master' => { - 'reportdir' => reportdir, - 'reports' => 'store', - } -} - -# In PE, the master is running as non-root. We need to set the -# reportdir permissions correctly for it. -on master, "chmod 750 #{reportdir}" -if options.is_pe? - on master, "chown pe-puppet:pe-puppet #{reportdir}" -elsif master.is_using_passenger? - on master, "chown puppet:puppet #{reportdir}" -end - -with_puppet_running_on(master, master_opts) do - on master, submit_bad_yaml - on master, "cat #{reportdir}/$(puppet master --configprint certname)/*" do - assert_no_match(/ERB/, stdout, "Improperly propagated ERB object from input into puppet code") - end -end - -on master, "rm -rf #{reportdir}" diff --git a/acceptance/tests/security/cve-2013-3567_yaml_parameter_deserialization.rb b/acceptance/tests/security/cve-2013-3567_yaml_parameter_deserialization.rb deleted file mode 100644 index a2b20e0d7..000000000 --- a/acceptance/tests/security/cve-2013-3567_yaml_parameter_deserialization.rb +++ /dev/null @@ -1,36 +0,0 @@ -test_name "CVE-2013-3567 Arbitrary YAML Query Parameter Deserialization" - -CURL_UNABLE_TO_FETCH_PAGE = 22 - -require 'uri' - -dangerous_yaml = "--- !ruby/object:Puppet::Node::Environment { name: 'manage' }" - -submit_bad_yaml_as_parameter = [ - "curl --tlsv1 -f -s -S -k -X GET", - "--cacert $(puppet master --configprint cacert)", - "--cert $(puppet master --configprint hostcert)", - "--key $(puppet master --configprint hostprivkey)", - "-H 'Accept: yaml'", - "\"https://#{master}:8140/production/file_metadata/modules/testing/tested?links=#{URI.encode(dangerous_yaml)}\"" -].join(' ') - - -modules = master.tmpdir('modules') -apply_manifest_on master, <<MANIFEST - file { "#{modules}": ensure => directory, owner => puppet } --> file { "#{modules}/testing": ensure => directory, owner => puppet } --> file { "#{modules}/testing/files": ensure => directory, owner => puppet } --> file { "#{modules}/testing/files/tested": ensure => file, content => "test", owner => puppet } -MANIFEST - -master_opts = { - 'master' => { - 'modulepath' => modules, - } -} - -with_puppet_running_on(master, master_opts) do - step "Expect the master to reject the request" - on master, submit_bad_yaml_as_parameter, :acceptable_exit_codes => [CURL_UNABLE_TO_FETCH_PAGE] -end diff --git a/acceptance/tests/security/cve-2013-4761_injection_of_class_names_loading_code.rb b/acceptance/tests/security/cve-2013-4761_injection_of_class_names_loading_code.rb deleted file mode 100644 index f3d3a4115..000000000 --- a/acceptance/tests/security/cve-2013-4761_injection_of_class_names_loading_code.rb +++ /dev/null @@ -1,75 +0,0 @@ -require 'puppet/acceptance/temp_file_utils' - -extend Puppet::Acceptance::TempFileUtils -initialize_temp_dirs - -teardown do - remove_temp_dirs -end - -test_name "CVE 2013-4761 Injection of bad class names causing code loading" do - confine :except, :platform => 'windows' - - def exploit_path - '/tmp/exploit.rb' - end - - # @return [String] path to the manifest file - def create_exploit_manifest(manifest_name, exploit_path_expression) - create_test_file(master, manifest_name, <<-AUTH) -$enc_data = '#{exploit_path_expression}' -include $enc_data - AUTH - get_test_file_path(master, manifest_name) - end - - def should_not_be_able_to_exploit(exploit_manifest_path) - master_opts = { - 'master' => { - 'autosign' => true, - 'manifest' => exploit_manifest_path, - }, - } - - with_puppet_running_on(master, master_opts) do - - agents.each do |agent| - next if agent['roles'].include?('master') - - step "Ensure that the exploit marker is gone" do - on master, "rm -f #{exploit_path}" - end - - step "Request a catalog to trigger the exploit" do - on agent, puppet('agent', '-t', "--server #{master}"), :acceptable_exit_codes => [1] - end - - step "Check that the exploit marker was not created" do - on master, "test ! -e #{exploit_path}" - end - - end - end - end - - step "Create exploit file" do - create_remote_file(master, exploit_path, <<-EXPLOIT) - ::File.open('#{exploit_path}', 'w') { |f| f.puts("exploited") } - EXPLOIT - - chmod(master, '777', exploit_path) - end - - step "Class name is not interpreted as an absolute path" do - manifest_file_path = create_exploit_manifest('site.pp', 'tmp::exploit') - should_not_be_able_to_exploit(manifest_file_path) - end - - step "Class name cannot be used for a directory traversal out of the module path" do - # This is just a guess about how far back we need to go... - traversal_exploit_expression = "#{'::..' * 20}#{exploit_path.gsub(File::SEPARATOR,'::')}" - traversal_manifest_path = create_exploit_manifest('site_traversal.pp', traversal_exploit_expression) - - should_not_be_able_to_exploit(traversal_manifest_path) - end -end diff --git a/acceptance/tests/security/cve-2013-4761_resource_type.rb b/acceptance/tests/security/cve-2013-4761_resource_type.rb deleted file mode 100644 index 24252a1d0..000000000 --- a/acceptance/tests/security/cve-2013-4761_resource_type.rb +++ /dev/null @@ -1,58 +0,0 @@ -require 'puppet/acceptance/temp_file_utils' - -extend Puppet::Acceptance::TempFileUtils -initialize_temp_dirs - -teardown do - remove_temp_dirs -end - -test_name "CVE 2013-4761 Remote code execution via REST resource_type" do - confine :except, :platform => 'windows' - - create_test_file(master, 'auth.conf', <<-AUTH) -path /resource_type -method find, search -auth any -allow * - AUTH - - create_remote_file(master, '/tmp/exploit.rb', <<-EXPLOIT) - ::File.open('/tmp/exploited', 'w') { |f| f.puts("exploited") } - EXPLOIT - chmod(master, '777', '/tmp/exploit.rb') - - master_opts = { - 'master' => { - 'autosign' => true, - 'rest_authconfig' => get_test_file_path(master, 'auth.conf'), - }, - } - - with_puppet_running_on(master, master_opts) do - # Ensure each agent has a signed cert - on agents, puppet("agent", "-t", "--server #{master}") - - agents.each do |agent| - next if agent['roles'].include?('master') - - step "Ensure that the exploit marker is gone" do - on master, "rm -f /tmp/exploited" - end - - step "Request a type that maps to the exploit file" do - type_name = "::..::..::..::..::..::tmp::exploit" - payload = "https://#{master}:8140/production/resource_type/#{type_name}" - cert_path = on(agent, puppet("agent", "--configprint hostcert")).stdout.chomp - key_path = on(agent, puppet("agent", "--configprint hostprivkey")).stdout.chomp - curl_base = "curl --tlsv1 -g --cert \"#{cert_path}\" --key \"#{key_path}\" -k -H 'Accept: pson'" - - on agent, "#{curl_base} '#{payload}'" - end - - step "Check that the exploit marker was not created" do - on master, "test ! -e /tmp/exploited" - end - end - end -end diff --git a/acceptance/tests/ssl/autosign_command.rb b/acceptance/tests/ssl/autosign_command.rb deleted file mode 100644 index b161c1be5..000000000 --- a/acceptance/tests/ssl/autosign_command.rb +++ /dev/null @@ -1,128 +0,0 @@ -require 'puppet/acceptance/common_utils' -extend Puppet::Acceptance::CAUtils - -test_name "autosign command and csr attributes behavior (#7243,#7244)" do - - def assert_key_generated(name) - assert_match(/Creating a new SSL key for #{name}/, stdout, "Expected agent to create a new SSL key for autosigning") - end - - testdirs = {} - step "generate tmp dirs on all hosts" do - hosts.each { |host| testdirs[host] = host.tmpdir('autosign_command') } - end - - teardown do - step "Remove autosign configuration" - testdirs.each do |host,testdir| - on(host, host_command("rm -rf '#{testdir}'") ) - end - reset_agent_ssl - end - - hostname = master.execute('facter hostname') - fqdn = master.execute('facter fqdn') - - reset_agent_ssl(false) - - step "Step 1: ensure autosign command can approve CSRs" do - master_opts = { - 'master' => { - 'autosign' => '/bin/true', - 'dns_alt_names' => "puppet,#{hostname},#{fqdn}", - } - } - with_puppet_running_on(master, master_opts) do - agents.each do |agent| - next if agent == master - - on(agent, puppet("agent --test --server #{master} --waitforcert 0 --certname #{agent}-autosign")) - assert_key_generated(agent) - assert_match(/Caching certificate for #{agent}/, stdout, "Expected certificate to be autosigned") - end - end - end - - reset_agent_ssl(false) - - step "Step 2: ensure autosign command can reject CSRs" do - master_opts = { - 'master' => { - 'autosign' => '/bin/false', - 'dns_alt_names' => "puppet,#{hostname},#{fqdn}", - } - } - with_puppet_running_on(master, master_opts) do - agents.each do |agent| - next if agent == master - - on(agent, puppet("agent --test --server #{master} --waitforcert 0 --certname #{agent}-reject"), :acceptable_exit_codes => [1]) - assert_key_generated(agent) - assert_match(/no certificate found/, stdout, "Expected certificate to not be autosigned") - end - end - end - - autosign_inspect_csr_path = "#{testdirs[master]}/autosign_inspect_csr.rb" - step "Step 3: setup an autosign command that inspects CSR attributes" do - autosign_inspect_csr = <<-END -#!/usr/bin/env ruby -require 'openssl' - -def unwrap_attr(attr) - set = attr.value - str = set.value.first - str.value -end - -csr_text = STDIN.read -csr = OpenSSL::X509::Request.new(csr_text) -passphrase = csr.attributes.find { |a| a.oid == '1.3.6.1.4.1.34380.2.1' } -# And here we jump hoops to unwrap ASN1's Attr Set Str -if unwrap_attr(passphrase) == 'my passphrase' - exit 0 -end -exit 1 - END - create_remote_file(master, autosign_inspect_csr_path, autosign_inspect_csr) - on master, "chmod 777 #{testdirs[master]}" - on master, "chmod 777 #{autosign_inspect_csr_path}" - end - - agent_csr_attributes = {} - step "Step 4: create attributes for inclusion on csr on agents" do - csr_attributes = <<-END -custom_attributes: - 1.3.6.1.4.1.34380.2.0: hostname.domain.com - 1.3.6.1.4.1.34380.2.1: my passphrase - 1.3.6.1.4.1.34380.2.2: # system IPs in hex - - 0xC0A80001 # 192.168.0.1 - - 0xC0A80101 # 192.168.1.1 - END - - agents.each do |agent| - agent_csr_attributes[agent] = "#{testdirs[agent]}/csr_attributes.yaml" - create_remote_file(agent, agent_csr_attributes[agent], csr_attributes) - end - end - - reset_agent_ssl(false) - - step "Step 5: successfully obtain a cert" do - master_opts = { - 'master' => { - 'autosign' => autosign_inspect_csr_path, - 'dns_alt_names' => "puppet,#{hostname},#{fqdn}", - }, - } - with_puppet_running_on(master, master_opts) do - agents.each do |agent| - next if agent == master - - step "attempting to obtain cert for #{agent}" - on(agent, puppet("agent --test --server #{master} --waitforcert 0 --csr_attributes '#{agent_csr_attributes[agent]}' --certname #{agent}-attrs"), :acceptable_exit_codes => [0]) - assert_key_generated(agent) - end - end - end -end diff --git a/acceptance/tests/ssl/certificate_extensions.rb b/acceptance/tests/ssl/certificate_extensions.rb deleted file mode 100644 index 1f7832aa2..000000000 --- a/acceptance/tests/ssl/certificate_extensions.rb +++ /dev/null @@ -1,75 +0,0 @@ -require 'puppet/acceptance/common_utils' -require 'puppet/acceptance/temp_file_utils' -extend Puppet::Acceptance::CAUtils -extend Puppet::Acceptance::TempFileUtils - -initialize_temp_dirs - -test_name "certificate extensions available as trusted data" do - - teardown do - reset_agent_ssl - end - - hostname = master.execute('facter hostname') - fqdn = master.execute('facter fqdn') - site_pp = get_test_file_path(master, "site.pp") - master_config = { - 'master' => { - 'autosign' => '/bin/true', - 'dns_alt_names' => "puppet,#{hostname},#{fqdn}", - 'manifest' => site_pp, - 'trusted_node_data' => true, - } - } - - csr_attributes = YAML.dump({ - 'extension_requests' => { - # registered puppet extensions - 'pp_uuid' => 'b5e63090-5167-11e3-8f96-0800200c9a66', - 'pp_instance_id' => 'i-3fkva', - # private (arbitrary) extensions - '1.3.6.1.4.1.34380.1.2.1' => 'db-server', # node role - '1.3.6.1.4.1.34380.1.2.2' => 'webops' # node group - } - }) - - create_test_file(master, "site.pp", <<-SITE) - file { "$test_dir/trusted.yaml": - ensure => file, - content => inline_template("<%= YAML.dump(@trusted) %>") - } - SITE - - reset_agent_ssl(false) - with_puppet_running_on(master, master_config) do - agents.each do |agent| - next if agent == master - - agent_csr_attributes = get_test_file_path(agent, "csr_attributes.yaml") - create_remote_file(agent, agent_csr_attributes, csr_attributes) - - on(agent, puppet("agent", "--test", - "--server", master, - "--waitforcert", 0, - "--csr_attributes", agent_csr_attributes, - "--certname #{agent}-extensions", - 'ENV' => { "FACTER_test_dir" => get_test_file_path(agent, "") }), - :acceptable_exit_codes => [0, 2]) - - trusted_data = YAML.load(on(agent, "cat #{get_test_file_path(agent, 'trusted.yaml')}").stdout) - - assert_equal({ - 'authenticated' => 'remote', - 'certname' => "#{agent}-extensions", - 'extensions' => { - 'pp_uuid' => 'b5e63090-5167-11e3-8f96-0800200c9a66', - 'pp_instance_id' => 'i-3fkva', - '1.3.6.1.4.1.34380.1.2.1' => 'db-server', - '1.3.6.1.4.1.34380.1.2.2' => 'webops' - } - }, - trusted_data) - end - end -end diff --git a/acceptance/tests/ssl/puppet_cert_generate_and_autosign.rb b/acceptance/tests/ssl/puppet_cert_generate_and_autosign.rb deleted file mode 100644 index 618b9a000..000000000 --- a/acceptance/tests/ssl/puppet_cert_generate_and_autosign.rb +++ /dev/null @@ -1,191 +0,0 @@ -require 'puppet/acceptance/common_utils' -extend Puppet::Acceptance::CAUtils - -test_name "Puppet cert generate behavior (#6112)" do - - # This acceptance test documents the behavior of `puppet cert generate` calls - # for three cases: - # - # 1) On a host which has ssl/ca infrastructure. Typically this would be the - # puppet master which is also the CA, and the expectation is that this is the - # host that `puppet cert generate` commands should be issued on. - # - # This case should succeed as it is the documented use case for the command. - # - # 2) On a host which has no ssl/ca infrastructure but has a valid ca.pem from - # the CA cached in ssl/cert. This would be a host (let's say CN=foo) with a - # puppet agent that has checked in and received a signed ca.pem and foo.pem - # certificate from the master CA. - # - # Talking with Nick Fagerlund, this behavior is unspecified, although it - # should not result in a certificate. And it currently fails with "Error: - # The certificate retrieved from the master does not match the agent's - # private key." This error messaging is a little misleading, in that it is - # strictly speaking true but does not point out that it is the CA cert and - # local CA keys that are involved. - # - # What happens is `puppet cert generate` starts by creating a local - # CertificateAuthority instance which looks for a locally cached - # ssl/cert/ca.pem, generating ssl/ca/ keys in the process. It finds an - # ssl/cert/ca.pem, because we have the master CA's pem, but this certificate - # does not match the keys in ssl/ca that have just been generated (for the - # local CA instance), and validation of the cert fails with the above error. - # - # 3) On a host which has no ssl infrastructure at all (fresh install, hasn't - # tried to send a CSR to the puppet master yet). - # - # Tracing this case, what happens is that `puppet cert generate` starts by - # creating a local CertificateAuthority instance which looks for a locally - # cached ssl/cert/ca.pem. It does not find one and then procedes to - # generate_ca_certificate, which populates a local ssl/ca with public/private - # keys for a local ca cert, creates a CSR locally for this cert, which it - # then signs and saves in ssl/ca/ca_crt.pem and caches in ssl/certs/ca.pem. - # (This is the normal bootstrapping case for a CA; same thing happens during an - # initial `puppet master` run). - # - # This case succeeds, but future calls such as `puppet agent -t` fail. - # Haven't fully traced what happens here. - - test_cn = "cert.test" - - teardown do - step "And try to leave with a good ssl configuration" - reset_agent_ssl - clean_cert(master, test_cn, false) - end - - def generate_and_clean_cert(host, cn, autosign) - on(host, puppet('cert', 'generate', cn, '--autosign', autosign)) - assert_no_match(/Could not find certificate request for.*cert\.test/i, stderr, "Should not see an error message for a missing certificate request.") - clean_cert(host, cn) - end - - def fail_to_generate_cert_on_agent_that_is_not_ca(host, cn, autosign) - return if master.is_pe? - on(host, puppet('cert', 'generate', cn, '--autosign', autosign), :acceptable_exit_codes => [23]) - assert_match(/Error: The certificate retrieved from the master does not match the agent's private key./, stderr, "Should not be able to generate a certificate on an agent that is not also the CA, with autosign #{autosign}.") - end - - def generate_and_clean_cert_with_dns_alt_names(host, cn, autosign) - on(host, puppet('cert', 'generate', cn, '--autosign', autosign, '--dns_alt_names', 'foo,bar')) - on(master, puppet('cert', 'list', '--all')) - assert_match(/cert.test.*DNS:foo/, stdout, "Should find a dns entry for 'foo' in the cert.test listing.") - assert_match(/cert.test.*DNS:bar/, stdout, "Should find a dns entry for 'bar' in the cert.test listing.") - clean_cert(host, cn) - end - - # @return true if the passed host operates in a master role. - def host_is_master?(host) - host['roles'].include?('master') - end - - ################ - # Cases 1 and 2: - - step "Case 1 and 2: Tests behavior of `puppet cert generate` on a master node, and on an agent node that has already authenticated to the master. Tests with combinations of autosign and dns_alt_names." - - reset_agent_ssl - - # User story: - # A root user on the puppet master has a configuration where autosigning is - # explicitly false. They run 'puppet cert generate foo.bar' for a new - # certificate and expect a certificate to be generated and signed because they - # are the root CA, and autosigning should not effect this. - step "puppet cert generate with autosign false" - - hosts.each do |host| - if host_is_master?(host) - generate_and_clean_cert(host, test_cn, false) - else - fail_to_generate_cert_on_agent_that_is_not_ca(host, test_cn, false) - end - end - - # User story: - # A root user on the puppet master has a configuration where autosigning is - # explicitly true. They run 'puppet cert generate foo.bar' for a new - # certificate and expect a certificate to be generated and signed without - # interference from the autosigning setting. (This succeedes in 3.2.2 and - # earlier but produces an extraneous error message per #6112 because there are - # two attempts to sign the CSR, only the first of which succedes due to the CSR - # already haveing been signed and removed.) - step "puppet cert generate with autosign true" - - hosts.each do |host| - if host_is_master?(host) - generate_and_clean_cert(host, test_cn, true) - else - fail_to_generate_cert_on_agent_that_is_not_ca(host, test_cn, true) - end - end - - # These steps are documenting the current behavior with regard to --dns_alt_names - # flags submitted on the command line with a puppet cert generate. - step "puppet cert generate with autosign false and dns_alt_names" - - hosts.each do |host| - if host_is_master?(host) - generate_and_clean_cert_with_dns_alt_names(host, test_cn, false) - else - fail_to_generate_cert_on_agent_that_is_not_ca(host, test_cn, false) - end - end - - step "puppet cert generate with autosign true and dns_alt_names" - hosts.each do |host| - if host_is_master?(host) - on(host, puppet('cert', 'generate', test_cn, '--autosign', 'true', '--dns_alt_names', 'foo,bar'), :acceptable_exit_codes => [24]) - assert_match(/Error: CSR '#{test_cn}' contains subject alternative names.*Use.*--allow-dns-alt-names/, stderr, "Should not be able to generate a certificate, with autosign true and dns_alt_names without specifying allow_dns_alt_names flag.") - # And now sign with allow_dns_alt_names set - on(host, puppet('cert', '--allow-dns-alt-names', 'sign', test_cn)) - assert_match(/Signed certificate request for #{test_cn}/, stdout, "Signed certificate once --allow-dns-alt-names specified") - clean_cert(host, test_cn) - else - fail_to_generate_cert_on_agent_that_is_not_ca(host, test_cn, true) - end - end - - ######### - # Case 3: - - # Attempting to run this in a windows machine fails during the CA generation - # attempting to set the ssl/ca/serial file. Fails inside - # Puppet::Settings#readwritelock because we can't overwrite the lock file in - # Windows. - - step "Case 3: A host with no ssl infrastructure makes a `puppet cert generate` call" do - if !master.is_pe? - confine_block :except, :platform => 'windows' do - - clear_agent_ssl - - step "puppet cert generate" - - hosts.each do |host| - generate_and_clean_cert(host, test_cn, false) - - # Commenting this out until we can figure out whether this behavior is a bug or - # not, and what the platform issues are. - # - # Need to figure out exactly why this fails, where it fails, and document or - # fix. Can reproduce a failure locally in Ubuntu, and the attempt fails - # 'as expected' in Jenkins acceptance jobs on Lucid and Fedora, but succeeds - # on RHEL and Centos... - # - # Redmine (#21739) captures this. - # - # with_puppet_running_on(master, :master => { :certname => master, :autosign => true }) do - # step "but now unable to authenticate normally as an agent" - # - # on(host, puppet('agent', '-t'), :acceptable_exit_codes => [1]) - # - # end - end - end - end - end - - ########## - # PENDING: Test behavior of `puppet cert generate` with an external ca. - -end diff --git a/acceptance/tests/stages/ticket_4655_default_stage_for_classes.rb b/acceptance/tests/stages/ticket_4655_default_stage_for_classes.rb deleted file mode 100644 index be5a16746..000000000 --- a/acceptance/tests/stages/ticket_4655_default_stage_for_classes.rb +++ /dev/null @@ -1,42 +0,0 @@ -test_name "#4655: Allow setting the default stage for parameterized classes" - -agents.each do |agent| - temp_file_name = agent.tmpfile('4655-stage-in-parameterized-class') -test_manifest = <<HERE -stage { one: before => Stage[two] } -stage { two: before => Stage[three] } -stage { three: before => Stage[main] } - -class in_one { - exec { "#{agent.echo('in_one', false)} > #{temp_file_name}": - path => '#{agent.path}', - } -} -class { in_one: stage => "one" } - -class in_two( $stage=two ){ - exec { "#{agent.echo('in_two', false)} >> #{temp_file_name}": - path => '#{agent.path}', - } -} -class { in_two: } - -class in_three { - exec { "#{agent.echo('in_three', false)} >> #{temp_file_name}": - path => '#{agent.path}', - } -} -class { "in_three": stage => "three" } -HERE - - expected_results = "in_one -in_two -in_three -" - apply_manifest_on agent, test_manifest - - on(agent, "cat #{temp_file_name}") do - # echo on windows adds \r\n, so do dotall regexp match - assert_match(/in_one\s*in_two\s*\in_three/m, stdout, "Unexpected result for host '#{agent}'") - end -end diff --git a/acceptance/tests/store_configs/enc_provides_node_when_storeconfigs_enabled.rb b/acceptance/tests/store_configs/enc_provides_node_when_storeconfigs_enabled.rb deleted file mode 100644 index c50cda655..000000000 --- a/acceptance/tests/store_configs/enc_provides_node_when_storeconfigs_enabled.rb +++ /dev/null @@ -1,121 +0,0 @@ -test_name "ENC node information is used when store configs enabled (#16698)" - -confine :to, :platform => ['debian', 'ubuntu'] -confine :except, :platform => 'lucid' - -testdir = master.tmpdir('use_enc') - -create_remote_file master, "#{testdir}/enc.rb", <<END -#!#{master['puppetbindir']}/ruby -require 'yaml' -puts({ - 'classes' => [], - 'parameters' => { - 'data' => 'data from enc' - }, - }.to_yaml) -END -on master, "chmod 755 #{testdir}/enc.rb" - -create_remote_file(master, "#{testdir}/site.pp", 'notify { $data: }') - -on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" -on master, "chmod -R g+rwX #{testdir}" - -create_remote_file master, "#{testdir}/setup.pp", <<END - -$active_record_version = $osfamily ? { - RedHat => $lsbmajdistrelease ? { - 5 => '2.2.3', - default => '3.2.16', - }, - default => '3.2.16', -} - -# Trusty doesn't have a rubygems package anymore -# Not sure which other Debian's might follow suit so -# restricting this narrowly for now -# -if $lsbdistid == "Ubuntu" and $lsbdistrelease == "14.04" { - package { - activerecord: - ensure => $active_record_version, - provider => 'gem', - } -} else { - package { - rubygems: - ensure => present; - - activerecord: - ensure => $active_record_version, - provider => 'gem', - require => Package[rubygems]; - } -} - -if $osfamily == "Debian" { - package { - # This is the deb sqlite3 package - sqlite3: - ensure => present; - - libsqlite3-dev: - ensure => present, - require => Package[sqlite3]; - - } -} elsif $osfamily == "RedHat" { - $sqlite_gem_pkg_name = $operatingsystem ? { - "Fedora" => "rubygem-sqlite3", - default => "rubygem-sqlite3-ruby" - } - - package { - sqlite: - ensure => present; - - $sqlite_gem_pkg_name: - ensure => present, - require => Package[sqlite] - } -} else { - fail "Unknown OS $osfamily" -} -END - -# This is a brute force hack around PUP-1073 because the deb for the core -# sqlite3 package and the rubygem for the sqlite3 driver are both named -# 'sqlite3'. So we just run a second puppet apply. -create_remote_file master, "#{testdir}/setup_sqlite_gem.pp", <<END -if $osfamily == "Debian" { - package { - # This is the rubygem sqlite3 driver - sqlite3-gem: - name => 'sqlite3', - ensure => present, - provider => 'gem', - } -} -END - -on master, puppet_apply("#{testdir}/setup.pp") -on master, puppet_apply("#{testdir}/setup_sqlite_gem.pp") - -master_opts = { - 'master' => { - 'node_terminus' => 'exec', - 'external_nodes' => "#{testdir}/enc.rb", - 'storeconfigs' => true, - 'dbadapter' => 'sqlite3', - 'dblocation' => "#{testdir}/store_configs.sqlite3", - 'manifest' => "#{testdir}/site.pp" - } -} - -with_puppet_running_on master, master_opts, testdir do - agents.each do |agent| - run_agent_on(agent, "--no-daemonize --onetime --server #{master} --verbose") - assert_match(/data from enc/, stdout) - end -end diff --git a/acceptance/tests/ticket_12572_no_last_run_summary_diff.rb b/acceptance/tests/ticket_12572_no_last_run_summary_diff.rb deleted file mode 100644 index 586168469..000000000 --- a/acceptance/tests/ticket_12572_no_last_run_summary_diff.rb +++ /dev/null @@ -1,9 +0,0 @@ -test_name "#12572: Don't print a diff for last_run_summary when show_diff is on" - -agents.each do |host| - # Have to run apply twice in order to make sure a diff would be relevant - on host, puppet_apply("--verbose --show_diff"), :stdin => "notice 'hello'" - on host, puppet_apply("--verbose --show_diff"), :stdin => "notice 'hello'" do - assert_no_match(/notice:.*last_run_summary/, stdout, "should not show a diff for last_run_summary") - end -end diff --git a/acceptance/tests/ticket_13489_service_refresh.pp b/acceptance/tests/ticket_13489_service_refresh.pp deleted file mode 100644 index ba3e48600..000000000 --- a/acceptance/tests/ticket_13489_service_refresh.pp +++ /dev/null @@ -1,20 +0,0 @@ -test_name "#13489: refresh service" - -confine :to, :platform => 'windows' - -manifest = <<MANIFEST -service { 'BITS': - ensure => 'running', -} - -exec { 'hello': - command => "cmd /c echo hello", - path => $::path, - logoutput => true, -} - -Exec['hello'] ~> Service['BITS'] -MANIFEST - -step "Refresh service" -apply_manifest_on(agents, manifest) diff --git a/acceptance/tests/ticket_13948_lib_dir_hook_should_be_called_on_initialization.rb b/acceptance/tests/ticket_13948_lib_dir_hook_should_be_called_on_initialization.rb deleted file mode 100644 index 4b42bb233..000000000 --- a/acceptance/tests/ticket_13948_lib_dir_hook_should_be_called_on_initialization.rb +++ /dev/null @@ -1,162 +0,0 @@ -test_name "the $libdir setting hook is called on startup" - -require 'puppet/acceptance/temp_file_utils' - -extend Puppet::Acceptance::TempFileUtils - -initialize_temp_dirs() -all_tests_passed = false - -############################################################################### -# BEGIN TEST LOGIC -############################################################################### - -# create some vars to point to the directories that we're going to point the master/agents at -master_module_dir = "master_modules" -agent_var_dir = "agent_var" -agent_lib_dir = "#{agent_var_dir}/lib" - -app_name = "superbogus" -app_desc = "a simple %1$s for testing %1$s delivery via plugin sync" -app_output = "Hello from the #{app_name} %s" - -master_module_file_content = {} - -master_module_face_content = <<-HERE -Puppet::Face.define(:#{app_name}, '0.0.1') do - copyright "Puppet Labs", 2011 - license "Apache 2 license; see COPYING" - - summary "#{app_desc % "face"}" - - action(:foo) do - summary "a test action defined in the test face in the main puppet lib dir" - - default - when_invoked do |*args| - puts "#{app_output % "face"}" - end - end - -end -HERE - -master_module_app_content = <<-HERE -require 'puppet/application/face_base' - -class Puppet::Application::#{app_name.capitalize} < Puppet::Application::FaceBase -end - -HERE - -# this begin block is here for handling temp file cleanup via an "ensure" block -# at the very end of the test. -begin - - # here we create a custom app, which basically doesn't do anything except for - # print a hello-world message - agent_module_face_file = "#{agent_lib_dir}/puppet/face/#{app_name}.rb" - master_module_face_file = "#{master_module_dir}/#{app_name}/lib/puppet/face/#{app_name}.rb" - - agent_module_app_file = "#{agent_lib_dir}/puppet/application/#{app_name}.rb" - master_module_app_file = "#{master_module_dir}/#{app_name}/lib/puppet/application/#{app_name}.rb" - - # copy all the files to the master - step "write our simple module out to the master" do - create_test_file(master, master_module_app_file, master_module_app_content, :mkdirs => true) - create_test_file(master, master_module_face_file, master_module_face_content, :mkdirs => true) - end - - step "verify that the app file exists on the master" do - unless test_file_exists?(master, master_module_app_file) then - fail_test("Failed to create app file '#{get_test_file_path(master, master_module_app_file)}' on master") - end - unless test_file_exists?(master, master_module_face_file) then - fail_test("Failed to create face file '#{get_test_file_path(master, master_module_face_file)}' on master") - end - end - - step "start the master" do - master_opts = { - 'master' => { - 'modulepath' => "#{get_test_file_path(master, master_module_dir)}", - 'node_terminus' => 'plain', - } - } - - with_puppet_running_on master, master_opts do - - # the module files shouldn't exist on the agent yet because they haven't been synced - step "verify that the module files don't exist on the agent path" do - agents.each do |agent| - if test_file_exists?(agent, agent_module_app_file) then - fail_test("app file already exists on agent: '#{get_test_file_path(agent, agent_module_app_file)}'") - end - if test_file_exists?(agent, agent_module_face_file) then - fail_test("face file already exists on agent: '#{get_test_file_path(agent, agent_module_face_file)}'") - end - end - end - - step "run the agent" do - agents.each do |agent| - - step "capture the existing ssldir, in case the default package puppet.conf sets it within vardir (rhel...)" - agent_ssldir = on(agent, puppet('agent --configprint ssldir')).stdout.chomp - - on(agent, puppet('agent', - "--vardir=\"#{get_test_file_path(agent, agent_var_dir)}\" ", - "--ssldir=\"#{agent_ssldir}\" ", - "--trace --test --server #{master}") - ) - end - end - - end - end - - step "verify that the module files were synced down to the agent" do - agents.each do |agent| - unless test_file_exists?(agent, agent_module_app_file) then - fail_test("Expected app file not synced to agent: '#{get_test_file_path(agent, agent_module_app_file)}'") - end - unless test_file_exists?(agent, agent_module_face_file) then - fail_test("Expected face file not synced to agent: '#{get_test_file_path(agent, agent_module_face_file)}'") - end - end - end - - step "verify that the application shows up in help" do - agents.each do |agent| - on(agent, PuppetCommand.new(:help, "--vardir=\"#{get_test_file_path(agent, agent_var_dir)}\"")) do - assert_match(/^\s+#{app_name}\s+#{app_desc % "face"}/, result.stdout) - end - end - end - - step "verify that we can run the application" do - agents.each do |agent| - on(agent, PuppetCommand.new(:"#{app_name}", "--vardir=\"#{get_test_file_path(agent, agent_var_dir)}\"")) do - assert_match(/^#{app_output % "face"}/, result.stdout) - end - end - end - - step "clear out the libdir on the agents in preparation for the next test" do - agents.each do |agent| - on(agent, "rm -rf '#{get_test_file_path(agent, agent_lib_dir)}/*'") - end - end - - all_tests_passed = true - -ensure - ########################################################################################## - # Clean up all of the temp files created by this test. It would be nice if this logic - # could be handled outside of the test itself; I envision a stanza like this one appearing - # in a very large number of the tests going forward unless it is handled by the framework. - ########################################################################################## - if all_tests_passed then - remove_temp_dirs() - end -end diff --git a/acceptance/tests/ticket_15560_managehome.rb b/acceptance/tests/ticket_15560_managehome.rb deleted file mode 100644 index de34258e7..000000000 --- a/acceptance/tests/ticket_15560_managehome.rb +++ /dev/null @@ -1,42 +0,0 @@ -test_name "#15560: Manage home directories" - -confine :to, :platform => 'windows' - -username = "pl#{rand(99999).to_i}" - -manifest_present = <<-EOM -user { '#{username}': - ensure => present, - managehome => true, - password => 'Password123!!', -} -EOM - -manifest_absent = <<-EOM -user { '#{username}': - ensure => absent, - managehome => true, -} -EOM - -agents.each do |host| - on(host, puppet_apply, :stdin => manifest_present) - - deleteable_profile = true - - version = on(host, facter('operatingsystemrelease')).stdout.chomp - if version =~ /^5\.[012]|2003/ - homedir = "C:/Documents and Settings/#{username}" - deleteable_profile = false - else - homedir = "C:/Users/#{username}" - end - - on(host, "test -d '#{homedir}'") - - on(host, puppet_apply, :stdin => manifest_absent) - - if deleteable_profile - on(host, "test ! -d '#{homedir}'") - end -end diff --git a/acceptance/tests/ticket_15717_puppet_kick.rb b/acceptance/tests/ticket_15717_puppet_kick.rb deleted file mode 100644 index 337020721..000000000 --- a/acceptance/tests/ticket_15717_puppet_kick.rb +++ /dev/null @@ -1,68 +0,0 @@ -test_name "#15717: puppet kick" -step "verify puppet kick actually triggers an agent run" - -confine :except, :platform => 'windows' - -restauth_conf = <<END -path /run -auth yes -allow * - -path / -auth any -END - -with_puppet_running_on master, {} do - agents.each do |agent| - if agent == master - Log.warn("This test does not support nodes that are both master and agent") - next - end - - # kick will verify the SSL server's cert, but since the master and - # agent can be in different domains (ec2, dc1), ask the agent for - # its fqdn, and always kick using that - agentname = on(agent, puppet_agent('--configprint certname')).stdout.chomp - - step "create rest auth.conf on agent" - testdir = agent.tmpdir('puppet-kick-auth') - create_remote_file(agent, "#{testdir}/auth.conf", restauth_conf) - - step "daemonize the agent" - on(agent, puppet_agent("--debug --daemonize --server #{master} --listen --no-client --rest_authconfig #{testdir}/auth.conf")) - - begin - step "wait for agent to start listening" - timeout = 15 - begin - Timeout.timeout(timeout) do - loop do - # 7 is "Could not connect to host", which will happen before it's running - result = on(agent, "curl --tlsv1 -k https://#{agent}:8139", :acceptable_exit_codes => [0,7]) - break if result.exit_code == 0 - sleep 1 - end - end - rescue Timeout::Error - fail_test "Puppet agent #{agent} failed to start after #{timeout} seconds" - end - - step "kick the agent from the master" - on(master, puppet_kick("--host #{agentname}")) do |result| - assert_match(/Puppet kick is deprecated/, - result.stderr, - "Puppet kick did not issue deprecation warning") - - assert_match(/status is success/, - result.stdout, - "Puppet kick was successful, " + - "but agent #{agent} did not report success") - end - ensure - step "kill agent" - on(agent, puppet_agent("--configprint pidfile")) do |result| - on(agent, "kill `cat #{result.stdout.chomp}`") - end - end - end -end diff --git a/acceptance/tests/ticket_17458_puppet_command_prints_help.rb b/acceptance/tests/ticket_17458_puppet_command_prints_help.rb deleted file mode 100644 index c6ce9d9cf..000000000 --- a/acceptance/tests/ticket_17458_puppet_command_prints_help.rb +++ /dev/null @@ -1,5 +0,0 @@ -test_name "puppet command with an unknown external command prints help" - -on(agents, puppet('unknown'), :acceptable_exit_codes => [1]) do - assert_match(/See 'puppet help' for help on available puppet subcommands/, stdout) -end diff --git a/acceptance/tests/ticket_3172_puppet_kick_with_hostnames_on_the_command_line.rb b/acceptance/tests/ticket_3172_puppet_kick_with_hostnames_on_the_command_line.rb deleted file mode 100644 index 7c58479f5..000000000 --- a/acceptance/tests/ticket_3172_puppet_kick_with_hostnames_on_the_command_line.rb +++ /dev/null @@ -1,19 +0,0 @@ -test_name "#3172: puppet kick with hostnames on the command line" -step "Verify puppet kick application attempts to connect to the hostname specified on the command line" - -target = 'working.example.org' -agents.each do |host| - if host['platform'].include?('windows') - on(host, puppet_kick(target), :acceptable_exit_codes => [1]) { - assert_match(/Puppet kick is not supported/, stderr) - } - else - # Error: Host working.example.org failed: getaddrinfo: Name or service not known - # working.example.org finished with exit code 2 - # Failed: working.example.org - # Exited: 3 - on(host, puppet_kick(target), :acceptable_exit_codes => [3]) { - assert_match(/Triggering #{target}/, stdout, "didn't trigger #{target} on #{host}" ) - } - end -end diff --git a/acceptance/tests/ticket_3360_allow_duplicate_csr_with_option_set.rb b/acceptance/tests/ticket_3360_allow_duplicate_csr_with_option_set.rb deleted file mode 100644 index 54d69177e..000000000 --- a/acceptance/tests/ticket_3360_allow_duplicate_csr_with_option_set.rb +++ /dev/null @@ -1,60 +0,0 @@ -test_name "#3360: Allow duplicate CSR when allow_duplicate_certs is on" - -agent_hostnames = agents.map {|a| a.to_s} - -with_puppet_running_on master, {'master' => {'allow_duplicate_certs' => true}} do - agents.each do |agent| - if agent['platform'].include?('windows') - Log.warn("Pending: Windows does not support facter fqdn") - next - end - - step "Generate a certificate request for the agent" - fqdn = on(agent, facter("fqdn")).stdout.strip - on agent, "puppet certificate generate #{fqdn} --ca-location remote --server #{master}" - end - - step "Collect the original certs" - on master, puppet_cert("--sign --all") - original_certs = on master, puppet_cert("--list --all") - - old_certs = {} - original_certs.stdout.each_line do |line| - if line =~ /^\+ (\S+) \((.+)\)$/ - old_certs[$1] = $2 - puts "old cert: #{$1} #{$2}" - end - end - - agents.each do |agent| - if agent['platform'].include?('windows') - Log.warn("Pending: Windows does not support facter fqdn") - next - end - - fqdn = on(agent, facter("fqdn")).stdout.strip - step "Make another request with the same certname" - on agent, "puppet certificate generate #{fqdn} --ca-location remote --server #{master}" - end - - step "Collect the new certs" - on master, puppet_cert("--sign --all") - new_cert_list = on master, puppet_cert("--list --all") - - new_certs = {} - new_cert_list.stdout.each_line do |line| - if line =~ /^\+ (\S+) \((.+)\)$/ - new_certs[$1] = $2 - puts "new cert: #{$1} #{$2}" - end - end - - step "Verify the certs have changed" - # using the agent name as the key may cause errors; - # agent name from cfg file is likely to have short name - # where certs might be signed with long names. - old_certs.each_key { |key| - next if key.include? master # skip the masters cert, only care about agents - assert_not_equal(old_certs[key], new_certs[key], "Expected #{key} to have a changed key") - } -end diff --git a/acceptance/tests/ticket_3656_requiring_multiple_resources.rb b/acceptance/tests/ticket_3656_requiring_multiple_resources.rb deleted file mode 100644 index 754e6415b..000000000 --- a/acceptance/tests/ticket_3656_requiring_multiple_resources.rb +++ /dev/null @@ -1,8 +0,0 @@ -test_name "#3656: requiring multiple resources" -apply_manifest_on agents, %q{ - notify { 'foo': } - notify { 'bar': } - notify { 'baz': - require => [Notify['foo'], Notify['bar']], - } -} diff --git a/acceptance/tests/ticket_3961_puppet_ca_should_produce_certs.rb b/acceptance/tests/ticket_3961_puppet_ca_should_produce_certs.rb deleted file mode 100644 index c26b8d206..000000000 --- a/acceptance/tests/ticket_3961_puppet_ca_should_produce_certs.rb +++ /dev/null @@ -1,30 +0,0 @@ -test_name "#3961: puppet ca should produce certs spec" -confine :except, :platform => 'windows' - -target = "working3961.example.org" - -expect = ['Signed certificate request for ca', - 'working3961.example.org has a waiting certificate request', - 'Signed certificate request for working3961.example.org', - 'Removing file Puppet::SSL::CertificateRequest working3961.example.org'] - -agents.each do |agent| - scratch = agent.tmpdir('puppet-ssl-3961') - options = { :confdir => scratch, :vardir => scratch } - - step "removing the SSL scratch directory..." - on(agent, "rm -rf #{scratch}") - - step "generate a certificate in #{scratch}" - on(agent,puppet_cert('--trace', '--generate', target, options)) do - expect.each do |line| - stdout.index(line) or fail_test("missing line in output: #{line}") - end - end - - step "verify the certificate for #{target} exists" - on agent, "test -f #{scratch}/ssl/certs/#{target}.pem" - - step "verify the private key for #{target} exists" - on agent, "grep -q 'BEGIN RSA PRIVATE KEY' #{scratch}/ssl/private_keys/#{target}.pem" -end diff --git a/acceptance/tests/ticket_4059_ralsh_can_change_settings.rb b/acceptance/tests/ticket_4059_ralsh_can_change_settings.rb deleted file mode 100644 index ea7b77cbf..000000000 --- a/acceptance/tests/ticket_4059_ralsh_can_change_settings.rb +++ /dev/null @@ -1,21 +0,0 @@ -test_name "#4059: ralsh can change settings" - -agents.each do |agent| - target = agent.tmpfile('hosts-#4059') - content = "host example.com ensure=present ip=127.0.0.1 target=#{target}" - - step "cleanup the target file" - on(agent, "rm -f #{target}") - - step "run the resource agent" - on(agent, puppet_resource(content)) do - stdout.index('Host[example.com]/ensure: created') or - fail_test("missing notice about host record creation") - end - on(agent, "cat #{target}") do - assert_match(/^127\.0\.0\.1\s+example\.com/, stdout, "missing host record in #{target} on #{agent}") - end - - step "cleanup at the end of the test" - on(agent, "rm -f #{target}") -end diff --git a/acceptance/tests/ticket_4110_puppet_apply_should_not_create_a_user_that_already_exists.rb b/acceptance/tests/ticket_4110_puppet_apply_should_not_create_a_user_that_already_exists.rb deleted file mode 100644 index 1d7db2318..000000000 --- a/acceptance/tests/ticket_4110_puppet_apply_should_not_create_a_user_that_already_exists.rb +++ /dev/null @@ -1,8 +0,0 @@ -test_name "#4110: puppet apply should not create a user that already exists" - -agents.each do |host| - user = host['user'] - apply_manifest_on(host, "user { '#{user}': ensure => 'present' }") do - assert_no_match(/created/, stdout, "we tried to create #{user} on #{host}") - end -end diff --git a/acceptance/tests/ticket_4233_resource_with_a_newline.rb b/acceptance/tests/ticket_4233_resource_with_a_newline.rb deleted file mode 100644 index b2e374584..000000000 --- a/acceptance/tests/ticket_4233_resource_with_a_newline.rb +++ /dev/null @@ -1,17 +0,0 @@ -test_name "#4233: resource with a newline" - -# 2010-07-22 Jeff McCune <jeff@puppetlabs.com> -# AffectedVersion: 2.6.0rc3 -# FixedVersion: 2.6.0 - -# JJM We expect 2.6.0rc3 to return an error -# and 2.6.0 final to not return an error line. -# Look for the line in the output and fail the test -# if we find it. - -agents.each do |host| - resource = host.echo('-e "\nHello World\n"') - apply_manifest_on(host, "exec { '#{resource}': }") do - assert_match(/Hello World.*success/, stdout) - end -end diff --git a/acceptance/tests/ticket_4285_file_resource_fail_when_name_defined_instead_of_path.rb b/acceptance/tests/ticket_4285_file_resource_fail_when_name_defined_instead_of_path.rb deleted file mode 100644 index cc67fa872..000000000 --- a/acceptance/tests/ticket_4285_file_resource_fail_when_name_defined_instead_of_path.rb +++ /dev/null @@ -1,21 +0,0 @@ -test_name "Bug #4285: ArgumentError: Cannot alias File[mytitle] to [nil]" - -agents.each do |host| - dir = host.tmpdir('4285-aliasing') - -manifest = %Q{ - file { "file1": - name => '#{dir}/file1', - source => "#{dir}/", - } - - file { "file2": - name => '#{dir}/file2', - source => "#{dir}/", - } -} - - apply_manifest_on(host, manifest) do - assert_no_match(/Cannot alias/, stdout, "#{host}: found the bug report output") - end -end diff --git a/acceptance/tests/ticket_4287_undefined_method_evaluate_match_when_function_call_used_in_an_if_statement.rb b/acceptance/tests/ticket_4287_undefined_method_evaluate_match_when_function_call_used_in_an_if_statement.rb deleted file mode 100644 index 532806346..000000000 --- a/acceptance/tests/ticket_4287_undefined_method_evaluate_match_when_function_call_used_in_an_if_statement.rb +++ /dev/null @@ -1,14 +0,0 @@ -test_name "Bug #4287: undefined method 'evaluate_match' when function call used in an 'if' statement" - -manifest = %q{ - $foo='abc' - if $foo != regsubst($foo,'abc','def') { - notify { 'No issue here...': } - } -} - -agents.each do |host| - apply_manifest_on(host, manifest) do - assert_match(/No issue here.../, stdout, "didn't get the expected notice on #{host}") - end -end diff --git a/acceptance/tests/ticket_4289_facter_should_recognize_OEL_operatingsystemrelease.rb b/acceptance/tests/ticket_4289_facter_should_recognize_OEL_operatingsystemrelease.rb deleted file mode 100644 index cacb7db65..000000000 --- a/acceptance/tests/ticket_4289_facter_should_recognize_OEL_operatingsystemrelease.rb +++ /dev/null @@ -1,21 +0,0 @@ -# 2010-08-02 Nan Liu -# -# http://projects.puppetlabs.com/issues/4289 -# -# NL: Facter should return OS version instead of kernel version for OEL -# test script only applicable to OEL, provided based on ticked info, not verified. - -test_name "#4289: facter should recognize OEL operatingsystemrelease" - -# REVISIT: We don't actually have support for this yet - we need a "not -# applicable" option, I guess, that can be based on detected stuff, which is -# cleaner than this is... --daniel 2010-12-22 -agents.each do |host| - step "determine the operating system of #{host}" - on host, facter("operatingsystem") - if stdout =~ /oel/i then - step "test operatingsystemrelease fact on OEL host #{host}" - on host, facter("operatingsystemrelease") - assert_match(/^\d\.\d$/, stdout, "operatingsystemrelease not as expected on #{host}") - end -end diff --git a/acceptance/tests/ticket_4293_define_and_use_a_define_within_a_class.rb b/acceptance/tests/ticket_4293_define_and_use_a_define_within_a_class.rb deleted file mode 100644 index 18aca2bd0..000000000 --- a/acceptance/tests/ticket_4293_define_and_use_a_define_within_a_class.rb +++ /dev/null @@ -1,23 +0,0 @@ -# 2010-07-22 Jeff McCune <jeff@puppetlabs.com> -# -# AffectedVersion: 2.6.0rc4 -# FixedVersion: 2.6.0 -# -# Description: using a defined type in the class it's declared in -# causes an error. - -manifest = <<PP -class foo { - define do_notify($msg) { - notify { "Message for $name: $msg": } - } - do_notify { "test_one": msg => "a_message_for_you" } -} -include foo -PP - -agents.each do |host| - apply_manifest_on(host, manifest) do - assert_match(/.*?Foo::Do_notify.*?a_message_for_you/, stdout, "the notification didn't show up in stdout on #{host}") - end -end diff --git a/acceptance/tests/ticket_4404_should_allow_stage_main_on_left_side_of_relationship.rb b/acceptance/tests/ticket_4404_should_allow_stage_main_on_left_side_of_relationship.rb deleted file mode 100644 index db7d5a4d3..000000000 --- a/acceptance/tests/ticket_4404_should_allow_stage_main_on_left_side_of_relationship.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Jeff McCune <jeff@puppetlabs.com> -# 2010-07-29 -# -# AffectedVersion: <= 2.6.0rc1 -# FixedVersion: -# -# This specification makes sure the syntax: -# Stage[main] -> Stage[last] -# works as expected - -apply_manifest_on agents, %q{ - stage { [ "pre", "post" ]: } - Stage["pre"] -> Stage["main"] -> Stage["post"] - class one { notify { "class one, first stage": } } - class two { notify { "class two, second stage": } } - class three { notify { "class three, third stage": } } - class { "one": stage => pre } - class { "two": } - class { "three": stage => post } -} - diff --git a/acceptance/tests/ticket_4423_cannot_declare_two_parameterized_classes.rb b/acceptance/tests/ticket_4423_cannot_declare_two_parameterized_classes.rb deleted file mode 100644 index 4c4111dfb..000000000 --- a/acceptance/tests/ticket_4423_cannot_declare_two_parameterized_classes.rb +++ /dev/null @@ -1,50 +0,0 @@ -# Jeff McCune <jeff@puppetlabs.com> -# 2010-07-31 -# -# AffectedVersion: 2.6.0, 2.6.1rc1 -# FixedVersion: -# -# Make sure two parameterized classes are able to be declared. - -test_name "#4423: cannot declare two parameterized classes" - -class1 = %q{ - class rainbow($color) { - notify { "color": message => "Color is [${color}]" } - } - class { "rainbow": color => "green" } -} - -class2 = %q{ - class planet($moons) { - notify { "planet": message => "Moons are [${moons}]" } - } - class { "planet": moons => "1" } -} - -step "Declaring one parameterized class works just fine" -apply_manifest_on(agents, class1) - -step "Make sure we try both classes stand-alone" -apply_manifest_on(agents, class2) - -step "Putting both classes in the same manifest should work." -apply_manifest_on agents, class1 + class2 - -step "Putting both classes in the same manifest should work." -apply_manifest_on agents, class1+class2+%q{ - - class rainbow::location($prism=false, $water=true) { - notify { "${name}": - message => "prism:[${prism}] water:[${water}]"; - } - } - class { "rainbow::location": prism => true, water => false; } - - class rainbow::type($pretty=true, $ugly=false) { - notify { "${name}": - message => "pretty:[${pretty}] ugly:[${ugly}]"; - } - } - class { "rainbow::type": pretty => false, ugly => true; } -} diff --git a/acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb b/acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb deleted file mode 100644 index 1497162ad..000000000 --- a/acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb +++ /dev/null @@ -1,42 +0,0 @@ -# In 2.6, compile does not fail when site.pp does not exist. -# -# However, if a catalog is compiled when site.pp does not exist, -# puppetmaster does not detect when site.pp is created. This requires a restart -# -test_name "Ticket 5477, Puppet Master does not detect newly created site.pp file" - -testdir = master.tmpdir('missing_site_pp') -manifest_file = "#{testdir}/site.pp" - -on master, "chmod 777 #{testdir}" -on master, "rm -f #{manifest_file}" - -master_opts = { - 'master' => { - 'manifest' => manifest_file, - 'node_terminus' => 'plain', - 'filetimeout' => 1 - } -} - -with_puppet_running_on master, master_opts, testdir do - # Run test on Agents - step "Agent: agent --test" - on agents, puppet('agent', "--test --server #{master}") - - # Create a new site.pp - step "Master: create basic site.pp file" - create_remote_file master, manifest_file, "notify{ticket_5477_notify:}" - - on master, "chmod 644 #{manifest_file}" - - sleep 3 - - step "Agent: puppet agent --test" - - agents.each do |host| - on(host, puppet('agent', "--test --server #{master}"), :acceptable_exit_codes => [2]) do - assert_match(/ticket_5477_notify/, stdout, "#{host}: Site.pp not detected on Puppet Master") - end - end -end diff --git a/acceptance/tests/ticket_6418_file_recursion_and_audit.rb b/acceptance/tests/ticket_6418_file_recursion_and_audit.rb deleted file mode 100644 index acb72f535..000000000 --- a/acceptance/tests/ticket_6418_file_recursion_and_audit.rb +++ /dev/null @@ -1,34 +0,0 @@ -# 2011-02-23 -# -# AffectedVersion: 2.6.0-2.6.5 -# FixedVersion: - -test_name "#6418: file recursion and audit" - -agents.each do |agent| - dir = agent.tmpdir('6418-recurse-audit') - -manifest = %Q{ - file { "#{dir}/6418": ensure => directory } - file { "#{dir}/6418/dir": ensure => directory} - file { "#{dir}/6418/dir/dir": ensure => directory} - file { "#{dir}/6418/dir/dir/dir": ensure => directory} - file { "#{dir}/6418-copy": ensure => present, source => "#{dir}/6418/" } - - File["#{dir}/6418"] -> File["#{dir}/6418/dir"] -> File["#{dir}/6418/dir/dir"] -> File["#{dir}/6418/dir/dir/dir"] -> File["#{dir}/6418-copy"] -} - - step "Query agent for statefile" - on agent, puppet_agent('--configprint statefile') do - statefile=stdout.chomp - - step "Remove the statefile on the agent" - on(agent, "rm -f '#{statefile}'") - - step "Apply the manifest" - apply_manifest_on agent, manifest - - step "Verify correct file recursion and audit state" - on(agent, "grep ensure.*directory '#{statefile}'", :acceptable_exit_codes => [ 1 ]) - end -end diff --git a/acceptance/tests/ticket_6541_invalid_filebucket_files.rb b/acceptance/tests/ticket_6541_invalid_filebucket_files.rb deleted file mode 100644 index b743efe87..000000000 --- a/acceptance/tests/ticket_6541_invalid_filebucket_files.rb +++ /dev/null @@ -1,33 +0,0 @@ -test_name "#6541: file type truncates target when filebucket cannot retrieve hash" - -agents.each do |agent| - target=agent.tmpfile('6541-target') - - on agent, "rm -rf \"#{agent.puppet['vardir']}/*bucket\"" - - step "write zero length file" - manifest = "file { '#{target}': content => '' }" - apply_manifest_on(agent, manifest) - - step "overwrite file, causing zero-length file to be backed up" - manifest = "file { '#{target}': content => 'some text' }" - apply_manifest_on(agent, manifest) - - test_name "verify invalid hashes should not change the file" - manifest = "file { '#{target}': content => '{md5}notahash' }" - apply_manifest_on(agent, manifest) do - assert_no_match(/content changed/, stdout, "#{agent}: shouldn't have overwrote the file") - end - - test_name "verify valid but unbucketed hashes should not change the file" - manifest = "file { '#{target}': content => '{md5}13ad7345d56b566a4408ffdcd877bc78' }" - apply_manifest_on(agent, manifest) do - assert_no_match(/content changed/, stdout, "#{agent}: shouldn't have overwrote the file") - end - - test_name "verify that an empty file can be retrieved from the filebucket" - manifest = "file { '#{target}': content => '{md5}d41d8cd98f00b204e9800998ecf8427e' }" - apply_manifest_on(agent, manifest) do - assert_match(/content changed '\{md5\}552e21cd4cd9918678e3c1a0df491bc3' to '\{md5\}d41d8cd98f00b204e9800998ecf8427e'/, stdout, "#{agent}: shouldn't have overwrote the file") - end -end diff --git a/acceptance/tests/ticket_6710_relationship_syntax_should_work_with_title_arrays.rb b/acceptance/tests/ticket_6710_relationship_syntax_should_work_with_title_arrays.rb deleted file mode 100644 index fdf688ea2..000000000 --- a/acceptance/tests/ticket_6710_relationship_syntax_should_work_with_title_arrays.rb +++ /dev/null @@ -1,15 +0,0 @@ -test_name "#6710: Relationship syntax should work with title arrays" - -# Jeff McCune <jeff@puppetlabs.com> -# 2011-03-14 -# -# If bug 6710 is closed, then this manifests should apply cleanly. -# There should be a many-to-many relationship established. -# - -apply_manifest_on agents, %q{ - notify { [ left_one, left_two ]: } -> notify { [ right_one, right_two ]: } - notify { left: } -> notify { right: } - notify { left_one_to_many: } -> notify { [ right_one_to_many_1, right_one_to_many_2 ]: } -} - diff --git a/acceptance/tests/ticket_6734_6256_5530_5503.rb b/acceptance/tests/ticket_6734_6256_5530_5503.rb deleted file mode 100644 index 04419ed22..000000000 --- a/acceptance/tests/ticket_6734_6256_5530_5503.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Puppet master fails to start due to impropper -# permissons on the puppet/ dir. Specially, the rrd -# sub dir is not created when puppet master starts - -test_name "Tickets 6734 6256 5530 5503i Puppet Master fails to start" - -with_puppet_running_on master, {} do - step "Check permissions on puppet/rrd/" - on master, "ls -l \"#{master.puppet['vardir']}\" | grep rrd | awk '{print $3\" \"$4}'" do - assert_match(/#{master['group']} #{master['group']}/, stdout, "puppet/rrd does not exist/wrong permissions") - end -end diff --git a/acceptance/tests/ticket_6857_password-disclosure-when-changing-a-users-password.rb b/acceptance/tests/ticket_6857_password-disclosure-when-changing-a-users-password.rb deleted file mode 100644 index d93348d70..000000000 --- a/acceptance/tests/ticket_6857_password-disclosure-when-changing-a-users-password.rb +++ /dev/null @@ -1,35 +0,0 @@ -test_name "#6857: redact password hashes when applying in noop mode" - -hosts_to_test = agents.reject do |agent| - if agent['platform'].match /(?:ubuntu|centos|debian|el-|fedora)/ - result = on(agent, %Q{#{agent['puppetbindir']}/ruby -e 'require "shadow" or raise'}, :acceptable_exit_codes => [0,1]) - result.exit_code != 0 - else - # Non-linux platforms do not rely on ruby-libshadow for password management - # and so we don't reject them from testing - false - end -end -skip_test "No suitable hosts found" if hosts_to_test.empty? - -adduser_manifest = <<MANIFEST -user { 'passwordtestuser': - ensure => 'present', - password => 'apassword', -} -MANIFEST - -changepass_manifest = <<MANIFEST -user { 'passwordtestuser': - ensure => 'present', - password => 'newpassword', - noop => true, -} -MANIFEST - -apply_manifest_on(hosts_to_test, adduser_manifest ) -results = apply_manifest_on(hosts_to_test, changepass_manifest ) - -results.each do |result| - assert_match( /current_value \[old password hash redacted\], should be \[new password hash redacted\]/ , "#{result.host}: #{result.stdout}" ) -end diff --git a/acceptance/tests/ticket_6907_use_provider_in_same_run_it_becomes_suitable.rb b/acceptance/tests/ticket_6907_use_provider_in_same_run_it_becomes_suitable.rb deleted file mode 100644 index 80ce01aba..000000000 --- a/acceptance/tests/ticket_6907_use_provider_in_same_run_it_becomes_suitable.rb +++ /dev/null @@ -1,46 +0,0 @@ -test_name "providers should be useable in the same run they become suitable" - -agents.each do |agent| - dir = agent.tmpdir('provider-6907') - - on agent, "mkdir -p #{dir}/lib/puppet/{type,provider/test6907}" - on agent, "cat > #{dir}/lib/puppet/type/test6907.rb", :stdin => <<TYPE -Puppet::Type.newtype(:test6907) do - newparam(:name, :namevar => true) - - newproperty(:file) -end -TYPE - - on agent, "cat > #{dir}/lib/puppet/provider/test6907/only.rb", :stdin => <<PROVIDER -Puppet::Type.type(:test6907).provide(:only) do - # The name of the file is chosen to be *.exe so it works on windows and *nix - # becasue windows inspects the PATHEXT environment variable in 1.9.3 and later. - commands :anything => "#{dir}/must_exist.exe" - require 'fileutils' - - def file - 'not correct' - end - - def file=(value) - FileUtils.touch(value) - end -end -PROVIDER - - on agent, puppet_apply("--libdir #{dir}/lib --trace"), :stdin => <<MANIFEST - test6907 { "test-6907": - file => "#{dir}/test_file", - } - - # The name of the file is chosen to be *.exe so it works on windows and *nix - # becasue windows inspects the PATHEXT environment variable in 1.9.3 and later. - file { "#{dir}/must_exist.exe": - ensure => file, - mode => 0755, - } -MANIFEST - - on agent, "ls #{dir}/test_file" -end diff --git a/acceptance/tests/ticket_6928_puppet_master_parse_fails.rb b/acceptance/tests/ticket_6928_puppet_master_parse_fails.rb deleted file mode 100644 index 55162a908..000000000 --- a/acceptance/tests/ticket_6928_puppet_master_parse_fails.rb +++ /dev/null @@ -1,32 +0,0 @@ -test_name "#6928: Puppet --parseonly should return deprication message" - -# Create good and bad formatted manifests -step "Master: create valid, invalid formatted manifests" -create_remote_file(master, '/tmp/good.pp', %w{notify{good:}} ) -create_remote_file(master, '/tmp/bad.pp', 'notify{bad:') - -step "Master: use --parseonly on an invalid manifest, should return 1 and issue deprecation warning" -on master, puppet_master( %w{--parseonly /tmp/bad.pp} ), :acceptable_exit_codes => [ 1 ] - assert_match(/--parseonly has been removed. Please use \'puppet parser validate <manifest>\'/, stdout, "Deprecation warning not issued for --parseonly on #{master}" ) - -step "Agents: create valid, invalid formatted manifests" -agents.each do |host| - good = host.tmpfile('good-6928') - bad = host.tmpfile('bad-6928') - - create_remote_file(host, good, %w{notify{good:}} ) - create_remote_file(host, bad, 'notify{bad:') - - step "Agents: use --parseonly on an invalid manifest, should return 1 and issue deprecation warning" - on(host, puppet('apply', '--parseonly', bad), :acceptable_exit_codes => [ 1 ]) do - assert_match(/--parseonly has been removed. Please use \'puppet parser validate <manifest>\'/, stdout, "Deprecation warning not issued for --parseonly on #{host}" ) - end - - step "Test Face for 'parser validate' with good manifest -- should pass" - on(host, puppet('parser', 'validate', good), :acceptable_exit_codes => [ 0 ]) - - step "Test Faces for 'parser validate' with bad manifest -- should fail" - on(host, puppet('parser', 'validate', bad), :acceptable_exit_codes => [ 1 ]) do - assert_match(/Error: Could not parse for environment production/, stderr, "Bad manifest detection failed on #{host}" ) - end -end diff --git a/acceptance/tests/ticket_7101_template_compile.rb b/acceptance/tests/ticket_7101_template_compile.rb deleted file mode 100644 index b2486b030..000000000 --- a/acceptance/tests/ticket_7101_template_compile.rb +++ /dev/null @@ -1,24 +0,0 @@ -test_name "#7101: template compile" - -agents.each do |agent| - template = agent.tmpfile('template_7101.erb') - target = agent.tmpfile('file_7101.erb') - - manifest = %Q{ -$bar = 'test 7101' -file { '#{target}': - content => template("#{template}") -} -} - - step "Agents: Create template file" - create_remote_file(agent, template, %w{<%= bar %>} ) - - step "Run manifest referencing template file" - apply_manifest_on(agent, manifest) - - step "Agents: Verify file is created with correct contents " - on(agent, "cat #{target}") do - assert_match(/test 7101/, stdout, "File #{target} not created with correct contents on #{agent}" ) - end -end diff --git a/acceptance/tests/ticket_7117_broke_env_criteria_authconf.rb b/acceptance/tests/ticket_7117_broke_env_criteria_authconf.rb deleted file mode 100644 index a94165076..000000000 --- a/acceptance/tests/ticket_7117_broke_env_criteria_authconf.rb +++ /dev/null @@ -1,38 +0,0 @@ -# Windows doesn't suppoert Facter fqdn properly -confine :except, :platform => 'windows' - -test_name "#7117 Broke the environment criteria in auth.conf" - -testdir = create_tmpdir_for_user master, 'env_in_auth_conf' - -# add to auth.conf -add_2_authconf = %q{ -path / -environment override -auth any -allow * -} - -step "Create a temp auth.conf" -create_remote_file master, "#{testdir}/auth.conf", add_2_authconf - -on master, "chmod 644 #{testdir}/auth.conf" -on master, "chmod 777 #{testdir}" - -with_puppet_running_on master, {'master' => {'rest_authconfig' => "#{testdir}/auth.conf"}}, testdir do - agents.each do |agent| - - # Run test on Agents - step "Run agent to upload facts" - on agent, puppet_agent("--test --server #{master}") - - certname = master.is_pe? ? - agent.to_s : - on(agent, facter('fqdn')).stdout.chomp - - step "Fetch agent facts from Puppet Master" - on(agent, "curl --tlsv1 -k -H \"Accept: yaml\" https://#{master}:8140/override/facts/#{certname}") do - assert_match(/--- !ruby\/object:Puppet::Node::Facts/, stdout, "Agent Facts not returned for #{agent}") - end - end -end diff --git a/acceptance/tests/ticket_7139_puppet_resource_file_qualified_paths.rb b/acceptance/tests/ticket_7139_puppet_resource_file_qualified_paths.rb deleted file mode 100644 index 7a7b59434..000000000 --- a/acceptance/tests/ticket_7139_puppet_resource_file_qualified_paths.rb +++ /dev/null @@ -1,13 +0,0 @@ -test_name "#7139: Puppet resource file fails on path with leading '/'" - -agents.each do |agent| - target = agent.tmpfile('ticket-7139') - - step "Agents: create valid, invalid formatted manifests" - create_remote_file(agent, target, %w{foo bar contents} ) - - step "Run puppet file resource on #{target}" - on(agent, puppet_resource('file', target)) do - assert_match(/file \{ \'#{Regexp.escape(target)}\':/, stdout, "puppet resource file failed on #{agent}") - end -end diff --git a/acceptance/tests/ticket_7165_no_refresh_after_starting_service.rb b/acceptance/tests/ticket_7165_no_refresh_after_starting_service.rb deleted file mode 100644 index f17caad94..000000000 --- a/acceptance/tests/ticket_7165_no_refresh_after_starting_service.rb +++ /dev/null @@ -1,41 +0,0 @@ -test_name "Bug #7165: Don't refresh service immediately after starting it" - -confine :except, :platform => 'windows' - -agents.each do |host| - dir = host.tmpdir('7165-no-refresh') - -manifest = %Q{ - file { "#{dir}/notify": - content => "foo", - notify => Service["service"], - } - - service { "service": - ensure => running, - hasstatus => true, - hasrestart => true, - status => "test -e #{dir}/service", - start => "touch #{dir}/service", - stop => "rm -f #{dir}/service", - restart => "touch #{dir}/service_restarted", - require => File["#{dir}/notify"], - provider => base, - } -} - - apply_manifest_on(host, manifest) do - on(host, "test -e #{dir}/service") - # service should not restart, since it wasn't running to begin with - on(host, "test -e #{dir}/service_restarted", :acceptable_exit_codes => [1]) - end - - # will trigger a notify next time as the file changes - on(host, "echo bar > #{dir}/notify") - - apply_manifest_on(host, manifest) do - on(host, "test -e #{dir}/service") - # service should restart this time - on(host, "test -e #{dir}/service_restarted") - end -end diff --git a/acceptance/tests/ticket_7728_don't_log_whits_on_failure.rb b/acceptance/tests/ticket_7728_don't_log_whits_on_failure.rb deleted file mode 100644 index c5fe7e4ef..000000000 --- a/acceptance/tests/ticket_7728_don't_log_whits_on_failure.rb +++ /dev/null @@ -1,18 +0,0 @@ -test_name "#7728: Don't log whits on resource failure" - -manifest = %Q{ - class foo { - exec { "test": command => "false", path => ['/bin', '/usr/bin'] } - - notify { "before": before => Exec["test"] } - notify { "after": require => Exec["test"] } - } - - include foo -} - -apply_manifest_on(agents, manifest) do - assert_match(Regexp.new(Regexp.quote('/Stage[main]/Foo/Notify[after]: Dependency Exec[test] has failures: true')), stdout, "the after dependency must be reported") - assert_no_match(Regexp.new(Regexp.quote('Class[Foo]')), stdout, 'the class should not be mentioned') - assert_no_match(Regexp.new(Regexp.quote('Stage[Main]')), stdout, 'the class should not be mentioned') -end diff --git a/acceptance/tests/ticket_9862_puppet_runs_without_service_user_or_group_present.rb b/acceptance/tests/ticket_9862_puppet_runs_without_service_user_or_group_present.rb deleted file mode 100644 index bdd98e414..000000000 --- a/acceptance/tests/ticket_9862_puppet_runs_without_service_user_or_group_present.rb +++ /dev/null @@ -1,65 +0,0 @@ -test_name "#9862: puppet runs without service user or group present" - -# puppet doesn't try to manage ownership on windows. -confine :except, :platform => 'windows' - -require 'puppet/acceptance/temp_file_utils' -extend Puppet::Acceptance::TempFileUtils -initialize_temp_dirs - -def assert_ownership(agent, location, expected_user, expected_group) - on(agent, "stat --format '%U:%G' #{location}") do - assert_match(/#{expected_user}:#{expected_group}/, stdout) - end -end - -def missing_directory_for(agent, dir) - agent_dir = get_test_file_path(agent, dir) - on agent, "rm -rf #{agent_dir}" - agent_dir -end - -teardown do - agents.each do |agent| - step "ensure puppet resets it's user/group settings" - on agent, puppet('apply', '-e', '"notify { puppet_run: }"') - on agent, "find \"#{agent.puppet['vardir']}\" -user existinguser" do - assert_equal('',stdout) - end - on agent, puppet('resource', 'user', 'existinguser', 'ensure=absent') - on agent, puppet('resource', 'group', 'existinggroup', 'ensure=absent') - end -end - -step "when the user and group are missing" -agents.each do |agent| - logdir = missing_directory_for(agent, 'log') - - on agent, puppet('apply', - '-e', '"notify { puppet_run: }"', - '--logdir', logdir, - '--user', 'missinguser', - '--group', 'missinggroup') do - - assert_match(/puppet_run/, stdout) - assert_ownership(agent, logdir, 'root', 'root') - end -end - -step "when the user and group exist" -agents.each do |agent| - logdir = missing_directory_for(agent, 'log') - - on agent, puppet('resource', 'user', 'existinguser', 'ensure=present') - on agent, puppet('resource', 'group', 'existinggroup', 'ensure=present') - - on agent, puppet('apply', - '-e', '"notify { puppet_run: }"', - '--logdir', logdir, - '--user', 'existinguser', - '--group', 'existinggroup') do - - assert_match(/puppet_run/, stdout) - assert_ownership(agent, logdir, 'existinguser', 'existinggroup') - end -end diff --git a/acceptance/tests/windows/eventlog.rb b/acceptance/tests/windows/eventlog.rb deleted file mode 100644 index 80bc8d924..000000000 --- a/acceptance/tests/windows/eventlog.rb +++ /dev/null @@ -1,24 +0,0 @@ -test_name "Write to Windows eventlog" - -confine :to, :platform => 'windows' - -require 'puppet/acceptance/windows_utils' -extend Puppet::Acceptance::WindowsUtils - -agents.each do |agent| - # get remote time - now = on(agent, "#{ruby_cmd(agent)} -e \"puts Time.now.utc.strftime('%m/%d/%Y %H:%M:%S')\"").stdout.chomp - - # it should fail to start since parent directories don't exist - confdir = "/does/not/exist" - - # generate an error, no master on windows boxes - on agent, puppet_agent('--server', '127.0.0.1', '--test', '--confdir', confdir), :acceptable_exit_codes => [1] - - # make sure there's a Puppet error message in the log - # cygwin + ssh + wmic hangs trying to read stdin, so echo '' | - on agent, "cmd /c echo '' | wmic ntevent where \"LogFile='Application' and SourceName='Puppet' and TimeWritten >= '#{now}'\" get Message,Type /format:csv" do - fail_test "Event not found in Application event log" unless - stdout =~ /Cannot create [a-z]:\/does\/not\/exist.*,Error/mi - end -end diff --git a/api/docs/http_api_index.md b/api/docs/http_api_index.md deleted file mode 100644 index 0683ee40f..000000000 --- a/api/docs/http_api_index.md +++ /dev/null @@ -1,108 +0,0 @@ -V1 API Services ---------------- - -Puppet Agents use various network services which the Puppet Master provides in -order to manage systems. Other systems can access these services in order to -put the information that the Puppet Master has to use. - -The V1 API is all based off of dispatching to puppet's internal "indirector" -framework. Every HTTP endpoint in V1 follows the form -`/:environment/:indirection/:key`, where - * `:environment` is the name of the environment that should be in effect for - the request. Not all endpoints need an environment, but the path component - must always be specified. - * `:indirection` is the indirection to dispatch the request to. - * `:key` is the "key" portion of the indirection call. - -Using this API requires a significant amount of understanding of how puppet's -internal services are structured. The following documents provide some -specification for what is available and the ways in which they can be -interacted with. - -### Configuration Management Services - -These services are all related to how the Puppet Agent is able to manage the -configuration of a node. - -* {file:api/docs/http_catalog.md Catalog} -* {file:api/docs/http_file_bucket_file.md File Bucket File} -* {file:api/docs/http_file_content.md File Content} -* {file:api/docs/http_file_metadata.md File Metadata} -* {file:api/docs/http_report.md Report} - -### Informational Services - -These services all provide extra information that can be used to understand how -the Puppet Master will be providing configuration management information to -Puppet Agents. - -* {file:api/docs/http_facts.md Facts} -* {file:api/docs/http_node.md Node} -* {file:api/docs/http_resource_type.md Resource Type} -* {file:api/docs/http_status.md Status} - -### SSL Certificate Related Services - -These services are all in support of Puppet's PKI system. - -* {file:api/docs/http_certificate.md Certificate} -* {file:api/docs/http_certificate_request.md Certificate Signing Requests} -* {file:api/docs/http_certificate_status.md Certificate Status} -* {file:api/docs/http_certificate_revocation_list.md Certificate Revocation List} - -V2 HTTP API ------------ - -The V2 HTTP API is accessed by prefixing requests with `/v2.0`. Authorization for -these endpoints is still controlled with the `auth.conf` authorization system -in puppet. When specifying the authorization of the V2 endpoints in `auth.conf` -the `/v2.0` prefix on V2 API paths must be retained; the full request path is used. - -The V2 API will only accept payloads formatted as JSON and respond with JSON -(MIME application/json). - -### Endpoints - -* {file:api/docs/http_environments.md Environments} - -### Error Responses - -All V2 API endpoints will respond to error conditions in a uniform manner and -use standard HTTP response code to signify those errors. - -* When the client submits a malformed request, the API will return a 400 Bad - Request response. -* When the client is not authorized, the API will return a 403 Not Authorized - response. -* When the client attempts to use an HTTP method that is not permissible for - the endpoint, the API will return a 405 Method Not Allowed response. -* When the client asks for a response in a format other than JSON, the API will - return a 406 Unacceptable response. -* When the server encounters an unexpected error during the handling of a - request, it will return a 500 Server Error response. -* When the server is unable to find an endpoint handler for the request that - starts with `/v2.0`, it will return a 404 Not Found response - -The V2 API paths are prefixed with `/v2.0` instead of `/v2` so that it is able -to respond with 404, but not interfere with any environments in the V1 API. -`v2` is a valid environment name, but `v2.0` is not. - -All error responses will contain a body, except when it is a HEAD request. The -error responses will uniformly be a JSON object with the following properties: - - * `message`: [String] A human readable message explaining the error. - * `issue_kind`: [String] A unique label to identify the error class. - * `stacktrace` (only for 5xx errors): [Array<String>] A stacktrace to where the error occurred. - -A {file:api/schemas/error.json JSON schema for the error objects} is also available. - - -Serialization Formats ---------------------- - -Puppet sends messages using several different serialization formats. Not all -REST services support all of the formats. - -* {file:api/docs/pson.md PSON} -* {http://www.yaml.org/spec/1.2/spec.html YAML} - diff --git a/api/docs/http_catalog.md b/api/docs/http_catalog.md deleted file mode 100644 index 2e2c9651b..000000000 --- a/api/docs/http_catalog.md +++ /dev/null @@ -1,159 +0,0 @@ -Catalog -============= - -The `catalog` endpoint returns a catalog for the specified node name given the provided facts. - -Find ----- - -Retrieve a catalog. - - POST /:environment/catalog/:nodename - GET /:environment/catalog/:nodename - -### Supported HTTP Methods - -POST, GET - -### Supported Response Formats - -PSON - -### Notes - -The POST and GET methods are functionally equivalent. Both provide the 3 parameters specified below: the POST in the -request body, the GET in the query string. - -Puppet originally used GET; POST was added because some web servers have a maximum URI length of -1024 bytes (which is easily exceeded with the `facts` parameter). - -The examples below use the POST method. - -### Parameters - -Three parameters should be provided to the POST or GET: -- `facts_format`: must be `pson` -- `facts`: serialized pson of the facts hash. One odd note: due to a long-ago misunderstanding in the code, this is - doubly-escaped (it should just be singly-escaped). To keep backward compatibility, the extraneous - escaping is still used/supported. -- `transaction_uuid`: a transaction uuid identifying the entire transaction (shows up in the report as well) - -### Example Response - -#### Catalog found - - POST /env/catalog/elmo.mydomain.com - - facts_format=pson&facts=%7B%22name%22%3A%22elmo.mydomain.com%22%2C%22values%22%3A%7B%22architecture%22%3A%22x86_64%22%7D&transaction_uuid=aff261a2-1a34-4647-8c20-ff662ec11c4c - - HTTP 200 OK - Content-Type: text/pson - - { - "document_type": "Catalog", - "data": { - "tags": [ - "settings", - "multi_param_class", - "class" - ], - "name": "elmo.mydomain.com", - "version": 1377473054, - "environment": "production", - "resources": [ - { - "type": "Stage", - "title": "main", - "tags": [ - "stage" - ], - "exported": false, - "parameters": { - "name": "main" - } - }, - { - "type": "Class", - "title": "Settings", - "tags": [ - "class", - "settings" - ], - "exported": false - }, - { - "type": "Class", - "title": "main", - "tags": [ - "class" - ], - "exported": false, - "parameters": { - "name": "main" - } - }, - { - "type": "Class", - "title": "Multi_param_class", - "tags": [ - "class", - "multi_param_class" - ], - "line": 10, - "exported": false, - "parameters": { - "one": "hello", - "two": "world" - } - }, - { - "type": "Notify", - "title": "foo", - "tags": [ - "notify", - "foo", - "class", - "multi_param_class" - ], - "line": 4, - "exported": false, - "parameters": { - "message": "One is hello, two is world" - } - } - ], - "edges": [ - { - "source": "Stage[main]", - "target": "Class[Settings]" - }, - { - "source": "Stage[main]", - "target": "Class[main]" - }, - { - "source": "Stage[main]", - "target": "Class[Multi_param_class]" - }, - { - "source": "Class[Multi_param_class]", - "target": "Notify[foo]" - } - ], - "classes": [ - "settings", - "multi_param_class" - ] - }, - "metadata": { - "api_version": 1 - } - } - -Schema ------- - -In the POST request body (or the GET query), the facts parameter should adhere to the -{file:api/schemas/facts.json api/schemas/facts.json} schema. - -A catalog response body should adhere to the {file:api/schemas/catalog.json api/schemas/catalog.json} schema. diff --git a/api/docs/http_certificate.md b/api/docs/http_certificate.md deleted file mode 100644 index 9b60eb034..000000000 --- a/api/docs/http_certificate.md +++ /dev/null @@ -1,108 +0,0 @@ -Certificate -============= - -The `certificate` endpoint returns the certificate for the specified name, -which might be either a standard certname or `ca`. - -Find ----- - -Get a certificate. - - GET /:environment/certificate/:nodename - - -### Supported HTTP Methods - -GET - -### Supported Response Formats - -s (denotes a string of text) - -The returned certificate is always in the `.pem` format. - -### Parameters - -None - -### Notes - -The environment field is ignored. - -### Responses - -#### Certificate found - - GET /env/certificate/elmo.mydomain.com - - HTTP 200 OK - Content-Type: text/plain - - -----BEGIN CERTIFICATE----- - MIIFujCCA6KgAwIBAgIBATANBgkqhkiG9w0BAQsFADBiMWAwXgYDVQQDDFdQdXBw - ZXQgQ0EgZ2VuZXJhdGVkIG9uIGRoY3A1MC5reWxvLmJhY2tsaW5lLnB1cHBldGxh - YnMubmV0IGF0IDIwMTMtMDYtMjQgMTY6MzA6MTcgLTA3MDAwHhcNMTMwNjIzMjMz - MDE5WhcNMTgwNjIzMjMzMDE5WjBiMWAwXgYDVQQDDFdQdXBwZXQgQ0EgZ2VuZXJh - dGVkIG9uIGRoY3A1MC5reWxvLmJhY2tsaW5lLnB1cHBldGxhYnMubmV0IGF0IDIw - MTMtMDYtMjQgMTY6MzA6MTcgLTA3MDAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw - ggIKAoICAQDABq1lmzccjuRmnCdXvTmdeXJGb9S8r8+I+G6fkHTa1WKDSob9PZpS - eXJtanbl0zNws9yBt1Dko2zhKDKctBRWf5CT42nDxBZPY7SaD7KaCzb07g9wfWgU - BOb/6smyl/iySEmQzzFLRgZbo5A9WLiy/UdyQim1faakevRme2Xi/l/i0TKbpu27 - DhCS+E8aC8Bvaj0ph0T+TzYphTR76pP5Kps6G7Jyk/HFYrVXnY44X2PEt2mgkEXp - xHCbU+qCFMtTLMG+ZArA/noM3I/O6W5LhLSzApjut/M7UdMlpZ45PGDrsvf2R306 - NcOh+zbbkhxuIaGqaxeaenYzbOlA3gXhZvYaV6EKjXNtm7BslpsvhLi0U+CWyb3C - qRkpex0MgxJgxoqViJ4TDVA+EmztOnK86+G4HGeJqTPQloYO/Td1wMT1Txh9T5Ue - Wctw/g+4o22EyJQRo+vxxzHNRIfe7EHAerMUtLT5u9MJeQb9N1iUR2ATNAN+QiB2 - KEqyc9eMapK6QUZFV23Xvbdup1WCrgsWXBqyRWKV7x0sc9Wv8RMRKEFYaBeHEVXU - m0hGgF34Z8Rzphq2H1FjkLD+xbtGOjrA1Mb2De81Hfvrf18497X5UMPtsuzOt/XU - PHbbSCy+05J7VNZ/gaiGqgpHfcG5yiqCdj1LIzhFuuvm+fADPxK38wIDAQABo3sw - eTA3BglghkgBhvhCAQ0EKhYoUHVwcGV0IFJ1YnkvT3BlblNTTCBJbnRlcm5hbCBD - ZXJ0aWZpY2F0ZTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV - HQ4EFgQUEhn/MqSDtuxg12klWosCGenxf1cwDQYJKoZIhvcNAQELBQADggIBAH1G - L3FG/keKlGqs70PxxvR1wCo4VM3K/C+5uxnzm1MHEAd96nhtwE6YSkUe+XgDiXfC - +NXS2C4TeTQAEo6grREapWDjhJvrhrgqTZmb4lTKzb91II3/VGYzG5UXxID262zy - QLoX/IBN/xDJ5ds0wF2adUbnHUssEGGljgngewH/7kjeW/L5iL+USXZnKHPSggjM - RAEjlucE/rDqDNoxhOS4K2PjseFm7krW4cZ0gNmxdrhc7OhmJ56dH92F4M9jn7Qy - EqxWB304U/aMcO3NJxTQc7AreL/pUtjtI6hxM4miHbjSh6RfNBqhzRyJvxA6gc6g - m3kumdw04KZFSs/6fPFFbI60i5K+vioB4CnUWpj+3Z+OnDEvhQJEACR1JC8A67Ih - x+GDlbHLU1BWonwZzSMJz+ABXV3dwIrOSFHI0UmDXg+cIdZ+SaL93qMjUVU4v9nu - gR9yJGMqNuzLjgfbD/KGCEEAITKBwPvCVd//OMlWVrXr7vvt+yo6STIlTJxABJDp - CSLyHUtT++CsPXsPADxgRctpIbh1eMFEivkK9Oy+W/CZYIZnARVysUpMWg7TkXqx - mSCXy9ZXLWqU/ssVhbLS9vFVa5pvxcyfiRpsFg0XZsx8mnZP6OaWcL8FjF+/NwNP - tg1+DuYTn+d54OHi/GZEnvutgrDZyrJDrrb/Czm9 - -----END CERTIFICATE----- - -#### Certificate not found - - GET /env/certificate/certificate_does_not_exist - - HTTP 404 Not Found - Content-Type: text/plain - - Not Found: Could not find certificate certificate_does_not_exist - -#### No Certificate name given - - GET /env/certificate/ - - HTTP/1.1 400 Bad Request - Content-Type: text/plain - - No request key specified in /env/certificate/ - -#### Master is not a CA - - GET /env/certificate/valid_certificate - - HTTP/1.1 400 Bad Request - Content-Type: text/plain - - this master is not a CA - - -Schema ------- - -A `certificate` response body is not structured data according to any standard scheme such as -json/pson/yaml, so no schema is applicable. diff --git a/api/docs/http_certificate_request.md b/api/docs/http_certificate_request.md deleted file mode 100644 index f84883169..000000000 --- a/api/docs/http_certificate_request.md +++ /dev/null @@ -1,165 +0,0 @@ -Certificate Request -============= - -The `certificate_request` endpoint submits a Certificate Signing Request (CSR) -to the master. The master must be configured to be a CA. The returned -CSR is always in the `.pem` format. - -In all requests the `:environment` must be given, but it has no bearing on the request. CSRs are not managed within environments, all CSRs are global. - -Find ----- - -Get a submitted CSR - - GET /:environment/certificate_request/:nodename - Accept: s - -Save ----- - -Submit a CSR - - PUT /:environment/certificate_request/:nodename - Content-Type: text/plain - -Note: The `:nodename` must match the Common Name on the submitted CSR. - -Note: Although the `Content-Type` is sent as `text/plain` the content is -specifically a CSR in PEM format. - -Search ----- - -List submitted CSRs - - GET /:environment/certificate_requests/:ignored_pattern - Accept: s - -The `:ignored_pattern` parameter is not used, but must still be provided. - -Destroy ----- - -Delete a submitted CSR - - DELETE /:environment/certificate_request/:nodename - Accept: s - -### Supported HTTP Methods - -The default configuration only allows requests that result in a Find and a -Save. You need to modify auth.conf in order to allow clients to use Search and -Destroy actions. It is not recommended that you change the default settings. - -GET, PUT, DELETE - -### Supported Response Formats - -s (denotes a string of text) - -The returned CSR is always in the `.pem` format. - -### Parameters - -None - -### Examples - -#### CSR found - - GET /env/certificate_request/agency - - HTTP/1.1 200 OK - Content-Type: text/plain - - -----BEGIN CERTIFICATE REQUEST----- - MIIBnzCCAQwCAQAwYzELMAkGA1UEBhMCVUsxDzANBgNVBAgTBkxvbmRvbjEPMA0G - A1UEBxMGTG9uZG9uMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQx - DzANBgNVBAMTBmFnZW5jeTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxSCr - FKUKjVGFPuQ0iGM9mZKw94sOIgGohqrHH743kPvjsId3d38Qk+H+1DbVf42bQY0W - kAVcwNDqmBnx0lOtQ0oeGnbbwlJFjhqXr8jFEljPrc9S2/IIILDf/FeYWw9lRiOV - LoU6ZfCIBfq6v4D4KX3utRbOoELNyBeT6VA1ufMCAwEAAaAAMAkGBSsOAwIPBQAD - gYEAno7O1jkR56TNMe1Cw/eyQUIaniG22+0kmoftjlcMYZ/IKCOz+HRgnDtBPf8j - O5nt0PQN8YClW7Xx2U8ZTvBXn/UEKMtCBkbF+SULiayxPgfyKy/axinfutEChnHS - ZtUMUBLlh+gGFqOuH69979SJ2QmQC6FNomTkYI7FOHD/TG0= - -----END CERTIFICATE REQUEST----- - -#### CSR not found - - GET /env/certificate_request/does_not_exist - - HTTP/1.1 404 Not Found - Content-Type: text/plain - - Not Found: Could not find certificate_request does_not_exist - -#### No node name given - - GET /env/certificate_request/ - - HTTP/1.1 400 Bad Request - Content-Type: text/plain - - No request key specified in /env/certificate_request/ - -#### Delete a CSR that exists - - DELETE /production/certificate_request/agency - Accept: s - - HTTP/1.1 200 OK - Content-Type: text/plain - - 1 - -#### Delete a CSR that does not exists - - DELETE /production/certificate_request/missing - Accept: s - - HTTP/1.1 200 OK - Content-Type: text/plain - - false - -#### Retrieve all CSRs - - GET /production/certificate_requests/ignored - Accept: s - - HTTP/1.1 200 OK - Content-Type: text/plain - - -----BEGIN CERTIFICATE REQUEST----- - MIIBnzCCAQwCAQAwYzELMAkGA1UEBhMCVUsxDzANBgNVBAgTBkxvbmRvbjEPMA0G - A1UEBxMGTG9uZG9uMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQx - DzANBgNVBAMTBmFnZW5jeTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxSCr - FKUKjVGFPuQ0iGM9mZKw94sOIgGohqrHH743kPvjsId3d38Qk+H+1DbVf42bQY0W - kAVcwNDqmBnx0lOtQ0oeGnbbwlJFjhqXr8jFEljPrc9S2/IIILDf/FeYWw9lRiOV - LoU6ZfCIBfq6v4D4KX3utRbOoELNyBeT6VA1ufMCAwEAAaAAMAkGBSsOAwIPBQAD - gYEAno7O1jkR56TNMe1Cw/eyQUIaniG22+0kmoftjlcMYZ/IKCOz+HRgnDtBPf8j - O5nt0PQN8YClW7Xx2U8ZTvBXn/UEKMtCBkbF+SULiayxPgfyKy/axinfutEChnHS - ZtUMUBLlh+gGFqOuH69979SJ2QmQC6FNomTkYI7FOHD/TG0= - -----END CERTIFICATE REQUEST----- - - --- - -----BEGIN CERTIFICATE REQUEST----- - MIIBnjCCAQsCAQAwYjELMAkGA1UEBhMCVUsxDzANBgNVBAgTBkxvbmRvbjEPMA0G - A1UEBxMGTG9uZG9uMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQx - DjAMBgNVBAMTBWFnZW50MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC1tucK - enT1CkDPgsCU/0e2cbzRsiKF8yHH7+ntF6Q3d9ZCaZWJ00mj0+YmiYrnum+KAikE - 45Iaf9vaUV3CPsDVrUPOI8kYehiv868ZhP3nxblE6iuNBK+Fdv9GN/vKQrmL5iRE - bIrOM3/lxpS7SpidGdA6EIVlS3604bwLY4xHNQIDAQABoAAwCQYFKw4DAg8FAAOB - gQAXH0YFuidPqB6P2MyPEEGZ3rzozINBx/oXvGptXI60Zy5mgH6iAkrZfi57pEzP - jFoO2JRaFxTJC1FVpc4zR1K6sq4h3fIMwqppJRX+5wJNKyhU61eY2gR2O/rAJzw4 - wcUKf9JhoE7/p1cUulIIIq7t/ibCvf0LYSFwGqTwGqN2TQ== - -----END CERTIFICATE REQUEST----- - -The CSR PEMs are separated by "\n---\n" - -Schema ------- - -A `certificate_request` response body is not structured data according to any -standard scheme such as json/pson/yaml, so no schema is applicable. diff --git a/api/docs/http_certificate_revocation_list.md b/api/docs/http_certificate_revocation_list.md deleted file mode 100644 index fa7468be4..000000000 --- a/api/docs/http_certificate_revocation_list.md +++ /dev/null @@ -1,187 +0,0 @@ -Certificate Revocation List -=========================== - -The `certificate_revocation_list` endpoint retrieves a Certificate Revocation List (CRL) -from the master. The master must be configured to be a CA. The returned -CRL is always in the `.pem` format. - -In all requests the `:environment` and `:nodename` must be given, but neither has any bearing on the request. - -Find ----- - -Get the submitted CRL - - GET /:environment/certificate_revocation_list/:nodename - Accept: s - -### Supported HTTP Methods - -GET - -### Supported Response Formats - -s (denotes a string of text) - -The returned CRL is always in the `.pem` format. - -### Parameters - -None - -### Examples - -Since the returned CRL always looks similar to the human eye, the successful examples are each followed by an openssl -decoding of the CRL PEM file. - -#### Empty revocation list - - GET /env/certificate_revocation_list/ca - - HTTP/1.1 200 OK - Content-Type: text/plain - - -----BEGIN X509 CRL----- - MIICdzBhAgEBMA0GCSqGSIb3DQEBBQUAMB8xHTAbBgNVBAMMFFB1cHBldCBDQTog - bG9jYWxob3N0Fw0xMzA3MTYyMDQ4NDJaFw0xODA3MTUyMDQ4NDNaoA4wDDAKBgNV - HRQEAwIBADANBgkqhkiG9w0BAQUFAAOCAgEAqyBJOy3dtCOcrb0Fu7ZOOiDQnarg - IzXUV/ug1dauPEVyURLNNr+CJrr89QZnU/71lqgpWTN/J47mO/lffMSPjmINE+ng - XzOffm0qCG2+gNyaOBOdEmQTLdHPIXvcm7T+wEqc7XFW2tjEdpEubZgweruU/+DB - RX6/PhFbalQ0bKcMeFLzLAD4mmtBaQCJISmUUFWx1pyCS6pgBtQ1bNy3PJPN2PNW - YpDf3DNZ16vrAJ4a4SzXLXCoONw0MGxZcS6/hctJ75Vz+dTMrArKwckytWgQS/5e - c/1/wlMZn4xlho+EcIPMPfCB5hW1qzGU2WjUakTVxzF4goamnfFuKbHKEoXVOo9C - 3dEQ9un4Uyd1xHxj8WvQck79In5/S2l9hdqp4eud4BaYB6tNRKxlUntSCvCNriR2 - wrDNsMuQ5+KJReG51vM0OzzKmlScgIHaqbVeNFZI9X6TpsO2bLEZX2xyqKw4xrre - OIEZRoJrmX3VQ/4u9hj14Qbt72/khYo6z/Fckc5zVD+dW4fjP2ztVTSPzBqIK3+H - zAgewYW6cJ6Aan8GSl3IfRqj6WlOubWj8Gr1U0dOE7SkBX6w/X61uqsHrOyg/E/Z - 0Wcz/V+W5iZxa4Spm0x4sfpNzf/bNmjTe4M2MXyn/hXx5MdHf/HZdhOs/lzwKUGL - kEwcy38d6hYtUjs= - -----END X509 CRL----- - - > openssl crl -inform PEM -in empty.crl -text -noout - Certificate Revocation List (CRL): - Version 2 (0x1) - Signature Algorithm: sha1WithRSAEncryption - Issuer: /CN=Puppet CA: localhost - Last Update: Jul 16 20:48:42 2013 GMT - Next Update: Jul 15 20:48:43 2018 GMT - CRL extensions: - X509v3 CRL Number: - 0 - No Revoked Certificates. - Signature Algorithm: sha1WithRSAEncryption - ab:20:49:3b:2d:dd:b4:23:9c:ad:bd:05:bb:b6:4e:3a:20:d0: - 9d:aa:e0:23:35:d4:57:fb:a0:d5:d6:ae:3c:45:72:51:12:cd: - 36:bf:82:26:ba:fc:f5:06:67:53:fe:f5:96:a8:29:59:33:7f: - 27:8e:e6:3b:f9:5f:7c:c4:8f:8e:62:0d:13:e9:e0:5f:33:9f: - 7e:6d:2a:08:6d:be:80:dc:9a:38:13:9d:12:64:13:2d:d1:cf: - 21:7b:dc:9b:b4:fe:c0:4a:9c:ed:71:56:da:d8:c4:76:91:2e: - 6d:98:30:7a:bb:94:ff:e0:c1:45:7e:bf:3e:11:5b:6a:54:34: - 6c:a7:0c:78:52:f3:2c:00:f8:9a:6b:41:69:00:89:21:29:94: - 50:55:b1:d6:9c:82:4b:aa:60:06:d4:35:6c:dc:b7:3c:93:cd: - d8:f3:56:62:90:df:dc:33:59:d7:ab:eb:00:9e:1a:e1:2c:d7: - 2d:70:a8:38:dc:34:30:6c:59:71:2e:bf:85:cb:49:ef:95:73: - f9:d4:cc:ac:0a:ca:c1:c9:32:b5:68:10:4b:fe:5e:73:fd:7f: - c2:53:19:9f:8c:65:86:8f:84:70:83:cc:3d:f0:81:e6:15:b5: - ab:31:94:d9:68:d4:6a:44:d5:c7:31:78:82:86:a6:9d:f1:6e: - 29:b1:ca:12:85:d5:3a:8f:42:dd:d1:10:f6:e9:f8:53:27:75: - c4:7c:63:f1:6b:d0:72:4e:fd:22:7e:7f:4b:69:7d:85:da:a9: - e1:eb:9d:e0:16:98:07:ab:4d:44:ac:65:52:7b:52:0a:f0:8d: - ae:24:76:c2:b0:cd:b0:cb:90:e7:e2:89:45:e1:b9:d6:f3:34: - 3b:3c:ca:9a:54:9c:80:81:da:a9:b5:5e:34:56:48:f5:7e:93: - a6:c3:b6:6c:b1:19:5f:6c:72:a8:ac:38:c6:ba:de:38:81:19: - 46:82:6b:99:7d:d5:43:fe:2e:f6:18:f5:e1:06:ed:ef:6f:e4: - 85:8a:3a:cf:f1:5c:91:ce:73:54:3f:9d:5b:87:e3:3f:6c:ed: - 55:34:8f:cc:1a:88:2b:7f:87:cc:08:1e:c1:85:ba:70:9e:80: - 6a:7f:06:4a:5d:c8:7d:1a:a3:e9:69:4e:b9:b5:a3:f0:6a:f5: - 53:47:4e:13:b4:a4:05:7e:b0:fd:7e:b5:ba:ab:07:ac:ec:a0: - fc:4f:d9:d1:67:33:fd:5f:96:e6:26:71:6b:84:a9:9b:4c:78: - b1:fa:4d:cd:ff:db:36:68:d3:7b:83:36:31:7c:a7:fe:15:f1: - e4:c7:47:7f:f1:d9:76:13:ac:fe:5c:f0:29:41:8b:90:4c:1c: - cb:7f:1d:ea:16:2d:52:3b - -#### One-item revocation list - - GET /env/certificate_revocation_list/ca - - HTTP/1.1 200 OK - Content-Type: text/plain - - -----BEGIN X509 CRL----- - MIICnDCBhQIBATANBgkqhkiG9w0BAQUFADAfMR0wGwYDVQQDDBRQdXBwZXQgQ0E6 - IGxvY2FsaG9zdBcNMTMxMDA3MTk0ODQwWhcNMTgxMDA2MTk0ODQxWjAiMCACAQUX - DTEzMTAwNzE5NDg0MVowDDAKBgNVHRUEAwoBAaAOMAwwCgYDVR0UBAMCAQEwDQYJ - KoZIhvcNAQEFBQADggIBALrh49WNdmrJOPCRntD1nxCObmqZgl8ZwTv7TO9VkmCG - Ksvo8zR2aTIOH9VUKqWrE0squhtFJXl8dxL4PR1RiLbmhO7dp+NHdu8ejTQpoOTp - h69xbQFT3oHcIdn2cBGrLJQcZgXsiswT0KJ8nuw6eDO93yXDrguSUdou99M99wTw - 2nn1kUQKW9b0vUI7t2ADF5U8/DES+1IrvBq2IEHmg4+ekZRCxeJMuqd1R13gymcJ - osSPbRgIjCli6zD3aK4Nq5OMMpVLV/VVPwyQb4GwW4Wj5iyNAp8d/EAqtZ21ZHUi - nvuXmRtUWHJwfi40D5T2GQXxuUjB4pnh8cFq7f89iUvqoCwFo7nRIacrrweNFMYD - GxVJVMfz4PkP66ckIPQ5Uuey92dg5p2w4b2cp8NstxMdgcc3KAF483ItKA8uIDuU - 1dbzw1v2k5qUjoImueHwKolbLmPyYmvFp7hbnV+WpFbvGjyIfW3BMankDEv4ig0L - MCw6n2GKv1hSWM6Mrk8Ja1yYOFLsjI0RoVCZsf1iNiRT28haldXVTPyNtct9mGAv - 6az5W/nyixIPrrHubTx28zhmuHZx6y3hQMCLmuYOT+e7F/eFsYXVEjuJjxjr33uA - O/ii4EkTls1gzvonOtoBoGElzQAogrZI3HXCwFYvU2whLKr9cwv5bpRkUfPCMQ4n - -----END X509 CRL----- - - > openssl crl -inform PEM -in 1revoked.crl -text -noout - Certificate Revocation List (CRL): - Version 2 (0x1) - Signature Algorithm: sha1WithRSAEncryption - Issuer: /CN=Puppet CA: localhost - Last Update: Oct 7 19:48:40 2013 GMT - Next Update: Oct 6 19:48:41 2018 GMT - CRL extensions: - X509v3 CRL Number: - 1 - Revoked Certificates: - Serial Number: 05 - Revocation Date: Oct 7 19:48:41 2013 GMT - CRL entry extensions: - X509v3 CRL Reason Code: - Key Compromise - Signature Algorithm: sha1WithRSAEncryption - ba:e1:e3:d5:8d:76:6a:c9:38:f0:91:9e:d0:f5:9f:10:8e:6e: - 6a:99:82:5f:19:c1:3b:fb:4c:ef:55:92:60:86:2a:cb:e8:f3: - 34:76:69:32:0e:1f:d5:54:2a:a5:ab:13:4b:2a:ba:1b:45:25: - 79:7c:77:12:f8:3d:1d:51:88:b6:e6:84:ee:dd:a7:e3:47:76: - ef:1e:8d:34:29:a0:e4:e9:87:af:71:6d:01:53:de:81:dc:21: - d9:f6:70:11:ab:2c:94:1c:66:05:ec:8a:cc:13:d0:a2:7c:9e: - ec:3a:78:33:bd:df:25:c3:ae:0b:92:51:da:2e:f7:d3:3d:f7: - 04:f0:da:79:f5:91:44:0a:5b:d6:f4:bd:42:3b:b7:60:03:17: - 95:3c:fc:31:12:fb:52:2b:bc:1a:b6:20:41:e6:83:8f:9e:91: - 94:42:c5:e2:4c:ba:a7:75:47:5d:e0:ca:67:09:a2:c4:8f:6d: - 18:08:8c:29:62:eb:30:f7:68:ae:0d:ab:93:8c:32:95:4b:57: - f5:55:3f:0c:90:6f:81:b0:5b:85:a3:e6:2c:8d:02:9f:1d:fc: - 40:2a:b5:9d:b5:64:75:22:9e:fb:97:99:1b:54:58:72:70:7e: - 2e:34:0f:94:f6:19:05:f1:b9:48:c1:e2:99:e1:f1:c1:6a:ed: - ff:3d:89:4b:ea:a0:2c:05:a3:b9:d1:21:a7:2b:af:07:8d:14: - c6:03:1b:15:49:54:c7:f3:e0:f9:0f:eb:a7:24:20:f4:39:52: - e7:b2:f7:67:60:e6:9d:b0:e1:bd:9c:a7:c3:6c:b7:13:1d:81: - c7:37:28:01:78:f3:72:2d:28:0f:2e:20:3b:94:d5:d6:f3:c3: - 5b:f6:93:9a:94:8e:82:26:b9:e1:f0:2a:89:5b:2e:63:f2:62: - 6b:c5:a7:b8:5b:9d:5f:96:a4:56:ef:1a:3c:88:7d:6d:c1:31: - a9:e4:0c:4b:f8:8a:0d:0b:30:2c:3a:9f:61:8a:bf:58:52:58: - ce:8c:ae:4f:09:6b:5c:98:38:52:ec:8c:8d:11:a1:50:99:b1: - fd:62:36:24:53:db:c8:5a:95:d5:d5:4c:fc:8d:b5:cb:7d:98: - 60:2f:e9:ac:f9:5b:f9:f2:8b:12:0f:ae:b1:ee:6d:3c:76:f3: - 38:66:b8:76:71:eb:2d:e1:40:c0:8b:9a:e6:0e:4f:e7:bb:17: - f7:85:b1:85:d5:12:3b:89:8f:18:eb:df:7b:80:3b:f8:a2:e0: - 49:13:96:cd:60:ce:fa:27:3a:da:01:a0:61:25:cd:00:28:82: - b6:48:dc:75:c2:c0:56:2f:53:6c:21:2c:aa:fd:73:0b:f9:6e: - 94:64:51:f3:c2:31:0e:27 - -#### No node name given - - GET /env/certificate_revocation_list - - HTTP/1.1 400 Bad Request - Content-Type: text/plain - - No request key specified in /env/certificate_revocation_list - -Schema ------- - -A `certificate_revocation_list` response body is not structured data according to any -standard scheme such as json/pson/yaml, so no schema is applicable. diff --git a/api/docs/http_certificate_status.md b/api/docs/http_certificate_status.md deleted file mode 100644 index 41bbdfda4..000000000 --- a/api/docs/http_certificate_status.md +++ /dev/null @@ -1,129 +0,0 @@ -Certificate Status -=============== - -The `certificate status` endpoint allows a client to read or alter the -status of a certificate or pending certificate request. It is only -useful on the CA. - -In all requests the `:environment` must be given, but it has no bearing -on the request. Certificates are global. - -Find ----- - - GET /:environment/certificate_status/:certname - Accept: pson - -Retrieve information about the specified certificate. Similar to `puppet -cert --list :certname`. - -Search ------ - - GET /:environment/certificate_statuses/:any_key - Accept: pson - -Retrieve information about all known certificates. Similar to `puppet -cert --list --all`. A key is required but is ignored. - -Save ----- - - PUT /:environment/certificate_status/:certname - Content-Type: text/pson - -Change the status of the specified certificate. The desired state -is sent in the body of the PUT request as a one-item PSON hash; the two -allowed complete hashes are `{"desired_state":"signed"}` (for signing a -certificate signing request; similar to `puppet cert --sign`) and -`{"desired_state":"revoked"}` (for revoking a certificate; similar to -`puppet cert --revoke`). - -Note that revoking a certificate will not clean up other info about the -host - see the DELETE request for more information. - -Delete ------ - - DELETE /:environment/certificate_status/:hostname - Accept: pson - -Cause the certificate authority to discard all SSL information regarding -a host (including any certificates, certificate requests, and keys). -This does not revoke the certificate if one is present; if you wish to -emulate the behavior of `puppet cert --clean`, you must PUT a -`desired_state` of `revoked` before deleting the host’s SSL information. - -If the deletion was successful, it returns a string listing the deleted -classes like - - "Deleted for myhost: Puppet::SSL::Certificate, Puppet::SSL::Key" - -Otherwise it returns - - "Nothing was deleted" - -### Supported HTTP Methods - -This endpoint is disabled in the default configuration. It is -recommended to be careful with this endpoint, as it can allow control -over the certificates used by the puppet master. - -GET, PUT, DELETE - - -### Supported Response Formats - -PSON - -This endpoint can produce yaml as well, but the returned data is -incomplete. - -### Examples - -#### Certificate information - - GET /env/certificate_status/mycertname - - HTTP/1.1 200 OK - Content-Type: text/pson - - { - "name":"mycertname", - "state":"signed", - "fingerprint":"A6:44:08:A6:38:62:88:5B:32:97:20:49:8A:4A:4A:AD:65:C3:3E:A2:4C:30:72:73:02:C5:F3:D4:0E:B7:FC:2F", - "fingerprints":{ - "default":"A6:44:08:A6:38:62:88:5B:32:97:20:49:8A:4A:4A:AD:65:C3:3E:A2:4C:30:72:73:02:C5:F3:D4:0E:B7:FC:2F", - "SHA1":"77:E6:5A:7E:DD:83:78:DC:F8:51:E3:8B:12:71:F4:57:F1:C2:34:AE", - "SHA256":"A6:44:08:A6:38:62:88:5B:32:97:20:49:8A:4A:4A:AD:65:C3:3E:A2:4C:30:72:73:02:C5:F3:D4:0E:B7:FC:2F", - "SHA512":"CA:A0:8C:B9:FE:9D:C2:72:18:57:08:E9:4B:11:B7:BC:4E:F7:52:C8:9C:76:03:45:B4:B6:C5:D2:DC:E8:79:43:D7:71:1F:5C:97:FA:B2:F3:ED:AE:19:BD:A9:3B:DB:9F:A5:B4:8D:57:3F:40:34:29:50:AA:AA:0A:93:D8:D7:54" - }, - "dns_alt_names":["DNS:puppet","DNS:mycertname"] - } - - -#### Revoking a certificate - - PUT /production/certificate_status/mycertname HTTP/1.1 - Content-Type: text/pson - Content-Length: 27 - - {"desired_state":"revoked"} - -This has no meaningful return value. - - -#### Deleting the certificate information - - DELETE /production/certificate_status/mycertname HTTP/1.1 - -Gets the response: - - "Deleted for mycertname: Puppet::SSL::Certificate, Puppet::SSL::Key" - -Schema ------ - -Find and search operations return objects which -conform to the json schema at {file:api/schemas/host.json -api/schemas/host.json}. diff --git a/api/docs/http_environments.md b/api/docs/http_environments.md deleted file mode 100644 index 2a0bb6904..000000000 --- a/api/docs/http_environments.md +++ /dev/null @@ -1,46 +0,0 @@ -Environments -============ - -The `environments` endpoint allows for enumeration of the environments known to the master. Each environment contains information -about itself like its modulepath, manifest directory, environment timeout, and the config version. -This endpoint is by default accessible to any client with a valid certificate, though this may be changed by `auth.conf`. - -Get ---- - -Get the list of known environments. - - GET /v2.0/environments - -### Parameters - -None - -### Example Request & Response - - GET /v2.0/environments - - HTTP 200 OK - Content-Type: application/json - - { - "search_paths": ["/etc/puppet/environments"] - "environments": { - "production": { - "settings": { - "modulepath": ["/etc/puppetlabs/puppet/environments/production/modules", "/etc/puppetlabs/puppet/environments/development/modules"], - "manifest": ["/etc/puppetlabs/puppet/environments/production/manifests"] - "environment_timeout": 180, - "config_version": "/version/of/config" - } - } - } - } - -The `environment_timeout` attribute could also be the string "unlimited". - -Schema ------- - -A environments response body adheres to the {file:api/schemas/environments.json -api/schemas/environments.json} schema. diff --git a/api/docs/http_facts.md b/api/docs/http_facts.md deleted file mode 100644 index 290493269..000000000 --- a/api/docs/http_facts.md +++ /dev/null @@ -1,144 +0,0 @@ -Facts -============= - -The `facts` endpoint allows getting or setting the facts for the specified node name. The `facts_search` endpoint -allows retrieving a list of node names containing the specified facts. - -Find ----- - -Get facts for a node. - - GET /:environment/facts/:nodename - -### Supported HTTP Methods - -GET - -### Supported Response Formats - -PSON - -### Parameters - -None - -### Example Response - -* Note: list of facts was shortened for readability. -* Note: pson was formatted for readability. - -#### Facts found - - GET /env/facts/elmo.mydomain.com - - HTTP 200 OK - Content-Type: text/pson - - { - "name": "elmo.mydomain.com", - "values": { - "architecture": "x86_64", - "kernel": "Darwin", - "domain": "local", - "macaddress": "70:11:24:8c:33:a9", - "osfamily": "Darwin", - "operatingsystem": "Darwin", - "facterversion": "1.7.2", - "fqdn": "elmo.mydomain.com", - }, - "timestamp": "2013-09-09 15:49:27 -0700", - "expiration": "2013-09-09 16:19:27 -0700" - } - -Save ----- - -Store facts for a node. The request body should contain pson-formatted facts. - - PUT /:environment/facts/:nodename - -### Supported HTTP Methods - -PUT - -### Supported Format - -Accept: pson, text/pson - -### Parameters - -None - -### Example Response - -* Note: list of facts was shortened for readability. -* Note: pson was formatted for readability. - -#### Facts found - - PUT /env/facts/elmo.mydomain.com - - Content-Type: text/pson - - { - "name": "elmo.mydomain.com", - "values": { - "architecture": "x86_64", - "kernel": "Darwin", - "domain": "local", - "macaddress": "70:11:24:8c:33:a9", - "osfamily": "Darwin", - "operatingsystem": "Darwin", - "facterversion": "1.7.2", - "fqdn": "elmo.mydomain.com", - }, - "timestamp": "2013-09-09 15:49:27 -0700", - "expiration": "2013-09-09 16:19:27 -0700" - } - - HTTP/1.1 200 OK - Content-Type: text/pson - - "/etc/puppet/var/yaml/facts/joebob.local.yaml" - -Search ----- - -Get the list of nodes matching the facts_search parameters - - GET /:environment/facts_search/search - -### Supported HTTP Methods - -GET - -### Supported Format - -Accept: pson, text/pson - -### Parameters - -For the parameters, see http://docs.puppetlabs.com/guides/rest_api.html#facts-search. - -### Response - -The response is an array of node names. The array is square-bracket delimited; the node names are quoted and -comma separated. - -### Example Response - -#### Facts found - - GET /env/facts_search/search?facts.processorcount.ge=2 - - HTTP 200 OK - Content-Type: text/pson - - ["elmo.mydomain.com","kermit.mydomain.com"] - -Schema ------- - -The representation of facts, whether returned from a GET or contained in a PUT body, should adhere to the -{file:api/schemas/facts.json api/schemas/facts.json} schema. diff --git a/api/docs/http_file_bucket_file.md b/api/docs/http_file_bucket_file.md deleted file mode 100644 index 3adf17b43..000000000 --- a/api/docs/http_file_bucket_file.md +++ /dev/null @@ -1,101 +0,0 @@ -File Bucket File -============= - -The `file_bucket_file` endpoint manages the contents of files in the -file bucket. All access to files is managed with the md5 checksum of the -file contents, represented as `:md5`. Where used, `:filename` means the -full absolute path of the file on the client system. This is usually -optional and used as an error check to make sure correct file is -retrieved. The environment is required in all requests but ignored, as -the file bucket does not distinguish between environments. - -Find ----- - -Retrieve the contents of a file. - - GET /:environment/file_bucket_file/:md5 - GET /:environment/file_bucket_file/:md5/:original_path - -This will return the contents of the file if it's present. If -`:original_path` is provided then the contents will only be sent if the -file was uploaded with the same path at some point. - -Head ----- - -Check if a file is present in the filebucket - - HEAD /:environment/file_bucket_file/:md5 - HEAD /:environment/file_bucket_file/:md5/:original_path - -This behaves identically to find, only returning headers. - -Save ----- - -Save a file to the filebucket - - PUT /:environment/file_bucket_file/:md5 - PUT /:environment/file_bucket_file/:md5/:original_path - -The body should contain the file contents. This saves the file using the -md5 sum of the file contents. If `:original_path` is provided, it adds -the path to a list for the given file. If the md5 sum in the request is -incorrect, the file will be instead saved under the correct checksum. - -### Supported HTTP Methods - -GET, HEAD, PUT - -### Supported Response Formats - -s or text/plain (a string of the raw file contents) - -Puppet also understands `pson` and `text/pson`, but their use is -deprecated and support will be removed in a future version. - -### Parameters - -None - -### Examples - -#### Saving a file - - > PUT /production/file_bucket_file/md5/eb61eead90e3b899c6bcbe27ac581660//home/user/myfile.txt HTTP/1.1 - - > Content-Type: text/plain - > Content-Length: 24 - - > This is the file content - - - < HTTP/1.1 200 OK - -#### Retrieving a file - - > GET /production/file_bucket_file/md5/4949e56d376cc80ce5387e8e89a75396//home/user/myfile.txt HTTP/1.1 - > Accept: s - - - < HTTP/1.1 200 OK - < Content-Length: 24 - - < This is the file content - -#### Wrong file name - - > GET /production/file_bucket_file/md5/4949e56d376cc80ce5387e8e89a75396//home/user/wrong_name HTTP/1.1 - > Accept: s - - - < HTTP/1.1 404 Not Found - < - < Not Found: Could not find file_bucket_file md5/4949e56d376cc80ce5387e8e89a75396/home/user/wrong_name - -Schema ------- - -A `file_bucket_file` response body is not structured data according to any standard scheme such as -json/pson/yaml, so no schema is applicable. diff --git a/api/docs/http_file_content.md b/api/docs/http_file_content.md deleted file mode 100644 index 8b13417c7..000000000 --- a/api/docs/http_file_content.md +++ /dev/null @@ -1,70 +0,0 @@ -File Content -============= - -The `file_content` endpoint returns the contents of the specified file. - -Find ----- - -Get a file. - - GET /:environment/file_content/:mount_point/:name - -`:mount_point` is one of mounts configured in the `fileserver.conf`. -See [the puppet file server guide](http://docs.puppetlabs.com/guides/file_serving.html) -for more information about how mount points work. - -`:name` is the path to the file within the `:mount_point` that is requested. - -### Supported HTTP Methods - -GET - -### Supported Response Formats - -raw (the raw binary content) - -### Parameters - -None - -### Notes - -### Responses - -#### File found - - GET /env/file_content/modules/example/my_file - Accept: raw - - HTTP/1.1 200 OK - Content-Type: application/x-raw - Content-Length: 16 - - this is my file - - -#### File not found - - GET /env/file_content/modules/example/not_found - Accept: raw - - HTTP/1.1 404 Not Found - Content-Type: text/plain - - Not Found: Could not find file_content modules/example/not_found - -#### No file name given - - GET /env/file_content/ - - HTTP/1.1 400 Bad Request - Content-Type: text/plain - - No request key specified in /env/file_content/ - -Schema ------- - -A `file_content` response body is not structured data according to any standard scheme such as -json/pson/yaml, so no schema is applicable. diff --git a/api/docs/http_file_metadata.md b/api/docs/http_file_metadata.md deleted file mode 100644 index e84c1fe14..000000000 --- a/api/docs/http_file_metadata.md +++ /dev/null @@ -1,436 +0,0 @@ -File Metadata -============= - -The `file_metadata` endpoint returns select metadata for a single file or many files. There are find and search variants -of the endpoint; the search variant has a trailing 's' so is actually `file_metadatas`. - -Although the term 'file' is used generically in the endpoint name and documentation, each returned item can be one of -the following three types: - -* file -* directory -* symbolic link - -Note that an `:environment` must be specified in the endpoint, but is actually ignored since the puppet file server -is not environment-specific. (In fact, the specified `:environment` does even need to be valid.) - -The endpoint path includes a `:mount` which can be one of three types: - -* custom file serving mounts as specified in fileserver.conf -- see [the puppet file serving guide](http://docs.puppetlabs.com/guides/file_serving.html#serving-files-from-custom-mount-points) -* `modules/<module>` -- a semi-magical mount point which allows access to the `files` subdirectory of `module` -- see [the puppet file serving guide](http://docs.puppetlabs.com/guides/file_serving.html#serving-module-files) -* `plugins` -- a highly magical mount point which merges many directories together: used for plugin sync, sub-paths can not be specified, not intended for general consumption - -Note: pson responses in the examples below are pretty-printed for readability. -Find ----- - -Get file metadata for a single file - - GET /:environment/file_metadata/:mount/path/to/file - -### Supported HTTP Methods - -GET - -### Supported Response Formats - -PSON - -### Parameters - -None - -### Example Response - -#### File metadata found for a file - - GET /env/file_metadata/modules/example/just_a_file.txt - - HTTP/1.1 200 OK - Content-Type: text/pson - - { - "data": { - "checksum": { - "type": "md5", - "value": "{md5}d0a10f45491acc8743bc5a82b228f89e" - }, - "destination": null, - "group": 20, - "links": "manage", - "mode": 420, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files/just_a_file.txt", - "relative_path": null, - "type": "file" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - } - -#### File metadata found for a directory - - GET /env/file_metadata/modules/example/subdirectory - - HTTP/1.1 200 OK - Content-Type: text/pson - - { - "data": { - "checksum": { - "type": "ctime", - "value": "{ctime}2013-10-01 13:16:10 -0700" - }, - "destination": null, - "group": 20, - "links": "manage", - "mode": 493, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files/subdirectory", - "relative_path": null, - "type": "directory" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - } - -#### File metadata found for a link - - GET /env/file_metadata/modules/example/link_to_file.txt - - HTTP/1.1 200 OK - Content-Type: text/pson - - { - "data": { - "checksum": { - "type": "md5", - "value": "{md5}d0a10f45491acc8743bc5a82b228f89e" - }, - "destination": "/etc/puppet/conf/modules/example/files/just_a_file.txt", - "group": 20, - "links": "manage", - "mode": 493, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files/link_to_file.txt", - "relative_path": null, - "type": "link" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - } - -#### File not found - - GET /env/file_metadata/modules/example/does_not_exist - - HTTP/1.1 404 Not Found - - Not Found: Could not find file_metadata modules/example/does_not_exist - -Search ------- - -Get a list of metadata for multiple files - - GET /env/file_metadatas/foo.txt - -### Supported HTTP Methods - -GET - -### Supported Format - -Accept: pson, text/pson - -### Parameters - -* `recurse` -- should always be set to `yes`; unfortunately the default is `no` which causes renders this a Find operation -* `ignore` -- file or directory regex to ignore; can be repeated -* `links` -- either `manage` (default) or `follow`. See examples below. - -### Example Response - -#### Basic search - - GET /env/file_metadatas/modules/example?recurse=yes - - HTTP 200 OK - Content-Type: text/pson - - [ - { - "data": { - "checksum": { - "type": "ctime", - "value": "{ctime}2013-10-01 13:15:59 -0700" - }, - "destination": null, - "group": 20, - "links": "manage", - "mode": 493, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files", - "relative_path": ".", - "type": "directory" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - }, - { - "data": { - "checksum": { - "type": "md5", - "value": "{md5}d0a10f45491acc8743bc5a82b228f89e" - }, - "destination": null, - "group": 20, - "links": "manage", - "mode": 420, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files", - "relative_path": "just_a_file.txt", - "type": "file" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - }, - { - "data": { - "checksum": { - "type": "md5", - "value": "{md5}d0a10f45491acc8743bc5a82b228f89e" - }, - "destination": "/etc/puppet/conf/modules/example/files/just_a_file.txt", - "group": 20, - "links": "manage", - "mode": 493, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files", - "relative_path": "link_to_file.txt", - "type": "link" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - }, - { - "data": { - "checksum": { - "type": "ctime", - "value": "{ctime}2013-10-01 13:15:59 -0700" - }, - "destination": null, - "group": 20, - "links": "manage", - "mode": 493, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files", - "relative_path": "subdirectory", - "type": "directory" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - }, - { - "data": { - "checksum": { - "type": "md5", - "value": "{md5}d41d8cd98f00b204e9800998ecf8427e" - }, - "destination": null, - "group": 20, - "links": "manage", - "mode": 420, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files", - "relative_path": "subdirectory/another_file.txt", - "type": "file" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - } - ] - -#### Search ignoring 'sub*' and links = manage - - GET /env/file_metadatas/modules/example?recurse=true&ignore=sub*&links=manage - - HTTP 200 OK - Content-Type: text/pson - - [ - { - "data": { - "checksum": { - "type": "ctime", - "value": "{ctime}2013-10-01 13:15:59 -0700" - }, - "destination": null, - "group": 20, - "links": "manage", - "mode": 493, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files", - "relative_path": ".", - "type": "directory" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - }, - { - "data": { - "checksum": { - "type": "md5", - "value": "{md5}d0a10f45491acc8743bc5a82b228f89e" - }, - "destination": null, - "group": 20, - "links": "manage", - "mode": 420, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files", - "relative_path": "just_a_file.txt", - "type": "file" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - }, - { - "data": { - "checksum": { - "type": "md5", - "value": "{md5}d0a10f45491acc8743bc5a82b228f89e" - }, - "destination": "/etc/puppet/conf/modules/example/files/just_a_file.txt", - "group": 20, - "links": "manage", - "mode": 493, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files", - "relative_path": "link_to_file.txt", - "type": "link" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - } - ] - -#### Search ignoring 'sub*' and links = follow - -This example is identical to the above example, except for the different links parameter. The result pson, then, -is identical to the above example, except for: - -* the 'links' field is set to "follow" rather than "manage" in all metadata objects -* in the 'link_to_file.txt' metadata: - * for 'manage' the 'destination' field is the link destination; for 'follow', it's null - * for 'manage' the 'type' field is 'link'; for 'follow' it's 'file' - * for 'manage' the 'mode', 'owner' and 'group' fields are the link's values; for 'follow' the destination's values - -` ` - - GET /env/file_metadatas/modules/example?recurse=true&ignore=sub*&links=follow - - HTTP 200 OK - Content-Type: text/pson - - [ - { - "data": { - "checksum": { - "type": "ctime", - "value": "{ctime}2013-10-01 13:15:59 -0700" - }, - "destination": null, - "group": 20, - "links": "follow", - "mode": 493, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files", - "relative_path": ".", - "type": "directory" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - }, - { - "data": { - "checksum": { - "type": "md5", - "value": "{md5}d0a10f45491acc8743bc5a82b228f89e" - }, - "destination": null, - "group": 20, - "links": "follow", - "mode": 420, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files", - "relative_path": "just_a_file.txt", - "type": "file" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - }, - { - "data": { - "checksum": { - "type": "md5", - "value": "{md5}d0a10f45491acc8743bc5a82b228f89e" - }, - "destination": null, - "group": 20, - "links": "follow", - "mode": 420, - "owner": 501, - "path": "/etc/puppet/conf/modules/example/files", - "relative_path": "link_to_file.txt", - "type": "file" - }, - "document_type": "FileMetadata", - "metadata": { - "api_version": 1 - } - } - ] - -Schema ------- - -The representation of file metadata conforms to the schema at {file:api/schemas/file_metadata.json api/schemas/file_metadata.json}. - -Sample Module -------------- - -The examples above use this (faux) module: - - /etc/puppet/conf/modules/example/ - files/ - just_a_file.txt - link_to_file.txt -> /etc/puppet/conf/modules/example/files/just_a_file.txt - subdirectory/ - another_file.txt diff --git a/api/docs/http_node.md b/api/docs/http_node.md deleted file mode 100644 index 301424166..000000000 --- a/api/docs/http_node.md +++ /dev/null @@ -1,57 +0,0 @@ -Node -==== - -The `node` endpoint is used by the puppet agent to get basic information -about a node. The returned information includes the node name and -environment, and optionally any classes set by an External Node -Classifier and a hash of parameters which may include the node's facts. -The returned node may have a different environment from the one given in -the request if Puppet is configured with an ENC. - -Find ----- - -Retrieve data for a node - - GET /:environment/node/:certname - - -### Supported HTTP Methods - -GET - -### Supported Response Formats - -PSON - -### Examples - - > GET /production/node/mycertname HTTP/1.1 - > Accept: pson, b64_zlib_yaml, yaml, raw - - < HTTP/1.1 200 OK - < Content-Type: text/pson - < Content-Length: 4630 - - { - "document_type":"Node", - "data":{ - "name":"thinky.corp.puppetlabs.net", - "parameters":{ - "architecture":"amd64", - "kernel":"Linux", - "blockdevices":"sda,sr0", - "clientversion":"3.3.1", - "clientnoop":"false", - "environment":"production", - ... - }, - "environment":"production" - } - } - -Schema ------- - -Returned node objects conform to the json schema at -{file:api/schemas/node.json api/schemas/node.json}. diff --git a/api/docs/http_report.md b/api/docs/http_report.md deleted file mode 100644 index bbe7f9b3a..000000000 --- a/api/docs/http_report.md +++ /dev/null @@ -1,116 +0,0 @@ -Report -====== -This document describes the Puppet master's report endpoint and the schema for -Report Format 4 in technical term. Also see the -[documentation](http://docs.puppetlabs.com/puppet/latest/reference/format_report.html). - -The `report` endpoint allows clients to send reports to the master via `http` -or `https`. Once received by the master they are processed by the *report -processors* configured to be triggered when a report is received. As an -example, storing reports in PuppetDB is handled by one such report processor. - -Save ----- -The http(s) endpoint for sending reports to the master is: - - PUT /:environment/report/:nodename - -### Supported HTTP Methods - -PUT - -### Supported Format(s) - -PSON - -### Parameters - -None - -### Content - -The content of a report is typically generated by the Puppet Runtime and consists of a pson-serialization of `Puppet::Transaction::Report` object which in turn contains a structure of objects with of the following runtime types: - -* `Puppet::Util::Log` -* `Puppet::Util::Metric` -* `Puppet::Resource::Status` -* `Puppet::Transaction::Event` - -This pson-serialization is compliant with the endpoint's report jsonschema. - -Example -------- -Here is an example of a PUT request. (Note that the content-length is not correct as the -example is formatted for readability) - - PUT /production/report/kermit.com HTTP/1.0 - ContentType: text/pson - Content-Length: 1428 - - {"host"=>"kermit.com", - "time"=>"2013-09-12T03:50:59.009301000+02:00", - "configuration_version"=>1357986, - "transaction_uuid"=>"df34516e-4050-402d-a166-05b03b940749", - "report_format"=>4, - "puppet_version"=>"3.3.0", - "kind"=>"apply", - "status"=>"unchanged", - "environment"=>"test_environment", - "logs"=> - [{"level"=>"warning", - "message"=>"log message", - "source"=>"Puppet", - "tags"=>["warning"], - "time"=>"2013-09-12T03:50:59.009328000+02:00", - "file"=>nil, - "line"=>nil}], - "metrics"=> - {"resources"=> - {"name"=>"resources", - "label"=>"Resources", - "values"=> - [["total", "Total", 1], - ["skipped", "Skipped", 0], - ["failed", "Failed", 0], - ["failed_to_restart", "Failed to restart", 0], - ["restarted", "Restarted", 0], - ["changed", "Changed", 1], - ["out_of_sync", "Out of sync", 0], - ["scheduled", "Scheduled", 0]]}, - "time"=> - {"name"=>"time", - "label"=>"Time", - "values"=>[["timing", "Timing", 4], ["total", "Total", 4]]}, - "changes"=> - {"name"=>"changes", "label"=>"Changes", "values"=>[["total", "Total", 0]]}, - "events"=> - {"name"=>"events", - "label"=>"Events", - "values"=> - [["total", "Total", 0], - ["failure", "Failure", 0], - ["success", "Success", 0]]}}, - "resource_statuses"=> - {"Notify[a resource]"=> - {"title"=>"a resource", - "file"=>nil, - "line"=>nil, - "resource"=>"Notify[a resource]", - "resource_type"=>"Notify", - "containment_path"=>["Notify[a resource]"], - "evaluation_time"=>nil, - "tags"=>["notify"], - "time"=>"2013-09-12T03:50:59.009238000+02:00", - "failed"=>false, - "changed"=>true, - "out_of_sync"=>false, - "skipped"=>false, - "change_count"=>0, - "out_of_sync_count"=>0, - "events"=>[]}}} - -Schema ------- - -The sent report objects must conform to the schema at -{file:api/schemas/report.json api/schemas/report.json}. diff --git a/api/docs/http_resource_type.md b/api/docs/http_resource_type.md deleted file mode 100644 index 413b60cb8..000000000 --- a/api/docs/http_resource_type.md +++ /dev/null @@ -1,222 +0,0 @@ -Resource Type -============= - -The `resource_type` and `resource_types` endpoints return information about the -following kinds of objects available to the puppet master: - -* Classes (`class myclass { ... }`) -* Defined types (`define mytype ($parameter) { ... }`) -* Node definitions (`node 'web01.example.com' { ... }`) - -For an object to be available to the puppet master, it must be present in the -site manifest (configured by the `manifest` setting) or in a module located in -the modulepath (configured by the `modulepath` setting; classes and defined -types only). - -Note that this endpoint does **not** return information about native resource -types written in Ruby. - -See the end of this page for the source manifest used to generate all example -responses. - -Find ----- - -Get info about a specific class, defined type, or node, by name. Returns a -single resource_type response object (see "Schema" below). - - GET /:environment/resource_type/:nodename - -> **Note:** Although no two classes or defined types may have the same name, -> it's possible for a node definition to have the same name as a class or -> defined type. If this happens, the class or defined type will be returned -> instead of the node definition. The order in which kinds of objects are -> searched is classes, then defined types, then node definitions. - - -### Supported HTTP Methods - -GET - -### Supported Formats - -PSON - -### Parameters - -None - -### Responses - -#### Resource Type Found - - GET /env/resource_type/athing - - HTTP 200 OK - Content-Type: text/pson - - { - "line": 7, - "file": "/etc/puppet/manifests/site.pp", - "name":"athing", - "kind":"class" - } - -#### Resource Type Not Found - - GET /env/resource_type/resource_type_does_not_exist - - HTTP 404 Not Found - Content-Type: text/plain - - Not Found: Could not find resource_type resource_type_does_not_exist - -#### No Resource Type Name Given - - GET /env/resource_type/ - - HTTP/1.1 400 Bad Request - Content-Type: text/plain - - No request key specified in /env/resource_type/ - -Search ------- - -List all resource types matching a regular expression. Returns an array of -resource_type response objects (see "Schema" below). - - GET /:environment/resource_types/:search_string - -The `search_string` is required. It must be either a Ruby regular expression or -the string `*` (which will match all resource types). Surrounding slashes are -stripped. Note that if you want to use the `?` character in a regular -expression, it must be escaped as `%3F`. - -### Supported HTTP Methods - -GET - -### Supported Formats - -Accept: pson, text/pson - -### Parameters - -* `kind`: Optional. Filter the returned resource types by the `kind` field. - Valid values are `class`, `node`, and `defined_type`. - -### Responses - -#### Search With Results - - GET /env/resource_types/* - - HTTP 200 OK - Content-Type: text/pson - - [ - { - "file": "/etc/puppet/manifests/site.pp", - "kind": "class", - "line": 7, - "name": "athing" - }, - { - "doc": "An example class\n", - "file": "/etc/puppet/manifests/site.pp", - "kind": "class", - "line": 11, - "name": "bthing", - "parent": "athing" - }, - { - "file": "/etc/puppet/manifests/site.pp", - "kind": "defined_type", - "line": 1, - "name": "hello", - "parameters": { - "a": "{key2 => \"val2\", key => \"val\"}", - "message": "$title" - } - }, - { - "file": "/etc/puppet/manifests/site.pp", - "kind": "node", - "line": 14, - "name": "web01.example.com" - }, - { - "file": "/etc/puppet/manifests/site.pp", - "kind": "node", - "line": 17, - "name": "default" - } - ] - - -#### Search Not Found - - GET /env/resource_types/pattern.that.finds.no.resources - - HTTP/1.1 404 Not Found: Could not find instances in resource_type with 'pattern.that.finds.no.resources' - Content-Type: text/plain - - Not Found: Could not find instances in resource_type with 'pattern.that.finds.no.resources' - -#### No Search Term Given - - GET /env/resource_types/ - - HTTP/1.1 400 Bad Request - Content-Type: text/plain - - No request key specified in /env/resource_types/ - -#### Search Term Is an Invalid Regular Expression - -Searching on `[-` for instance. - - GET /env/resource_types/%5b- - - HTTP/1.1 400 Bad Request - Content-Type: text/plain - - Invalid regex '[-': premature end of char-class: /[-/ - -### Examples - -List all classes: - - GET /:environment/resource_types/*?kind=class - -List matching a regular expression: - - GET /:environment/resource_types/foo.*bar - -Schema ------- - -A `resource_type` response body conforms to the schema at {file:api/schemas/resource_type.json api/schemas/resource_type.json}. - -Source ------- - -Example site.pp used to generate all the responses in this file: - - define hello ($message = $title, $a = { key => 'val', key2 => 'val2' }) { - notify {$message: } - } - - hello { "there": } - - class athing { - } - - # An example class - class bthing inherits athing { - } - - node 'web01.example.com' {} - node default {} - diff --git a/api/docs/http_status.md b/api/docs/http_status.md deleted file mode 100644 index 7da3c6151..000000000 --- a/api/docs/http_status.md +++ /dev/null @@ -1,41 +0,0 @@ -Status -============= - -The `status` endpoint provides information about a running master. - -Find ----- - -Get status for a master - - GET /:environment/status/:name - -The `:environment` and `:name` sections of the URL are both ignored, but a -value must be provided for both. - -### Supported HTTP Methods - -GET - -### Supported Response Formats - -PSON - -### Parameters - -None - -### Example Response - - GET /env/status/whatever - - HTTP 200 OK - Content-Type: text/pson - - {"is_alive":true,"version":"3.3.2"} - -Schema ------- - -The returned status conforms to the -{file:api/schemas/status.json api/schemas/status.json} schema. diff --git a/api/docs/pson.md b/api/docs/pson.md deleted file mode 100644 index 23108d1d3..000000000 --- a/api/docs/pson.md +++ /dev/null @@ -1,62 +0,0 @@ -PSON -============= - -PSON is a variant of {http://json.org JSON} that puppet uses for serializing -data to transmit across the network or store on disk. Whereas JSON requires -that the serialized form is valid unicode (usually UTF-8), PSON is 8-bit ASCII, -which allows it to represent arbitrary byte sequences in strings. - -Puppet uses the MIME types "pson" and "text/pson" to refer to PSON. - -Differences from JSON ---------------------- - -PSON does *not differ* from JSON in its representation of objects, arrays, -numbers, booleans, and null values. PSON *does* serialize strings differently -from JSON. - -A PSON string is a sequence of 8-bit ASCII encoded data. It must start and end -with " (ASCII 0x22) characters. Between these characters it may contain any -byte sequence. Some individual characters are represented by a sequence of -characters: - - | Byte | ASCII Character | Encoded Sequence | Encoded ASCII Sequence | - | ---- | --------------- | ---------------- | ---------------------- | - | 0x22 | " | 0x5C, 0x22 | \" | - | 0x5c | \ | 0x5C, 0x5C | \\ | - | 0x08 | Backspace | 0x5C, 0x62 | \b | - | 0x09 | Horizontal Tab | 0x5C, 0x74 | \t | - | 0x0A | Line Feed | 0x5C, 0x6E | \n | - | 0x0C | Form Feed | 0x5C, 0x66 | \f | - | 0x0D | Carriage Return | 0x5C, 0x72 | \r | - -In addition, any character between 0x00 and 0x1F, (except the ones listed -above) must be encoded as a six byte sequence of \u followed by four ASCII -digits of the hex number of the desired character. For example the ASCII -Record Separator character (0x1E) is represented as \u001E (0x5C, 0x75, 0x30, -0x30, 0x31, 0x45). - -Decoding PSON Using JSON Parsers --------------------------------- - -Many languages have JSON parsers already, which can often be used to parse PSON -data. Although JSON requires that it is encoded as unicode most parsers will -produce usable output from PSON if they are instructed to interpret the input -as Latin-1 encoding. - -In all these examples there is a file available called `data.pson` that -contains the ruby structure `{ "data" => "\x07\x08\xC3\xC3" }` encoded as -PSON (the value is an invalid unicode sequence). In bytes the data is: - - 0x7b 0x22 0x64 0x61 0x74 0x61 0x22 0x3a 0x22 0x5c 0x75 0x30 0x30 0x30 0x37 0x5c 0x62 0xc3 0xc3 0x22 0x7d - -Python Example: - - >>> import json - >>> json.load(open("data.pson"), "latin_1") - {u'data': u'\x07\x08\xc3\xc3'} - -Clojure Example: - - user> (parse-string (slurp "data.pson" :encoding "ISO-8859-1")) - {"data" "^G\bÃÃ"} diff --git a/api/schemas/catalog.json b/api/schemas/catalog.json deleted file mode 100644 index a29e63d91..000000000 --- a/api/schemas/catalog.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Catalog", - "description": "A puppet resource catalog", - "type": "object", - "properties": { - "document_type": { - "description": "Only supported value is 'Catalog'", - "type": "string", - "enum": ["Catalog"] - }, - "metadata": { - "description": "Only contents of metadata is api_version", - "type": "object", - "properties": { - "api_version": { - "description": "Only supported api_version is 1", - "type": "integer", - "enum": [1] - } - }, - "required": ["api_version"], - "additionalProperties": false - }, - "data": { - "description": "The catalog data itself", - "type": "object", - "properties": { - "tags": { - "description": "Tags: regex is from http://docs.puppetlabs.com/puppet/3/reference/lang_reserved.html", - "type": "array", - "items": { - "type": "string", - "pattern": "^[a-z0-9_][a-z0-9_:\.\-]*$" - } - }, - "name": { - "type": "string" - }, - "version": { - "type": "integer" - }, - "environment": { - "type": "string" - }, - "resources": { - "description": "The array of resources in the catalog", - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "line": { - "type": "integer" - }, - "file": { - "type": "string" - }, - "exported": { - "type": "boolean" - }, - "tags": { - "description": "Tags: regex is from http://docs.puppetlabs.com/puppet/3/reference/lang_reserved.html", - "type": "array", - "items": { - "type": "string", - "pattern": "^[a-z0-9_][a-z0-9_:\.\-]*$" - } - }, - "parameters": { - "description": "Parameters: regex is from http://docs.puppetlabs.com/puppet/3/reference/lang_reserved.html", - "type": "object", - "patternProperties": { - "^[a-z][a-z0-9_]*$": {} - }, - "additionalProperties": false - } - }, - "required": ["type", "title", "tags", "exported"], - "additionalProperties": false - } - }, - "edges": { - "description": "An array of the containment relationships in the catalog.", - "type": "array", - "items": { - "type": "object", - "properties": { - "source": { - "description": "Containing object", - "type": "string" - }, - "target": { - "description": "Contained object", - "type": "string" - } - }, - "required": ["source", "target"], - "additionalProperties": false - } - - }, - "classes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["tags", "name", "version", "environment", "resources", "edges", "classes"], - "additionalProperties": false - } - }, - "required": ["document_type", "metadata", "data"], - "additionalProperties": false -} diff --git a/api/schemas/environments.json b/api/schemas/environments.json deleted file mode 100644 index 58931180a..000000000 --- a/api/schemas/environments.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Environment Enumeration", - "description": "An enumeration of environments and their settings", - "type": "object", - "properties": { - "search_paths": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "description": "An array of the paths where the master looked for environments." - }, - "environments": { - "type": "object", - "patternProperties": { - "^[a-z0-9_]+$": { - "type": "object", - "properties": { - "settings" : { - "type": "object", - "properties": { - "manifest": { "type": "string" }, - "modulepath": { - "type": "array", - "items": { "type": "string" } - }, - "config_version": { "type": "string" }, - "environment_timeout": { "type": ["integer", "string"] } - }, - "required": ["modulepath", "manifest", "environment_timeout", "config_version"], - "oneOf": [ - { - "title": "numeric timeout", - "properties": { - "environment_timeout": { - "type": "integer", - "minimum": 0 - } - } - }, - { - "title": "unlimited timeout", - "properties": { - "environment_timeout": { - "type": "string", - "enum": ["unlimited"] - } - } - } - ] - } - }, - "required": ["settings"] - } - } - } - }, - "required": ["search_paths", "environments"] -} diff --git a/api/schemas/error.json b/api/schemas/error.json deleted file mode 100644 index 7cc570446..000000000 --- a/api/schemas/error.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "HTTP Error Response Object", - "description": "A description of the error encountered when attempting to service an HTTP request.", - "type": "object", - "properties": { - "message": { - "description": "A human-readable message explaining the error", - "type": "string" - }, - "issue_kind": { - "description": "A unique label to identify the error class", - "type": "string" - }, - "stacktrace": { - "description": "For 5xx responses only, a ruby stacktrace to where an error occurred.", - "type": "array", - "items": { "type": "string" } - } - }, - "required": ["message", "issue_kind"], - "additionalProperties": false -} diff --git a/api/schemas/facts.json b/api/schemas/facts.json deleted file mode 100644 index 2a2e3d155..000000000 --- a/api/schemas/facts.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Catalog facts", - "description": "Facts parameter in a POST to retrieve a catalog", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "values": { - "description": "The facts for the specified node", - "type": "object", - "patternProperties": { - "^[a-z][a-z0-9_]*$": {} - }, - "additionalProperties": false - }, - "timestamp": { - "description": "When the facts were gathered; NB doesn't adhere to json 'date-time' format.", - "type": "string" - }, - "expiration": { - "description": "When the facts will expire; NB doesn't adhere to json 'date-time' format", - "type": "string" - } - }, - "required": ["name", "values", "timestamp", "expiration"], - "additionalProperties": false -} diff --git a/api/schemas/file_metadata.json b/api/schemas/file_metadata.json deleted file mode 100644 index 3d744637e..000000000 --- a/api/schemas/file_metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "File Metadata", - "description": "Metadata about a file, directory, or symbolic link", - "type": "object", - "properties": { - "document_type": { - "description": "Only supported value is 'FileMetadata'", - "type": "string", - "enum": ["FileMetadata"] - }, - "metadata": { - "description": "Only contents of metadata is api_version", - "type": "object", - "properties": { - "api_version": { - "description": "Only supported api_version is 1", - "type": "integer", - "enum": [1] - } - }, - "required": ["api_version"], - "additionalProperties": false - }, - "data": { - "description": "The file metadata itself", - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "relative_path": { - "oneOf": [{"type": "string"}, {"type": "null"}] - }, - "links": { - "enum": ["manage", "follow"] - }, - "owner": { - "type": "integer" - }, - "group": { - "type": "integer" - }, - "mode": { - "type": "integer" - }, - "type": { - "enum": ["file", "directory", "link"] - }, - "destination": { - "oneOf": [{"type": "string"}, {"type": "null"}] - }, - "checksum": { - "type": "object", - "properties": { - "type": { - "enum": ["md5", "sha256", "ctime"] - }, - "value": { - "type": "string" - } - }, - "required": ["type", "value"], - "additionalProperties": false - } - }, - "required": ["path", "relative_path", "links", "owner", "group", "mode", "type", "destination", "checksum"], - "additionalProperties": false - } - }, - "required": ["document_type", "metadata", "data"], - "additionalProperties": false -} diff --git a/api/schemas/host.json b/api/schemas/host.json deleted file mode 100644 index ba64773d4..000000000 --- a/api/schemas/host.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Host", - "description": "SSL Host information", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "state": { - "type": "string", - "enum": [ - "requested", - "signed", - "revoked" - ] - }, - "desired_state": { - "type": "string", - "enum": [ - "signed", - "revoked" - ] - }, - "fingerprint": { - "type": "string" - }, - "fingerprints": { - "type": "object", - "patternProperties": { - "^[A-Za-z0-9_]*$": {} - }, - "additionalProperties": false - }, - "dns_alt_names": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["name", "state", "fingerprint", "fingerprints", "dns_alt_names"], - "additionalProperties": false -} diff --git a/api/schemas/json-meta-schema.json b/api/schemas/json-meta-schema.json deleted file mode 100644 index 85eb502a6..000000000 --- a/api/schemas/json-meta-schema.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "id": "http://json-schema.org/draft-04/schema#", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": { "$ref": "#" } - }, - "positiveInteger": { - "type": "integer", - "minimum": 0 - }, - "positiveIntegerDefault0": { - "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ] - }, - "simpleTypes": { - "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] - }, - "stringArray": { - "type": "array", - "items": { "type": "string" }, - "minItems": 1, - "uniqueItems": true - } - }, - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uri" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": {}, - "multipleOf": { - "type": "number", - "minimum": 0, - "exclusiveMinimum": true - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "boolean", - "default": false - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "boolean", - "default": false - }, - "maxLength": { "$ref": "#/definitions/positiveInteger" }, - "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": { - "anyOf": [ - { "type": "boolean" }, - { "$ref": "#" } - ], - "default": {} - }, - "items": { - "anyOf": [ - { "$ref": "#" }, - { "$ref": "#/definitions/schemaArray" } - ], - "default": {} - }, - "maxItems": { "$ref": "#/definitions/positiveInteger" }, - "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxProperties": { "$ref": "#/definitions/positiveInteger" }, - "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" }, - "required": { "$ref": "#/definitions/stringArray" }, - "additionalProperties": { - "anyOf": [ - { "type": "boolean" }, - { "$ref": "#" } - ], - "default": {} - }, - "definitions": { - "type": "object", - "additionalProperties": { "$ref": "#" }, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": { "$ref": "#" }, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": { "$ref": "#" }, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { "$ref": "#" }, - { "$ref": "#/definitions/stringArray" } - ] - } - }, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - { "$ref": "#/definitions/simpleTypes" }, - { - "type": "array", - "items": { "$ref": "#/definitions/simpleTypes" }, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "allOf": { "$ref": "#/definitions/schemaArray" }, - "anyOf": { "$ref": "#/definitions/schemaArray" }, - "oneOf": { "$ref": "#/definitions/schemaArray" }, - "not": { "$ref": "#" } - }, - "dependencies": { - "exclusiveMaximum": [ "maximum" ], - "exclusiveMinimum": [ "minimum" ] - }, - "default": {} -} diff --git a/api/schemas/node.json b/api/schemas/node.json deleted file mode 100644 index e1ef12707..000000000 --- a/api/schemas/node.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Node", - "description": "A Puppet node object", - "type": "object", - "properties": { - "document_type": { - "type": "string", - "enum": ["Node"] - }, - "data": { - "type": "object", - "properties": { - "environment": { - "type": "string" - }, - "name": { - "type": "string" - }, - "classes": { - "type": "array", - "items": { "type": "string" } - }, - "parameters": { - "type": "object" - } - }, - "required": ["name", "environment"], - "additionalProperties": false - } - }, - "required": ["document_type", "data"], - "additionalProperties": false -} diff --git a/api/schemas/report.json b/api/schemas/report.json deleted file mode 100644 index cf76bfbbc..000000000 --- a/api/schemas/report.json +++ /dev/null @@ -1,592 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Report", - "description": "A Puppet Report", - "type": "object", - - "additionalProperties": false, - - "required": [ - "host", - "time", - "resource_statuses", - "configuration_version", - "report_format", - "puppet_version", - "kind", - "status", - "environment" - ], - - "properties": { - "host": { - "description": "The host that generated the report", - "type": "string" - }, - - "time": { - "description": "When the run began. In ISO 8601 format with 9 characters second-fragment", - "type": "string" - }, - - "logs": { - "description": "Zero or more occurrences of Log objects", - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/log" - } - }, - - "metrics": { - "description": "Hash of metric category to data for that category", - "type": "object", - - "properties": { - "time": { - "type": "object", - "$ref": "#/definitions/time_metrics" - }, - - "resources": { - "type": "object", - "$ref": "#/definitions/resources_metrics" - }, - - "events": { - "type": "object", - "$ref": "#/definitions/events_metrics" - }, - - "changes": { - "type": "object", - "$ref": "#/definitions/changes_metrics" - } - }, - - "additionalProperties": false, - "minProperties": 1 - }, - - "resource_statuses": { - "description": "Object with one property per resource-name having type as described by #report/status.json schema type", - "type": "object", - "patternProperties": { - ".*": { - "type": "object", - "$ref": "#/definitions/status" - } - }, - "additionalProperties": false - }, - - "configuration_version": { - "description": "The configuration version of the Puppet run. This is a String if the user has specified their own versioning scheme, otherwise an Integer representing seconds since the epoch.", - "anyOf": [ - { "type": "integer", "description": "seconds since the epoch" }, - { "type": "string", "description": "custom versioning scheme" } - ] - }, - - "transaction_uuid": { - "description": "A UUID covering the transaction. The query parameters for the catalog retrieval will have included the same UUID.", - "type": "string" - }, - - "report_format": { - "description": "The report format version documented by this schema", - "type": "integer", - "enum": ["4", 4] - }, - - "puppet_version": { - "description": "The version of the Puppet Agent the report is for.", - "type": "string" - }, - - "kind": { - "description": "Report kind, enumerator with one of the values:\n\n* `inspect`, if this report came from a puppet inspect run.\n* `apply`, if this report came from a puppet apply or puppet agent run", - "enum": [ - "inspect", - "apply" - ] - }, - - "status": { - "description": "Report status, enumerator with one of the values:\n\n* `failed`, if run failed\n* `changed`, if something changed\n* `unchanged`, if nothing changed from the previous run\n", - "enum": [ - "failed", - "changed", - "unchanged" - ] - }, - - "environment": { - "description": "The name of the environment that was used for the puppet run (e.g. \"production\").", - "type": "string" - } - }, - - "definitions" : { - "log" : { - "properties": { - - "file": { - "description": "The pathname of the manifest file which triggered the log message.", - "oneOf": [ - {"type": "string"}, - {"type": "null"} - ] - }, - - "line": { - "description": "The line number in the manifest file which triggered the log message.", - "oneOf": [ - {"type": "string"}, - {"type": "null"} - ] - }, - - "level": { - "description": "The severity of the message.", - "enum": [ - "debug", - "info", - "notice", - "warning", - "err", - "alert", - "emerg", - "crit" - ] - }, - - "message": { - "description": "The message itself.", - "type": "string" - }, - - "source": { - "description": "The origin of the log message. This could be a resource, a property of a resource, or the string 'Puppet'.", - "type": "string" - }, - - "tags": { - "description": "The strings with which the source is tagged", - "type": "array", - "items": { "type": "string" } - }, - - "time": { - "description": "When the message was sent. In ISO 8601 format with 9 characters second-fragment", - "type": "string" - } - }, - - "required": [ - "level", - "message", - "source", - "tags", - "time" - ], - "additionalProperties": false - }, - - "time_metrics": { - "description": "A Metric in the `time` category", - "type": "object", - "properties": { - - "name": { - "description": "The name of the metric category ('time')", - "enum": ["time"] - }, - - "label": { - "description": "The name in title form", - "enum": ["Time"] - }, - - "values": { - "description": "The metric values in the 'time' category contains one entry per resource type in the catalog for\nwhich there is at least one resource and the values named:\n\n* `config_retrieval`\n* `total`\n* `inspect` (only present if the report is of `inspect`-kind)\n", - "type": "array", - "items": { - "description": "Each entry in `values` is an array with 3 slots for `name`, `label` and `value`", - "type": "array", - "items": [ - { - "description": "The name of the value (the name of a resource type, `config_retrieval`, or `total`", - "type": "string" - }, - { - "description": "The name in title form", - "type": "string" - }, - { - "description": "The value", - "type": "number" - } - ] - } - } - }, - - "required": [ "name", "label", "values"], - "additionalProperties": false - }, - - "resources_metrics": { - "description": "A Metric in the `resources` category", - "type": "object", - "properties": { - - "name": { - "description": "The name of the metric category ('resources')", - "enum": ["resources"] - }, - - "label": { - "description": "The name in title form", - "enum": ["Resources"] - }, - - "values": { - "description": "The metric values in the 'resources' category", - "type": "array", - "items": { - "description": "Each entry in `values` is an array with 3 slots for `name`, `label` and `value`", - "type": "array", - "items": [ - { - "description": "The name of the value", - "enum": [ - "failed", - "out_of_sync", - "changed", - "total", - "skipped", - "failed_to_restart", - "restarted", - "scheduled" - ] - }, - { - "description": "The name in title form", - "enum": [ - "Failed", - "Out of sync", - "Changed", - "Total", - "Skipped", - "Failed to restart", - "Restarted", - "Scheduled" - ] - }, - { - "description": "The value", - "type": "integer" - } - ] - } - } - }, - "required": [ "name", "label", "values"], - "additionalProperties": false - }, - - "events_metrics": { - "description": "A Metric in the `events` category", - "type": "object", - "properties": { - - "name": { - "description": "The name of the metric category ('events')", - "enum": ["events"] - }, - - "label": { - "description": "The name in title form", - "enum": ["Events"] - }, - - "values": { - "description": "The metric values in the 'events' category. The entry named `total` is always present, the others are present only if their value is non zero.", - "type": "array", - "items": { - "description": "Each entry in `values` is an array with 3 slots for `name`, `label` and `value`.", - "type": "array", - "items": [ - { - "description": "The name of the value", - "enum": [ - "success", - "failure", - "audit", - "noop", - "total" - ] - }, - { - "description": "The name in title form", - "enum": [ - "Success", - "Failure", - "Audit", - "Noop", - "Total" - ] - }, - { - "description": "The value", - "type": "integer" - } - ] - } - } - }, - - "required": [ "name", "label", "values"], - "additionalProperties": false - }, - - "changes_metrics": { - "description": "A Metric in the `changes` category", - "type": "object", - "properties": { - - "name": { - "description": "The name of the metric category ('changes')", - "enum": ["changes"] - }, - - "label": { - "description": "The name in title form", - "enum": ["Changes"] - }, - - "values": { - "description": "The metric value in the 'changes' category is called `total` - there is only one total.", - "type": "array", - "items": { - "description": "Each entry in `values` is an array with 3 slots for `name`, `label` and `value`.", - "type": "array", - "items": [ - { - "description": "The name of the value", - "enum": ["total" ] - }, - { - "description": "The name in title form", - "enum": ["Total"] - }, - { - "description": "The value", - "type": "integer" - } - ] - } - } - }, - "required": [ "name", "label", "values"], - "additionalProperties": false - }, - - "status": { - "description": "A Status entry for a resource in a report", - "type": "object", - - "properties": { - - "resource_type": { - "description": "The type name of the resource, capitalized", - "type": "string", - "pattern": "^[A-Z].*$" - }, - - "title": { - "description": "The title of the resource.", - "type": "string" - }, - - "resource": { - "description": "The resource name, in the form Type[title]. **Deprecated**. This is always the same string as the name of the property where this Status object is the value.", - "type": "string" - }, - - "file": { - "description": "The pathname of the manifest file which declared the resource.", - "oneOf": [ - {"type": "string"}, - {"type": "null"} - ] - }, - - "line": { - "description": "The line number in the manifest file which declared the resource.", - "oneOf": [ - {"type": "string"}, - {"type": "null"} - ] - }, - - "evaluation_time": { - "description": "The amount of time, in seconds, taken to evaluate the resource. Not present in reports of `inspect` kind.", - "oneOf": [ - {"type": "number"}, - {"type": "null"} - ] - }, - - "change_count": { - "description": "The number of properties which changed. Always 0 in reports of `inspect` kind.", - "type": "integer" - }, - - "out_of_sync_count": { - "description": "The number of properties which were out of sync. Always 0 in reports of `inspect` kind.", - "type": "integer" - }, - - "tags": { - "description": "The strings with which the resource is tagged", - "type": "array", - "items": { "type": "string" } - }, - - "time": { - "description": "The time the resource was evaluated. In ISO 8601 format with 9 characters second-fragment", - "type": "string" - }, - - "events": { - "description": "the Puppet::Transaction::Event objects for the resource", - "type": "array", - "items": { "$ref": "#/definitions/event" } - }, - - "out_of_sync": { - "description": "True if out_of_sync_count > 0, otherwise false. **Deprecated**", - "type": "boolean" - }, - - "changed": { - "description": "True if change_count > 0, otherwise false. **Deprecated**", - "type": "boolean" - }, - - "skipped": { - "description": "True if the resource was skipped, otherwise false.", - "type": "boolean" - }, - - "failed": { - "description": "True if Puppet experienced an error while evaluating this resource, otherwise false. **Deprecated**", - "type": "boolean" - }, - - "containment_path": { - "description": "An array of strings; each element represents a container (type or class) that, together, make up the path of the resource in the catalog.", - "type": "array", - "items": { "type": "string" } - } - }, - - "required": [ - "resource_type", - "title", - "change_count", - "out_of_sync_count", - "tags", - "events", - "skipped", - "containment_path" - ], - "additionalProperties": false - }, - "event": { - "description": "An Event in a Report", - "type": "object", - "properties": { - - "audited": { - "description": "True if this property is being audited, otherwise false. True in report of `inspect` kind.", - "type": "boolean" - }, - - "property": { - "description": "The property for which the event occurred.", - "oneOf": [ - { "type": "string" }, - { "type": "null" } - ] - }, - - "previous_value": { - "description": "The value of the property before the change (if any) was applied.", - "oneOf": [ - { "type": "string" }, - { "type": "array" }, - { "type": "object" }, - { "type": "null" } - ] - }, - - "desired_value": { - "description": "the value specified in the manifest. Absent in reports of `inspect` kind.", - "oneOf": [ - { "type": "string" }, - { "type": "array" }, - { "type": "object" }, - { "type": "null" } - ] - }, - - "historical_value": { - "description": "The audited value from a previous run of Puppet, if known. Absent in reports of `inspect` kind.", - "oneOf": [ - { "type": "string" }, - { "type": "array" }, - { "type": "object" }, - { "type": "null" } - ] - }, - - "message": { - "description": "The log message generated by this event.", - "type": "string" - }, - - "name": { - "description": "The name of the event. Absent in reports of `inspect` kind.", - "type": "string" - }, - - "status": { - "description": "One of the following strings:\n\n* `success` - property was out of sync, and was successfully changed to be in sync.\n* `failure`- property was out of sync, and couldn't be changed to be in sync due to an error.\n* `noop` - property was out of sync, and wasn't changed due to noop mode.\n* `audit` - property was in sync, and was being audited.\n\ndepending on the type of the event. Always `audit` in reports of `inspect` kind.\n", - "enum": [ - "success", - "failure", - "noop", - "audit" - ] - }, - "time": { - "description": "The time at which the property was evaluated. In ISO 8601 format with 9 characters second-fragment", - "type": "string" - } - }, - "required": [ - "audited", - "property", - "message", - "name", - "status", - "time" - ], - - "additionalProperties": false - } - } -} diff --git a/api/schemas/resource_type.json b/api/schemas/resource_type.json deleted file mode 100644 index e97079120..000000000 --- a/api/schemas/resource_type.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Resource Type", - "description": "A puppet resource type", - "type": "object", - "properties": { - "doc": { - "type": "string", - "description": "Any documentation comment from the type definition" - }, - "line": { - "type": "integer", - "description": "The line number where the type is defined" - }, - "file": { - "type": "string", - "description": "The full path of the file where the type is defined" - }, - "parent": { - "type": "string", - "description": "If the type inherits from another type, the name of that type" - }, - "name": { - "type": "string", - "description": "The fully qualified name" - }, - "kind": { - "type": "string", - "description": "The kind of object the type represents", - "enum": [ - "class", - "node", - "defined_type" - ] - }, - "parameters": { - "type": "object", - "description": "The default arguments to the type. If an argument has no default value, the value is represented by a literal \"null\" (without quotes in pson). Default values are the string representation of that value, even for more complex structures (e.g. the hash { key => 'val', key2 => 'val2' } would be represented in pson as \"{key => \\\"val\\\", key2 => \\\"val2\\\"}\"." - } - }, - "required": ["name", "kind"], - "additionalProperties": false -} diff --git a/api/schemas/status.json b/api/schemas/status.json deleted file mode 100644 index f3fa8abe5..000000000 --- a/api/schemas/status.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Master status", - "description": "Information about a running master", - "type": "object", - "properties": { - "is_alive": { - "description": "This will always be true since the master must be running to retrieve the object", - "type": "boolean" - }, - "version": { - "description": "The version of the master", - "type": "string" - } - }, - "required": ["is_alive", "version"], - "additionalProperties": false -} diff --git a/autotest/README.markdown b/autotest/README.markdown deleted file mode 100644 index 4cb3d8370..000000000 --- a/autotest/README.markdown +++ /dev/null @@ -1,45 +0,0 @@ -# Continuous Testing - -This directory contains configurations for continuous testing, using -either autotest (part of the ZenTest gem) or watchr (in the watchr -gem). The purpose of these tools is to automatically run the -appropriate test when a file is changed or, if appropriate, all -tests. In general, they do a straightforward mapping from a given -code file to its unit and/or integration test. - -It is highly recommended that you have one of these running at all -times during development, as they provide immediate and continuous -feedback as to your development process. There are some general -usability downsides as you have to track the running process, but -those downsides are easily worth it. - -# How to use - -To use autotest, install ZenTest and run it with no arguments -from the root of the puppet repository: - - $ autotest - -It is currently only configured to run specs. - -To use watchr, run it with the watchr file specified as its argument: - - $ watchr autotest/watcher.rb - -Both will use growl if installed on a Mac, but watchr assumes the -presence of growl and will likely fail without it. Autotest is a bit -more mature and should be resilient to either. - -The primary reason to use to use watchr over autotest is that it uses -filesystem events to detect changes (theoretically portably although -only tested on OS X), thus eliminating the need for polling for -changes across all files being monitored. - -# Gotchas - -Autotest will start out by running all tests; if you don't want that, -stick a syntax error in one of the tests to force a failure, then fix -it and go on your merry way. - -Watchr, on the other hand, will default to only running the files you -change. diff --git a/autotest/discover.rb b/autotest/discover.rb deleted file mode 100644 index 0ac563724..000000000 --- a/autotest/discover.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'autotest' - -Autotest.add_discovery do - "rspec" -end - -Autotest.add_discovery do - "puppet" -end diff --git a/autotest/images/fail.png b/autotest/images/fail.png Binary files differdeleted file mode 100644 index 41f49055a..000000000 --- a/autotest/images/fail.png +++ /dev/null diff --git a/autotest/images/pass.png b/autotest/images/pass.png Binary files differdeleted file mode 100644 index 7167a61d4..000000000 --- a/autotest/images/pass.png +++ /dev/null diff --git a/autotest/images/pending.png b/autotest/images/pending.png Binary files differdeleted file mode 100644 index 7c412e6fb..000000000 --- a/autotest/images/pending.png +++ /dev/null diff --git a/autotest/puppet_rspec.rb b/autotest/puppet_rspec.rb deleted file mode 100644 index eda9cb534..000000000 --- a/autotest/puppet_rspec.rb +++ /dev/null @@ -1,51 +0,0 @@ -require 'autotest' -require 'autotest/rspec' - -Autotest.add_hook :initialize do |at| - at.clear_mappings - - # the libraries under lib/puppet - at.add_mapping(%r{^lib/puppet/(.*)\.rb$}) { |filename, m| - at.files_matching %r!spec/(unit|integration)/#{m[1]}.rb! - } - - # the actual spec files themselves - at.add_mapping(%r{^spec/(unit|integration)/.*\.rb$}) { |filename, _| - filename - } - - # force a complete re-run for all of these: - - # main puppet lib - at.add_mapping(%r{^lib/puppet\.rb$}) { |filename, _| - at.files_matching %r{spec/(unit|integration)/.*\.rb} - } - - # the spec_helper - at.add_mapping(%r{^spec/spec_helper\.rb$}) { |filename, _| - at.files_matching %r{spec/(unit|integration)/.*\.rb} - } - - # the puppet test libraries - at.add_mapping(%r{^test/lib/puppettest/.*}) { |filename, _| - at.files_matching %r{spec/(unit|integration)/.*\.rb} - } - - # the puppet spec libraries - at.add_mapping(%r{^spec/lib/spec.*}) { |filename, _| - at.files_matching %r{spec/(unit|integration)/.*\.rb} - } - - # the monkey patches for rspec - at.add_mapping(%r{^spec/lib/monkey_patches/.*}) { |filename, _| - at.files_matching %r{spec/(unit|integration)/.*\.rb} - } -end - -# a place for overrides when necessary. -class Autotest::PuppetRspec < Autotest::Rspec - def spec_commands - ENV["AUTOTEST"] = "true" - ENV["PATH"].split(File::PATH_SEPARATOR).collect { |dir| File.join(dir, "spec") } - end -end diff --git a/autotest/rspec.rb b/autotest/rspec.rb deleted file mode 100644 index f97e9668f..000000000 --- a/autotest/rspec.rb +++ /dev/null @@ -1,74 +0,0 @@ -require 'autotest' - -Autotest.add_hook :initialize do |at| - at.clear_mappings - # watch out: Ruby bug (1.8.6): - # %r{/} != /\// - at.add_mapping(%r{^spec/.*\.rb$}) { |filename, _| - filename - } - at.add_mapping(%r{^lib/(.*)\.rb$}) { |_, m| - ["spec/#{m[1]}_spec.rb"] - } - at.add_mapping(%r{^spec/(spec_helper|shared/.*)\.rb$}) { - at.files_matching %r{^spec/.*_spec\.rb$} - } -end - -class RspecCommandError < StandardError; end - -class Autotest::Rspec < Autotest - - def initialize - super - - self.failed_results_re = /^\d+\)\n(?:\e\[\d*m)?(?:.*?Error in )?'([^\n]*)'(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m - self.completed_re = /\Z/ # FIX: some sort of summary line at the end? - end - - def consolidate_failures(failed) - filters = Hash.new { |h,k| h[k] = [] } - failed.each do |spec, failed_trace| - if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } - filters[f] << spec - break - end - end - filters - end - - def make_test_cmd(files_to_test) - "#{ruby} -S #{spec_command} #{add_options_if_present} #{files_to_test.keys.flatten.join(' ')}" - end - - def add_options_if_present - File.exist?("spec/spec.opts") ? "-O spec/spec.opts " : "" - end - - # Finds the proper spec command to use. Precendence is set in the - # lazily-evaluated method spec_commands. Alias + Override that in - # ~/.autotest to provide a different spec command then the default - # paths provided. - def spec_command(separator=File::ALT_SEPARATOR) - unless defined?(@spec_command) - @spec_command = spec_commands.find { |cmd| File.exists? cmd } - - raise RspecCommandError, "No spec command could be found!" unless @spec_command - - @spec_command.gsub! File::SEPARATOR, separator if separator - end - @spec_command - end - - # Autotest will look for spec commands in the following - # locations, in this order: - # - # * bin/spec - # * default spec bin/loader installed in Rubygems - def spec_commands - [ - File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'spec')), - File.join(Config::CONFIG['bindir'], 'spec') - ] - end -end diff --git a/benchmarks/defined_types/benchmarker.rb b/benchmarks/defined_types/benchmarker.rb deleted file mode 100644 index a54e228b0..000000000 --- a/benchmarks/defined_types/benchmarker.rb +++ /dev/null @@ -1,73 +0,0 @@ -require 'erb' -require 'ostruct' -require 'fileutils' -require 'json' - -class Benchmarker - include FileUtils - - def initialize(target, size) - @target = target - @size = size - end - - def setup - require 'puppet' - config = File.join(@target, 'puppet.conf') - Puppet.initialize_settings(['--config', config]) - end - - def run(args=nil) - env = Puppet.lookup(:environments).get('benchmarking') - node = Puppet::Node.new("testing", :environment => env) - Puppet::Resource::Catalog.indirection.find("testing", :use_node => node) - end - - def generate - environment = File.join(@target, 'environments', 'benchmarking') - templates = File.join('benchmarks', 'defined_types') - - mkdir_p(File.join(environment, 'modules')) - mkdir_p(File.join(environment, 'manifests')) - - render(File.join(templates, 'site.pp.erb'), - File.join(environment, 'manifests', 'site.pp'), - :size => @size) - - @size.times do |i| - module_name = "module#{i}" - module_base = File.join(environment, 'modules', module_name) - manifests = File.join(module_base, 'manifests') - - mkdir_p(manifests) - - File.open(File.join(module_base, 'metadata.json'), 'w') do |f| - JSON.dump({ - "types" => [], - "source" => "", - "author" => "Defined Types Benchmark", - "license" => "Apache 2.0", - "version" => "1.0.0", - "description" => "Defined Types benchmark module #{i}", - "summary" => "Just this benchmark module, you know?", - "dependencies" => [], - }, f) - end - - render(File.join(templates, 'module', 'testing.pp.erb'), - File.join(manifests, 'testing.pp'), - :name => module_name) - end - - render(File.join(templates, 'puppet.conf.erb'), - File.join(@target, 'puppet.conf'), - :location => @target) - end - - def render(erb_file, output_file, bindings) - site = ERB.new(File.read(erb_file)) - File.open(output_file, 'w') do |fh| - fh.write(site.result(OpenStruct.new(bindings).instance_eval { binding })) - end - end -end diff --git a/benchmarks/defined_types/description b/benchmarks/defined_types/description deleted file mode 100644 index 30c8b7fa1..000000000 --- a/benchmarks/defined_types/description +++ /dev/null @@ -1,3 +0,0 @@ -Benchmark scenario: heavy use of defined types -Benchmark target: catalog compilation - diff --git a/benchmarks/defined_types/module/testing.pp.erb b/benchmarks/defined_types/module/testing.pp.erb deleted file mode 100644 index e723561d5..000000000 --- a/benchmarks/defined_types/module/testing.pp.erb +++ /dev/null @@ -1,3 +0,0 @@ -define <%= name %>::testing { - notify { "in <%= name %>: $title": } -} diff --git a/benchmarks/defined_types/puppet.conf.erb b/benchmarks/defined_types/puppet.conf.erb deleted file mode 100644 index e0c5d8588..000000000 --- a/benchmarks/defined_types/puppet.conf.erb +++ /dev/null @@ -1,3 +0,0 @@ -confdir = <%= location %> -vardir = <%= location %> -environmentpath = <%= File.join(location, 'environments') %> diff --git a/benchmarks/defined_types/site.pp.erb b/benchmarks/defined_types/site.pp.erb deleted file mode 100644 index 338b635b2..000000000 --- a/benchmarks/defined_types/site.pp.erb +++ /dev/null @@ -1,4 +0,0 @@ -<% size.times do |i| %> - module<%= i %>::testing { "first": } - module<%= i %>::testing{ "second": } -<% end %> diff --git a/benchmarks/defined_types4/benchmarker.rb b/benchmarks/defined_types4/benchmarker.rb deleted file mode 100644 index 5b0669291..000000000 --- a/benchmarks/defined_types4/benchmarker.rb +++ /dev/null @@ -1,73 +0,0 @@ -require 'erb' -require 'ostruct' -require 'fileutils' -require 'json' - -class Benchmarker - include FileUtils - - def initialize(target, size) - @target = target - @size = size - end - - def setup - require 'puppet' - config = File.join(@target, 'puppet.conf') - Puppet.initialize_settings(['--config', config]) - end - - def run(args=nil) - env = Puppet.lookup(:environments).get('benchmarking') - node = Puppet::Node.new("testing", :environment => env) - Puppet::Resource::Catalog.indirection.find("testing", :use_node => node) - end - - def generate - environment = File.join(@target, 'environments', 'benchmarking') - templates = File.join('benchmarks', 'defined_types4') - - mkdir_p(File.join(environment, 'modules')) - mkdir_p(File.join(environment, 'manifests')) - - render(File.join(templates, 'site.pp.erb'), - File.join(environment, 'manifests', 'site.pp'), - :size => @size) - - @size.times do |i| - module_name = "module#{i}" - module_base = File.join(environment, 'modules', module_name) - manifests = File.join(module_base, 'manifests') - - mkdir_p(manifests) - - File.open(File.join(module_base, 'metadata.json'), 'w') do |f| - JSON.dump({ - "types" => [], - "source" => "", - "author" => "Defined Types Benchmark Future Parser", - "license" => "Apache 2.0", - "version" => "1.0.0", - "description" => "Defined Types benchmark module #{i}", - "summary" => "Just this benchmark module, you know?", - "dependencies" => [], - }, f) - end - - render(File.join(templates, 'module', 'testing.pp.erb'), - File.join(manifests, 'testing.pp'), - :name => module_name) - end - - render(File.join(templates, 'puppet.conf.erb'), - File.join(@target, 'puppet.conf'), - :location => @target) - end - - def render(erb_file, output_file, bindings) - site = ERB.new(File.read(erb_file)) - File.open(output_file, 'w') do |fh| - fh.write(site.result(OpenStruct.new(bindings).instance_eval { binding })) - end - end -end diff --git a/benchmarks/defined_types4/description b/benchmarks/defined_types4/description deleted file mode 100644 index f24e9bba4..000000000 --- a/benchmarks/defined_types4/description +++ /dev/null @@ -1,4 +0,0 @@ -Benchmark scenario: heavy use of defined types future parser -Benchmark target: catalog compilation -Parser: Future - diff --git a/benchmarks/defined_types4/module/testing.pp.erb b/benchmarks/defined_types4/module/testing.pp.erb deleted file mode 100644 index e723561d5..000000000 --- a/benchmarks/defined_types4/module/testing.pp.erb +++ /dev/null @@ -1,3 +0,0 @@ -define <%= name %>::testing { - notify { "in <%= name %>: $title": } -} diff --git a/benchmarks/defined_types4/puppet.conf.erb b/benchmarks/defined_types4/puppet.conf.erb deleted file mode 100644 index 618ea6e2f..000000000 --- a/benchmarks/defined_types4/puppet.conf.erb +++ /dev/null @@ -1,4 +0,0 @@ -confdir = <%= location %> -vardir = <%= location %> -environmentpath = <%= File.join(location, 'environments') %> -parser = future diff --git a/benchmarks/defined_types4/site.pp.erb b/benchmarks/defined_types4/site.pp.erb deleted file mode 100644 index 338b635b2..000000000 --- a/benchmarks/defined_types4/site.pp.erb +++ /dev/null @@ -1,4 +0,0 @@ -<% size.times do |i| %> - module<%= i %>::testing { "first": } - module<%= i %>::testing{ "second": } -<% end %> diff --git a/benchmarks/empty_catalog/benchmarker.rb b/benchmarks/empty_catalog/benchmarker.rb deleted file mode 100644 index aee97d26e..000000000 --- a/benchmarks/empty_catalog/benchmarker.rb +++ /dev/null @@ -1,52 +0,0 @@ -require 'erb' -require 'ostruct' -require 'fileutils' -require 'json' - -class Benchmarker - include FileUtils - - def initialize(target, size) - @target = target - @size = size - end - - def setup - end - - def run(args=nil) - unless @initialized - require 'puppet' - config = File.join(@target, 'puppet.conf') - Puppet.initialize_settings(['--config', config]) - @initialized = true - end - env = Puppet.lookup(:environments).get('benchmarking') - node = Puppet::Node.new("testing", :environment => env) - # Mimic what apply does (or the benchmark will in part run for the *root* environment) - Puppet.push_context({:current_environment => env},'current env for benchmark') - Puppet::Resource::Catalog.indirection.find("testing", :use_node => node) - end - - def generate - environment = File.join(@target, 'environments', 'benchmarking') - templates = File.join('benchmarks', 'empty_catalog') - - mkdir_p(File.join(environment, 'modules')) - mkdir_p(File.join(environment, 'manifests')) - - render(File.join(templates, 'site.pp.erb'), - File.join(environment, 'manifests', 'site.pp'),{}) - - render(File.join(templates, 'puppet.conf.erb'), - File.join(@target, 'puppet.conf'), - :location => @target) - end - - def render(erb_file, output_file, bindings) - site = ERB.new(File.read(erb_file)) - File.open(output_file, 'w') do |fh| - fh.write(site.result(OpenStruct.new(bindings).instance_eval { binding })) - end - end -end diff --git a/benchmarks/empty_catalog/description b/benchmarks/empty_catalog/description deleted file mode 100644 index d06e41b82..000000000 --- a/benchmarks/empty_catalog/description +++ /dev/null @@ -1,4 +0,0 @@ -Benchmark scenario: an empty catalog (only one call to log a message) shows the setup time for env / compiler -Benchmark target: catalog compilation overhead -Parser: Future - diff --git a/benchmarks/empty_catalog/puppet.conf.erb b/benchmarks/empty_catalog/puppet.conf.erb deleted file mode 100644 index 00e2986bf..000000000 --- a/benchmarks/empty_catalog/puppet.conf.erb +++ /dev/null @@ -1,5 +0,0 @@ -confdir = <%= location %> -vardir = <%= location %> -environmentpath = <%= File.join(location, 'environments') %> -environment_timeout = '0' -parser = future diff --git a/benchmarks/empty_catalog/site.pp.erb b/benchmarks/empty_catalog/site.pp.erb deleted file mode 100644 index 054628183..000000000 --- a/benchmarks/empty_catalog/site.pp.erb +++ /dev/null @@ -1 +0,0 @@ -notice('hello world')
\ No newline at end of file diff --git a/benchmarks/evaluations/benchmarker.rb b/benchmarks/evaluations/benchmarker.rb deleted file mode 100644 index 4ed397db7..000000000 --- a/benchmarks/evaluations/benchmarker.rb +++ /dev/null @@ -1,140 +0,0 @@ -require 'erb' -require 'ostruct' -require 'fileutils' -require 'json' - -class Benchmarker - include FileUtils - - def initialize(target, size) - @target = target - @size = size - @micro_benchmarks = {} - @parsecount = 100 - @evalcount = 100 - end - - def setup - require 'puppet' - require 'puppet/pops' - config = File.join(@target, 'puppet.conf') - Puppet.initialize_settings(['--config', config]) - manifests = File.join('benchmarks', 'evaluations', 'manifests') - Dir.foreach(manifests) do |f| - if f =~ /^(.*)\.pp$/ - @micro_benchmarks[$1] = File.read(File.join(manifests, f)) - end - end - # Run / Evaluate the common puppet logic - @env = Puppet.lookup(:environments).get('benchmarking') - @node = Puppet::Node.new("testing", :environment => @env) - @parser = Puppet::Pops::Parser::EvaluatingParser.new - @compiler = Puppet::Parser::Compiler.new(@node) - @scope = @compiler.topscope - - # Perform a portion of what a compile does (just enough to evaluate the site.pp logic) - @compiler.catalog.environment_instance = @compiler.environment - @compiler.send(:evaluate_main) - - # Then pretend we are running as part of a compilation - Puppet.push_context(@compiler.context_overrides, "Benchmark masquerading as compiler configured context") - end - - def run(args = {}) - details = args[:detail] || 'all' - measurements = [] - @micro_benchmarks.each do |name, source| - # skip if all but the wanted if a single benchmark is wanted - next unless details == 'all' || match = details.match(/#{name}(?:[\._\s](parse|eval))?$/) - # if name ends with .parse or .eval only do that part, else do both parts - ending = match ? match[1] : nil # parse, eval or nil ending - unless ending == 'eval' - measurements << Benchmark.measure("#{name} parse") do - 1..@parsecount.times { @parser.parse_string(source, name) } - end - end - unless ending == 'parse' - model = @parser.parse_string(source, name) - measurements << Benchmark.measure("#{name} eval") do - 1..@evalcount.times do - begin - # Run each in a local scope - scope_memo = @scope.ephemeral_level - @scope.new_ephemeral(true) - @parser.evaluate(@scope, model) - ensure - # Toss the created local scope - @scope.unset_ephemeral_var(scope_memo) - end - end - end - end - end - measurements - end - - def generate - environment = File.join(@target, 'environments', 'benchmarking') - templates = File.join('benchmarks', 'evaluations') - - mkdir_p(File.join(environment, 'modules')) - mkdir_p(File.join(environment, 'manifests')) - - render(File.join(templates, 'site.pp.erb'), - File.join(environment, 'manifests', 'site.pp'),{}) - - render(File.join(templates, 'puppet.conf.erb'), - File.join(@target, 'puppet.conf'), - :location => @target) - - # Generate one module with a 3x function and a 4x function (namespaces) - module_name = "module1" - module_base = File.join(environment, 'modules', module_name) - manifests = File.join(module_base, 'manifests') - mkdir_p(manifests) - functions_3x = File.join(module_base, 'lib', 'puppet', 'parser', 'functions') - functions_4x = File.join(module_base, 'lib', 'puppet', 'functions') - mkdir_p(functions_3x) - mkdir_p(functions_4x) - - File.open(File.join(module_base, 'metadata.json'), 'w') do |f| - JSON.dump({ - "types" => [], - "source" => "", - "author" => "Evaluations Benchmark", - "license" => "Apache 2.0", - "version" => "1.0.0", - "description" => "Evaluations Benchmark module 1", - "summary" => "Module with supporting logic for evaluations benchmark", - "dependencies" => [], - }, f) - end - - render(File.join(templates, 'module', 'init.pp.erb'), - File.join(manifests, 'init.pp'), - :name => module_name) - - render(File.join(templates, 'module', 'func3.rb.erb'), - File.join(functions_3x, 'func3.rb'), - :name => module_name) - - # namespaced function - mkdir_p(File.join(functions_4x, module_name)) - render(File.join(templates, 'module', 'module1_func4.rb.erb'), - File.join(functions_4x, module_name, 'func4.rb'), - :name => module_name) - - # non namespaced - render(File.join(templates, 'module', 'func4.rb.erb'), - File.join(functions_4x, 'func4.rb'), - :name => module_name) - end - - def render(erb_file, output_file, bindings) - site = ERB.new(File.read(erb_file)) - File.open(output_file, 'w') do |fh| - fh.write(site.result(OpenStruct.new(bindings).instance_eval { binding })) - end - end - -end diff --git a/benchmarks/evaluations/benchmarker_task.rb b/benchmarks/evaluations/benchmarker_task.rb deleted file mode 100644 index d38ed1088..000000000 --- a/benchmarks/evaluations/benchmarker_task.rb +++ /dev/null @@ -1,11 +0,0 @@ -# Helper class that is used by the Rake task generator. -# Currently only supports defining arguments that are passed to run -# (The rake task generator always passes :warm_up_runs as an Integer when profiling). -# Other benchmarks, and for regular runs that wants arguments must specified them -# as an Array of symbols. -# -class BenchmarkerTask - def self.run_args - [:detail] - end -end
\ No newline at end of file diff --git a/benchmarks/evaluations/description b/benchmarks/evaluations/description deleted file mode 100644 index 812037e6d..000000000 --- a/benchmarks/evaluations/description +++ /dev/null @@ -1,13 +0,0 @@ -Benchmark scenario: evaluates a select set of time critical expressions -Benchmark target: measuring individual use cases of evaluation -Parser: Future - -Evaluations: -* fcall_3x - calls sprintf 20x times -* fcall_4x - calls assert_type 20x times (is heavier than sprintf, have no similar simple 4x function) -* interpolation - does 20x interpolations of variying length -* var_absolute - references a top scope variable 20x times with absolute reference -* var_relative - references a top scope variable 20x times with non absolute reference -* var_class_absolute - references a class variable 20x times with absolute reference -* var_class_relative - references a class variable 20x times with non absolute reference - diff --git a/benchmarks/evaluations/manifests/assert_type.pp b/benchmarks/evaluations/manifests/assert_type.pp deleted file mode 100644 index 0be757281..000000000 --- a/benchmarks/evaluations/manifests/assert_type.pp +++ /dev/null @@ -1,6 +0,0 @@ -$tmp = [ -assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), -assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), -assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), -assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), assert_type(Integer,1), -] diff --git a/benchmarks/evaluations/manifests/fcall_3x.pp b/benchmarks/evaluations/manifests/fcall_3x.pp deleted file mode 100644 index 9689ca97a..000000000 --- a/benchmarks/evaluations/manifests/fcall_3x.pp +++ /dev/null @@ -1,6 +0,0 @@ -$tmp = [ -func3(x,y), func3(x,y), func3(x,y), func3(x,y), func3(x,y), -func3(x,y), func3(x,y), func3(x,y), func3(x,y), func3(x,y), -func3(x,y), func3(x,y), func3(x,y), func3(x,y), func3(x,y), -func3(x,y), func3(x,y), func3(x,y), func3(x,y), func3(x,y), -] diff --git a/benchmarks/evaluations/manifests/fcall_4x.pp b/benchmarks/evaluations/manifests/fcall_4x.pp deleted file mode 100644 index a7b7b712a..000000000 --- a/benchmarks/evaluations/manifests/fcall_4x.pp +++ /dev/null @@ -1,6 +0,0 @@ -$tmp = [ -func4(x,y), func4(x,y), func4(x,y), func4(x,y), func4(x,y), -func4(x,y), func4(x,y), func4(x,y), func4(x,y), func4(x,y), -func4(x,y), func4(x,y), func4(x,y), func4(x,y), func4(x,y), -func4(x,y), func4(x,y), func4(x,y), func4(x,y), func4(x,y), -] diff --git a/benchmarks/evaluations/manifests/fcall_ns4x.pp b/benchmarks/evaluations/manifests/fcall_ns4x.pp deleted file mode 100644 index d59de8539..000000000 --- a/benchmarks/evaluations/manifests/fcall_ns4x.pp +++ /dev/null @@ -1,6 +0,0 @@ -$tmp = [ -module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), -module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), -module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), -module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), module1::func4(x,y), -] diff --git a/benchmarks/evaluations/manifests/interpolation.pp b/benchmarks/evaluations/manifests/interpolation.pp deleted file mode 100644 index 817770146..000000000 --- a/benchmarks/evaluations/manifests/interpolation.pp +++ /dev/null @@ -1,11 +0,0 @@ -$tmp = [ "...$x...", - "...$x...$x", - "...$x...$x...", - "...$x...$x...$x...", - "...$x...$x...$x...$x", - "...$x...$x...$x...$x...", - "...$x...$x...$x...$x...$x", - "...$x...$x...$x...$x...$x...", - "...$x...$x...$x...$x...$x...$x", - "...$x...$x...$x...$x...$x...$x...", -]
\ No newline at end of file diff --git a/benchmarks/evaluations/manifests/var_absolute.pp b/benchmarks/evaluations/manifests/var_absolute.pp deleted file mode 100644 index ed4731817..000000000 --- a/benchmarks/evaluations/manifests/var_absolute.pp +++ /dev/null @@ -1,3 +0,0 @@ -$tmp = [ $::x, $::x, $::x, $::x, $::x, $::x, $::x, $::x, $::x, $::x, - $::x, $::x, $::x, $::x, $::x, $::x, $::x, $::x, $::x, $::x, -] diff --git a/benchmarks/evaluations/manifests/var_class_absolute.pp b/benchmarks/evaluations/manifests/var_class_absolute.pp deleted file mode 100644 index e86940f6e..000000000 --- a/benchmarks/evaluations/manifests/var_class_absolute.pp +++ /dev/null @@ -1,5 +0,0 @@ -$tmp = [ $::testing::param_a, $::testing::param_a, $::testing::param_a, $::testing::param_a, $::testing::param_a, - $::testing::param_a, $::testing::param_a, $::testing::param_a, $::testing::param_a, $::testing::param_a, - $::testing::param_a, $::testing::param_a, $::testing::param_a, $::testing::param_a, $::testing::param_a, - $::testing::param_a, $::testing::param_a, $::testing::param_a, $::testing::param_a, $::testing::param_a, -] diff --git a/benchmarks/evaluations/manifests/var_class_relative.pp b/benchmarks/evaluations/manifests/var_class_relative.pp deleted file mode 100644 index 3048db6ad..000000000 --- a/benchmarks/evaluations/manifests/var_class_relative.pp +++ /dev/null @@ -1,5 +0,0 @@ -$tmp = [ $testing::param_a, $testing::param_a, $testing::param_a, $testing::param_a, $testing::param_a, - $testing::param_a, $testing::param_a, $testing::param_a, $testing::param_a, $testing::param_a, - $testing::param_a, $testing::param_a, $testing::param_a, $testing::param_a, $testing::param_a, - $testing::param_a, $testing::param_a, $testing::param_a, $testing::param_a, $testing::param_a, -] diff --git a/benchmarks/evaluations/manifests/var_relative.pp b/benchmarks/evaluations/manifests/var_relative.pp deleted file mode 100644 index 3fba7b6ef..000000000 --- a/benchmarks/evaluations/manifests/var_relative.pp +++ /dev/null @@ -1,3 +0,0 @@ -$tmp = [$x, $x, $x, $x, $x, $x, $x, $x, $x, $x, - $x, $x, $x, $x, $x, $x, $x, $x, $x, $x, -] diff --git a/benchmarks/evaluations/module/func3.rb.erb b/benchmarks/evaluations/module/func3.rb.erb deleted file mode 100644 index 6b814a0d0..000000000 --- a/benchmarks/evaluations/module/func3.rb.erb +++ /dev/null @@ -1,8 +0,0 @@ -Puppet::Parser::Functions::newfunction(:func3, - :arity => 2, - :doc => "Blah blah, this is a lot of documentation that the ruby parser must deal with - because documentation is part of what is loaded at runtime. Some functions have - very little documentation, and some have quite a lot. This simulates documentation - that is slightly longer than the shortest ones.") do |vals| - # produces nil -end diff --git a/benchmarks/evaluations/module/func4.rb.erb b/benchmarks/evaluations/module/func4.rb.erb deleted file mode 100644 index b923ec4f5..000000000 --- a/benchmarks/evaluations/module/func4.rb.erb +++ /dev/null @@ -1,9 +0,0 @@ -# Blah blah, this is a lot of documentation that the ruby parser must deal with -# because documentation is part of what is loaded at runtime. Some functions have -# very little documentation, and some have quite a lot. This simulates documentation -# that is slightly longer than the shortest ones. -# -Puppet::Functions.create_function(:func4) do - def func4(x,y) - end -end
\ No newline at end of file diff --git a/benchmarks/evaluations/module/init.pp.erb b/benchmarks/evaluations/module/init.pp.erb deleted file mode 100644 index 755657c8a..000000000 --- a/benchmarks/evaluations/module/init.pp.erb +++ /dev/null @@ -1 +0,0 @@ -# empty init (for now)
\ No newline at end of file diff --git a/benchmarks/evaluations/module/module1_func4.rb.erb b/benchmarks/evaluations/module/module1_func4.rb.erb deleted file mode 100644 index 1891156c0..000000000 --- a/benchmarks/evaluations/module/module1_func4.rb.erb +++ /dev/null @@ -1,9 +0,0 @@ -# Blah blah, this is a lot of documentation that the ruby parser must deal with -# because documentation is part of what is loaded at runtime. Some functions have -# very little documentation, and some have quite a lot. This simulates documentation -# that is slightly longer than the shortest ones. -# -Puppet::Functions.create_function(:'<%= name %>::func4') do - def func4(x,y) - end -end
\ No newline at end of file diff --git a/benchmarks/evaluations/puppet.conf.erb b/benchmarks/evaluations/puppet.conf.erb deleted file mode 100644 index d0bf4b2f1..000000000 --- a/benchmarks/evaluations/puppet.conf.erb +++ /dev/null @@ -1,6 +0,0 @@ -confdir = <%= location %> -vardir = <%= location %> -environmentpath = <%= File.join(location, 'environments') %> -environment_timeout = '0' -parser = future -strict_variables = true diff --git a/benchmarks/evaluations/site.pp.erb b/benchmarks/evaluations/site.pp.erb deleted file mode 100644 index 05cc8d8c5..000000000 --- a/benchmarks/evaluations/site.pp.erb +++ /dev/null @@ -1,10 +0,0 @@ -# Common setup done once for all micro benchmarks -# -class testing { - $param_a = 10 - $param_b = 20 -} -include testing -$x = 'aaaaaaaa' - - diff --git a/benchmarks/many_modules/benchmarker.rb b/benchmarks/many_modules/benchmarker.rb deleted file mode 100644 index 4a6d4f463..000000000 --- a/benchmarks/many_modules/benchmarker.rb +++ /dev/null @@ -1,77 +0,0 @@ -require 'erb' -require 'ostruct' -require 'fileutils' -require 'json' - -class Benchmarker - include FileUtils - - def initialize(target, size) - @target = target - @size = size - end - - def setup - require 'puppet' - config = File.join(@target, 'puppet.conf') - Puppet.initialize_settings(['--config', config]) - end - - def run(args=nil) - env = Puppet.lookup(:environments).get('benchmarking') - node = Puppet::Node.new("testing", :environment => env) - Puppet::Resource::Catalog.indirection.find("testing", :use_node => node) - end - - def generate - environment = File.join(@target, 'environments', 'benchmarking') - templates = File.join('benchmarks', 'many_modules') - - mkdir_p(File.join(environment, 'modules')) - mkdir_p(File.join(environment, 'manifests')) - - render(File.join(templates, 'site.pp.erb'), - File.join(environment, 'manifests', 'site.pp'), - :size => @size) - - @size.times do |i| - module_name = "module#{i}" - module_base = File.join(environment, 'modules', module_name) - manifests = File.join(module_base, 'manifests') - - mkdir_p(manifests) - - File.open(File.join(module_base, 'metadata.json'), 'w') do |f| - JSON.dump({ - "types" => [], - "source" => "", - "author" => "ManyModules Benchmark", - "license" => "Apache 2.0", - "version" => "1.0.0", - "description" => "Many Modules benchmark module #{i}", - "summary" => "Just this benchmark module, you know?", - "dependencies" => [], - }, f) - end - - render(File.join(templates, 'module', 'init.pp.erb'), - File.join(manifests, 'init.pp'), - :name => module_name) - - render(File.join(templates, 'module', 'internal.pp.erb'), - File.join(manifests, 'internal.pp'), - :name => module_name) - end - - render(File.join(templates, 'puppet.conf.erb'), - File.join(@target, 'puppet.conf'), - :location => @target) - end - - def render(erb_file, output_file, bindings) - site = ERB.new(File.read(erb_file)) - File.open(output_file, 'w') do |fh| - fh.write(site.result(OpenStruct.new(bindings).instance_eval { binding })) - end - end -end diff --git a/benchmarks/many_modules/description b/benchmarks/many_modules/description deleted file mode 100644 index a2b58ebe7..000000000 --- a/benchmarks/many_modules/description +++ /dev/null @@ -1,3 +0,0 @@ -Benchmark scenario: many manifests spread across many modules. -Benchmark target: catalog compilation. - diff --git a/benchmarks/many_modules/module/init.pp.erb b/benchmarks/many_modules/module/init.pp.erb deleted file mode 100644 index 49fca07ba..000000000 --- a/benchmarks/many_modules/module/init.pp.erb +++ /dev/null @@ -1,3 +0,0 @@ -class <%= name %> { - class { "<%= name %>::internal": } -} diff --git a/benchmarks/many_modules/module/internal.pp.erb b/benchmarks/many_modules/module/internal.pp.erb deleted file mode 100644 index 83a36947d..000000000 --- a/benchmarks/many_modules/module/internal.pp.erb +++ /dev/null @@ -1,3 +0,0 @@ -class <%= name %>::internal { - notify { "<%= name %>::internal": } -} diff --git a/benchmarks/many_modules/puppet.conf.erb b/benchmarks/many_modules/puppet.conf.erb deleted file mode 100644 index e0c5d8588..000000000 --- a/benchmarks/many_modules/puppet.conf.erb +++ /dev/null @@ -1,3 +0,0 @@ -confdir = <%= location %> -vardir = <%= location %> -environmentpath = <%= File.join(location, 'environments') %> diff --git a/benchmarks/many_modules/site.pp.erb b/benchmarks/many_modules/site.pp.erb deleted file mode 100644 index 9f6c9668a..000000000 --- a/benchmarks/many_modules/site.pp.erb +++ /dev/null @@ -1,3 +0,0 @@ -<% size.times do |i| %> - include module<%= i %> -<% end %> diff --git a/benchmarks/system_startup/benchmarker.rb b/benchmarks/system_startup/benchmarker.rb deleted file mode 100644 index 4a691a35c..000000000 --- a/benchmarks/system_startup/benchmarker.rb +++ /dev/null @@ -1,17 +0,0 @@ -class Benchmarker - def initialize(target, size) - end - - def setup - end - - def generate - end - - def run(args=nil) - # Just running help is probably a good proxy of a full startup. - # Simply asking for the version might also be good, but it would miss all - # of the app searching and loading parts - `puppet help` - end -end diff --git a/benchmarks/system_startup/description b/benchmarks/system_startup/description deleted file mode 100644 index 85c6dea3a..000000000 --- a/benchmarks/system_startup/description +++ /dev/null @@ -1,2 +0,0 @@ -Benchmark scenario: running puppet commands from the CLI -Benchmark target: overhead of loading puppet diff --git a/docs/acceptance_tests.md b/docs/acceptance_tests.md deleted file mode 100644 index 809ac9c43..000000000 --- a/docs/acceptance_tests.md +++ /dev/null @@ -1,239 +0,0 @@ -Running Acceptance Tests Yourself -================================= - -Table of Contents ------------------ - -* [General Notes](#general-notes) -* [Running Tests on the vcloud](#running-tests-on-the-vcloud) -* [Running Tests on Vagrant Boxen](#running-tests-on-vagrant-boxen) - -General Notes -------------- - -The rake tasks for running the tests are defined by the Rakefile in the acceptance test directory. -These tasks come with some documentation: `rake -T` will give short descriptions, and a `rake -D` will give full descriptions with information on ENV options required and optional for the various tasks. - -If you are setting up a new repository for acceptance, you will need to bundle install first. This step assumes you have ruby and the bundler gem installed. - -```sh -cd /path/to/repo/acceptance -bundle install --path=.bundle/gems -``` - -### Using Git Mirrors - -By default if you are installing from source, packages will be installed from Github, from their puppetlabs forks. This can be selectively overridden for all installed projects, or per project, by setting environment variables. - -GIT_SERVER => this will be the address the git server used for all installed projects. Defaults to 'github.com'. -FORK => this will be the fork of the project for all installed projects. Defaults to 'puppetlabs'. - -To customize the server or fork for a specific project use PROJECT_NAME_GIT_SERVER and PROJECT_NAME_FORK. - -For example, run with these options: - -```sh -bundle exec rake ci:test:git CONFIG=config/nodes/win2008r2.yaml SHA=abcd PUPPET_GIT_SERVER=percival.corp.puppetlabs.net GIT_SERVER=github.delivery.puppetlabs.net -``` - -Beaker will install the following: - -``` -:install=> - ["git://github.delivery.puppetlabs.net/puppetlabs-facter.git#stable", - "git://github.delivery.puppetlabs.net/puppetlabs-hiera.git#stable", - "git://percival.corp.puppetlabs.net/puppetlabs-puppet.git#abcd"], -``` - -This corresponds to installing facter and hiera stable from our internal mirror, while installing puppet SHA abcd from a git daemon on my local machine percival. See below for details on setting up a local git daemon. - -Running Tests on the vcloud ---------------------------- - -In order to use the Puppet Labs vcloud, you'll need to be a Puppet Labs employee. -Community members should see the [guide to running the tests on vagrant boxen](#running-tests-on-vagrant-boxen). - -### Authentication - -Normally the ci tasks are called from a prepared Jenkins job. - -If you are running this on your laptop, you will need this ssh private key in order for beaker to be able to log into the vms created from the hosts file: - -https://github.com/puppetlabs/puppetlabs-modules/blob/production/secure/jenkins/id_rsa-acceptance -https://github.com/puppetlabs/puppetlabs-modules/blob/production/secure/jenkins/id_rsa-acceptance.pub - -Please note in acceptance/Rakefile where the ssh key is defaulted to. It may be looking in ~/.ssh/id_rsa-acceptance, but it may want to look in the working directory (e.g. puppet/acceptance). - -You will also need QA credentials to vsphere in a ~/.fog file. These credentials can be found on any of the Jenkins coordinator hosts. You may want to check periodically to ensure that the credentials you have are still valid as they may change periodically. - -### Packages - -In order to run the tests on hosts provisioned from packages produced by Delivery, you will need to reference a Puppet commit sha that has been packaged using Delivery's pl:jenkins:uber_build task. This is the snippet used by 'Puppet Packaging' Jenkins jobs: - -```sh -# EXAMPLE - DO NOT RUN THIS -rake --trace package:implode -rake --trace package:bootstrap -rake --trace pl:jenkins:uber_build -``` - -The above Rake tasks were run from the root of a Puppet checkout. They are quoted just for reference. Typically if you are investigating a failure, you will have a SHA from a failed jenkins run which should correspond to a successful pipeline run, and you should not need to run the pipeline manually. - -A finished pipeline will have repository information available at http://builds.puppetlabs.lan/puppet/ So you can also browse this list and select a recent sha which has repo_configs/ available. - -When executing the ci:test:packages task, you must set the SHA, and also set CONFIG to point to a valid Beaker hosts_file. Configurations used in the Jenkins jobs are available under config/nodes - -```sh -bundle exec rake ci:test:packages SHA=abcdef CONFIG=config/nodes/rhel.yaml -``` - -Optionally you may set the TEST (TEST=a/test.rb,and/another/test.rb), and may pass additional OPTIONS to beaker (OPTIONS='--opt foo'). - -You may also edit a ./local_options.rb hash which will override config/ options, and in turn be overriden by commandline options set in the environment variables CONFIG, TEST and OPTIONS. This file is a ruby file containing a Ruby hash with configuration expected by Beaker. See Beaker source, and examples in config/. - -### Git - -Alternatively you may provision via git clone by calling the ci:test:git task. Currently we don't have packages for Windows or Solaris from the Delivery pipeline, and must use ci:test:git to provision and test these platforms. - -#### Source Checkout for Different Fork - -If you have a branch pushed to your fork which you wish to test prior to merging into puppetlabs/puppet, you can do so be setting the FORK environment variable. So, if I have a branch 'issue/master/wonder-if-this-explodes' pushed to my jpartlow puppet fork that I want to test on Windows, I could invoke the following: - -```sh -bundle exec rake ci:test:git CONFIG=config/nodes/win2008r2.yaml SHA=issue/master/wonder-if-this-explodes FORK=jpartlow -``` - -#### Source Checkout for Local Branch - -See notes on running acceptance with Vagrant for more details on using a local git daemon. - -TODO Fix up the Rakefile's handling of git urls so that there is a simple way to specify both a branch on a github fork, and a branch on some other git server daemon, so that you have fewer steps when serving from a local git daemon. - -### Preserving Hosts - -If you need to ssh into the hosts after a test run, you can use the following sequence: - - bundle exec rake ci:test_and_preserve_hosts CONFIG=some/config.yaml SHA=12345 TEST=a/foo_test.rb - -to get the initial templates provisioned, and a local log/latest/preserve_config.yaml created for them. - -Then you can log into the hosts, or rerun tests against them by: - - bundle exec rake ci:test_against_preserved_hosts TEST=a/foo_test.rb - -This will use the existing hosts. - -NOTE: If you want configuration information to be preserved for all runs (potentially allowing you to run ci:test_against_preserved_hosts for any previous run that failed, and who's hosts were preserved, regardless of whether you initiated with a ci:test_and_preserve_hosts call) then you should add a ':__preserve_config__ => true' to your local_options.rb. - -### Cleaning Up Preserved Hosts - -If you run a number of jobs with --preserve_hosts or vi ci:test_and_preserve_hosts, you may eventually generate a large number of stale vms. They should be reaped automatically by qa infrastructure within a day or so, but you may also run: - - bundle exec rake ci:release_hosts - -to clean them up sooner and free resources. - -There also may be scenarios where you want to specify the host(s) to relase. E.g. you may want to relase a subset of the hosts you've created. Or, if a test run terminates early, ci:release_hosts may not be able to derive the name of the vm to delete. In such cases you can specify host(s) to be deleted using the HOST_NAMES environment variable. E.g. - - HOST_NAMES=lvwwr9tdplg351u bundle exec rake ci:release_hosts - HOST_NAMES=lvwwr9tdplg351u,ylrqjh5l6xvym4t bundle exec rake ci:release_hosts - - -Running Tests on Vagrant Boxen ------------------------------- - -This guide assumes that you have an acceptable Ruby (i.e. 1.9+) installed along with the bundler gem, that you have the puppet repo checked out locally somewhere, and that the name of the checkout folder is `puppet`. -I used Ruby 1.9.3-p484 - -Change to the `acceptance` directory in the root of the puppet repo: -```sh -cd /path/to/repo/puppet/acceptance -``` -Install the necessary gems with bundler: -```sh -bundle install -``` - -Now you can get a list of test-related tasks you can run via rake: -```sh -bundle exec rake -T -``` -and view detailed information on the tasks with -```sh -bundle exec rake -D -``` - -As an example, let's try running the acceptance tests using git as the code deployment mechanism. -First, we'll have to create a beaker configuration file for a local vagrant box on which to run the tests. -Here's what such a file could look like: -```yaml -HOSTS: - all-in-one: - roles: - - master - - agent - platform: centos-64-x64 - hypervisor: vagrant - ip: 192.168.80.100 - box: centos-64-x64-vbox4210-nocm - box_url: http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box - -CONFIG: -``` -This defines a 64-bit CentOS 6.4 vagrant box that serves as both a puppet master and a puppet agent for the test roles. -(For more information on beaker config files, see [beaker's README](https://github.com/puppetlabs/beaker/blob/master/README.md).) -Save this file as `config/nodes/centos6-local.yaml`; we'll be needing it later. - -Since we have only provided a CentOS box, we don't have anywhere to run windows tests, therefore we'll have to skip those tests. -That means we want to pass beaker a --tests argument that contains every directory and file in the `tests` directory besides the one called `windows`. -We could pass this option on the command line, but it will be gigantic, so instead let's create a `local_options.rb` file that beaker will automatically read in. -This file should contain a ruby hash of beaker's command-line flags to the corresponding flag arguments. -Our hash will only contain the `tests` key, and its value will be a comma-seperated list of the other files and directories in `tests`. -Here's an easy way to generate this file: -```sh -echo "{tests: \"$(echo tests/* | sed -e 's| *tests/windows *||' -e 's/ /,/g')\"}" > local_options.rb" -``` - -The last thing that needs to be done before we can run the tests is to set up a way for the test box to check out our local changes for testing. -We'll do this by starting a git daemon on our host. -In another session, navigate to the folder that contains your checkout of the puppet repo, and then create the following symlink: -```sh -ln -s . puppetlabs-puppet.git -``` -This works around the inflexible checkout path used by the test prep code. - -Now start the git daemon with -```sh -git daemon --verbose --informative-errors --reuseaddr --export-all --base-path=. -``` -after which you should see a message like `[32963] Ready to rumble` echoed to the console. - -Now we can finally run the tests! -The rake task that we'll use is `ci:test:git`. -Run -``` -bundle exec rake -D ci:test:git -``` -to read the full description of this task. -From the description, we can see that we'll need to set a few environment variables: - + CONFIG should be set to point to the CentOS beaker config file we created above. - + SHA should be the SHA of the commit we want to test. - + GIT_SERVER should be the IP address of the host (i.e. your machine) in the vagrant private network created for the test box. - This is derived from the test box's ip by replacing the last octet with 1. - For our example above, the host IP is 192.168.80.1 - + FORK should be the path to a 'puppetlabs-puppet.git' directory that points to the repo. - In our case, this is the path to the symlink we created before, which is inside your puppet repo checkout, so FORK should just be the name of your checkout. - We'll assume that the name is `puppet`. - -Putting it all together, we construct the following command-line invocation to run the tests: -```sh -CONFIG=config/nodes/centos6-local.yaml SHA=#{test-commit-sha} GIT_SERVER='192.168.80.1' FORK='puppet' bundle exec rake --trace ci:test:git -``` -Go ahead and run that sucker! - -Testing will take some time. -After the testing finishes, you'll either see this line -``` -systest completed successfully, thanks. -``` -near the end of the output, indicating that all tests completed succesfully, or you'll see the end of a stack trace, indicating failed tests further up. diff --git a/docs/catalogs.md b/docs/catalogs.md deleted file mode 100644 index 6702a9b27..000000000 --- a/docs/catalogs.md +++ /dev/null @@ -1,122 +0,0 @@ -# Two Types of Catalog - -When working on subsystems of Puppet that deal with the catalog it is important -to be aware of the two different types of Catalog. Developers will often find -this difference while working on the static compiler and types and providers. - -The two different types of catalog becomes relevant when writing spec tests -because we frequently need to wire up a fake catalog so that we can exercise -types, providers, or termini that filter the catalog. - -The two different types of catalogs are so-called "resource" catalogs and "RAL" -(resource abstraction layer) catalogs. At a high level, the resource catalog -is the in-memory object we serialize and transfer around the network. The -compiler terminus is expected to produce a resource catalog. The agent takes a -resource catalog and converts it into a RAL catalog. The RAL catalog is what -is used to apply the configuration model to the system. - -Resource dependency information is most easily obtained from a RAL catalog by -walking the graph instance produced by the `relationship_graph` method. - -### Resource Catalog - -If you're writing spec tests for something that deals with a catalog "server -side," a new catalog terminus for example, then you'll be dealing with a -resource catalog. You can produce a resource catalog suitable for spec tests -using something like this: - - let(:catalog) do - catalog = Puppet::Resource::Catalog.new("node-name-val") # NOT certname! - rsrc = Puppet::Resource.new("file", "sshd_config", - :parameters => { - :ensure => 'file', - :source => 'puppet:///modules/filetest/sshd_config', - } - ) - rsrc.file = 'site.pp' - rsrc.line = 21 - catalog.add_resource(rsrc) - end - -The resources in this catalog may be accessed using `catalog.resources`. -Resource dependencies are not easily walked using a resource catalog however. -To walk the dependency tree convert the catalog to a RAL catalog as described -in - -### RAL Catalog - -The resource catalog may be converted to a RAL catalog using `catalog.to_ral`. -The RAL catalog contains `Puppet::Type` instances instead of `Puppet::Resource` -instances as is the case with the resource catalog. - -One very useful feature of the RAL catalog are the methods to work with -resource relationships. For example: - - irb> catalog = catalog.to_ral - irb> graph = catalog.relationship_graph - irb> pp graph.edges - [{ Notify[alpha] => File[/tmp/file_20.txt] }, - { Notify[alpha] => File[/tmp/file_21.txt] }, - { Notify[alpha] => File[/tmp/file_22.txt] }, - { Notify[alpha] => File[/tmp/file_23.txt] }, - { Notify[alpha] => File[/tmp/file_24.txt] }, - { Notify[alpha] => File[/tmp/file_25.txt] }, - { Notify[alpha] => File[/tmp/file_26.txt] }, - { Notify[alpha] => File[/tmp/file_27.txt] }, - { Notify[alpha] => File[/tmp/file_28.txt] }, - { Notify[alpha] => File[/tmp/file_29.txt] }, - { File[/tmp/file_20.txt] => Notify[omega] }, - { File[/tmp/file_21.txt] => Notify[omega] }, - { File[/tmp/file_22.txt] => Notify[omega] }, - { File[/tmp/file_23.txt] => Notify[omega] }, - { File[/tmp/file_24.txt] => Notify[omega] }, - { File[/tmp/file_25.txt] => Notify[omega] }, - { File[/tmp/file_26.txt] => Notify[omega] }, - { File[/tmp/file_27.txt] => Notify[omega] }, - { File[/tmp/file_28.txt] => Notify[omega] }, - { File[/tmp/file_29.txt] => Notify[omega] }] - -If the `relationship_graph` method is throwing exceptions at you, there's a -good chance the catalog is not a RAL catalog. - -## Settings Catalog ## - -Be aware that Puppet creates a mini catalog and applies this catalog locally to -manage file resource from the settings. This behavior made it difficult and -time consuming to track down a race condition in -[2888](http://projects.puppetlabs.com/issues/2888). - -Even more surprising, the `File[puppetdlockfile]` resource is only added to the -settings catalog if the file exists on disk. This caused the race condition as -it will exist when a separate process holds the lock while applying the -catalog. - -It may be sufficient to simply be aware of the settings catalog and the -potential for race conditions it presents. An effective way to be reasonably -sure and track down the problem is to wrap the File.open method like so: - - # We're wrapping ourselves around the File.open method. - # As described at: http://goo.gl/lDsv6 - class File - WHITELIST = [ /pidlock.rb:39/ ] - - class << self - alias xxx_orig_open open - end - - def self.open(name, *rest, &block) - # Check the whitelist for any "good" File.open calls against the # - puppetdlock file - white_listed = caller(0).find do |line| - JJM_WHITELIST.find { |re| re.match(line) } - end - - # If you drop into IRB here, take a look at your caller, it might be - # the ghost in the machine you're looking for. - binding.pry if name =~ /puppetdlock/ and not white_listed - xxx_orig_open(name, *rest, &block) - end - end - -The settings catalog is populated by the `Puppet::Util::Settings#to\_catalog` -method. diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 240d30bab..000000000 --- a/docs/index.md +++ /dev/null @@ -1,18 +0,0 @@ -# Puppet Developer Documentation - -Setting up and running tests - -* [Quickstart Guide](quickstart.md) -* [RSpec Tutorial](rspec_tutorial.md) -* [Running acceptance tests](acceptance_tests.md) - -Developer References - -* [Profiling and Benchmarking](profiling.md) -* [Various Catalog Forms](catalogs.md) -* [Windows](windows.md) -* [Unicode and you](unicode.md) - -Misc - -* [Static Compiler](static_compiler.md) diff --git a/docs/profiling.md b/docs/profiling.md deleted file mode 100644 index 83d4533bd..000000000 --- a/docs/profiling.md +++ /dev/null @@ -1,49 +0,0 @@ -# Profiling Puppet - -Puppet is a beast. Puppet is at times a very *slow* beast. Maybe we can find -what is making it slow and fix it. - -## Coarse Grained Profiling - -There is a built-in system of profiling that can be used to identify some slow -spots. This can only work with code that is explicitly instrumented, which, at -the time of this writing, is primarily the compiler. To enable profiling there -are several options: - -* To profile every request on the master add `--profile` to your master's - startup. -* To profile a single run for an agent add `--profile` to your agent's options - for that run. -* To profile a masterless run add `--profile` to your `puppet apply` options. - -The timing information will be output to the logs and tagged with the word -"PROFILE". - -For the agent there is actually a second system: evaltrace. You can enable this -on the agent by passing it `--evaltrace`. Timing information for each resource -will be output to the logs. - -## Using a Ruby Profiler - -For much finer grained profiling, you'll want to use -[ruby-prof](http://rubygems.org/gems/ruby-prof). Once you have the gem -installed you can either modify the code to profile a certain section (using -RubyProf.profile) or run the master with ruby-prof by adding `use -Rack::RubyProf, :path => '/temp/profile'` to the config.ru for your master. - -## Running the Benchmarks - -Puppet has a number of benchmark scenarios to pinpoint problems in specific, -known, use cases. The benchmark scenarios live in the `benchmarks` directory. - -To run a scenario you do: - - bundle exec rake benchmark:<scenario_name> - -If you have ruby-prof installed you can get a calltrace of the benchmark -scenario by running: - - bundle exec rake benchmark:<scenario_name>:profile - -The calltrace file is viewable with -[kcachegrind](http://kcachegrind.sourceforge.net/html/Home.html). diff --git a/docs/quickstart.md b/docs/quickstart.md deleted file mode 100644 index e8a88c3ec..000000000 --- a/docs/quickstart.md +++ /dev/null @@ -1,61 +0,0 @@ -# Quick Start to Developing on Puppet - -Before diving into the code, you should first take the time to make sure you -have an environment where you can run puppet as a developer. In a nutshell you -need: the puppet codebase, ruby versions, and dependencies. Once you've got all -of that in place you can make sure that you have a working development system -by running the puppet spec tests. - -## The Puppet Codebase - -In order to contribute to puppet you'll need to have a github account. Once you -have your account, fork the puppetlabs/puppet repo, and clone it onto your -local machine. The [github docs have a good -explanation](https://help.github.com/articles/fork-a-repo) of how to do all of -this. - -## Ruby versions - -Puppet needs to work across a variety of ruby versions. At a minimum you need -to try any changes you make on both ruby 1.8.7 and ruby 1.9.3. Ruby 2.0.0 and -2.1.0 are also supported, but they have small enough differences from 1.9.3 -that they are not as important to always check while developing. - -Popular ways of making sure you have access to the various versions of ruby are -to use either [rbenv](https://github.com/sstephenson/rbenv) or -[rvm](http://rvm.io/). You can read up on the linked sites for how to get them -installed on your system. - -## Dependencies - -Make sure you have [bundler](http://bundler.io/) installed. This should be as -simple as: - - $ gem install bundler - -Now you can get all of the dependencies using: - - $ bundle install --path .bundle/gems/ - -Once this is done, you can interact with puppet through bundler using `bundle -exec <command>` which will ensure that `<command>` is executed in the context -of puppet's dependencies. - -For example to run the specs: - - $ bundle exec rake spec - -To run puppet itself (for a resource lookup say): - - $ bundle exec puppet resource host localhost - -## Running Spec Tests - -Puppet Labs projects use a common convention of using Rake to run unit tests. -The tests can be run with the following rake task: - - bundle exec rake spec - -To run a single file's worth of tests (much faster!), give the filename: - - bundle exec rake spec TEST=spec/unit/ssl/host_spec.rb diff --git a/docs/rspec_tutorial.md b/docs/rspec_tutorial.md deleted file mode 100644 index c22e5c6ad..000000000 --- a/docs/rspec_tutorial.md +++ /dev/null @@ -1,364 +0,0 @@ -# A brief introduction to testing in Puppet - -Puppet relies heavily on automated testing to ensure that Puppet behaves as -expected and that new features don't interfere with existing behavior. There are -three primary sets of tests that Puppet uses: _unit tests_, _integration tests_, -and _acceptance tests_. - -- - - - -Unit tests are used to test the individual components of Puppet to ensure that -they function as expected in isolation. Unit tests are designed to hide the -actual system implementations and provide canned information so that only the -intended behavior is tested, rather than the targeted code and everything else -connected to it. Unit tests should never affect the state of the system that's -running the test. - -- - - - -Integration tests serve to test different units of code together to ensure that -they interact correctly. While individual methods might perform correctly, when -used with the rest of the system they might fail, so integration tests are a -higher level version of unit tests that serve to check the behavior of -individual subsystems. - -All of the unit and integration tests for Puppet are kept in the spec/ directory. - -- - - - -Acceptance tests are used to test high level behaviors of Puppet that deal with -a number of concerns and aren't easily tested with normal unit tests. Acceptance -tests function by changing system state and checking the system after -the fact to make sure that the intended behavior occurred. Because of this -acceptance tests can be destructive, so the systems being tested should be -throwaway systems. - -All of the acceptance tests for Puppet are kept in the acceptance/tests/ -directory. Running the acceptance tests is much more involved than running the -spec tests. Information about how to run them can be found in the [acceptance -testing documentation](acceptance_tests.md) - -## Testing dependency version requirements - -Puppet is only compatible with certain versions of RSpec and Mocha. If you are -not using Bundler to install the required test libraries you must ensure that -you are using the right library versions. Using unsupported versions of Mocha -and RSpec will probably display many spurious failures. The supported versions -of RSpec and Mocha can be found in the project Gemfile. - -## Puppet Continuous integration - - * Travis-ci (spec tests only): https://travis-ci.org/puppetlabs/puppet/ - * Jenkins (spec and acceptance tests): https://jenkins.puppetlabs.com/view/Puppet%20FOSS/ - -## RSpec - -Puppet uses RSpec to perform unit and integration tests. RSpec handles a number -of concerns to make testing easier: - - * Executing examples and ensuring the actual behavior matches the expected behavior (examples) - * Grouping tests (describe and contexts) - * Setting up test environments and cleaning up afterwards (before and after blocks) - * Isolating tests (mocks and stubs) - -#### Examples and expectations - -At the most basic level, RSpec provides a framework for executing tests (which -are called examples) and ensuring that the actual behavior matches the expected -behavior (which are done with expectations) - -```ruby -# This is an example; it sets the test name and defines the test to run -specify "one equals one" do - # 'should' is an expectation; it adds a check to make sure that the left argument - # matches the right argument - 1.should == 1 -end - -# Examples can be declared with either 'it' or 'specify' -it "one doesn't equal two" do - 1.should_not == 2 -end -``` - -Good examples generally do as little setup as possible and only test one or two -things; it makes tests easier to understand and easier to debug. - -More complete documentation on expectations is available at https://www.relishapp.com/rspec/rspec-expectations/docs - -### Example groups - -Example groups are fairly self explanatory; they group similar examples into a -set. - -```ruby -describe "the number one" do - - it "is larger than zero" do - 1.should be > 0 - end - - it "is an odd number" do - 1.odd?.should be true - end - - it "is not nil" do - 1.should_not be_nil - end -end -``` - -Example groups have a number of uses that we'll get into later, but one of the -simplest demonstrations of what they do is how they help to format -documentation: - -``` -rspec ex.rb --format documentation - -the number one - is larger than zero - is an odd number - is not nil - -Finished in 0.00516 seconds -3 examples, 0 failures -``` - -### Setting up and tearing down tests - -Examples may require some setup before they can run, and might need to clean up -afterwards. `before` and `after` blocks can be used before this, and can be -used inside of example groups to limit how many examples they affect. - -```ruby - -describe "something that could warn" do - before :each do - # Disable warnings for this test - $VERBOSE = nil - end - - after :each do - # Enable warnings afterwards - $VERBOSE = true - end - - it "doesn't generate a warning" do - MY_CONSTANT = 1 - # reassigning a constant normally prints out 'warning: already initialized constant FOO' - MY_CONSTANT = 2 - end -end -``` - -### Setting up helper data - -Some examples may require setting up data before hand and making it available to -tests. RSpec provides helper methods with the `let` method call that can be used -inside of tests. - -```ruby -describe "a helper object" do - # This creates an array with three elements that we can retrieve in tests. A - # new copy will be made for each test. - let(:my_helper) do - ['foo', 'bar', 'baz'] - end - - it "is an array" do - my_helper.should be_a_kind_of Array - end - - it "has three elements" do - my_helper.should have(3).items - end -end -``` - -Like `before` blocks, helper objects like this are used to avoid doing a lot of -setup in individual examples and share setup between similar tests. - -### Isolating tests with stubs - -RSpec allows you to provide fake data during testing to make sure that -individual tests are only running the code being tested. You can stub out entire -objects, or just stub out individual methods on an object. When a method is -stubbed the method itself will never be called. - -While RSpec comes with its own stubbing framework, Puppet uses the Mocha -framework. - -A brief usage guide for Mocha is available at http://gofreerange.com/mocha/docs/#Usage, -and an overview of Mocha expectations is available at http://gofreerange.com/mocha/docs/Mocha/Expectation.html - -```ruby -describe "stubbing a method on an object" do - let(:my_helper) do - ['foo', 'bar', 'baz'] - end - - it 'has three items before being stubbed' do - my_helper.size.should == 3 - end - - describe 'when stubbing the size' do - before :each do - my_helper.stubs(:size).returns 10 - end - - it 'has the stubbed value for size' do - my_helper.size.should == 10 - end - end -end -``` - -Entire objects can be stubbed as well. - -```ruby -describe "stubbing an object" do - let(:my_helper) do - stub(:not_an_array, :size => 10) - end - - it 'has the stubbed size' - my_helper.size.should == 10 - end -end -``` - -### Adding expectations with mocks - -It's possible to combine the concepts of stubbing and expectations so that a -method has to be called for the test to pass (like an expectation), and can -return a fixed value (like a stub). - -```ruby -describe "mocking a method on an object" do - let(:my_helper) do - ['foo', 'bar', 'baz'] - end - - describe "when mocking the size" do - before :each do - my_helper.expects(:size).returns 10 - end - - it "adds an expectation that a method was called" do - my_helper.size - end - end -end -``` - -Like stubs, entire objects can be mocked. - -```ruby -describe "mocking an object" do - let(:my_helper) do - mock(:not_an_array) - end - - before :each do - not_an_array.expects(:size).returns 10 - end - - it "adds an expectation that the method was called" do - not_an_array.size - end -end -``` -### Writing tests without side effects - -When properly written each test should be able to run in isolation, and tests -should be able to be run in any order. This makes tests more reliable and allows -a single test to be run if only that test is failing, instead of running all -17000+ tests each time something is changed. However, there are a number of ways -that can make tests fail when run in isolation or out of order. - -#### Using instance variables - -Puppet has a number of older tests that use `before` blocks and instance -variables to set up fixture data, instead of `let` blocks. These can retain -state between tests, which can lead to test failures when tests are run out of -order. - -```ruby -# test.rb -RSpec.configure do |c| - c.mock_framework = :mocha -end - -describe "fixture data" do - describe "using instance variables" do - - # BAD - before :all do - # This fixture will be created only once and will retain the `foo` stub - # between tests. - @fixture = stub 'test data' - end - - it "can be stubbed" do - @fixture.stubs(:foo).returns :bar - @fixture.foo.should == :bar - end - - it "does not keep state between tests" do - # The foo stub was added in the previous test and shouldn't be present - # in this test. - expect { @fixture.foo }.to raise_error - end - end - - describe "using `let` blocks" do - - # GOOD - # This will be recreated between tests so that state isn't retained. - let(:fixture) { stub 'test data' } - - it "can be stubbed" do - fixture.stubs(:foo).returns :bar - fixture.foo.should == :bar - end - - it "does not keep state between tests" do - # since let blocks are regenerated between tests, the foo stub added in - # the previous test will not be present here. - expect { fixture.foo }.to raise_error - end - end -end -``` - -``` -bundle exec rspec test.rb -fd - -fixture data - using instance variables - can be stubbed - should not keep state between tests (FAILED - 1) - using `let` blocks - can be stubbed - should not keep state between tests - -Failures: - - 1) fixture data using instance variables should not keep state between tests - Failure/Error: expect { @fixture.foo }.to raise_error - expected Exception but nothing was raised - # ./test.rb:17:in `block (3 levels) in <top (required)>' - -Finished in 0.00248 seconds -4 examples, 1 failure - -Failed examples: - -rspec ./test.rb:16 # fixture data using instance variables should not keep state between tests -``` - -### RSpec references - - * RSpec core docs: https://www.relishapp.com/rspec/rspec-core/docs - * RSpec guidelines with Ruby: http://betterspecs.org/ - diff --git a/docs/static_compiler.md b/docs/static_compiler.md deleted file mode 100644 index 8a3270eab..000000000 --- a/docs/static_compiler.md +++ /dev/null @@ -1,83 +0,0 @@ -# Static Compiler - -The static compiler was added to Puppet in the 2.7.0 release. -[1](http://links.puppetlabs.com/static-compiler-announce) - -The static compiler is intended to provide a configuration catalog that -requires a minimal amount of network communication in order to apply the -catalog to the system. As implemented in Puppet 2.7.x and Puppet 3.0.x this -intention takes the form of replacing all of the source parameters of File -resources with a content parameter containing an address in the form of a -checksum. The expected behavior is that the process applying the catalog to -the node will retrieve the file content from the FileBucket instead of the -FileServer. - -The high level approach can be described as follows. The `StaticCompiler` is a -terminus that inserts itself between the "normal" compiler terminus and the -request. The static compiler takes the resource catalog produced by the -compiler and filters all File resources. Any file resource that contains a -source parameter with a value starting with 'puppet://' is filtered in the -following way in a "standard" single master / networked agents deployment -scenario: - - 1. The content, owner, group, and mode values are retrieved from th - FileServer by the master. - 2. The file content is stored in the file bucket on the master. - 3. The source parameter value is stripped from the File resource. - 4. The content parameter value is set in the File resource using the form - '{XXX}1234567890' which can be thought of as a content address indexed by - checksum. - 5. The owner, group and mode values are set in the File resource if they are - not already set. - 6. The filtered catalog is returned in the response. - -In addition to the catalog terminus, the process requesting the catalog needs -to obtain the file content. The default behavior of `puppet agent` is to -obtain file contents from the local client bucket. The method we expect users -to employ to reconfigure the agent to use the server bucket is to declare the -`Filebucket[puppet]` resource with the address of the master. For example: - - node default { - filebucket { puppet: - server => $server, - path => false, - } - class { filetest: } - } - -This special filebucket resource named "puppet" will cause the agent to fetch -file contents specified by checksum from the remote filebucket instead of the -default clientbucket. - -## Trying out the Static Compiler - -Create a module that recursively downloads something. The jeffmccune-filetest -module will recursively copy the rubygems source tree. - - $ bundle exec puppet module install jeffmccune-filetest - -Start the master with the StaticCompiler turned on: - - $ bundle exec puppet master \ - --catalog_terminus=static_compiler \ - --verbose \ - --no-daemonize - -Add the special Filebucket[puppet] resource: - - # site.pp - node default { - filebucket { puppet: server => $server, path => false } - class { filetest: } - } - -Get the static catalog: - - $ bundle exec puppet agent --test - -You should expect all file metadata to be contained in the catalog, including a -checksum representing the content. When managing an out of sync file resource, -the real contents should be fetched from the server instead of the -clientbucket. - - diff --git a/docs/unicode.md b/docs/unicode.md deleted file mode 100644 index a6c81df82..000000000 --- a/docs/unicode.md +++ /dev/null @@ -1,56 +0,0 @@ -# UTF-8 Handling # - -As Ruby 1.9 becomes more commonly used with Puppet, developers should be aware -of major changes to the way Strings and Regexp objects are handled. -Specifically, every instance of these two classes will have an encoding -attribute determined in a number of ways. - - * If the source file has an encoding specified in the magic comment at the - top, the instance will take on that encoding. - * Otherwise, the encoding will be determined by the LC\_LANG or LANG - environment variables. - * Otherwise, the encoding will default to ASCII-8BIT - -## References ## - -Excellent information about the differences between encodings in Ruby 1.8 and -Ruby 1.9 is published in this blog series: -[Understanding M17n](http://links.puppetlabs.com/understanding_m17n) - -## Encodings of Regexp and String instances ## - -In general, please be aware that Ruby 1.9 regular expressions need to be -compatible with the encoding of a string being used to match them. If they are -not compatible you can expect to receive and error such as: - - Encoding::CompatibilityError: incompatible encoding regexp match (ASCII-8BIT - regexp with UTF-8 string) - -In addition, some escape sequences were valid in Ruby 1.8 are no longer valid -in 1.9 if the regular expression is not marked as an ASCII-8BIT object. You -may expect errors like this in this situation: - - SyntaxError: (irb):7: invalid multibyte escape: /\xFF/ - -This error is particularly common when serializing a string to other -representations like JSON or YAML. To resolve the problem you can explicitly -mark the regular expression as ASCII-8BIT using the /n flag: - - "a" =~ /\342\230\203/n - -Finally, any time you're thinking of a string as an array of bytes rather than -an array of characters, common when escaping a string, you should work with -everything in ASCII-8BIT. Changing the encoding will not change the data -itself and allow the Regexp and the String to deal with bytes rather than -characters. - -Puppet provides a monkey patch to String which returns an encoding suitable for -byte manipulations: - - # Example of how to escape non ASCII printable characters for YAML. - >> snowman = "☃" - >> snowman.to_ascii8bit.gsub(/([\x80-\xFF])/n) { |x| "\\x#{x.unpack("C")[0].to_s(16)} } - => "\\xe2\\x98\\x83" - -If the Regexp is not marked as ASCII-8BIT using /n, then you can expect the -SyntaxError, invalid multibyte escape as mentioned above. diff --git a/docs/windows.md b/docs/windows.md deleted file mode 100644 index 1a61f8b45..000000000 --- a/docs/windows.md +++ /dev/null @@ -1,73 +0,0 @@ -# Windows # - -If you'd like to run Puppet from source on Windows platforms, the -include `ext/envpuppet.bat` will help. - -To quickly run Puppet from source, assuming you already have Ruby installed -from [rubyinstaller.org](http://rubyinstaller.org). - - C:\> cd C:\work\puppet - C:\work\puppet> set PATH=%PATH%;C:\work\puppet\ext - C:\work\puppet> envpuppet bundle install - C:\work\puppet> envpuppet puppet --version - 2.7.9 - -When writing a test that cannot possibly run on Windows, e.g. there is -no mount type on windows, do the following: - - describe Puppet::MyClass, :unless => Puppet.features.microsoft_windows? do - .. - end - -If the test doesn't currently pass on Windows, e.g. due to on going porting, then use an rspec conditional pending block: - - pending("porting to Windows", :if => Puppet.features.microsoft_windows?) do - <example1> - end - - pending("porting to Windows", :if => Puppet.features.microsoft_windows?) do - <example2> - end - -Then run the test as: - - C:\work\puppet> envpuppet bundle exec rspec spec - -## Common Issues ## - - * Don't assume file paths start with '/', as that is not a valid path on - Windows. Use Puppet::Util.absolute\_path? to validate that a path is fully - qualified. - - * Use File.expand\_path('/tmp') in tests to generate a fully qualified path - that is valid on POSIX and Windows. In the latter case, the current working - directory will be used to expand the path. - - * Always use binary mode when performing file I/O, unless you explicitly want - Ruby to translate between unix and dos line endings. For example, opening an - executable file in text mode will almost certainly corrupt the resulting - stream, as will occur when using: - - IO.open(path, 'r') { |f| ... } - IO.read(path) - - If in doubt, specify binary mode explicitly: - - IO.open(path, 'rb') - - * Don't assume file paths are separated by ':'. Use `File::PATH_SEPARATOR` - instead, which is ':' on POSIX and ';' on Windows. - - * On Windows, `File::SEPARATOR` is '/', and `File::ALT_SEPARATOR` is '\'. On - POSIX systems, `File::ALT_SEPARATOR` is nil. In general, use '/' as the - separator as most Windows APIs, e.g. CreateFile, accept both types of - separators. - - * Don't use waitpid/waitpid2 if you need the child process' exit code, - as the child process may exit before it has a chance to open the - child's HANDLE and retrieve its exit code. Use Puppet::Util.execute. - - * Don't assume 'C' drive. Use environment variables to look these up: - - "#{ENV['windir']}/system32/netsh.exe" - diff --git a/ext/debian/changelog.erb b/ext/debian/changelog index 14cc79dc8..de2ac6b06 100644 --- a/ext/debian/changelog.erb +++ b/ext/debian/changelog @@ -1,8 +1,8 @@ -puppet (<%= @debversion %>) hardy lucid natty oneiric unstable sid squeeze wheezy precise; urgency=low +puppet (3.7.0-1puppetlabs1) hardy lucid natty oneiric unstable sid squeeze wheezy precise; urgency=low - * Update to version <%= @debversion %> + * Update to version 3.7.0-1puppetlabs1 - -- Puppet Labs Release <info@puppetlabs.com> <%= Time.now.strftime("%a, %d %b %Y %H:%M:%S %z")%> + -- Puppet Labs Release <info@puppetlabs.com> Wed, 03 Sep 2014 15:22:51 -0700 puppet (3.2.3-0.1rc0puppetlabs1) lucid unstable sid squeeze wheezy precise quantal raring; urgency=low diff --git a/ext/ips/puppet.p5m.erb b/ext/ips/puppet.p5m index 45fd14be7..7645152d6 100644 --- a/ext/ips/puppet.p5m.erb +++ b/ext/ips/puppet.p5m @@ -1,10 +1,10 @@ -set name=pkg.fmri value=pkg://puppetlabs.com/system/management/<%=@name%>@<%=@ipsversion%> -set name=pkg.summary value="<%=@summary%>" -set name=pkg.human-version value="<%=@version%>" -set name=pkg.description value="<%=@description%>" +set name=pkg.fmri value=pkg://puppetlabs.com/system/management/@3.7.0,13.3.0-0 +set name=pkg.summary value="Puppet, an automated configuration management tool" +set name=pkg.human-version value="3.7.0" +set name=pkg.description value="Puppet, an automated configuration management tool" set name=info.classification value="org.opensolaris.category.2008:System/Administration and Configuration" set name=org.opensolaris.consolidation value="puppet" -set name=description value="<%=@description%>" +set name=description value="Puppet, an automated configuration management tool" set name=variant.opensolaris.zone value=global value=nonglobal set name=variant.arch value=sparc value=i386 license puppet.license license="Apache v2.0" diff --git a/ext/redhat/puppet.spec.erb b/ext/redhat/puppet.spec index 6b8b3f9f5..ac5222659 100644 --- a/ext/redhat/puppet.spec.erb +++ b/ext/redhat/puppet.spec @@ -16,8 +16,8 @@ %endif # VERSION is subbed out during rake srpm process -%global realversion <%= @version %> -%global rpmversion <%= @rpmversion %> +%global realversion 3.7.0 +%global rpmversion 3.7.0 %global confdir ext/redhat %global pending_upgrade_path %{_localstatedir}/lib/rpm-state/puppet @@ -25,7 +25,7 @@ Name: puppet Version: %{rpmversion} -Release: <%= @rpmrelease -%>%{?dist} +Release: 1%{?dist} Vendor: %{?_host_vendor} Summary: A network tool for managing many disparate systems License: ASL 2.0 @@ -446,8 +446,8 @@ fi rm -rf %{buildroot} %changelog -* <%= Time.now.strftime("%a %b %d %Y") %> Puppet Labs Release <info@puppetlabs.com> - <%= @rpmversion %>-<%= @rpmrelease %> -- Build for <%= @version %> +* Wed Sep 03 2014 Puppet Labs Release <info@puppetlabs.com> - 3.7.0-1 +- Build for 3.7.0 * Wed Oct 2 2013 Jason Antman <jason@jasonantman.com> - Move systemd service and unit file names back to "puppet" from erroneous "puppetagent" diff --git a/lib/puppet/module_tool/skeleton/templates/generator/.fixtures.yml.erb b/lib/puppet/module_tool/skeleton/templates/generator/.fixtures.yml.erb deleted file mode 100644 index ff33af1eb..000000000 --- a/lib/puppet/module_tool/skeleton/templates/generator/.fixtures.yml.erb +++ /dev/null @@ -1,7 +0,0 @@ -fixtures: - repositories: - stdlib: - repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git' - ref: '4.1.0' - symlinks: - <%= metadata.name %>: "#{source_dir}" diff --git a/lib/puppet/module_tool/skeleton/templates/generator/.gitignore b/lib/puppet/module_tool/skeleton/templates/generator/.gitignore deleted file mode 100644 index 1ac0a8c92..000000000 --- a/lib/puppet/module_tool/skeleton/templates/generator/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -## MAC OS -.DS_Store - -## TEXTMATE -*.tmproj -tmtags - -## EMACS -*~ -\#* -.\#* - -## VIM -*.swp -tags diff --git a/lib/puppet/vendor/rgen/.gitignore b/lib/puppet/vendor/rgen/.gitignore deleted file mode 100644 index d41f82329..000000000 --- a/lib/puppet/vendor/rgen/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.eprj -test/metamodel_roundtrip_test/TestModel_Regenerated.rb -test/metamodel_roundtrip_test/houseMetamodel_Regenerated.ecore -test/model_builder/ecore_internal.rb -test/testmodel/ea_testmodel_regenerated.xml diff --git a/lib/puppet/vendor/rgen/.project b/lib/puppet/vendor/rgen/.project deleted file mode 100644 index ba7e10352..000000000 --- a/lib/puppet/vendor/rgen/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>rgen-head</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.rubypeople.rdt.core.rubybuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.rubypeople.rdt.core.rubynature</nature>
- </natures>
-</projectDescription>
diff --git a/lib/puppet/vendor/rgen/test/metamodel_roundtrip_test/.gitignore b/lib/puppet/vendor/rgen/test/metamodel_roundtrip_test/.gitignore deleted file mode 100644 index 817ba4948..000000000 --- a/lib/puppet/vendor/rgen/test/metamodel_roundtrip_test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -using_builtin_types_serialized.ecore
-
diff --git a/lib/puppet/vendor/rgen/test/util/file_cache_map_test/testdir/.gitignore b/lib/puppet/vendor/rgen/test/util/file_cache_map_test/testdir/.gitignore deleted file mode 100644 index bad49a678..000000000 --- a/lib/puppet/vendor/rgen/test/util/file_cache_map_test/testdir/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.cache
-fileA
-
diff --git a/lib/puppet/vendor/safe_yaml/.gitignore b/lib/puppet/vendor/safe_yaml/.gitignore deleted file mode 100644 index c6067bf39..000000000 --- a/lib/puppet/vendor/safe_yaml/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Gemfile.lock -dist/ diff --git a/lib/puppet/vendor/safe_yaml/.travis.yml b/lib/puppet/vendor/safe_yaml/.travis.yml deleted file mode 100644 index ec42077cd..000000000 --- a/lib/puppet/vendor/safe_yaml/.travis.yml +++ /dev/null @@ -1,47 +0,0 @@ -language: - ruby - -before_install: - gem install bundler - -script: - bundle exec rake spec - -rvm: - - ruby-head - - 2.0.0 - - 1.9.3 - - 1.9.2 - - 1.8.7 - - rbx-19mode - - rbx-18mode - - jruby-head - - jruby-19mode - - jruby-18mode - - ree - -env: - - YAMLER=syck - - YAMLER=psych - -matrix: - allow_failures: - - rvm: ruby-head - - rvm: rbx-19mode - - rvm: rbx-18mode - - rvm: ree - - exclude: - - rvm: 1.8.7 - env: YAMLER=psych - - rvm: jruby-head - env: YAMLER=syck - - rvm: jruby-19mode - env: YAMLER=syck - - rvm: jruby-18mode - env: YAMLER=syck - -branches: - only: - - master - diff --git a/util/README_UTIL.md b/util/README_UTIL.md deleted file mode 100644 index e0b340c0a..000000000 --- a/util/README_UTIL.md +++ /dev/null @@ -1,80 +0,0 @@ -Development Utilities -===================== - -The scripts in this directory are utility scripts useful during development. - -binary_search_specs.rb ----------------------- - -This script, written by Nick Lewis, is useful if you encounter a spec failure which only occurs when run in some sequence with other specs. If you have a spec which passes by itself, but fails when run with the full spec suite, this script will help track it down. - -The puppet spec/spec_helper.rb checks for an environment variable LOG_SPEC_ORDER. If this is present, it will save the current order of the spec files to './spec_order.txt'. - -This file is then used by binary_search_specs.rb so that: - - $ ./util/binary_search_specs.rb spec/unit/foo_spec.rb - -will begin bisecting runs before and after this spec until it narrows down to a candidate which seems to be effecting foo_spec.rb and causing it to fail. - -### with parallel-spec - -To get the groups that the parallel task is running, run: be util/rspec_grouper 1000. Then run each spit out file with "be util/rspec_runner <groupfile>". If it fails, rename it to spec_order.txt and run the binary script. - -dev-puppet-master ------------------ - -This script is very helpful for setting up a local puppet master daemon which you can then interrogate with other puppet 'app' calls such as puppet cert or puppet agent. I'm not sure who wrote it originally. - -There are a few steps needed to get this configured properly. - -* /etc/hosts needs a 'puppetmaster' added to its localhost entry - -The dev-puppet-master script calls `puppet master` with --certname=puppetmaster, and this needs to resolve locally. - -You can execute the dev-puppet-master script with a name for the sandbox configuration directory (which will be placed in ~/test/master) or it will use 'default'. - -* ./util/dev-puppet-master bar-env - -(places conf and var info in ~/tests/master/bar-env for instance) - -You should now be able to do things like: - - jpartlow@percival:~/work/puppet$ bundler exec puppet agent -t --server puppetmaster - Info: Creating a new SSL key for percival.corp.puppetlabs.net - Info: Caching certificate for ca - Info: Creating a new SSL certificate request for percival.corp.puppetlabs.net - Info: Certificate Request fingerprint (SHA256): 1B:DE:91:8C:AE:10:1B:18:0D:67:9D:4B:87:F1:26:19:6D:C6:37:35:F6:64:40:90:CF:FC:BE:8F:6F:C9:8D:D4 - Info: Caching certificate for percival.corp.puppetlabs.net - Info: Caching certificate_revocation_list for ca - Info: Retrieving plugin - Info: Caching catalog for percival.corp.puppetlabs.net - Info: Applying configuration version '1374193823' - Info: Creating state file /home/jpartlow/.puppet/var/state/state.yaml - Notice: Finished catalog run in 0.04 seconds - -For an agent run (or any command you want to call the server), you must specify '--server puppetmaster'. - -To check the puppetmaster's certs, you instead would need to specify the confdir/vardir: - - jpartlow@percival:~/work/puppet$ bundler exec puppet cert list --all --confdir=~/test/master/default --vardir= ~/test/master/default/ - + "percival.corp.puppetlabs.net" (SHA256) 0D:8D:A4:F1:19:E3:7A:62:ED:ED:21:B4:76:FE:04:47:50:01:20:4A:04:48:09:3A:1A:98:86:4A:08:8D:46:F0 - + "puppetmaster" (SHA256) B9:F5:06:F4:74:3B:15:CE:7C:7B:A6:38:83:0E:30:6A:6F:DC:F4:FD:FF:B1:A9:8A:35:12:90:10:26:46:C2:A6 (alt names: "DNS:percival.corp.puppetlabs.net", "DNS:puppet", "DNS:puppet.corp.puppetlabs.net", "DNS:puppetmaster") - -### Curl - -For simple cases of testing REST API via curl: - -* edit ~/tests/master/:confdir/auth.conf and add `"allow *"` to `"path /"` - -Now you should be able to: - -```bash -jpartlow@percival:~/work/puppet$ curl -k -H 'Accept: text/pson' https://puppetmaster:8140/main/resource/user/nobody -{"type":"User","title":"nobody","tags":["user","nobody"],"exported":false,"parameters":{"ensure":"present","home":"/nonexistent","uid":65534,"gid":65534,"comment":"nobody","shell":"/bin/sh","groups":[],"expiry":"absent","provider":"useradd","membership":"minimum","role_membership":"minimum","auth_membership":"minimum","profile_membership":"minimum","key_membership":"minimum","attribute_membership":"minimum","loglevel":"notice"}} -``` - -For more complex authorization cases you will need to reference the agents keys: - -```bash -jpartlow@percival:~/work/puppet$ curl -H 'Accept: text/pson' --cert `puppet agent --configprint hostcert` --key `be puppet agent --configprint hostprivkey` --cacert `be puppet agent --configprint localcacert` https://puppetmaster:8140/foo/node/percival.corp.puppetlabs.net -``` diff --git a/util/binary_search_specs.rb b/util/binary_search_specs.rb deleted file mode 100755 index c34a83c96..000000000 --- a/util/binary_search_specs.rb +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env ruby -# Author: Nick Lewis - -specs_in_order = File.read('spec_order.txt').split - -failing_spec = ARGV.first - -specs = specs_in_order[0...specs_in_order.index(failing_spec)] - -suspects = specs - -while suspects.length > 1 do - count = suspects.length - specs_to_run = suspects[0...(count/2)] - puts "Trying #{specs_to_run.join(' ')}" - start = Time.now - system("bundle exec rspec #{specs_to_run.join(' ')} #{failing_spec}") - puts "Finished in #{Time.now - start} seconds" - if $? == 0 - puts "This group is innocent. The culprit is in the other half." - suspects = suspects[(count/2)..-1] - else - puts "One of these is guilty." - suspects = specs_to_run - end -end - -puts "The culprit is #{suspects.first}" diff --git a/util/dev-puppet-master b/util/dev-puppet-master deleted file mode 100755 index f2cfa32ec..000000000 --- a/util/dev-puppet-master +++ /dev/null @@ -1,23 +0,0 @@ -#/bin/sh -name="default" - -if [ $# -gt 0 ]; then - name=$1 - shift 1 -fi - -export dir="${HOME}/test/master/${name}" -mkdir -p ${dir} - -if [ ! -f $dir/auth.conf ]; then - # Edit this file to change default puppet authorizations. - cp ./conf/auth.conf "${dir}/auth.conf" -fi -mkdir -p ${dir}/manifests -touch ${dir}/manifests/site.pp - -# Work around Redmine #21908 where the master generates a warning if agent pluginsyncs -# and there isn't at least one module with a libdir. -mkdir -p ${dir}/modules/foo/lib - -bundle exec puppet master --no-daemonize --autosign=true --confdir=${dir} --vardir=${dir} --certname puppetmaster $@ diff --git a/util/rspec_grouper b/util/rspec_grouper deleted file mode 100755 index 22260d461..000000000 --- a/util/rspec_grouper +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env ruby -require 'rubygems' -require 'rspec' - -# Disable ruby verbosity -# We need control over output so that the parallel task can parse it correctly -$VERBOSE = nil - -# Monkey patch Proc.source_location for 1.8.7 -unless Proc.method_defined? :source_location - class Proc - def source_location - match = to_s.match(/^#<Proc.*@(.*):([0-9]+)>$/) - return unless match - [match[1], match[2]] - end - end -end - -module Parallel - module RSpec - # - # Responsible for grouping rspec examples into groups of a given size. - # - class Grouper - attr_reader :groups - attr_reader :files - attr_reader :total_examples - - def initialize(group_size) - config = ::RSpec::Core::Configuration.new - options = ::RSpec::Core::ConfigurationOptions.new((ENV['TEST'] || ENV['TESTS'] || 'spec').split(';')) - options.parse_options - options.configure config - - # This will scan and load all spec examples - config.load_spec_files - - @total_examples = 0 - - # Populate a map of spec file => example count, sorted ascending by count - # NOTE: this uses a private API of RSpec and is may break if the gem is updated - @files = ::RSpec::Core::ExampleGroup.children.inject({}) do |files, group| - file = group.metadata[:example_group_block].source_location[0] - count = count_examples(group) - files[file] = (files[file] || 0) + count - @total_examples += count - files - end.sort_by { |_, v| v} - - # Group the spec files - @groups = [] - group = nil - example_count = 0 - @files.each do |file, count| - group = [] unless group - group << file - if (example_count += count) > group_size - example_count = 0 - @groups << group - group = nil - end - end - @groups << group if group - end - - private - def count_examples(group) - return 0 unless group - # Each group can have examples as well as child groups, so recursively traverse - group.children.inject(group.examples.count) { |count, g| count + count_examples(g) } - end - end - end -end - -def print_usage - puts 'usage: rspec_grouper <group_size>' -end - -if __FILE__ == $0 - if ARGV.length != 1 - print_usage - else - group_size = ARGV[0].to_i - abort 'error: group count must be greater than zero.' if group_size < 1 - grouper = Parallel::RSpec::Grouper.new(group_size) - abort 'error: no rspec examples were found.' if grouper.total_examples == 0 - groups = grouper.groups - puts "Grouped #{grouper.total_examples} rspec example(s) into #{groups.length} group(s) from #{grouper.files.count} file(s)." - puts - - paths = [] - - begin - # Create a temp directory and write out group files - tmpdir = Dir.mktmpdir - groups.each_with_index do |group, index| - path = File.join(tmpdir, "group#{index+1}") - file = File.new(path, 'w') - paths << path - file.puts group - file.close - puts path - end - rescue Exception - # Delete all files on an exception - paths.each do |path| - begin - File.delete path - rescue Exception - end - end - raise - end - end -end
\ No newline at end of file diff --git a/util/rspec_runner b/util/rspec_runner deleted file mode 100755 index e4452a01c..000000000 --- a/util/rspec_runner +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env ruby -require 'rubygems' -require 'rspec' -require 'rspec/core/formatters/progress_formatter' -require 'rspec/core/command_line' - -# Disable ruby verbosity -# We need control over output so that the parallel task can parse it correctly -$VERBOSE = nil - -module Parallel - module RSpec - # - # Responsible for formatting output. - # This differs from the built-in progress formatter by not appending an index to failures. - # - class Formatter < ::RSpec::Core::Formatters::ProgressFormatter - def dump_failure(example, _) - # Unlike the super class implementation, do not print the failure number - output.puts "#{short_padding}#{example.full_description}" - dump_failure_info(example) - end - end - # - # Responsible for running spec files given a spec file. - # We do it this way so that we can run very long spec file lists on Windows, since - # Windows has a limited argument length depending on method of invocation. - # - class Runner - def initialize(specs_file) - abort "error: spec list file '#{specs_file}' does not exist." unless File.exists? specs_file - @options = ['-fParallel::RSpec::Formatter'] - File.readlines(specs_file).each { |line| @options << line.chomp } - end - - def run - ::RSpec::Core::CommandLine.new(@options).run($stderr, $stdout) - end - end - end -end - -def print_usage - puts 'usage: rspec_runner <spec_list_file>' -end - -if __FILE__ == $0 - if ARGV.length != 1 - print_usage - else - exit Parallel::RSpec::Runner.new(ARGV[0]).run - end -end
\ No newline at end of file diff --git a/yardoc/templates/default/method_details/html/method_signature.erb b/yardoc/templates/default/method_details/html/method_signature.erb deleted file mode 100644 index 5416782d6..000000000 --- a/yardoc/templates/default/method_details/html/method_signature.erb +++ /dev/null @@ -1,25 +0,0 @@ -<h3 class="signature <%= 'first' if @index == 0 %>" id="<%= anchor_for(object) %>"> - <% if object.tags(:overload).size == 1 %> - <%= signature(object.tag(:overload), false) + format_method_detail_extras(object) %> - <% elsif object.tags(:overload).size > 1 %> - <% object.tags(:overload).each do |overload| %> - <span class="overload"><%= signature(overload, false) + format_method_detail_extras(object) %></span> - <% end %> - <% else %> - <%= signature(object, false) + format_method_detail_extras(object)%> - <% end %> - - <% if object.aliases.size > 0 %> - <span class="aliases">Also known as: - <span class="names"><%= object.aliases.map {|o| - "<span id='#{anchor_for(o)}'>" + h(o.name.to_s) + "</span>" }.join(", ") %></span> - </span> - <% end %> - - <% if owner != object.namespace %> - <span class="not_defined_here"> - Originally defined in <%= object.namespace.type %> - <%= linkify object, owner.relative_path(object.namespace) %> - </span> - <% end %> -</h3>
\ No newline at end of file diff --git a/yardoc/templates/default/method_details/html/setup.rb b/yardoc/templates/default/method_details/html/setup.rb deleted file mode 100644 index 3de2542b9..000000000 --- a/yardoc/templates/default/method_details/html/setup.rb +++ /dev/null @@ -1,37 +0,0 @@ -def init - super -end - -def format_method_detail_extras(object) - result = "" - if object - if object.respond_to?(:visibility) - if object.visibility != :public - result << "<span class=\"note title #{object.visibility}\">#{object.visibility}</span>" - end - end - if object.has_tag?(:abstract) - result << '<span class="abstract note title">abstract</span>' - end - if object.has_tag?(:deprecated) - result << '<span class="deprecated note title">deprecated</span>' - end - if object.respond_to?(:visibility) - if object.has_tag?(:api) && object.tag(:api).text == 'private' && object.visibility != :private - result << '<span class="private note title">private</span>' - end - else - if object.has_tag?(:api) && object.tag(:api).text == 'private' - result << '<span class="private note title">private</span>' - end - end - if object.has_tag?(:dsl) - result << '<span class="note title readonly">DSL</span>' - end - end - # separate the extras with one space - if result != "" - result = " " + result - end - result -end diff --git a/yardoc/templates/default/module/html/item_summary.erb b/yardoc/templates/default/module/html/item_summary.erb deleted file mode 100644 index a42c45f4b..000000000 --- a/yardoc/templates/default/module/html/item_summary.erb +++ /dev/null @@ -1,47 +0,0 @@ -<% -# This is a copy of the original erb file with the same name. It adds "DSL" marker. -# It also removes the double output of "private" when being both api private and private -%> -<li class="<%= @item.visibility %> <%= @item.has_tag?(:deprecated) ? 'deprecated' : '' %>"> - <span class="summary_signature"> - <% if @item.tags(:overload).size == 1 %> - <%= signature(@item.tag(:overload), true, !@item.attr_info) %> - <% else %> - <%= signature(@item, true, false, !@item.attr_info) %> - <% end %> - - <% if @item.aliases.size > 0 %> - (also: <%= @item.aliases.map {|o| h(o.name(true)) }.join(", ") %>) - <% end %> - </span> - <% if object != @item.namespace %> - <span class="note title not_defined_here"> - <%= @item.namespace.type == :class ? 'inherited' : (@item.scope == :class ? 'extended' : 'included') %> - from <%= linkify @item, object.relative_path(@item.namespace) %> - </span> - <% end %> - <% if @item.constructor? %> - <span class="note title constructor">constructor</span> - <% end %> - <% if @item.has_tag?(:dsl) %> - <span class="note title readonly">DSL</span> - <% end %> - <% if rw = @item.attr_info %> - <% if !run_verifier([rw[:read]].compact).empty? && run_verifier([rw[:write]].compact).empty? %> - <span class="note title readonly">readonly</span> - <% end %> - <% if !run_verifier([rw[:write]].compact).empty? && run_verifier([rw[:read]].compact).empty? %> - <span class="note title writeonly">writeonly</span> - <% end %> - <% end %> - <% if @item.visibility != :public %><span class="note title <%= @item.visibility %>"><%= @item.visibility %></span><% end %> - <% if @item.has_tag?(:abstract) %><span class="abstract note title">abstract</span><% end %> - <% if @item.has_tag?(:deprecated) %><span class="deprecated note title">deprecated</span><% end %> - <% if @item.has_tag?(:api) && @item.tag(:api).text == 'private'&& @item.visibility != :private %><span class="private note title">private</span><% end %> - - <% if @item.has_tag?(:deprecated) %> - <span class="summary_desc"><strong>Deprecated.</strong> <%= htmlify_line @item.tag(:deprecated).text %></span> - <% else %> - <span class="summary_desc"><%= htmlify_line docstring_summary(@item) %></span> - <% end %> -</li> |