From b210b790e36408319e86cc732f29f92e167b94d4 Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Wed, 10 Dec 2014 16:08:47 -0700 Subject: [PATCH] add beaker support --- .gitignore | 1 - spec/acceptance/nodesets/aix-71-vcloud.yml | 19 ++++++++ spec/acceptance/nodesets/centos-59-x64.yml | 10 +++++ spec/acceptance/nodesets/centos-64-x64-pe.yml | 12 +++++ spec/acceptance/nodesets/centos-64-x64.yml | 10 +++++ spec/acceptance/nodesets/centos-65-x64.yml | 10 +++++ spec/acceptance/nodesets/debian-607-x64.yml | 10 +++++ spec/acceptance/nodesets/debian-70rc1-x64.yml | 10 +++++ spec/acceptance/nodesets/debian-73-x64.yml | 11 +++++ spec/acceptance/nodesets/default.yml | 10 +++++ spec/acceptance/nodesets/fedora-18-x64.yml | 10 +++++ spec/acceptance/nodesets/sles-11-x64.yml | 10 +++++ spec/acceptance/nodesets/sles-11sp1-x64.yml | 10 +++++ .../nodesets/ubuntu-server-10044-x64.yml | 10 +++++ .../nodesets/ubuntu-server-12042-x64.yml | 10 +++++ .../nodesets/ubuntu-server-1404-x64.yml | 11 +++++ spec/acceptance/nsstools_spec.rb | 18 ++++++++ spec/spec_helper_acceptance.rb | 45 +++++++++++++++++++ 18 files changed, 226 insertions(+), 1 deletion(-) create mode 100644 spec/acceptance/nodesets/aix-71-vcloud.yml create mode 100644 spec/acceptance/nodesets/centos-59-x64.yml create mode 100644 spec/acceptance/nodesets/centos-64-x64-pe.yml create mode 100644 spec/acceptance/nodesets/centos-64-x64.yml create mode 100644 spec/acceptance/nodesets/centos-65-x64.yml create mode 100644 spec/acceptance/nodesets/debian-607-x64.yml create mode 100644 spec/acceptance/nodesets/debian-70rc1-x64.yml create mode 100644 spec/acceptance/nodesets/debian-73-x64.yml create mode 100644 spec/acceptance/nodesets/default.yml create mode 100644 spec/acceptance/nodesets/fedora-18-x64.yml create mode 100644 spec/acceptance/nodesets/sles-11-x64.yml create mode 100644 spec/acceptance/nodesets/sles-11sp1-x64.yml create mode 100644 spec/acceptance/nodesets/ubuntu-server-10044-x64.yml create mode 100644 spec/acceptance/nodesets/ubuntu-server-12042-x64.yml create mode 100644 spec/acceptance/nodesets/ubuntu-server-1404-x64.yml create mode 100644 spec/acceptance/nsstools_spec.rb create mode 100644 spec/spec_helper_acceptance.rb diff --git a/.gitignore b/.gitignore index 7307300..3ec2327 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ Gemfile.lock *.patch pkg/ *.rej -.rspec_system/ spec/fixtures/manifests/ spec/fixtures/modules/ *.swp diff --git a/spec/acceptance/nodesets/aix-71-vcloud.yml b/spec/acceptance/nodesets/aix-71-vcloud.yml new file mode 100644 index 0000000..f0ae87a --- /dev/null +++ b/spec/acceptance/nodesets/aix-71-vcloud.yml @@ -0,0 +1,19 @@ +HOSTS: + pe-aix-71-acceptance: + roles: + - master + - dashboard + - database + - agent + - default + platform: aix-7.1-power + hypervisor: aix + ip: pe-aix-71-acceptance.delivery.puppetlabs.net +CONFIG: + type: pe + nfs_server: NONE + consoleport: 443 + datastore: instance0 + folder: Delivery/Quality Assurance/Enterprise/Dynamic + resourcepool: delivery/Quality Assurance/Enterprise/Dynamic + pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/spec/acceptance/nodesets/centos-59-x64.yml b/spec/acceptance/nodesets/centos-59-x64.yml new file mode 100644 index 0000000..2ad90b8 --- /dev/null +++ b/spec/acceptance/nodesets/centos-59-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + centos-59-x64: + roles: + - master + platform: el-5-x86_64 + box : centos-59-x64-vbox4210-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box + hypervisor : vagrant +CONFIG: + type: git diff --git a/spec/acceptance/nodesets/centos-64-x64-pe.yml b/spec/acceptance/nodesets/centos-64-x64-pe.yml new file mode 100644 index 0000000..7d9242f --- /dev/null +++ b/spec/acceptance/nodesets/centos-64-x64-pe.yml @@ -0,0 +1,12 @@ +HOSTS: + centos-64-x64: + roles: + - master + - database + - dashboard + platform: el-6-x86_64 + box : centos-64-x64-vbox4210-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box + hypervisor : vagrant +CONFIG: + type: pe diff --git a/spec/acceptance/nodesets/centos-64-x64.yml b/spec/acceptance/nodesets/centos-64-x64.yml new file mode 100644 index 0000000..0639835 --- /dev/null +++ b/spec/acceptance/nodesets/centos-64-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + centos-64-x64: + roles: + - master + platform: el-6-x86_64 + box : centos-64-x64-vbox4210-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box + hypervisor : vagrant +CONFIG: + type: git diff --git a/spec/acceptance/nodesets/centos-65-x64.yml b/spec/acceptance/nodesets/centos-65-x64.yml new file mode 100644 index 0000000..4e2cb80 --- /dev/null +++ b/spec/acceptance/nodesets/centos-65-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + centos-65-x64: + roles: + - master + platform: el-6-x86_64 + box : centos-65-x64-vbox436-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box + hypervisor : vagrant +CONFIG: + type: foss diff --git a/spec/acceptance/nodesets/debian-607-x64.yml b/spec/acceptance/nodesets/debian-607-x64.yml new file mode 100644 index 0000000..4c8be42 --- /dev/null +++ b/spec/acceptance/nodesets/debian-607-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + debian-607-x64: + roles: + - master + platform: debian-6-amd64 + box : debian-607-x64-vbox4210-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box + hypervisor : vagrant +CONFIG: + type: git diff --git a/spec/acceptance/nodesets/debian-70rc1-x64.yml b/spec/acceptance/nodesets/debian-70rc1-x64.yml new file mode 100644 index 0000000..19181c1 --- /dev/null +++ b/spec/acceptance/nodesets/debian-70rc1-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + debian-70rc1-x64: + roles: + - master + platform: debian-7-amd64 + box : debian-70rc1-x64-vbox4210-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box + hypervisor : vagrant +CONFIG: + type: git diff --git a/spec/acceptance/nodesets/debian-73-x64.yml b/spec/acceptance/nodesets/debian-73-x64.yml new file mode 100644 index 0000000..3e6a3a9 --- /dev/null +++ b/spec/acceptance/nodesets/debian-73-x64.yml @@ -0,0 +1,11 @@ +HOSTS: + debian-73-x64.localhost: + roles: + - master + platform: debian-7-amd64 + box : debian-73-x64-virtualbox-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box + hypervisor : vagrant +CONFIG: + log_level: debug + type: foss diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml new file mode 100644 index 0000000..0639835 --- /dev/null +++ b/spec/acceptance/nodesets/default.yml @@ -0,0 +1,10 @@ +HOSTS: + centos-64-x64: + roles: + - master + platform: el-6-x86_64 + box : centos-64-x64-vbox4210-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box + hypervisor : vagrant +CONFIG: + type: git diff --git a/spec/acceptance/nodesets/fedora-18-x64.yml b/spec/acceptance/nodesets/fedora-18-x64.yml new file mode 100644 index 0000000..624b537 --- /dev/null +++ b/spec/acceptance/nodesets/fedora-18-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + fedora-18-x64: + roles: + - master + platform: fedora-18-x86_64 + box : fedora-18-x64-vbox4210-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box + hypervisor : vagrant +CONFIG: + type: git diff --git a/spec/acceptance/nodesets/sles-11-x64.yml b/spec/acceptance/nodesets/sles-11-x64.yml new file mode 100644 index 0000000..41abe21 --- /dev/null +++ b/spec/acceptance/nodesets/sles-11-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + sles-11-x64.local: + roles: + - master + platform: sles-11-x64 + box : sles-11sp1-x64-vbox4210-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/sles-11sp1-x64-vbox4210-nocm.box + hypervisor : vagrant +CONFIG: + type: foss diff --git a/spec/acceptance/nodesets/sles-11sp1-x64.yml b/spec/acceptance/nodesets/sles-11sp1-x64.yml new file mode 100644 index 0000000..554c37a --- /dev/null +++ b/spec/acceptance/nodesets/sles-11sp1-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + sles-11sp1-x64: + roles: + - master + platform: sles-11-x86_64 + box : sles-11sp1-x64-vbox4210-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/sles-11sp1-x64-vbox4210-nocm.box + hypervisor : vagrant +CONFIG: + type: git diff --git a/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml b/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml new file mode 100644 index 0000000..5047017 --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + ubuntu-server-10044-x64: + roles: + - master + platform: ubuntu-10.04-amd64 + box : ubuntu-server-10044-x64-vbox4210-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box + hypervisor : vagrant +CONFIG: + type: git diff --git a/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml b/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml new file mode 100644 index 0000000..1c7a34c --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + ubuntu-server-12042-x64: + roles: + - master + platform: ubuntu-12.04-amd64 + box : ubuntu-server-12042-x64-vbox4210-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box + hypervisor : vagrant +CONFIG: + type: git diff --git a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml new file mode 100644 index 0000000..cba1cd0 --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml @@ -0,0 +1,11 @@ +HOSTS: + ubuntu-server-1404-x64: + roles: + - master + platform: ubuntu-14.04-amd64 + box : puppetlabs/ubuntu-14.04-64-nocm + box_url : https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm + hypervisor : vagrant +CONFIG: + log_level : debug + type: git diff --git a/spec/acceptance/nsstools_spec.rb b/spec/acceptance/nsstools_spec.rb new file mode 100644 index 0000000..820d8a3 --- /dev/null +++ b/spec/acceptance/nsstools_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper_acceptance' + +describe 'nsstools class' do + describe 'running puppet code' do + pp = <<-EOS + if $::osfamily == 'RedHat' { + class { 'epel': } -> Class['nsstools'] + } + + include ::nsstools + EOS + + it 'applies the manifest twice with no stderr' do + apply_manifest(pp, :catch_failures => true) + apply_manifest(pp, :catch_changes => true) + end + end +end diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb new file mode 100644 index 0000000..4554f75 --- /dev/null +++ b/spec/spec_helper_acceptance.rb @@ -0,0 +1,45 @@ +require 'beaker-rspec/spec_helper' +require 'beaker-rspec/helpers/serverspec' + +unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no' + # This will install the latest available package on el and deb based + # systems fail on windows and osx, and install via gem on other *nixes + foss_opts = {:default_action => 'gem_install'} + + if default.is_pe?; then + install_pe; + else + install_puppet(foss_opts); + end + + hosts.each do |host| + on hosts, "mkdir -p #{host['distmoduledir']}" + end +end + +RSpec.configure do |c| + # Project root + proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) + + # Readable test descriptions + c.formatter = :documentation + + # Configure all nodes in nodeset + c.before :suite do + # Install module and dependencies + hosts.each do |host| + on host, "mkdir -p #{host['distmoduledir']}/nsstools" + result = on host, "echo #{host['distmoduledir']}/nsstools" + target = result.raw_output.chomp + + %w(files lib manifests templates metadata.json).each do |file| + path = "#{proj_root}/#{file}" + next unless File.exists? path + scp_to host, path, target + end + on host, puppet('module', 'install', 'puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]} + on host, puppet('module', 'install', 'stahnma-epel'), {:acceptable_exit_codes => [0, 1]} + on host, puppet('module', 'install', 'camptocamp-openssl'), {:acceptable_exit_codes => [0, 1]} + end + end +end