Skip to content
This repository has been archived by the owner on Aug 8, 2020. It is now read-only.

Commit

Permalink
(SIMP-1275) Validate compliance_markup mapping
Browse files Browse the repository at this point in the history
* Ported to new RPM build structure
* Validated compliance_markup dependencies

SIMP-1275 #comment validated compliance_markup mapping

Change-Id: I8d9e888c7e0a0a3ac037100dffcabb4e688e170c
  • Loading branch information
trevor-vaughan committed Aug 3, 2016
1 parent 2867cdb commit c84b016
Show file tree
Hide file tree
Showing 16 changed files with 221 additions and 244 deletions.
4 changes: 2 additions & 2 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
fixtures:
repositories:
common: "git://github.com/simp/pupmod-simp-common"
stdlib: "git://github.com/simp/puppetlabs-stdlib"
common: "https://github.com/simp/pupmod-simp-common"
stdlib: "https://github.com/simp/puppetlabs-stdlib"
symlinks:
cgroups: "#{source_dir}"
6 changes: 0 additions & 6 deletions .fixtures.yml.local

This file was deleted.

18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.*.sw?
.yardoc
dist
/pkg
!/spec/fixtures/
/spec/fixtures/*
/spec/rp_env
!/spec/fixtures/hieradata
!/spec/fixtures/hieradata/*.yaml
!/spec/fixtures/site.pp
/spec/fixtures/hieradata/hiera.yaml
/.rspec_system
/.vagrant
/.bundle
/Gemfile.lock
/vendor
/junit
/log
4 changes: 4 additions & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--log-format="%{path}:%{line}:%{check}:%{KIND}:%{message}"
--relative
--no-class_inherits_from_params_class-check
--no-80chars-check
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--format documentation
--color
--fail-fast
104 changes: 92 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,97 @@
---
language: ruby
sudo: false
cache: bundler
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
- 2.2.1
install: bundle install
before_script:
- bundle
bundler_args: --without development system_tests
before_install: rm Gemfile.lock || true
script:
- 'bundle exec rake validate'
- 'bundle exec rake lint'
- 'bundle exec rake spec'
- bundle exec rake test
notifications:
email: false
rvm:
- 2.0.0
- 2.1.0
- 2.2.1
- 1.9.3
env:
global:
- STRICT_VARIABLES=yes
- TRUSTED_NODE_DATA=yes
matrix:
- PUPPET_VERSION="~> 3.8.0"
- PUPPET_VERSION="~> 4.4.0"
- PUPPET_VERSION="~> 3.5.0"
- PUPPET_VERSION="~> 3.6.0"
- PUPPET_VERSION="~> 3.7.0"
- PUPPET_VERSION="~> 3.7.0" FUTURE_PARSER=yes
- PUPPET_VERSION="~> 3.8.0" FUTURE_PARSER=yes
- PUPPET_VERSION="~> 4.0.0"
- PUPPET_VERSION="~> 4.1.0"
- PUPPET_VERSION="~> 4.2.0"
- PUPPET_VERSION="~> 4.3.0"
matrix:
allow_failures:
- rvm: 1.8.7
- rvm: 2.2.1
fast_finish: true
allow_failures:
- rvm: 1.9.3
- rvm: 2.2.1
- env: PUPPET_VERSION="~> 3.5.0"
- env: PUPPET_VERSION="~> 3.6.0"
- env: PUPPET_VERSION="~> 3.7.0"
- env: PUPPET_VERSION="~> 3.7.0" FUTURE_PARSER=yes
- env: PUPPET_VERSION="~> 3.8.0" FUTURE_PARSER=yes
- env: PUPPET_VERSION="~> 4.0.0"
- env: PUPPET_VERSION="~> 4.1.0"
- env: PUPPET_VERSION="~> 4.2.0"
- env: PUPPET_VERSION="~> 4.3.0"


exclude:
# Ruby 1.9.3
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.5.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.6.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.7.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.7.0" FUTURE_PARSER=yes
- rvm: 1.9.3
env: PUPPET_VERSION="~> 4.0.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 4.1.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 4.2.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 4.3.0"

# Ruby 2.1.0
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.5.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.6.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.7.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.7.0" FUTURE_PARSER=yes

# Ruby 2.2.1
- rvm: 2.2.1
env: PUPPET_VERSION="~> 3.5.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 3.6.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 3.7.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 3.7.0" FUTURE_PARSER=yes
- rvm: 2.2.1
env: PUPPET_VERSION="~> 3.8.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 4.0.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 4.1.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 4.2.0"
- rvm: 2.2.1
env: PUPPET_VERSION="~> 4.3.0"
60 changes: 3 additions & 57 deletions build/pupmod-cgroups.spec → CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,61 +1,7 @@
%global short_name cgroups
* Tue Aug 02 2016 Trevor Vaughan <tvaughan@onyxpoint.com> - 1.0.1-0
- Updated to the new RPM naming structure

Summary: CGroups Puppet Module
Name: pupmod-cgroups
Version: 1.0.0
Release: 7
License: Apache License, Version 2.0
Group: Applications/System
Source: %{name}-%{version}-%{release}.tar.gz
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: puppet >= 3.3.0
Buildarch: noarch
Requires: simp-bootstrap >= 4.2.0
Obsoletes: pupmod-cgroups-test

Prefix:"/etc/puppet/environments/simp/modules/%{short_name}"

%description
This puppet module provides for the management of CGroups on a Linux system.
See http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt for additional
information.

%prep
%setup -q

%build

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

mkdir -p %{buildroot}/%{prefix}

dirs='files lib manifests templates'
for dir in $dirs; do
test -d $dir && cp -r $dir %{buildroot}/%{prefix}
done

mkdir -p %{buildroot}/usr/share/simp/tests/modules/%{short_name}

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(0640,root,puppet,0750)
/etc/puppet/environments/simp/modules/%{short_name}

%post
#!/bin/sh

if [ -d /etc/puppet/environments/simp/modules/%{short_name}/plugins ]; then
/bin/mv /etc/puppet/environments/simp/modules/%{short_name}/plugins /etc/puppet/environments/simp/modules/%{short_name}/plugins.bak
fi

%postun
# Post uninstall stuff

%changelog
* Wed Sep 2 2015 Nick Miller <nick.miller@onyxpoint.com> - 1.0.0-7
* Wed Sep 02 2015 Nick Miller <nick.miller@onyxpoint.com> - 1.0.0-7
- Updated with support for travis ci

* Fri Jan 16 2015 Trevor Vaughan <tvaughan@onyxpoint.com> - 1.0.0-6
Expand Down
46 changes: 26 additions & 20 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# Variables:
#
# SIMP_GEM_SERVERS | a space/comma delimited list of rubygem servers
# PUPPET_VERSION | specifies the version of the puppet gem to load
puppetversion = ENV.key?('PUPPET_VERSION') ? "#{ENV['PUPPET_VERSION']}" : ['~>3']
# ------------------------------------------------------------------------------
# Environment variables:
# SIMP_GEM_SERVERS | a space/comma delimited list of rubygem servers
# PUPPET_VERSION | specifies the version of the puppet gem to load
# ------------------------------------------------------------------------------
# NOTE: SIMP Puppet rake tasks support ruby 2.0 and ruby 2.1
# ------------------------------------------------------------------------------
puppetversion = ENV.key?('PUPPET_VERSION') ? "#{ENV['PUPPET_VERSION']}" : '~>3'
gem_sources = ENV.key?('SIMP_GEM_SERVERS') ? ENV['SIMP_GEM_SERVERS'].split(/[, ]+/) : ['https://rubygems.org']

gem_sources.each { |gem_source| source gem_source }

group :test do
gem 'rake'
gem "rake"
gem 'puppet', puppetversion
gem 'rspec', '< 3.2.0'
gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git'
gem 'puppetlabs_spec_helper'
gem 'metadata-json-lint'
gem 'simp-rspec-puppet-facts'
gem "rspec", '< 3.2.0'
gem "rspec-puppet"
gem "hiera-puppet-helper"
gem "puppetlabs_spec_helper"
gem "metadata-json-lint"
gem "simp-rspec-puppet-facts", "~> 1.3"


# simp-rake-helpers does not suport puppet 2.7.X
if "#{ENV['PUPPET_VERSION']}".scan(/\d+/).first != '2' &&
Expand All @@ -26,20 +31,21 @@ group :test do
end

group :development do
gem 'travis'
gem 'travis-lint'
gem 'vagrant-wrapper'
gem 'puppet-blacksmith'
gem 'guard-rake'
gem "travis"
gem "travis-lint"
gem "travish"
gem "puppet-blacksmith"
gem "guard-rake"
gem 'pry'
gem 'pry-doc'

# `listen` is a dependency of `guard`
# from `listen` 3.1+, `ruby_dep` requires Ruby version >= 2.2.3, ~> 2.2
gem 'listen', '~> 3.0.6'
end

group :system_tests do
gem 'beaker'
gem 'beaker-rspec'
gem 'simp-beaker-helpers'
# NOTE: Workaround because net-ssh 2.10 is busting beaker
# lib/ruby/1.9.1/socket.rb:251:in `tcp': wrong number of arguments (5 for 4) (ArgumentError)
gem 'net-ssh', '~> 2.9.0'
gem 'simp-beaker-helpers', '>= 1.0.5'
end
80 changes: 2 additions & 78 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,80 +1,4 @@
#!/usr/bin/rake -T
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet/version'
require 'puppet/vendor/semantic/lib/semantic' unless Puppet.version.to_f < 3.6
require 'puppet-syntax/tasks/puppet-syntax'
require 'simp/rake/pupmod/helpers'

# For playing nice with mock
File.umask(027)
Simp::Rake::Pupmod::Helpers.new(File.dirname(__FILE__))


begin
require 'puppetlabs_spec_helper/rake_tasks'
rescue LoadError
puts "== WARNING: Gem puppetlabs_spec_helper not found, spec tests cannot be run! =="
end

Rake::Task[:lint].clear

# Lint Material
begin
require 'puppet-lint/tasks/puppet-lint'

PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.send("disable_variables_not_enclosed")
PuppetLint.configuration.send("disable_class_parameter_defaults")

PuppetLint.configuration.relative = true
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
#PuppetLint.configuration.fail_on_warnings = true

# Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
# http://puppet-lint.com/checks/class_parameter_defaults/
PuppetLint.configuration.send('disable_class_parameter_defaults')
# http://puppet-lint.com/checks/class_inherits_from_params_class/
PuppetLint.configuration.send('disable_class_inherits_from_params_class')

exclude_paths = [
"bundle/**/*",
"pkg/**/*",
"dist/**/*",
"vendor/**/*",
"spec/**/*",
]
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths
rescue LoadError
puts "== WARNING: Gem puppet-lint not found, lint tests cannot be run! =="
end

begin
require 'simp/rake/pkg'
Simp::Rake::Pkg.new( File.dirname( __FILE__ ) ) do | t |
t.clean_list << "#{t.base_dir}/spec/fixtures/hieradata/hiera.yaml"
end
rescue LoadError
puts "== WARNING: Gem simp-rake-helpers not found, pkg: tasks cannot be run! =="
end


desc "Run acceptance tests"
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end

desc "Populate CONTRIBUTORS file"
task :contributors do
system("git log --format='%aN' | sort -u > CONTRIBUTORS")
end

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

desc "Run syntax, lint, and spec tests."
task :test => [
:syntax,
:lint,
:spec,
:metadata,
]
1 change: 1 addition & 0 deletions build/rpm_metadata/requires
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Obsoletes: pupmod-cgroups-test
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
$cgred_gid = '450'
){

if $default_mounts and is_hash($::cgroups) and !empty($::cgroups) {
if $default_mounts and defined('$::cgroups') and is_hash($::cgroups) and !empty($::cgroups) {
$system_cgroups = keys($::cgroups)
cgroup { $system_cgroups: }
}
Expand Down
Loading

0 comments on commit c84b016

Please sign in to comment.