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

Add tests for r10k profile #139

Open
wants to merge 1 commit into
base: production
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
24 changes: 24 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,29 @@ fixtures:
puppetserver_gem:
repo: "puppetlabs/puppetserver_gem"
ref: "0.1.0"
r10k:
repo: "zack/r10k"
ref: "2.7.0"
ruby:
repo: "puppetlabs/ruby"
ref: "0.0.2"
gcc:
repo: "puppetlabs/gcc"
ref: "0.0.3"
pe_gem:
repo: "puppetlabs/pe_gem"
ref: "0.0.1"
vcsrepo:
repo: "puppetlabs/vcsrepo"
ref: "0.1.2"
git:
repo: "puppetlabs/git"
ref: "0.0.3"
make:
repo: "croddy/make"
ref: "0.0.3"
portage:
repo: "gentoo/portage"
ref: "2.0.1"
symlinks:
puppet: "#{source_dir}"
60 changes: 60 additions & 0 deletions spec/classes/puppet_profile_r10k_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env rspec
require 'spec_helper'
require 'pry'

describe 'puppet::profile::r10k', :type => :class do
on_supported_os({
:hardwaremodels => ['x86_64'],
:supported_os => [
{
"operatingsystem" => "Ubuntu",
"operatingsystemrelease" => [
"14.04"
]
},
{
"operatingsystem" => "CentOS",
"operatingsystemrelease" => [
"6",
"7"
]
}
],
}).each do |os, facts|
context "When on an #{os} system" do
let(:facts) do
facts.merge({
:concat_basedir => '/tmp',
:fqdn => 'constructorfleet.vogon.gal',
:domain => 'vogon.gal',
:puppetversion => Puppet.version
})
end
it { is_expected.to compile.with_all_deps }
if Puppet.version.to_f >= 4.0
confdir = '/etc/puppetlabs/puppet'
codedir = '/etc/puppetlabs/code'
else
confdir = '/etc/puppet'
codedir = '/etc/puppet'
end
context 'when fed no parameters' do
it 'should contain class r10k' do
should contain_class('r10k').with({
:version => 'installed'
})
end
# it 'should contain puppet_r10k cron' do
# should contain_cron('puppet_r10k').with({
# :ensure => true,
# :command => "r10k deploy environment production -p",
# :environment => 'PATH=/usr/local/bin:/bin:/usr/bin:/usr/sbin',
# :user => true,
# :minute => [0,15,30,45],
# })
# end
end#no params

end
end
end