Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
spec fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cristifalcas committed Nov 26, 2016
1 parent ca2e482 commit c97ef07
Show file tree
Hide file tree
Showing 23 changed files with 111 additions and 72 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
language: ruby
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
bundler_args: --without development
matrix:
Expand Down
93 changes: 35 additions & 58 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,37 @@
#This file is generated by ModuleSync, do not edit.
source 'https://rubygems.org'

source ENV['GEM_SOURCE'] || "https://rubygems.org"
gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 2.7'

def location_for(place, version = nil)
if place =~ /^(git[:@][^#]*)#(.*)/
[version, { :git => $1, :branch => $2, :require => false}].compact
elsif place =~ /^file:\/\/(.*)/
['>= 0', { :path => File.expand_path($1), :require => false}]
else
[place, version, { :require => false}].compact
end
end

group :unit_tests do
gem 'rake', :require => false
gem 'metadata-json-lint', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-puppet', '>= 2.3.2', :require => false
gem 'parallel_tests', :require => false
gem 'simplecov', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'puppet-lint-file_ensure-check', :require => false
gem 'puppet-lint-empty_string-check', :require => false
gem 'puppet-lint-undef_in_function-check', :require => false
gem 'puppet-lint-version_comparison-check', :require => false
gem 'puppet-lint-appends-check', :require => false
gem 'puppet-lint-spaceship_operator_without_tag-check', :require => false
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false
gem 'puppet-lint-param-docs', :require => false
gem 'puppet-lint-absolute_template_path', :require => false
gem 'puppet-lint-numericvariable', :require => false
gem 'puppet-lint-strict_indent-check', :require => false
gem 'puppet-lint-resource_reference_syntax', :require => false
gem 'puppet-lint-usascii_format-check', :require => false
gem 'puppet-lint-duplicate_class_parameters-check', :require => false
end
group :development do
gem 'puppet-blacksmith', :require => false
gem 'travis', :require => false
gem 'travis-lint', :require => false
gem 'guard-rake', :require => false
end
group :system_tests do
gem 'beaker-rspec', *location_for(ENV['BEAKER_RSPEC_VERSION'] || '>= 3.4')
gem 'beaker', *location_for(ENV['BEAKER_VERSION'])
gem 'beaker-puppet_install_helper', :require => false
end

gem 'facter', *location_for(ENV['FACTER_GEM_VERSION'])
gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])

if File.exists? "#{__FILE__}.local"
eval(File.read("#{__FILE__}.local"), binding)
end
gem 'rake'
gem 'rspec', '~> 3.0'
gem 'rspec-puppet', '~> 2.3'
gem 'rspec-puppet-facts', '>= 1.7'
gem 'puppetlabs_spec_helper', '>= 0.8.0'
gem 'puppet-lint'
gem 'puppet-lint-absolute_classname-check'
gem 'puppet-lint-absolute_template_path'
gem 'puppet-lint-appends-check'
gem 'puppet-lint-classes_and_types_beginning_with_digits-check'
gem 'puppet-lint-empty_string-check'
gem 'puppet-lint-file_ensure-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-numericvariable'
gem 'puppet-lint-param-docs', '>= 1.3.0'
gem 'puppet-lint-resource_reference_syntax'
gem 'puppet-lint-spaceship_operator_without_tag-check'
gem 'puppet-lint-strict_indent-check'
gem 'puppet-lint-trailing_comma-check'
gem 'puppet-lint-undef_in_function-check'
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-usascii_format-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'puppet-lint-version_comparison-check'
gem 'simplecov'
gem 'puppet-blacksmith', '>= 3.1.0', {"groups"=>["development"]}
gem 'json', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]}
gem 'json_pure', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]}
gem 'metadata-json-lint'
gem 'webmock', '< 2.0'
gem 'addressable', '< 2.4', {"platforms"=>["ruby_18"]}
gem 'oauth'
gem 'parallel_tests'
8 changes: 7 additions & 1 deletion manifests/addon/ccpp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
# $makecompatcore:: If you also want to dump file named "core"
# in crashed process' current dir, set to "yes"
#
Expand All @@ -12,7 +14,11 @@
#
# $verboselog:: Used for debugging the hook
#
# $debuginfo_location:: Specify where you want to store debuginfos (default: /var/cache/abrt-di)
# $debuginfo_location:: Specify where you want to store debuginfos (default: /var/cache/abrt-di)
#
# $allowed_users:: allowed_users
#
# $allowed_groups:: allowed_groups
#
class abrt::addon::ccpp (
$package_ensure = $abrt::package_ensure,
Expand Down
9 changes: 9 additions & 0 deletions manifests/addon/java.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@
#
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
# $executable:: TBD
#
# $syslog:: TBD
#
# $journald:: TBD
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# include abrt::addon::java
#
class abrt::addon::java (
Expand Down
4 changes: 3 additions & 1 deletion manifests/addon/kerneloops.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#
# installs and starts the service for the kerneloops abrt addon.
#
# Parameters: None
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
class abrt::addon::kerneloops (
$package_ensure = $abrt::package_ensure,
Expand Down
2 changes: 2 additions & 0 deletions manifests/addon/python.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
# $require_absolute_path:: If set to 'no', unhandled python exceptions will be caught
# and saved even in scripts which are run without full path
# in sys.argv[0].
Expand Down
6 changes: 4 additions & 2 deletions manifests/addon/ruby.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#
# installs and configures the ruby abrt addon.
#
# Parameters: None
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
class abrt::addon::ruby (
$package_ensure = $abrt::package_ensure,
Expand All @@ -12,7 +14,7 @@

package { 'rubygem-abrt': ensure => $package_ensure, }

if $::operatingsystemmajrelease == 6 {
if $::operatingsystemmajrelease == '6' {
file { '/etc/profile.d/ruby_load_abrt.sh':
ensure => 'file',
mode => '0644',
Expand Down
6 changes: 5 additions & 1 deletion manifests/addon/vmcore.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
#
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
# $copyvmcore:: Do you want vmcore to be copied, or moved from /var/crash to /var/spool/abrt?
# (default is to copy, but it may duplicate way too much data)
#
# $attempthardlink:: TBD
#
class abrt::addon::vmcore (
$package_ensure = $abrt::package_ensure,
$copyvmcore = 'yes',
Expand All @@ -16,7 +20,7 @@
include ::abrt
include ::abrt::addon::kerneloops

if $::operatingsystemmajrelease == 6 {
if $::operatingsystemmajrelease == '6' {
$vmcore_conf = '/etc/abrt/abrt-harvest-vmcore.conf'
} else {
$vmcore_conf = '/etc/abrt/plugins/vmcore.conf'
Expand Down
4 changes: 4 additions & 0 deletions manifests/addon/xorg.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#
# Parameters: None
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
# $blacklisted_xorg_modules:: TBD
#
class abrt::addon::xorg (
$package_ensure = $abrt::package_ensure,
$blacklisted_xorg_modules = 'nvidia, fglrx, vboxvideo',
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#
# $black_list:: Blacklisted packages
#
# $black_listed_paths:: TBD
#
# $process_unpackaged:: Process crashes in executables which do not belong to any package?
#
class abrt (
Expand Down
2 changes: 1 addition & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Installs default abrt packages
class abrt::install {
# extra packages: abrt-action-generate-machine-id needs python-argparse
if $::operatingsystemmajrelease == 6 {
if $::operatingsystemmajrelease == '6' {
package { ['python-argparse']: ensure => $abrt::package_ensure, }
} else {
}
Expand Down
2 changes: 2 additions & 0 deletions manifests/libreport/bugzilla.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
# $bugzillaurl:: Bugzilla URL
#
# $sslverify:: yes means that ssl certificates will be checked
Expand Down
2 changes: 2 additions & 0 deletions manifests/libreport/cli.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
class abrt::libreport::cli (
$package_ensure = $abrt::package_ensure,
) {
Expand Down
2 changes: 2 additions & 0 deletions manifests/libreport/gui.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
class abrt::libreport::gui (
$package_ensure = $abrt::package_ensure,
) {
Expand Down
4 changes: 3 additions & 1 deletion manifests/libreport/kerneloops.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#
# This package contains plugin which sends kernel crash information to specified server, usually to kerneloops.org.
#
# Parameters: none
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
class abrt::libreport::kerneloops (
$package_ensure = $abrt::package_ensure,
Expand Down
2 changes: 2 additions & 0 deletions manifests/libreport/logger.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
# $log_file:: Path to file where to write reports
#
# $append:: Append reports
Expand Down
10 changes: 6 additions & 4 deletions manifests/libreport/mailx.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
#
# Parameters:
#
# $subject::
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
# $emailfrom::
# $subject:: TBD
#
# $emailto::
# $emailfrom:: TBD
#
# $sendbinarydata::
# $emailto:: TBD
#
# $sendbinarydata:: TBD
#
class abrt::libreport::mailx (
$package_ensure = $abrt::package_ensure,
Expand Down
4 changes: 4 additions & 0 deletions manifests/libreport/sos.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
# $enable:: TBD
#
class abrt::libreport::sos (
$package_ensure = $abrt::package_ensure,
$enable = true,
Expand Down
4 changes: 3 additions & 1 deletion manifests/libreport/uploader.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#
# Parameters:
#
# $report_uploader_cmd:: command to be used to upload reports
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
# $report_uploadercmd:: Command to be used to upload reports
# example: 'scp://user:[email protected]/var/spool/abrt-upload || :'
#
class abrt::libreport::uploader (
Expand Down
2 changes: 2 additions & 0 deletions manifests/libreport/ureport.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Parameters:
#
# $package_ensure:: Set to "installed", "latest" or any other allowed method for package type
#
# $url:: Base URL to uReport server
#
# $sslverify:: no means that ssl certificates will not be checked
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cristifalcas-abrt",
"version": "2.0.2",
"version": "2.1.0",
"author": "Falcas Cristian",
"license": "Apache-2.0",
"project_page": "https://github.com/cristifalcas/puppet-abrt",
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let(:facts) do
facts.merge({:puppetmaster => 'localhost.localdomain'})
end
let(:params) { { :puppetmaster => 'localhost.localdomain' } }
let(:params) { { :package_ensure => 'installed' } }
it { should compile.with_all_deps }
it { should contain_class('abrt') }
end
Expand Down
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
require 'rubygems'

require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
include RspecPuppetFacts

RSpec.configure do |config|
config.mock_with :rspec do |c|
c.syntax = :expect
end
end

0 comments on commit c97ef07

Please sign in to comment.