Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #49 from hairyhenderson/support-kernel-4x-in-amazon
Browse files Browse the repository at this point in the history
Supporting kernel 4.x in recent Amazon Linux releases
  • Loading branch information
dwerder committed Oct 22, 2015
2 parents 0a47edd + 3d6a55e commit cd47771
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 9 deletions.
4 changes: 1 addition & 3 deletions manifests/client/redhat/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
$osmajor = 7
}
# Amazon linux operatingsystemrelease is verbose: 3.10.35-43.137.amzn1.x86_64
/^3\.(\d|-|\.)+(amzn){1}/: {
/^[34]\.(\d|-|\.)+(amzn){1}/: {
$osmajor = 6
}
default:{
fail("Operatingsystemrelease ${::operatingsystemrelease} not supported")
}
}
}


22 changes: 22 additions & 0 deletions spec/classes/client_redhat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,28 @@
end
end

context "operatingsystemrelease => 4.1.7-15.23.amzn1.x86_64" do
let(:facts) { {:operatingsystemrelease => "4.1.7-15.23.amzn1.x86_64" } }
it do
should contain_class('nfs::client::redhat::install')
should contain_class('nfs::client::redhat::configure')
should contain_class('nfs::client::redhat::service')

should contain_service('nfslock').with(
'ensure' => 'running'
)
should contain_service('netfs').with(
'enable' => 'true'
)
should contain_package('nfs-utils')
should contain_class('nfs::client::redhat')
should contain_package('rpcbind')
should contain_service('rpcbind').with(
'ensure' => 'running'
)
end
end

context ":nfs_v4 => true" do
let(:params) {{ :nfs_v4 => true }}
let(:facts) {{ :operatingsystemrelease => '6.4' }}
Expand Down
4 changes: 4 additions & 0 deletions spec/classes/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
let(:facts) { {:operatingsystem => 'Amazon', :operatingsystemrelease => '3.10.35-43.137.amzn1.x86_64' } }
it { should contain_class('nfs::client::redhat') }
end
context "operatingsysten => Amazon v4" do
let(:facts) { {:operatingsystem => 'Amazon', :operatingsystemrelease => '4.1.7-15.23.amzn1.x86_64' } }
it { should contain_class('nfs::client::redhat') }
end
context "operatingsysten => gentoo" do
let(:facts) { {:operatingsystem => 'gentoo', } }
it { should contain_class('nfs::client::gentoo') }
Expand Down
16 changes: 10 additions & 6 deletions spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
let(:facts) { {:operatingsystem => 'ubuntu', :concat_basedir => '/tmp', } }
it { should contain_class('nfs::server::ubuntu') }
end

context "operatingsysten => ubuntu with params for mountd" do
let(:facts) { {:operatingsystem => 'ubuntu', :concat_basedir => '/tmp', } }
let(:params) {{ :mountd_port => '4711', :mountd_threads => '99' }}
it do

it do
should contain_class('nfs::server::ubuntu').with( 'mountd_port' => '4711', 'mountd_threads' => '99' )
end
end

context "operatingsysten => debian" do
let(:facts) { {:operatingsystem => 'debian', :concat_basedir => '/tmp',} }
it { should contain_class('nfs::server::debian') }
end

context "operatingsysten => scientific" do
let(:facts) { {:operatingsystem => 'scientific', :concat_basedir => '/tmp', :operatingsystemrelease => '6.4' } }
it { should contain_class('nfs::server::redhat') }
Expand All @@ -40,7 +40,7 @@
let(:facts) { {:operatingsystem => 'SLC', :concat_basedir => '/tmp', :operatingsystemrelease => '6.4' } }
it { should contain_class('nfs::server::redhat') }
end

context "operatingsysten => centos v6" do
let(:facts) { {:operatingsystem => 'centos', :concat_basedir => '/tmp', :operatingsystemrelease => '6.4' } }
it { should contain_class('nfs::server::redhat') }
Expand All @@ -53,6 +53,10 @@
let(:facts) { {:operatingsystem => 'Amazon', :concat_basedir => '/tmp', :operatingsystemrelease => '3.10.35-43.137.amzn1.x86_64' } }
it { should contain_class('nfs::server::redhat') }
end
context "operatingsysten => Amazon v3" do
let(:facts) { {:operatingsystem => 'Amazon', :concat_basedir => '/tmp', :operatingsystemrelease => '4.1.7-15.23.amzn1.x86_64' } }
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') }
Expand Down

0 comments on commit cd47771

Please sign in to comment.