Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beaker #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ gem "puppet-syntax"
group :development do
gem "puppet-blacksmith"
end

group :system_tests do
gem 'beaker-rspec', :require => false
gem 'serverspec', :require => false
end

82 changes: 82 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,53 @@
GEM
remote: http://rubygems.org/
specs:
CFPropertyList (2.3.0)
addressable (2.3.7)
archive-tar-minitar (0.5.2)
autoparse (0.3.3)
addressable (>= 2.3.1)
extlib (>= 0.9.15)
multi_json (>= 1.0.0)
aws-sdk (1.42.0)
json (~> 1.4)
nokogiri (>= 1.4.4)
beaker (1.17.7)
aws-sdk (= 1.42.0)
blimpy (~> 0.6)
docker-api
fission (~> 0.4)
google-api-client (~> 0.7.1)
hocon (~> 0.0.4)
inifile (~> 2.0)
json (~> 1.8)
mime-types (~> 1.25)
net-scp (~> 1.1)
net-ssh (~> 2.6)
nokogiri (~> 1.5.10)
rbvmomi (= 1.8.1)
unf (~> 0.1)
beaker-rspec (3.0.0)
beaker (~> 1.10)
rspec
serverspec (~> 1.0)
specinfra (~> 1.0)
blimpy (0.6.7)
fog
minitar
thor
builder (3.2.2)
diff-lcs (1.2.5)
docker-api (1.10.11)
archive-tar-minitar
excon (>= 0.28)
json
excon (0.31.0)
extlib (0.9.16)
facter (1.7.5)
faraday (0.9.1)
multipart-post (>= 1.2, < 3)
fission (0.5.0)
CFPropertyList (~> 2.2)
fog (1.20.0)
builder
excon (~> 0.31.0)
Expand All @@ -15,15 +58,35 @@ GEM
net-ssh (>= 2.1.3)
nokogiri (>= 1.5.11)
formatador (0.2.4)
google-api-client (0.7.1)
addressable (>= 2.3.2)
autoparse (>= 0.3.3)
extlib (>= 0.9.15)
faraday (>= 0.9.0)
jwt (>= 0.1.5)
launchy (>= 2.1.1)
multi_json (>= 1.0.0)
retriable (>= 1.4)
signet (>= 0.5.0)
uuidtools (>= 2.1.0)
hiera (1.3.2)
json_pure
highline (1.7.1)
hocon (0.0.7)
inifile (2.0.2)
json (1.8.2)
json_pure (1.8.1)
jwt (1.3.0)
kwalify (0.7.2)
launchy (2.4.3)
addressable (~> 2.3)
metaclass (0.0.4)
mime-types (1.25.1)
minitar (0.5.4)
mocha (1.0.0)
metaclass (~> 0.0.1)
multi_json (1.8.4)
multipart-post (2.0.0)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.8.0)
Expand Down Expand Up @@ -52,6 +115,7 @@ GEM
trollop
rest-client (1.6.7)
mime-types (>= 1.16)
retriable (2.0.2)
rgen (0.6.6)
rspec (2.14.1)
rspec-core (~> 2.14.0)
Expand All @@ -75,14 +139,31 @@ GEM
systemu (~> 2.5)
rspec-system-puppet (2.2.1)
rspec-system (~> 2.0)
serverspec (1.7.0)
highline
net-ssh
rspec (~> 2.13)
specinfra (~> 1.13)
signet (0.5.1)
addressable (>= 2.2.3)
faraday (>= 0.9.0.rc5)
jwt (>= 0.1.5)
multi_json (>= 1.0.0)
specinfra (1.27.5)
systemu (2.6.3)
thor (0.19.1)
trollop (2.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.6)
uuidtools (2.1.5)
vagrant-wrapper (1.2.1.1)

PLATFORMS
ruby

DEPENDENCIES
beaker-rspec
puppet (~> 3.2.0)
puppet-blacksmith
puppet-lint
Expand All @@ -91,4 +172,5 @@ DEPENDENCIES
rake
rspec-puppet (~> 1.0.0)
rspec-system-puppet
serverspec
vagrant-wrapper
10 changes: 0 additions & 10 deletions Modulefile

This file was deleted.

55 changes: 55 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "garethr-erlang",
"version": "0.3.0",
"author": "Gareth Rushgrove",
"summary": "Install one of the official erlang packages",
"license": "Apache-2.0",
"source": "https://github.com/garethr/puppet-erlang",
"project_page": "https://github.com/garethr/puppet-erlang",
"issues_url": "https://github.com/garethr/puppet-erlang",
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5",
"6"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"5",
"6"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"6",
"7"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"12.04",
"14.04"
]
}
],
"requirements": [
{
"name": "pe",
"version_requirement": "3.x"
},
{
"name": "puppet",
"version_requirement": "3.x"
}
],
"dependencies": [
{ "name": "puppetlabs/stdlib", "version_requirement": ">=2.0.0 <5.0.0" },
{ "name": "puppetlabs/apt", "version_requirement": ">=1.0.0 <2.0.0" },
{ "name": "stahnma/epel", "version_requirement": ">=1.0.0 <2.0.0" }
]
}
28 changes: 28 additions & 0 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require 'spec_helper_acceptance'

describe 'erlang class:' do
case fact('osfamily')
when 'RedHat'
package_name = 'rabbitmq-server'
when 'Debian'
package_name = 'rabbitmq-server'
end

context "default class inclusion" do
it 'should run successfully' do
pp = <<-EOS
include 'erlang'
EOS

# Apply twice to ensure no errors the second time.
apply_manifest(pp, :catch_failures => true)
expect(apply_manifest(pp, :catch_changes => true).exit_code).to be_zero
end

describe package(package_name) do
it { should be_installed }
end

end

end
11 changes: 11 additions & 0 deletions spec/acceptance/nodesets/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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:
log_level: debug
type: git
11 changes: 11 additions & 0 deletions spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
HOSTS:
ubuntu-server-1404-x64:
roles:
- master
platform: ubuntu-14.04-amd64
box : trusty-server-cloudimg-amd64-vagrant-disk1
box_url : https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box
hypervisor : vagrant
CONFIG:
log_level : debug
type: git
38 changes: 38 additions & 0 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
require 'beaker-rspec'

UNSUPPORTED_PLATFORMS = []

unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
if hosts.first.is_pe?
install_pe
else
install_puppet
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
c.before :suite do
hosts.each do |host|
copy_module_to(host, :source => proj_root, :module_name => 'erlang')

shell("/bin/touch #{default['puppetpath']}/hiera.yaml")
shell('puppet module install puppetlabs-stdlib', { :acceptable_exit_codes => [0,1] })
if fact('osfamily') == 'Debian'
shell('puppet module install puppetlabs-apt', { :acceptable_exit_codes => [0,1] })
end
shell('puppet module install nanliu-staging', { :acceptable_exit_codes => [0,1] })
if fact('osfamily') == 'RedHat'
shell('puppet module install stahnma-epel', { :acceptable_exit_codes => [0,1] })
end
end
end
end