Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14 from adamcrews/fix_tests
Browse files Browse the repository at this point in the history
Fixup some tests, and cut a new release.
  • Loading branch information
adamcrews committed Jan 30, 2016
2 parents be6a464 + 103cc94 commit 937ec35
Show file tree
Hide file tree
Showing 7 changed files with 267 additions and 62 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ spec/fixtures/
.bundle/
coverage/
.ruby-version

.rake_tasks
50 changes: 35 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
---
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
- 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: FGIAZuQnrRB4L/Un36qd5+FyE+15vjehfbFWGSYHdw7ICU2M6Xh9sLoB60Fc8Rj4OqYSU0xvEi3FZjLoSZKBpldCPtxMQlnswNoaq4rg/G+JyTRvSNXta3IdTrX1RtVq/0+TQXVKZMbq4ztR0xT/H5jLLOGr95rCWYOB8jZi0o0=
156 changes: 156 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

38 changes: 18 additions & 20 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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
58 changes: 53 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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,
]
5 changes: 1 addition & 4 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -22,9 +22,6 @@
"name": "puppetlabs/stdlib",
"version_requirement": ">= 3.2.1 <5.0.0"
}
],
"types": [

],
"operatingsystem_support": [
{
Expand Down
20 changes: 2 additions & 18 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 937ec35

Please sign in to comment.