From d6c00f0a465bce80397f409ecc7cfb5e0c65caaf Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 6 Aug 2012 09:50:06 -0500 Subject: [PATCH] Initial import --- Modulefile | 8 ++++++++ README.md | 4 ++++ manifests/init.pp | 8 ++++++++ spec/spec_helper.rb | 17 +++++++++++++++++ tests/init.pp | 11 +++++++++++ 5 files changed, 48 insertions(+) create mode 100644 Modulefile create mode 100644 README.md create mode 100644 manifests/init.pp create mode 100644 spec/spec_helper.rb create mode 100644 tests/init.pp diff --git a/Modulefile b/Modulefile new file mode 100644 index 0000000..41827ab --- /dev/null +++ b/Modulefile @@ -0,0 +1,8 @@ +name 'openstackci-apparmor' +version '0.0.1' +source 'https://github.com/openstack-ci/puppet-apparmor.git' +author 'OpenStack Continuous Integration' +license 'Apache License, Version 2.0' +summary 'apparmor module' +description 'apparmor module' +project_page 'https://github.com/openstack-ci/puppet-apparmor' diff --git a/README.md b/README.md new file mode 100644 index 0000000..f79a27b --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +apparmor +-------- + +This is the apparmor module. It simply manages the apparmor service. diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..2095c71 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,8 @@ +class apparmor { + package { "apparmor": + ensure => present + } + service { "apparmor": + ensure => 'running'; + } +} diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..5fda588 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,17 @@ +dir = File.expand_path(File.dirname(__FILE__)) +$LOAD_PATH.unshift File.join(dir, 'lib') + +require 'mocha' +require 'puppet' +require 'rspec' +require 'spec/autorun' + +Spec::Runner.configure do |config| + config.mock_with :mocha +end + +# We need this because the RAL uses 'should' as a method. This +# allows us the same behaviour but with a different method name. +class Object + alias :must :should +end diff --git a/tests/init.pp b/tests/init.pp new file mode 100644 index 0000000..b35bdcf --- /dev/null +++ b/tests/init.pp @@ -0,0 +1,11 @@ +# The baseline for module testing used by Puppet Labs is that each manifest +# should have a corresponding test manifest that declares that class or defined +# type. +# +# Tests are then run by using puppet apply --noop (to check for compilation errors +# and view a log of events) or by fully applying the test in a virtual environment +# (to compare the resulting system state to the desired state). +# +# Learn more about module testing here: http://docs.puppetlabs.com/guides/tests_smoke.html +# +include apparmor