Skip to content

Commit

Permalink
- added spec tests for gentoo
Browse files Browse the repository at this point in the history
  • Loading branch information
derdanne committed Dec 12, 2014
1 parent 968117b commit efe0cb8
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
25 changes: 25 additions & 0 deletions spec/classes/client_gentoo_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require 'spec_helper'
describe 'nfs::client::gentoo' do

it do
should contain_class('nfs::client::gentoo')
should contain_class('nfs::client::gentoo::install')
should contain_class('nfs::client::gentoo::configure')
should contain_class('nfs::client::gentoo::service')

should contain_package('net-nds/rpcbind')
should contain_package('net-fs/nfs-utils')
should contain_package('net-libs/libnfsidmap')


end

context ":nfs_v4 => true" do
let(:params) {{ :nfs_v4 => true }}
it do
should contain_augeas('/etc/conf.d/nfs')
should contain_augeas('/etc/idmapd.conf')
end
end

end
4 changes: 4 additions & 0 deletions spec/classes/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
let(:facts) { {:operatingsystem => 'redhat', :osmajor => 6 } }
it { should contain_class('nfs::client::redhat') }
end
context "operatingsysten => gentoo" do
let(:facts) { {:operatingsystem => 'gentoo', } }
it { should contain_class('nfs::client::gentoo') }
end
context "operatingsystem => darwin" do
let(:facts) { {:operatingsystem => 'darwin', } }
it do
Expand Down
15 changes: 15 additions & 0 deletions spec/classes/server_gentoo_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'spec_helper'
describe 'nfs::server::gentoo' do

it do
should contain_class('nfs::client::gentoo')
should contain_service('nfs').with( 'ensure' => 'running' )
end
context ":nfs_v4 => true" do
let(:params) {{ :nfs_v4 => true , :nfs_v4_idmap_domain => 'teststring' }}
it do
should contain_augeas('/etc/idmapd.conf').with_changes(/set Domain teststring/)
end

end
end
6 changes: 5 additions & 1 deletion spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
should contain_concat__fragment('nfs_exports_header').with( 'target' => '/etc/exports' )
end
context "nfs_v4 => true" do
let(:params) { {:nfs_v4 => true, } }
let(:params) { {:nfs_v4 => true, } }
it do
should contain_concat__fragment('nfs_exports_root').with( 'target' => '/etc/exports' )
should contain_file('/export').with( 'ensure' => 'directory' )
Expand All @@ -33,6 +33,10 @@
let(:facts) { {:operatingsystem => 'redhat', :concat_basedir => '/tmp', :osmajor => 6, } }
it { should contain_class('nfs::server::redhat') }
end
context "operatingsysten => gentoo" do
let(:facts) { {:operatingsystem => 'gentoo', :concat_basedir => '/tmp',} }
it { should contain_class('nfs::server::gentoo') }
end
context "operatingsysten => darwin" do
let(:facts) { {:operatingsystem => 'darwin'} }
it do
Expand Down

0 comments on commit efe0cb8

Please sign in to comment.