From 52784c1b20c1afa3504df1ab6d8b2e4bb2a642bb Mon Sep 17 00:00:00 2001 From: Roberto Valentini Date: Mon, 4 Mar 2024 15:52:56 +0100 Subject: [PATCH] Add Debian 12 OS support add OS to metadata, skip acceptance on version 5.0 --- metadata.json | 3 ++- spec/acceptance/agent_spec.rb | 3 +++ spec/acceptance/server_spec.rb | 2 ++ spec/acceptance/zabbix_application_spec.rb | 2 ++ spec/acceptance/zabbix_host_spec.rb | 2 ++ spec/acceptance/zabbix_hostgroup_spec.rb | 2 ++ spec/acceptance/zabbix_proxy_spec.rb | 2 ++ spec/acceptance/zabbix_template_host_spec.rb | 2 ++ spec/acceptance/zabbix_template_spec.rb | 2 ++ spec/setup_acceptance_node.pp | 8 +++++--- spec/spec_helper_methods.rb | 2 +- 11 files changed, 25 insertions(+), 5 deletions(-) diff --git a/metadata.json b/metadata.json index 05866f543..42d978541 100644 --- a/metadata.json +++ b/metadata.json @@ -131,7 +131,8 @@ { "operatingsystem": "Debian", "operatingsystemrelease": [ - "11" + "11", + "12" ] }, { diff --git a/spec/acceptance/agent_spec.rb b/spec/acceptance/agent_spec.rb index 0c469e94b..2f8f2c88f 100644 --- a/spec/acceptance/agent_spec.rb +++ b/spec/acceptance/agent_spec.rb @@ -3,6 +3,9 @@ require 'spec_helper_acceptance' supported_versions.each do |version| + # < 6.0 agent packages are not available for Debian 12 + next if version < '6.0' && default[:platform] =~ %r{debian-12} + describe "zabbix::agent class with zabbix_version #{version}" do it 'works idempotently with no errors' do pp = <<-EOS diff --git a/spec/acceptance/server_spec.rb b/spec/acceptance/server_spec.rb index a7821a909..20f625b9d 100644 --- a/spec/acceptance/server_spec.rb +++ b/spec/acceptance/server_spec.rb @@ -45,6 +45,8 @@ class { 'zabbix::database': } next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64' # <6.0 server packages are not available for ubuntu 22.04 next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22} + # < 6.0 server packages are not available for Debian 12 + next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12} context "deploys a zabbix #{zabbix_version} server" do # Using puppet_apply as a helper diff --git a/spec/acceptance/zabbix_application_spec.rb b/spec/acceptance/zabbix_application_spec.rb index a202d567e..6150ac751 100644 --- a/spec/acceptance/zabbix_application_spec.rb +++ b/spec/acceptance/zabbix_application_spec.rb @@ -11,6 +11,8 @@ next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64' # <6.0 server packages are not available for ubuntu 22.04 next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22} + # < 6.0 server packages are not available for Debian 12 + next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12} template = case zabbix_version when '5.0' diff --git a/spec/acceptance/zabbix_host_spec.rb b/spec/acceptance/zabbix_host_spec.rb index fe7af3d6c..79b195b99 100644 --- a/spec/acceptance/zabbix_host_spec.rb +++ b/spec/acceptance/zabbix_host_spec.rb @@ -12,6 +12,8 @@ next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64' # <6.0 server packages are not available for ubuntu 22.04 next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22} + # < 6.0 server packages are not available for Debian 12 + next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12} context "create zabbix_host resources with zabbix version #{zabbix_version}" do # This will deploy a running Zabbix setup (server, web, db) which we can diff --git a/spec/acceptance/zabbix_hostgroup_spec.rb b/spec/acceptance/zabbix_hostgroup_spec.rb index 2a140f409..22cf7ed81 100644 --- a/spec/acceptance/zabbix_hostgroup_spec.rb +++ b/spec/acceptance/zabbix_hostgroup_spec.rb @@ -11,6 +11,8 @@ next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64' # <6.0 server packages are not available for ubuntu 22.04 next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22} + # < 6.0 server packages are not available for Debian 12 + next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12} context "create zabbix_hostgroup resources with zabbix version #{zabbix_version}" do # This will deploy a running Zabbix setup (server, web, db) which we can diff --git a/spec/acceptance/zabbix_proxy_spec.rb b/spec/acceptance/zabbix_proxy_spec.rb index d57f26973..401566c47 100644 --- a/spec/acceptance/zabbix_proxy_spec.rb +++ b/spec/acceptance/zabbix_proxy_spec.rb @@ -12,6 +12,8 @@ next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64' # <6.0 server packages are not available for ubuntu 22.04 next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22} + # < 6.0 server packages are not available for Debian 12 + next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12} context "create zabbix_proxy resources with zabbix version #{zabbix_version}" do # This will deploy a running Zabbix setup (server, web, db) which we can diff --git a/spec/acceptance/zabbix_template_host_spec.rb b/spec/acceptance/zabbix_template_host_spec.rb index 0aacccf91..961e66eba 100644 --- a/spec/acceptance/zabbix_template_host_spec.rb +++ b/spec/acceptance/zabbix_template_host_spec.rb @@ -13,6 +13,8 @@ next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64' # <6.0 server packages are not available for ubuntu 22.04 next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22} + # < 6.0 server packages are not available for Debian 12 + next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12} context "create zabbix_template_host resources with zabbix version #{zabbix_version}" do template = case zabbix_version diff --git a/spec/acceptance/zabbix_template_spec.rb b/spec/acceptance/zabbix_template_spec.rb index 43a2686a9..1cbb87eac 100644 --- a/spec/acceptance/zabbix_template_spec.rb +++ b/spec/acceptance/zabbix_template_spec.rb @@ -11,6 +11,8 @@ next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64' # <6.0 server packages are not available for ubuntu 22.04 next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22} + # < 6.0 server packages are not available for Debian 12 + next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12} context "create zabbix_template resources with zabbix version #{zabbix_version}" do # This will deploy a running Zabbix setup (server, web, db) which we can diff --git a/spec/setup_acceptance_node.pp b/spec/setup_acceptance_node.pp index 9c7a3b4ba..de1ecc6a6 100644 --- a/spec/setup_acceptance_node.pp +++ b/spec/setup_acceptance_node.pp @@ -2,9 +2,11 @@ 'Debian': { # On Debian it seems that make is searching for mkdir in /usr/bin/ but mkdir # does not exist. Symlink it from /bin/mkdir to make it work. - file { '/usr/bin/mkdir': - ensure => link, - target => '/bin/mkdir', + if $facts['os']['release']['major'] < '12' { + file { '/usr/bin/mkdir': + ensure => link, + target => '/bin/mkdir', + } } } 'Ubuntu': { diff --git a/spec/spec_helper_methods.rb b/spec/spec_helper_methods.rb index 9d2f49970..5b3e02063 100644 --- a/spec/spec_helper_methods.rb +++ b/spec/spec_helper_methods.rb @@ -9,7 +9,7 @@ def baseline_os_hash }, { 'operatingsystem' => 'Debian', - 'operatingsystemrelease' => %w[11] + 'operatingsystemrelease' => %w[11 12] }, { 'operatingsystem' => 'Ubuntu',