From b8ebdb8f32aaa49e5621fef0f3d5612bcc424034 Mon Sep 17 00:00:00 2001 From: Adam Crews Date: Fri, 29 Jan 2016 15:23:17 -0800 Subject: [PATCH 1/4] Updating spec framework --- .gitignore | 2 ++ Gemfile | 38 ++++++++++++++--------------- Rakefile | 58 +++++++++++++++++++++++++++++++++++++++++---- spec/spec_helper.rb | 20 ++-------------- 4 files changed, 75 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index a86c1c5..8da7116 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ spec/fixtures/ .bundle/ coverage/ .ruby-version + +.rake_tasks diff --git a/Gemfile b/Gemfile index f772545..ca68a36 100644 --- a/Gemfile +++ b/Gemfile @@ -1,28 +1,26 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" -rspecversion = ENV.key?('RSPEC_VERSION') ? "= #{ENV['RSPEC_VERSION']}" : ['>= 2.9 ', '< 3.0.0'] -gem 'rake' -gem 'rspec', rspecversion -gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git' -gem 'rspec-puppet-utils' -gem 'parallel_tests' -gem 'puppet-lint' - -gem 'puppetlabs_spec_helper' - -#gem 'pry' -#gem 'serverspec' +group :test do + gem "rake" + gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.7.0' + 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 "rspec-puppet-facts" +end -if facterversion = ENV['FACTER_GEM_VERSION'] - gem 'facter', facterversion -else - gem 'facter', '< 2.0.0' +group :development do + gem "travis" + gem "travis-lint" + gem "vagrant-wrapper" + gem "puppet-blacksmith" + gem "guard-rake" end -if puppetversion = ENV['PUPPET_GEM_VERSION'] - gem 'puppet', puppetversion -else - gem 'puppet', '~> 3.6.0' +group :system_tests do + gem "beaker" + gem "beaker-rspec" end # vim:ft=ruby diff --git a/Rakefile b/Rakefile index 43d4418..1778d2a 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,56 @@ -require 'puppet-lint' require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet/version' +require 'puppet/vendor/semantic/lib/semantic' unless Puppet.version.to_f < 3.6 +require 'puppet-lint/tasks/puppet-lint' +require 'puppet-syntax/tasks/puppet-syntax' -PuppetLint.configuration.fail_on_warnings -PuppetLint.configuration.send('disable_80chars') -PuppetLint.configuration.send('disable_class_inherits_from_params_class') +# These gems aren't always present, for instance +# on Travis with --without development +begin + require 'puppet_blacksmith/rake_tasks' +rescue LoadError +end + +Rake::Task[:lint].clear + +PuppetLint.configuration.relative = true +PuppetLint.configuration.send("disable_80chars") +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') -PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] +# http://puppet-lint.com/checks/class_inherits_from_params_class/ +PuppetLint.configuration.send('disable_class_inherits_from_params_class') + +exclude_paths = [ + "bundle/**/*", + "pkg/**/*", + "vendor/**/*", + "spec/**/*", +] +PuppetLint.configuration.ignore_paths = exclude_paths +PuppetSyntax.exclude_paths = exclude_paths + +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, +] diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2858bd7..1ffdf17 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,19 +1,3 @@ require 'puppetlabs_spec_helper/module_spec_helper' -require 'rspec-puppet-utils' - -FIXTURES_PATH = File.expand_path(File.dirname(__FILE__) + '/fixtures') -# Set up our $LOAD_PATH to properly include custom provider code from modules -# in spec/fixtures -$LOAD_PATH.unshift(*Dir["#{FIXTURES_PATH}/modules/*/lib"]) - -Dir[File.absolute_path(File.dirname(__FILE__) + '/support/*.rb')].each do |f| - require f -end - -RSpec.configure do |c| - c.mock_with :rspec - c.formatter = :documentation - c.default_facts = PathDefender::CentOS.centos_facts.merge({:fqdn => 'pd.example.com'}) - c.hiera_config = File.join(FIXTURES_PATH, 'hiera.yaml') - c.treat_symbols_as_metadata_keys_with_true_values = true -end +require 'rspec-puppet-facts' +include RspecPuppetFacts From 665c45fd1c1a495b3c9267177e453b2bdfdec3e2 Mon Sep 17 00:00:00 2001 From: Adam Crews Date: Fri, 29 Jan 2016 15:30:50 -0800 Subject: [PATCH 2/4] Removed deprecated 'types' from metadata.json' --- metadata.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/metadata.json b/metadata.json index 299f6c6..e397ade 100644 --- a/metadata.json +++ b/metadata.json @@ -22,9 +22,6 @@ "name": "puppetlabs/stdlib", "version_requirement": ">= 3.2.1 <5.0.0" } - ], - "types": [ - ], "operatingsystem_support": [ { From 97b2ba71af3d72dd67af60fbcfc23b321b9ba742 Mon Sep 17 00:00:00 2001 From: Adam Crews Date: Fri, 29 Jan 2016 16:08:40 -0800 Subject: [PATCH 3/4] travis updates --- .travis.yml | 49 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c88dbb..936fbd7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,45 @@ ---- language: ruby -bundler_args: --without development +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 SPEC_OPTS='--format documentation'" +script: bundle exec rake test +sudo: false rvm: - 1.9.3 - 2.0.0 + - 2.1.0 + env: - - PUPPET_GEM_VERSION="~> 3.4.0" - - PUPPET_GEM_VERSION="~> 3.5.0" - - PUPPET_GEM_VERSION="~> 3.6.0" + - PUPPET_VERSION="~> 3.4.0" + - PUPPET_VERSION="~> 3.5.0" STRICT_VARIABLES=yes + - PUPPET_VERSION="~> 3.6.0" STRICT_VARIABLES=yes + - PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes + - PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes FUTURE_PARSER=yes + - PUPPET_VERSION="~> 4.0.0" STRICT_VARIABLES=yes + - PUPPET_VERSION="~> 4.1.0" + - PUPPET_VERSION="~> 4.2.0" + - PUPPET_VERSION="~> 4.3.0" + matrix: exclude: - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 3.1.0" - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 2.7.0" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 2.7.0" + - 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" + - rvm: 2.0.0 + env: PUPPET_VERSION="~> 4.0.0" + - rvm: 2.0.0 + env: PUPPET_VERSION="~> 4.1.0" + - rvm: 2.0.0 + env: PUPPET_VERSION="~> 4.2.0" + - rvm: 2.0.0 + env: PUPPET_VERSION="~> 4.3.0" + - rvm: 2.1.0 + env: PUPPET_VERSION="~> 3.4.0" + notifications: - email: false + slack: + secure: fw5MTlCm8tMU7UhegXS+DM8eyGQ3Rjs686RetsIs9JDLBT51gNgcn9xogfrDLd1cOxQkNSA6T6sI/KGrrrIVoGIfaJ/dJb1MpYUXEWiVSsC2OMn4gZogs4yMJL1R5abcYCEDbE5mjIXru6CbUsQfDfjJWBy1yAPbVVpMViBHhPcU8+RrybijnMOo+x4DvlmrOy4A9Fws08gKMJeK8GFJ9Sm4x4Au5tSL55XrAntMIb1+Q9etLAfSXcVryRi9tlg6cYOm0PzfvKzyEwVLgqWT3Q7q5efYjFWXuLIEhAPphWVNXWZMc1xurSHYOTfvHEy25MM3Eajrm4Nzurw6kmbMbyv68rqmF/dRJ7a6fJiMEQUOlux8ztCRbz2P/ijbq23/wbWDZ7f53RLpMJyQ2Q0hS46WEvqsJZgvvz8NYjPmHmcyZhMMP8m6K9bpJjlFXT7fK8GGCVDcX20mwO2NCL47WzJBjXDPU9X1CGFoByML8WOUirMzWV1dribB83wxknB6BIr5Bv/ws+wVfnApzItzbx4kEjbzIVjP50btFGdn6LmlU19K68IXNde1xWgTX/uMbR1S+k4ZP+Phfihq0TZDAEh2xj8K6c3cVNpAYFWZQAVLZB3Ftnzm/d9Ikzwr4OkjGltiHRCG8tuq/VgO+PVfxqpvekSHW8Aq/4RC6hiK0qg= From 103cc9428980eaf0a117abd239929cc0df96173e Mon Sep 17 00:00:00 2001 From: Adam Crews Date: Fri, 29 Jan 2016 16:23:28 -0800 Subject: [PATCH 4/4] Fix travis notifications and bump version for release --- .travis.yml | 29 +++++----- CHANGELOG.md | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++ metadata.json | 2 +- 3 files changed, 170 insertions(+), 17 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.travis.yml b/.travis.yml index 936fbd7..065ec02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,21 +4,19 @@ before_install: rm Gemfile.lock || true script: bundle exec rake test sudo: false rvm: - - 1.9.3 - - 2.0.0 - - 2.1.0 - +- 1.9.3 +- 2.0.0 +- 2.1.0 env: - - PUPPET_VERSION="~> 3.4.0" - - PUPPET_VERSION="~> 3.5.0" STRICT_VARIABLES=yes - - PUPPET_VERSION="~> 3.6.0" STRICT_VARIABLES=yes - - PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes - - PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes FUTURE_PARSER=yes - - PUPPET_VERSION="~> 4.0.0" STRICT_VARIABLES=yes - - PUPPET_VERSION="~> 4.1.0" - - PUPPET_VERSION="~> 4.2.0" - - PUPPET_VERSION="~> 4.3.0" - +- PUPPET_VERSION="~> 3.4.0" +- PUPPET_VERSION="~> 3.5.0" STRICT_VARIABLES=yes +- PUPPET_VERSION="~> 3.6.0" STRICT_VARIABLES=yes +- PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes +- PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes FUTURE_PARSER=yes +- PUPPET_VERSION="~> 4.0.0" STRICT_VARIABLES=yes +- PUPPET_VERSION="~> 4.1.0" +- PUPPET_VERSION="~> 4.2.0" +- PUPPET_VERSION="~> 4.3.0" matrix: exclude: - rvm: 1.9.3 @@ -39,7 +37,6 @@ matrix: env: PUPPET_VERSION="~> 4.3.0" - rvm: 2.1.0 env: PUPPET_VERSION="~> 3.4.0" - notifications: slack: - secure: fw5MTlCm8tMU7UhegXS+DM8eyGQ3Rjs686RetsIs9JDLBT51gNgcn9xogfrDLd1cOxQkNSA6T6sI/KGrrrIVoGIfaJ/dJb1MpYUXEWiVSsC2OMn4gZogs4yMJL1R5abcYCEDbE5mjIXru6CbUsQfDfjJWBy1yAPbVVpMViBHhPcU8+RrybijnMOo+x4DvlmrOy4A9Fws08gKMJeK8GFJ9Sm4x4Au5tSL55XrAntMIb1+Q9etLAfSXcVryRi9tlg6cYOm0PzfvKzyEwVLgqWT3Q7q5efYjFWXuLIEhAPphWVNXWZMc1xurSHYOTfvHEy25MM3Eajrm4Nzurw6kmbMbyv68rqmF/dRJ7a6fJiMEQUOlux8ztCRbz2P/ijbq23/wbWDZ7f53RLpMJyQ2Q0hS46WEvqsJZgvvz8NYjPmHmcyZhMMP8m6K9bpJjlFXT7fK8GGCVDcX20mwO2NCL47WzJBjXDPU9X1CGFoByML8WOUirMzWV1dribB83wxknB6BIr5Bv/ws+wVfnApzItzbx4kEjbzIVjP50btFGdn6LmlU19K68IXNde1xWgTX/uMbR1S+k4ZP+Phfihq0TZDAEh2xj8K6c3cVNpAYFWZQAVLZB3Ftnzm/d9Ikzwr4OkjGltiHRCG8tuq/VgO+PVfxqpvekSHW8Aq/4RC6hiK0qg= + secure: FGIAZuQnrRB4L/Un36qd5+FyE+15vjehfbFWGSYHdw7ICU2M6Xh9sLoB60Fc8Rj4OqYSU0xvEi3FZjLoSZKBpldCPtxMQlnswNoaq4rg/G+JyTRvSNXta3IdTrX1RtVq/0+TQXVKZMbq4ztR0xT/H5jLLOGr95rCWYOB8jZi0o0= diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e766d3a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,156 @@ +2016-01-29 16:23:28 -0800 Adam Crews + + * Fix travis notifications and bump version for release (HEAD -> fix_tests) + +2016-01-29 16:08:40 -0800 Adam Crews + + * travis updates (origin/fix_tests) + +2016-01-29 15:30:50 -0800 Adam Crews + + * Removed deprecated 'types' from metadata.json' + +2016-01-29 15:23:17 -0800 Adam Crews + + * Updating spec framework + +2016-01-29 11:32:03 -0500 Mason Malone + + * Fix dependency error in nessus::config + +2015-01-10 15:39:03 -0800 Adam Crews + + * New release to remove the files directory from management (tag: v0.3.1) + +2015-01-06 14:39:05 -0500 Adam Stephens + + * don't test for removed files directory + +2015-01-06 09:43:02 -0500 Adam Stephens + + * don't create files directory + +2014-12-17 11:57:32 -0800 Adam Crews + + * Fix a couple lint warnings and cut a new release (origin/release) + +2014-12-17 14:19:36 -0500 Adam Stephens + + * activation code fact needs sbin for nessuscli + +2014-12-17 14:16:45 -0500 Adam Stephens + + * user changes need a service restart + +2014-12-17 14:06:20 -0500 Adam Stephens + + * fix activate nessus check + +2014-12-17 14:03:52 -0500 Adam Stephens + + * document security_center + +2014-12-17 14:00:19 -0500 Adam Stephens + + * add simple spec for security_center + +2014-12-17 13:56:04 -0500 Adam Stephens + + * add support for security center setup + +2014-12-17 13:41:11 -0500 Adam Stephens + + * nessuscli is in /opt/nessus/sbin + +2014-12-02 11:58:23 -0800 Adam Crews + + * Add forge badge + +2014-11-13 12:48:50 -0800 Adam Crews + + * Bumped a new release to support Nessus 6 + +2014-11-13 14:10:58 -0600 root + + * adding support for nessus 6, nessus_fetch has been merged into a nessuscli command + +2014-08-27 12:52:31 -0700 Adam Crews + + * Cut new forge release + +2014-08-27 12:45:01 -0700 Adam Crews + + * Cleanup some spec tests, added coverage report + +2014-08-26 16:49:17 -0700 Adam Crews + + * Ignore local .ruby-version + +2014-08-26 16:46:25 -0700 Adam Crews + + * Fix a couple typos from copy/paste + +2014-07-14 10:23:28 -0700 Adam Crews + + * Minor cleanup of metadata (tag: v0.1.1) + +2014-07-14 10:08:25 -0700 Adam Crews + + * Fix forge metadata + +2014-07-14 09:42:04 -0700 Adam Crews + + * Pin rspec to > 3 to avoid warnings until rspec-puppet is updated + +2014-07-14 09:15:52 -0700 Adam Crews + + * Lots of tests added + +2014-07-12 00:25:19 -0700 Adam Crews + + * Add build image to Readme + +2014-07-12 00:23:20 -0700 Adam Crews + + * Remove old puppet version + +2014-07-12 00:17:00 -0700 Adam Crews + + * Fix some test options + +2014-07-12 00:06:08 -0700 Adam Crews + + * Lots of tests and various cleanup + +2014-07-11 14:19:36 -0700 Adam Crews + + * Add rules file + +2014-07-11 14:00:59 -0700 Adam Crews + + * Fix user to use a password hash, generated from the nessus-chpasswd command + +2014-07-11 13:24:44 -0700 Adam Crews + + * Add require + +2014-07-11 13:19:04 -0700 Adam Crews + + * Fix define declaration for user type + +2014-07-11 13:16:39 -0700 Adam Crews + + * Fix some file names + +2014-07-11 13:12:10 -0700 Adam Crews + + * Fixing default service and program names + +2014-07-11 12:56:40 -0700 Adam Crews + + * Add more management to nessus + +2014-07-11 10:29:30 -0700 Adam Crews + + * Initial commit + diff --git a/metadata.json b/metadata.json index e397ade..29455bf 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "adamcrews-nessus", - "version": "0.3.1", + "version": "0.3.2", "source": "https://github.com/adamcrews/puppet-nessus", "author": "Adam Crews", "license": "Apache-2.0",