forked from voxpupuli/puppet-jenkins
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request voxpupuli#2 from EagleDelta2/v1.1.2
v1.1.2-release
- Loading branch information
Showing
21 changed files
with
209 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fixtures: | ||
repositories: | ||
stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git | ||
concat: git://github.com/puppetlabs/puppetlabs-concat.git | ||
symlinks: | ||
autofs: "#{source_dir}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
sudo: false | ||
language: ruby | ||
bundler_args: --without system_tests | ||
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec" | ||
matrix: | ||
fast_finish: true | ||
include: | ||
- rvm: 1.9.3 | ||
env: PUPPET_GEM_VERSION="~> 3.0" | ||
- rvm: 2.1.5 | ||
env: PUPPET_GEM_VERSION="~> 3.0" | ||
- rvm: 2.1.6 | ||
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes" | ||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'puppet', '>= 3.3' | ||
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.3'] | ||
gem 'puppet', puppetversion | ||
gem 'puppetlabs_spec_helper', '>= 0.1.0' | ||
gem 'puppet-lint', '>= 0.3.2' | ||
gem 'facter', '>= 1.7.0' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'spec_helper' | ||
describe 'autofs', :type => :class do | ||
|
||
context 'main init tests' do | ||
let(:facts) do | ||
{ | ||
:osfamily => 'RedHat', | ||
:concat_basedir => '/etc' | ||
} | ||
end | ||
it { should contain_class('autofs::package') } | ||
it { should contain_class('autofs::config') } | ||
it { should contain_class('autofs::service') } | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
require 'spec_helper' | ||
describe 'autofs::config' do | ||
describe 'autofs::config', :type => :class do | ||
hiera = Hiera.new(:config => 'spec/fixtures/hiera/hiera.yaml') | ||
mapoptions = hiera.lookup('mapOptions', nil, nil) | ||
let(:params) {{ :map_options => mapoptions}} | ||
|
||
end | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'spec_helper' | ||
describe 'autofs::package', :type => :class do | ||
opsys = %w( | ||
Debian | ||
Ubuntu | ||
RedHat | ||
CentOS | ||
) | ||
|
||
opsys.each do |os| | ||
context "install autofs #{os}" do | ||
let(:facts){ {:osfamily => "#{os}"} } | ||
|
||
it { should contain_package('autofs').with_ensure('installed') } | ||
|
||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require 'spec_helper' | ||
describe 'autofs::service', :type => :class do | ||
|
||
context 'test default service' do | ||
it { should contain_service('autofs').with( | ||
'ensure' => 'running', | ||
'enable' => 'true', | ||
'hasstatus' => 'true', | ||
'hasrestart' => 'true', | ||
) | ||
} | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
require 'spec_helper' | ||
describe 'autofs::mount', :type => :define do | ||
let(:title) { 'auto.home' } | ||
|
||
let(:facts) do | ||
{ | ||
:concat_basedir => '/etc' | ||
} | ||
end | ||
|
||
let(:params) do | ||
{ | ||
:mount => '/home', | ||
:mapfile => '/etc/auto.home', | ||
:mapcontents => %W( test foo bar ), | ||
:options => '--timeout=120', | ||
:order => '01' | ||
} | ||
end | ||
|
||
context 'with default parameters' do | ||
|
||
it do | ||
should contain_concat__fragment('autofs::fragment preamble /home').with('target' => '/etc/auto.master') | ||
end | ||
|
||
it do | ||
should contain_file('/home').with('ensure' => 'directory') | ||
end | ||
|
||
it do | ||
should contain_file('/etc/auto.home').with( | ||
'ensure' => 'present', | ||
'owner' => 'root', | ||
'group' => 'root', | ||
'mode' => '0644' | ||
) | ||
end | ||
end | ||
|
||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
:backends: | ||
- yaml | ||
:hierarchy: | ||
- test | ||
:yaml: | ||
:datadir: 'spec/fixtures/hiera' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
mapOptions: | ||
home: | ||
mount: '/home' | ||
mapfile: '/etc/auto.home' | ||
mapcontents: | ||
- 'test' | ||
- 'foo' | ||
- 'bar' | ||
options: '--timeout=120' | ||
order: 01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,43 @@ | ||
require 'rspec-puppet' | ||
require 'puppetlabs_spec_helper/module_spec_helper' | ||
require 'mocha' | ||
require 'hiera' | ||
require 'erb' | ||
fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) | ||
# include common helpers | ||
support_path = File.expand_path(File.join(File.dirname(__FILE__), '..', | ||
'spec/support/*.rb')) | ||
Dir[support_path].each {|f| require f} | ||
RSpec.configure do |c| | ||
c.config = '/doesnotexist' | ||
c.manifest_dir = File.join(fixture_path, 'manifests') | ||
c.mock_with :rspec do |mock| | ||
mock.syntax = [:expect, :should] | ||
end | ||
c.hiera_config = File.join(fixture_path, 'hiera/hiera.yaml') | ||
c.include PuppetlabsSpec::Files | ||
|
||
if ENV['PARSER'] == 'future' | ||
c.parser = 'future' | ||
end | ||
|
||
c.before :each do | ||
# Ensure that we don't accidentally cache facts and environment | ||
# between test cases. | ||
Facter::Util::Loader.any_instance.stubs(:load_all) | ||
Facter.clear | ||
Facter.clear_messages | ||
|
||
# Store any environment variables away to be restored later | ||
@old_env = {} | ||
ENV.each_key {|k| @old_env[k] = ENV[k]} | ||
|
||
if Gem::Version.new(`puppet --version`) >= Gem::Version.new('3.5') | ||
Puppet.settings[:strict_variables]=true | ||
end | ||
end | ||
|
||
c.after :each do | ||
PuppetlabsSpec::Files.cleanup | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters