diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cdfc30f..454906c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,5 +15,5 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" with: - flags: "--nightly" + flags: "--platform-include sles-15" secrets: "inherit" diff --git a/Gemfile b/Gemfile index 4e7de031..999619c1 100644 --- a/Gemfile +++ b/Gemfile @@ -64,8 +64,7 @@ group :development, :release_prep do gem "puppet-blacksmith", '~> 7.0', require: false end group :system_tests do - gem "puppet_litmus", '~> 2.0', require: false, platforms: [:ruby, :x64_mingw] if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty? - gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] if ENV['PUPPET_FORGE_TOKEN'].to_s.empty? + gem "puppet_litmus", git: 'https://github.com/puppetlabs/puppet_litmus', branch: 'CAT-2476-Address_SLES_failures', require: false, platforms: [:ruby, :x64_mingw] gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "serverspec", '~> 2.41', require: false end diff --git a/manifests/init.pp b/manifests/init.pp index 31750303..8851f7c5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -111,11 +111,12 @@ } # If the OS is SLES >= 15.3, enable the legacy repo to install net-tools-deprecated package + # Only attempt this if SUSEConnect is available and the system is registered if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['full'], '15.3') >= 0) { exec { 'Enable legacy repos': path => '/bin:/usr/bin/:/sbin:/usr/sbin', - command => "SUSEConnect --product sle-module-legacy/${facts['os']['release']['full']}/x86_64", - unless => "SUSEConnect --status-text | grep sle-module-legacy/${facts['os']['release']['full']}/x86_64", + command => "SUSEConnect --product sle-module-legacy/${facts['os']['release']['major']}/x86_64", + unless => "test ! -x /usr/bin/SUSEConnect || SUSEConnect --status-text | grep -qE '(Not Registered|sle-module-legacy/${facts['os']['release']['major']}/x86_64)'", } } diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 6e3a1d3f..8f508c16 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -211,6 +211,21 @@ MANIFEST describe 'installing' do + before(:all) do + # Configure Puppet Labs internal mirror for SLES (required for java-1_8_0-openjdk packages) + if os[:family] == 'sles' + sles_version = os[:release].split('.').first # Get major version (15 from 15.x) + mirror_manifest = <<-MANIFEST + exec { 'add osmirror repo': + command => "zypper addrepo -G -c -n 'localmirror-os' 'http://osmirror.delivery.puppetlabs.net/sles-#{sles_version}-gm-x86_64/RPMS.os' localmirror-os", + path => ['/usr/bin', '/bin'], + unless => 'zypper lr | grep -q localmirror-os', + } + MANIFEST + apply_manifest(mirror_manifest, catch_failures: true) + end + end + context 'when installing java jre' do it 'installs jre' do idempotent_apply(java_class_jre)