Skip to content

Commit

Permalink
add spec tests, update validations, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jlambert121 committed Feb 24, 2015
1 parent 2a16ded commit 6506130
Show file tree
Hide file tree
Showing 32 changed files with 471 additions and 330 deletions.
7 changes: 7 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fixtures:
repositories:
concat: https://github.com/puppetlabs/puppetlabs-concat.git
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
symlinks:
selinux: "#{source_dir}"

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.swp
pkg/*
vendor/bundle
.bundle
Gemfile.lock
59 changes: 59 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
language: ruby
cache: bundler
bundler_args: --without development
script: "bundle exec rake validate && bundle exec rake test SPEC_OPTS='--format documentation'"
sudo: false
matrix:
fast_finish: true
include:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.1.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.2.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.3.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.4.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.5.0" STRICT_VARIABLES="yes"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.6.0" STRICT_VARIABLES="yes"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.7.0" STRICT_VARIABLES="yes"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.1.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.2.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.4.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.5.0" STRICT_VARIABLES="yes"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.6.0" STRICT_VARIABLES="yes"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.7.0" STRICT_VARIABLES="yes"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.2.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.3.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.4.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.5.0" STRICT_VARIABLES="yes"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.6.0" STRICT_VARIABLES="yes"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.7.0" STRICT_VARIABLES="yes"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.5.0" STRICT_VARIABLES="yes"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.6.0" STRICT_VARIABLES="yes"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.7.0" STRICT_VARIABLES="yes"
notifications:
email: false
27 changes: 17 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
source 'https://rubygems.org'
source ENV['GEM_SOURCE'] || "https://rubygems.org"

group :unit_tests do
gem 'rake', :require => false
gem 'rspec-puppet', :require => false, :git => 'https://github.com/rodjek/rspec-puppet.git', :tag => 'v2.0.0'
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '1.0.1', :require => false
gem 'puppet-syntax', :require => false
gem 'metadata-json-lint', :require => false
gem 'json', :require => false
end

group :rake, :test do
gem 'puppetlabs_spec_helper', '>=0.8.2', :require => false
gem 'puppet-blacksmith', :require => false
gem 'rspec-system-puppet', :require => false
group :development do
gem 'simplecov', :require => false
gem 'guard-rake', :require => false
end

group :rake do
gem 'rspec-puppet', '>=1.0.1'
gem 'rake', '>=0.9.2.2'
gem 'puppet-lint', '>=1.0.1'
gem 'rspec-system-serverspec', :require => false
if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion, :require => false
else
gem 'facter', :require => false
end

if puppetversion = ENV['PUPPET_GEM_VERSION']
Expand Down
165 changes: 0 additions & 165 deletions Gemfile.lock

This file was deleted.

44 changes: 31 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
require 'bundler'
Bundler.require(:rake)
require 'rake/clean'

CLEAN.include('spec/fixtures/', 'doc', 'pkg')
CLOBBER.include('.tmp', '.librarian')

require 'rubygems' if RUBY_VERSION < '1.9.0'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet_blacksmith/rake_tasks'
require 'rspec-system/rake_task'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-syntax/tasks/puppet-syntax'

begin
require 'puppet_blacksmith/rake_tasks'
rescue LoadError
end

task :default => [:clean, :spec]
exclude_paths = [
"pkg/**/*",
"vendor/**/*",
"spec/**/*",
]

PuppetLint.configuration.fail_on_warnings
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_class_parameter_defaults')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
PuppetLint.configuration.ignore_paths = exclude_paths
#PuppetLint.configuration.send('disable_class_parameter_defaults')
#PuppetLint.configuration.send('disable_single_quote_string_with_variables')
PuppetSyntax.exclude_paths = exclude_paths

task :default => [:test, :spec]

task :metadata do
sh "metadata-json-lint metadata.json"
end

desc "Run syntax, lint, and spec tests."
task :test => [
:syntax,
:lint,
:metadata,
:spec,
]
1 change: 1 addition & 0 deletions files/restorecond.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# File Managed by Puppet
/etc/services
/etc/resolv.conf
/etc/samba/secrets.tdb
Expand Down
6 changes: 5 additions & 1 deletion manifests/boolean.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@
#

define selinux::boolean (
$ensure = 'undef'
$ensure = true
) {

if !defined(Class['selinux']) {
fail('You must include the selinux base class before using any selinux defined resources')
}

Exec {
path => '/bin:/sbin:/usr/bin:/usr/sbin',
}
Expand Down
Loading

0 comments on commit 6506130

Please sign in to comment.