puppet-augeasproviders icon indicating copy to clipboard operation
puppet-augeasproviders copied to clipboard

Use rspec-puppet-augeas

Open raphink opened this issue 11 years ago • 4 comments

Using rspec-puppet-augeas is the first step towards splitting this project.

This step should allow us to get rid of specific rspec extensions in the project, so that any module using augeasproviders can write type/provider specs using rspec-puppet-augeas.

raphink avatar Dec 09 '13 21:12 raphink

So until this is done.. how do you test when using augeasproviders?

02:21:35   1) profile_compliance::controls::auditlog with defaults for all parameters should contain Class[auditd]
02:21:35      Failure/Error: it { should contain_class('auditd') }
02:21:35      Puppet::Error:
02:21:35        Could not autoload puppet/type/pam: Could not autoload puppet/provider/pam/augeas: undefined method `provider' for nil:NilClass on node cit-jenkins-n02.staging.ord1.cit.rackspace.net
02:21:35      # ./spec/fixtures/modules/augeasproviders_pam/lib/puppet/provider/pam/augeas.rb:6
02:21:35      # ./spec/fixtures/modules/augeasproviders_pam/lib/puppet/type/pam.rb:6
02:21:35      # ./spec/classes/controls/auditlog_spec.rb:16

gregswift avatar May 18 '16 07:05 gregswift

@gregswift check that you have the augeasproviders_core module present, the stack trace suggests it can't load the augeasproviders type.

This ticket's about refactoring ap's own tests.

domcleal avatar May 18 '16 07:05 domcleal

Ahh... that was it. and explains why i couldnt find any other examples... i saw that augeasproviders_pam was included.

For hijack, sorry I miss read the 'any module using augeasproviders can write type/provider specs using rspec-puppet-augeas' in the raphink's text.

gregswift avatar May 18 '16 08:05 gregswift

You should find other examples… See https://github.com/camptocamp/puppet-varnish or https://github.com/camptocamp/puppet-openldap

raphink avatar May 18 '16 13:05 raphink