Skip to content

Commit 50c8c52

Browse files
authored
Merge pull request #895 from voxpupuli/test-server-all
increase default CacheSize to 32M, the default in 6.0
2 parents f22bc00 + b65a7ff commit 50c8c52

File tree

10 files changed

+64
-13
lines changed

10 files changed

+64
-13
lines changed

manifests/params.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
# Zabbix-server
195195
$server_alertscriptspath = '/etc/zabbix/alertscripts'
196196
$server_allowroot = '0'
197-
$server_cachesize = '8M'
197+
$server_cachesize = '32M'
198198
$server_cacheupdatefrequency = '60'
199199
$server_config_group = 'zabbix'
200200
$server_config_owner = 'zabbix'
@@ -365,7 +365,7 @@
365365

366366
# Proxy specific params
367367
$proxy_allowroot = '0'
368-
$proxy_cachesize = '8M'
368+
$proxy_cachesize = '32M'
369369
$proxy_configfile_path = '/etc/zabbix/zabbix_proxy.conf'
370370
$proxy_configfrequency = '3600'
371371
$proxy_database_host = 'localhost'

spec/acceptance/server_spec.rb

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class { 'postgresql::globals':
2121
locale => 'en_US.UTF-8',
2222
manage_package_repo => $facts['os']['release']['major'] != '8',
2323
manage_dnf_module => $facts['os']['release']['major'] == '8',
24-
version => '12',
24+
version => '13',
2525
}
2626
-> class { 'postgresql::server': }
2727
-> class { 'zabbix::database': }
@@ -45,4 +45,55 @@ class { 'postgresql::globals':
4545
it { is_expected.to be_enabled }
4646
end
4747
end
48+
49+
supported_versions.each do |zabbix_version|
50+
# >= 5.2 server packages are not available for RHEL 7
51+
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'
52+
53+
context "deploys a zabbix #{zabbix_version} server" do
54+
# Using puppet_apply as a helper
55+
it 'works idempotently with no errors' do
56+
# this is a minimal working example if you've a postgres server
57+
# running on another node. multinode testing with beaker is pain,
58+
# so we will deploy multiple services into one box
59+
# pp = <<-EOS
60+
# class { 'zabbix::server':
61+
# manage_database => false,
62+
# }
63+
# EOS
64+
65+
# this will actually deploy apache + postgres + zabbix-server + zabbix-web
66+
pp = <<-EOS
67+
class { 'postgresql::globals':
68+
encoding => 'UTF-8',
69+
locale => 'en_US.UTF-8',
70+
manage_package_repo => $facts['os']['release']['major'] != '8',
71+
manage_dnf_module => $facts['os']['release']['major'] == '8',
72+
version => '13',
73+
}
74+
-> class { 'postgresql::server': }
75+
-> class { 'zabbix::database': }
76+
-> class { 'zabbix::server':
77+
zabbix_version => "#{zabbix_version}"
78+
}
79+
EOS
80+
81+
prepare_host
82+
83+
# Run it twice and test for idempotency
84+
apply_manifest(pp, catch_failures: true)
85+
apply_manifest(pp, catch_changes: true)
86+
end
87+
88+
# do some basic checks
89+
describe package('zabbix-server-pgsql') do
90+
it { is_expected.to be_installed }
91+
end
92+
93+
describe service('zabbix-server') do
94+
it { is_expected.to be_running }
95+
it { is_expected.to be_enabled }
96+
end
97+
end
98+
end
4899
end

spec/acceptance/zabbix_application_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class { 'postgresql::globals':
2727
locale => 'en_US.UTF-8',
2828
manage_package_repo => $facts['os']['release']['major'] != '8',
2929
manage_dnf_module => $facts['os']['release']['major'] == '8',
30-
version => '12',
30+
version => '13',
3131
}
3232
-> class { 'postgresql::server': }
3333

spec/acceptance/zabbix_host_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class { 'postgresql::globals':
3636
locale => 'en_US.UTF-8',
3737
manage_package_repo => $facts['os']['release']['major'] != '8',
3838
manage_dnf_module => $facts['os']['release']['major'] == '8',
39-
version => '12',
39+
version => '13',
4040
}
4141
-> class { 'postgresql::server': }
4242

spec/acceptance/zabbix_hostgroup_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class { 'postgresql::globals':
2020
locale => 'en_US.UTF-8',
2121
manage_package_repo => $facts['os']['release']['major'] != '8',
2222
manage_dnf_module => $facts['os']['release']['major'] == '8',
23-
version => '12',
23+
version => '13',
2424
}
2525
-> class { 'postgresql::server': }
2626

spec/acceptance/zabbix_proxy_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class { 'postgresql::globals':
2121
locale => 'en_US.UTF-8',
2222
manage_package_repo => $facts['os']['release']['major'] != '8',
2323
manage_dnf_module => $facts['os']['release']['major'] == '8',
24-
version => '12',
24+
version => '13',
2525
}
2626
-> class { 'postgresql::server': }
2727

spec/acceptance/zabbix_template_host_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class { 'postgresql::globals':
2929
locale => 'en_US.UTF-8',
3030
manage_package_repo => $facts['os']['release']['major'] != '8',
3131
manage_dnf_module => $facts['os']['release']['major'] == '8',
32-
version => '12',
32+
version => '13',
3333
}
3434
-> class { 'postgresql::server': }
3535

spec/acceptance/zabbix_template_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class { 'postgresql::globals':
2020
locale => 'en_US.UTF-8',
2121
manage_package_repo => $facts['os']['release']['major'] != '8',
2222
manage_dnf_module => $facts['os']['release']['major'] == '8',
23-
version => '12',
23+
version => '13',
2424
}
2525
-> class { 'postgresql::server': }
2626

spec/classes/proxy_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
let(:params) do
203203
{
204204
allowroot: '0',
205-
cachesize: '8M',
205+
cachesize: '32M',
206206
configfrequency: '3600',
207207
database_host: 'localhost',
208208
database_name: 'zabbix-proxy',
@@ -321,7 +321,7 @@
321321
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^StartSNMPTrapper=0$} }
322322
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^ListenIP=192.168.1.1$} }
323323
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^HousekeepingFrequency=1$} }
324-
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^CacheSize=8M$} }
324+
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^CacheSize=32M$} }
325325
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^StartDBSyncers=4$} }
326326
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^HistoryCacheSize=16M$} }
327327
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^Timeout=20$} }

spec/classes/server_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
{
195195
alertscriptspath: '${datadir}/zabbix/alertscripts',
196196
allowroot: '1',
197-
cachesize: '8M',
197+
cachesize: '32M',
198198
cacheupdatefrequency: '30',
199199
database_host: 'localhost',
200200
database_name: 'zabbix-server',
@@ -271,7 +271,7 @@
271271

272272
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^AlertScriptsPath=\$\{datadir\}/zabbix/alertscripts} }
273273
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^AllowRoot=1} }
274-
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^CacheSize=8M} }
274+
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^CacheSize=32M} }
275275
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^CacheUpdateFrequency=30} }
276276
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^DBHost=localhost} }
277277
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^DBName=zabbix-server} }

0 commit comments

Comments
 (0)