From c1da63a188af2f73f95185916b63e1cdd28634d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Sun, 27 Mar 2022 17:10:20 -1000 Subject: [PATCH] Skip acceptance tests on Puppet 6 / Debian 11 No puppetserver6 / puppetdb6 packages are available for Debian 11. --- spec/acceptance/class_spec.rb | 4 +++- spec/acceptance/support/puppetdb.rb | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 spec/acceptance/support/puppetdb.rb diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index 7d978b66..e24ff85c 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -2,7 +2,9 @@ require 'spec_helper_acceptance' -describe 'puppetboard class' do +require_relative 'support/puppetdb' + +describe 'puppetboard class', if: has_puppetdb do case fact('os.family') when 'RedHat' apache_conf_file = '/etc/httpd/conf.d/25-puppetboard.conf' diff --git a/spec/acceptance/support/puppetdb.rb b/spec/acceptance/support/puppetdb.rb new file mode 100644 index 00000000..d38ccc2b --- /dev/null +++ b/spec/acceptance/support/puppetdb.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +def has_puppetdb + case host_inventory['facter']['os']['name'] + when 'Debian' + return false if ENV['BEAKER_PUPPET_COLLECTION'] == 'puppet6' && host_inventory['facter']['os']['release']['major'] == '11' + end + + true +end