Skip to content

Commit

Permalink
Feature Icinga#326: Ubuntu 18.04 Bionic Support
Browse files Browse the repository at this point in the history
  • Loading branch information
zhmurko committed Oct 3, 2018
1 parent bd21a53 commit 26d5254
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ platforms:
- name: ubuntu-16.04
run_list:
- recipe[apt::default]
- name: ubuntu-18.04
run_list:
- recipe[apt::default]
- name: debian-8.5
run_list:
- recipe[apt::default]
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ env:
matrix:
- INSTANCE=chef12server-ubuntu-14
- INSTANCE=chef12server-ubuntu-16
- INSTANCE=chef12server-ubuntu-18
- INSTANCE=chef12server-debian-8
- INSTANCE=chef12server-debian-9
- INSTANCE=chef12server-centos-6
Expand All @@ -33,6 +34,7 @@ env:
- INSTANCE=chef12server-amazon
- INSTANCE=chef13server-ubuntu-14
- INSTANCE=chef13server-ubuntu-16
- INSTANCE=chef13server-ubuntu-18
- INSTANCE=chef13server-debian-8
- INSTANCE=chef13server-debian-9
- INSTANCE=chef13server-centos-6
Expand Down
59 changes: 55 additions & 4 deletions spec/unit/recipes/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
expect(chef_run).to create_directory('/etc/icinga2/repository.d')
end

it 'install package icinga2' do
expect(chef_run).to install_package('icinga2')
%w(icinga2 icinga2-bin icinga2-common icinga2-doc).each do |p|
it "install package #{p}" do
expect(chef_run).to install_package(p)
end
end

it 'configure logrotate for icinga2' do
Expand Down Expand Up @@ -171,6 +173,14 @@
mode: 0o640
)
end

it 'set proper ulimits' do
expect(chef_run).to create_user_ulimit('icinga').with(
filehandle_limit: 48_000,
process_limit: 'unlimited',
memory_limit: 'unlimited'
)
end
end

context 'rhel' do
Expand All @@ -193,7 +203,7 @@
include_context 'rhel_family'
end

context 'ubuntu' do
shared_context 'ubuntu_family' do
let(:chef_run) do
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '14.04') do |node|
node.automatic['platform_family'] = 'debian'
Expand All @@ -220,7 +230,7 @@
expect(chef_run).to remove_apt_repository('icinga2-snapshot')
end

%w(g++ mailutils build-essential).each do |p|
%w(g++ mailutils build-essential libicinga2).each do |p|
it 'install packages' do
expect(chef_run).to install_package(p)
end
Expand Down Expand Up @@ -265,5 +275,46 @@
mode: 0o640
)
end

it 'set proper ulimits' do
expect(chef_run).to create_user_ulimit('nagios').with(
filehandle_limit: 48_000,
process_limit: 'unlimited',
memory_limit: 'unlimited'
)
end
end

context 'ubuntu 14.04' do
let(:chef_run) do
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '14.04') do |node|
node.automatic['platform_family'] = 'debian'
node.automatic['lsb']['codename'] = 'trusty'
end.converge(described_recipe)
end

include_context 'ubuntu_family'
end

context 'ubuntu 16.04' do
let(:chef_run) do
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04') do |node|
node.automatic['platform_family'] = 'debian'
node.automatic['lsb']['codename'] = 'xenial'
end.converge(described_recipe)
end

include_context 'ubuntu_family'
end

context 'ubuntu 18.04' do
let(:chef_run) do
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '18.04') do |node|
node.automatic['platform_family'] = 'debian'
node.automatic['lsb']['codename'] = 'bionic'
end.converge(described_recipe)
end

include_context 'ubuntu_family'
end
end

0 comments on commit 26d5254

Please sign in to comment.