ghoneycutt / puppet-module-nfs

Puppet module to manage NFS
Other
4 stars 30 forks source link

Adding in rspec-puppet tests for module #5

Closed ebrdann closed 11 years ago

ebrdann commented 11 years ago

these tests cover RHEL 5 and 6 for the nfs, nfs::idmapd, and nfs::server modules. There are stubs for other OSes created as well for future development.

ghoneycutt commented 11 years ago

When writing tests, especially look for conditionals and test those.

So for https://github.com/ghoneycutt/puppet-module-nfs/blob/master/manifests/init.pp#L17

we want to test Service['rpcbind'] is in the catalog for EL6 and is not in the catalog for EL5

There is also a conditional in the template - https://github.com/ghoneycutt/puppet-module-nfs/blob/master/templates/idmapd.conf.erb#L9

So there should be a content check on that file, something like

describe 'idmapd.conf' do
  context 'with idmap_domain as default' do
     check that it is missing
  end
  context 'with idmap_domain set to exampe.com' do
    check that /^Domain = example.com$/ is in the file
  end
end
ebrdann commented 11 years ago

GH: all your suggested changes should be implemented.

ghoneycutt commented 11 years ago

@MWinther rebased this code and it was merged in 24ca307daff0818da8cb70291491dd2c5c6de9fc