diff --git a/spec/acceptance/define_patternfile_spec.rb b/spec/acceptance/define_patternfile_spec.rb index 7f50cbac..4ab825f2 100644 --- a/spec/acceptance/define_patternfile_spec.rb +++ b/spec/acceptance/define_patternfile_spec.rb @@ -36,7 +36,6 @@ def apply_pattern(pattern_number, extra_logstash_class_args = nil) it 'does not restart logstash if logstash::restart_on_change is false' do os = fact('lsbdistdescription') - skip('Something funky happening with Upstart and Puppet 3?') if (os =~ %r{(centos release 6\.|ubuntu 12\.04)}i) && PUPPET_VERSION[0] == '3' log = apply_pattern(1, 'restart_on_change => false').stdout expect(log).not_to include(restart_message) end diff --git a/spec/defines/define_plugin_spec.rb b/spec/defines/define_plugin_spec.rb index 60a3a683..fa09cfcc 100644 --- a/spec/defines/define_plugin_spec.rb +++ b/spec/defines/define_plugin_spec.rb @@ -10,10 +10,10 @@ end let(:pre_condition) do - ' + <<~PUPPET include elastic_stack::repo include logstash - ' + PUPPET end let(:title) { 'logstash-input-mysql' } diff --git a/spec/support/acceptance/helpers.rb b/spec/support/acceptance/helpers.rb index 32cd3396..83e5b29c 100644 --- a/spec/support/acceptance/helpers.rb +++ b/spec/support/acceptance/helpers.rb @@ -1,58 +1,15 @@ # frozen_string_literal: true -require 'beaker-rspec' -require 'net/http' -require 'securerandom' require 'yaml' # Collect global options from the environment. LS_VERSION = ENV['LOGSTASH_VERSION'] || '7.17.7' -PUPPET_VERSION = ENV['PUPPET_VERSION'] || '4.10.7' - -PE_VERSION = ENV['BEAKER_PE_VER'] || ENV['PE_VERSION'] || '3.8.3' -PE_DIR = ENV['BEAKER_PE_DIR'] - IS_PRERELEASE = if LS_VERSION =~ %r{(alpha|beta|rc)} true else false end -def agent_version_for_puppet_version(puppet_version) - # REF: https://docs.puppet.com/puppet/latest/reference/about_agent.html - version_map = { - # Puppet => Agent - '4.9.4' => '1.9.3', - '4.8.2' => '1.8.3', - '4.8.1' => '1.8.2', - '4.8.0' => '1.8.0', - '4.7.1' => '1.7.2', - '4.7.0' => '1.7.1', - '4.6.2' => '1.6.2', - '4.6.1' => '1.6.1', - '4.6.0' => '1.6.0', - '4.5.3' => '1.5.3', - '4.4.2' => '1.4.2', - '4.4.1' => '1.4.1', - '4.4.0' => '1.4.0', - '4.3.2' => '1.3.6', - '4.3.1' => '1.3.2', - '4.3.0' => '1.3.0', - '4.2.3' => '1.2.7', - '4.2.2' => '1.2.6', - '4.2.1' => '1.2.2', - '4.2.0' => '1.2.1', - '4.1.0' => '1.1.1', - '4.0.0' => '1.0.1' - } - version_map[puppet_version] -end - -def apply_manifest_fixture(manifest_name) - manifest = File.read("./spec/fixtures/manifests/#{manifest_name}.pp") - apply_manifest(manifest, catch_failures: true) -end - def expect_no_change_from_manifest(manifest) expect(apply_manifest(manifest).exit_code).to eq(0) end @@ -212,28 +169,3 @@ def pipelines_from_yaml def service_restart_message "Service[logstash]: Triggered 'refresh'" end - -def pe_package_url - distro, distro_version = ENV['BEAKER_set'].split('-') - case distro - when 'debian' - os = 'debian' - arch = 'amd64' - when 'centos' - os = 'el' - arch = 'x86_64' - when 'ubuntu' - os = 'ubuntu' - arch = 'amd64' - end - url_root = "https://s3.amazonaws.com/pe-builds/released/#{PE_VERSION}" - "#{url_root}/puppet-enterprise-#{PE_VERSION}-#{os}-#{distro_version}-#{arch}.tar.gz" -end - -def pe_package_filename - File.basename(pe_package_url) -end - -def puppet_enterprise? - ENV['BEAKER_IS_PE'] == 'true' || ENV['IS_PE'] == 'true' -end