From 1192618d075d30a8131f8cfff6af79f42c85d6a3 Mon Sep 17 00:00:00 2001 From: david22swan Date: Thu, 24 Mar 2022 16:33:31 +0000 Subject: [PATCH] (GH-iac-334) Remove code specific to unsupported OSs Code removed includes ubuntu 16.04 + 14.04 and Debian 7 + 8 --- manifests/params.pp | 12 +- manifests/source.pp | 8 +- provision.yaml | 6 +- spec/acceptance/apt_key_provider_spec.rb | 19 +-- spec/classes/apt_backports_spec.rb | 38 +++--- spec/classes/apt_spec.rb | 112 ++++-------------- spec/classes/apt_update_spec.rb | 48 ++++---- spec/defines/conf_spec.rb | 6 +- spec/defines/key_compat_spec.rb | 6 +- spec/defines/key_spec.rb | 6 +- spec/defines/mark_spec.rb | 6 +- spec/defines/pin_spec.rb | 6 +- spec/defines/ppa_spec.rb | 70 +++++------ spec/defines/setting_spec.rb | 12 +- spec/defines/source_compat_spec.rb | 14 +-- spec/defines/source_spec.rb | 30 ++--- spec/unit/facter/apt_dist_has_updates_spec.rb | 4 +- .../apt_dist_package_security_updates_spec.rb | 16 +-- .../facter/apt_dist_package_updates_spec.rb | 4 +- .../facter/apt_dist_security_updates_spec.rb | 16 +-- spec/unit/facter/apt_dist_updates_spec.rb | 4 +- spec/unit/facter/apt_has_updates_spec.rb | 4 +- .../apt_package_security_updates_spec.rb | 16 +-- spec/unit/facter/apt_package_updates_spec.rb | 4 +- spec/unit/facter/apt_security_updates_spec.rb | 16 +-- spec/unit/facter/apt_updates_spec.rb | 4 +- 26 files changed, 200 insertions(+), 287 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 58ce9ed..ae656db 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -84,11 +84,7 @@ class apt::params { } $ppa_options = undef $ppa_package = undef - if versioncmp($facts['os']['release']['major'], '9') >= 0 { - $auth_conf_owner = '_apt' - } else { - $auth_conf_owner = 'root' - } + $auth_conf_owner = '_apt' } 'Ubuntu': { $backports = { @@ -98,11 +94,7 @@ class apt::params { } $ppa_options = '-y' $ppa_package = 'software-properties-common' - if versioncmp($facts['os']['release']['full'], '16.04') >= 0 { - $auth_conf_owner = '_apt' - } else { - $auth_conf_owner = 'root' - } + $auth_conf_owner = '_apt' } undef: { fail('Unable to determine value for fact os[\"name\"]') diff --git a/manifests/source.pp b/manifests/source.pp index da01ef1..b24aa34 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -99,7 +99,7 @@ define apt::source( $_location = $location } # Newer oses, do not need the package for HTTPS transport. - $_transport_https_releases = [ '7', '8', '9', '14.04', '16.04' ] + $_transport_https_releases = ['9'] if (fact('os.release.major') in $_transport_https_releases) and $_location =~ /(?i:^https:\/\/)/ { ensure_packages('apt-transport-https') Package['apt-transport-https'] -> Class['apt::update'] @@ -111,7 +111,7 @@ define apt::source( $includes = merge($::apt::include_defaults, $include) if $key and $keyring { - fail("parameters key and keyring are mutualy exclusive") + fail('parameters key and keyring are mutualy exclusive') } if $key { @@ -138,8 +138,8 @@ define apt::source( 'includes' => $includes, 'options' => delete_undef_values({ 'arch' => $architecture, - 'trusted' => $allow_unsigned ? {true => "yes", false => undef}, - 'allow-insecure' => $allow_insecure ? {true => "yes", false => undef}, + 'trusted' => $allow_unsigned ? {true => 'yes', false => undef}, + 'allow-insecure' => $allow_insecure ? {true => 'yes', false => undef}, 'signed-by' => $keyring, }), 'location' => $_location, diff --git a/provision.yaml b/provision.yaml index d3ef67b..144e28b 100644 --- a/provision.yaml +++ b/provision.yaml @@ -2,7 +2,7 @@ default: provisioner: docker images: - - litmusimage/debian:8 + - litmusimage/debian:9 vagrant: provisioner: vagrant images: @@ -16,7 +16,6 @@ travis_deb: travis_ub_6: provisioner: docker images: - - litmusimage/ubuntu:16.04 - litmusimage/ubuntu:18.04 - litmusimage/ubuntu:20.04 travis_el7: @@ -25,11 +24,8 @@ travis_el7: release_checks_6: provisioner: abs images: - - debian-8-x86_64 - debian-9-x86_64 - debian-10-x86_64 - - ubuntu-1404-x86_64 - - ubuntu-1604-x86_64 - ubuntu-1804-x86_64 - ubuntu-2004-x86_64 release_checks_7: diff --git a/spec/acceptance/apt_key_provider_spec.rb b/spec/acceptance/apt_key_provider_spec.rb index 0db1d32..ee4a4c8 100644 --- a/spec/acceptance/apt_key_provider_spec.rb +++ b/spec/acceptance/apt_key_provider_spec.rb @@ -18,8 +18,7 @@ SHOULD_NEVER_EXIST_ID = 'EF8D349F' KEY_CHECK_COMMAND = 'apt-key adv --no-tty --list-keys --with-colons --fingerprint | grep ' PUPPETLABS_KEY_CHECK_COMMAND = "#{KEY_CHECK_COMMAND} #{PUPPETLABS_GPG_KEY_FINGERPRINT}" CENTOS_KEY_CHECK_COMMAND = "#{KEY_CHECK_COMMAND} #{CENTOS_GPG_KEY_FINGERPRINT}" -PUPPETLABS_EXP_CHECK_COMMAND = "#{KEY_CHECK_COMMAND} '#{PUPPETLABS_EXP_KEY_DATES}'" -DEBIAN_PUPPETLABS_EXP_CHECK_COMMAND = 'apt-key list | grep -F -A 1 \'pub rsa4096 2010-07-10 [SC] [expired: 2017-01-05]\' | grep \'47B3 20EB 4C7C 375A A9DA E1A0 1054 B7A2 4BD6 EC30\'' +PUPPETLABS_EXP_CHECK_COMMAND = 'apt-key list | grep -F -A 1 \'pub rsa4096 2010-07-10 [SC] [expired: 2017-01-05]\' | grep \'47B3 20EB 4C7C 375A A9DA E1A0 1054 B7A2 4BD6 EC30\'' def install_key(key) retry_on_error_matching do @@ -890,17 +889,9 @@ describe 'apt_key' do end describe 'refresh' do - if ['8', '14.04', '16.04'].include?(host_inventory['facter']['os']['release']['major']) - # older OSes use puppetlabs_exp_check_command - let(:puppetlabs_exp_check_command) { PUPPETLABS_EXP_CHECK_COMMAND } + # Ensure dirmngr package is installed + apply_manifest(refresh_check_for_dirmngr_pp, acceptable_exit_codes: [0, 2]) - else - # Set Debian Stetch and newer OSes puppetlabs_exp_check_command - let(:puppetlabs_exp_check_command) { DEBIAN_PUPPETLABS_EXP_CHECK_COMMAND } - - # Ensure dirmngr package is installed - apply_manifest(refresh_check_for_dirmngr_pp, acceptable_exit_codes: [0, 2]) - end before(:each) do # Delete the Puppet Labs Release Key and install an expired version of the key apply_manifest(refresh_del_key_pp) @@ -910,14 +901,14 @@ describe 'apt_key' do it 'updates an expired key' do apply_manifest(refresh_true_pp) # Check key has been updated to new version - run_shell(puppetlabs_exp_check_command.to_s) + run_shell(PUPPETLABS_EXP_CHECK_COMMAND.to_s) end end context 'when refresh => false' do it 'does not replace an expired key' do apply_manifest(refresh_false_pp) # Expired key is present and has not been updated by the new version - run_shell(puppetlabs_exp_check_command.to_s, expect_failures: true) + run_shell(PUPPETLABS_EXP_CHECK_COMMAND.to_s, expect_failures: true) end end end diff --git a/spec/classes/apt_backports_spec.rb b/spec/classes/apt_backports_spec.rb index 2f3865b..6f6d530 100644 --- a/spec/classes/apt_backports_spec.rb +++ b/spec/classes/apt_backports_spec.rb @@ -13,11 +13,11 @@ describe 'apt::backports', type: :class do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -27,8 +27,8 @@ describe 'apt::backports', type: :class do it { is_expected.to contain_apt__source('backports').with(location: 'http://deb.debian.org/debian', repos: 'main contrib non-free', - release: 'jessie-backports', - pin: { 'priority' => 200, 'release' => 'jessie-backports' }) + release: 'stretch-backports', + pin: { 'priority' => 200, 'release' => 'stretch-backports' }) } end context 'with defaults on ubuntu' do @@ -38,11 +38,11 @@ describe 'apt::backports', type: :class do family: 'Debian', name: 'Ubuntu', release: { - major: '16', - full: '16.04', + major: '18', + full: '18.04', }, distro: { - codename: 'xenial', + codename: 'bionac', id: 'Ubuntu', }, }, @@ -53,8 +53,8 @@ describe 'apt::backports', type: :class do is_expected.to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu', key: '630239CC130E1A7FD81A27B140976EAF437D05B5', repos: 'main universe multiverse restricted', - release: 'xenial-backports', - pin: { 'priority' => 200, 'release' => 'xenial-backports' }) + release: 'bionac-backports', + pin: { 'priority' => 200, 'release' => 'bionac-backports' }) } end context 'with everything set' do @@ -64,11 +64,11 @@ describe 'apt::backports', type: :class do family: 'Debian', name: 'Ubuntu', release: { - major: '16', - full: '16.04', + major: '18', + full: '18.04', }, distro: { - codename: 'xenial', + codename: 'bionac', id: 'Ubuntu', }, }, @@ -99,11 +99,11 @@ describe 'apt::backports', type: :class do family: 'Debian', name: 'Ubuntu', release: { - major: '16', - full: '16.04', + major: '18', + full: '18.04', }, distro: { - codename: 'xenial', + codename: 'bionac', id: 'Ubuntu', }, }, @@ -222,11 +222,11 @@ describe 'apt::backports', type: :class do family: 'Debian', name: 'Ubuntu', release: { - major: '16', - full: '16.04', + major: '18', + full: '18.04', }, distro: { - codename: 'xenial', + codename: 'bionac', id: 'Ubuntu', }, }, diff --git a/spec/classes/apt_spec.rb b/spec/classes/apt_spec.rb index 03b638c..1a7513c 100644 --- a/spec/classes/apt_spec.rb +++ b/spec/classes/apt_spec.rb @@ -45,11 +45,11 @@ describe 'apt' do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -342,34 +342,6 @@ describe 'apt' do context 'with entries for /etc/apt/auth.conf' do facts_hash = { - 'Ubuntu 14.04' => { - os: { - family: 'Debian', - name: 'Ubuntu', - release: { - major: '14', - full: '14.04', - }, - distro: { - codename: 'trusty', - id: 'Ubuntu', - }, - }, - }, - 'Ubuntu 16.04' => { - os: { - family: 'Debian', - name: 'Ubuntu', - release: { - major: '16', - full: '16.04', - }, - distro: { - codename: 'xenial', - id: 'Ubuntu', - }, - }, - }, 'Ubuntu 18.04' => { os: { family: 'Debian', @@ -384,34 +356,6 @@ describe 'apt' do }, }, }, - 'Debian 7.0' => { - os: { - family: 'Debian', - name: 'Debian', - release: { - major: '7', - full: '7.0', - }, - distro: { - codename: 'wheezy', - id: 'Debian', - }, - }, - }, - 'Debian 8.0' => { - os: { - family: 'Debian', - name: 'Debian', - release: { - major: '8', - full: '8.0', - }, - distro: { - codename: 'jessie', - id: 'Debian', - }, - }, - }, 'Debian 9.0' => { os: { family: 'Debian', @@ -469,16 +413,6 @@ describe 'apt' do super().merge(manage_auth_conf: true) end - # Going forward starting with Ubuntu 16.04 and Debian 9.0 - # /etc/apt/auth.conf is owned by _apt. In previous versions it is - # root. - auth_conf_owner = case os - when 'Ubuntu 14.04', 'Debian 7.0', 'Debian 8.0' - 'root' - else - '_apt' - end - auth_conf_content = "// This file is managed by Puppet. DO NOT EDIT. machine deb.example.net login foologin password secret machine apt.example.com login aptlogin password supersecret @@ -486,7 +420,7 @@ machine apt.example.com login aptlogin password supersecret it { is_expected.to contain_file('/etc/apt/auth.conf').with(ensure: 'present', - owner: auth_conf_owner, + owner: '_apt', group: 'root', mode: '0600', notify: 'Class[Apt::Update]', @@ -535,11 +469,11 @@ machine apt.example.com login aptlogin password supersecret family: 'Debian', name: 'Ubuntu', release: { - major: '16', - full: '16.04', + major: '18', + full: '18.04', }, distro: { - codename: 'xenial', + codename: 'bionic', id: 'Ubuntu', }, }, @@ -574,7 +508,7 @@ machine apt.example.com login aptlogin password supersecret is_expected.to contain_apt__setting('list-puppetlabs').with(ensure: 'present') } - it { is_expected.to contain_file('/etc/apt/sources.list.d/puppetlabs.list').with_content(%r{^deb http://apt.puppetlabs.com xenial main$}) } + it { is_expected.to contain_file('/etc/apt/sources.list.d/puppetlabs.list').with_content(%r{^deb http://apt.puppetlabs.com bionic main$}) } end context 'with confs defined on valid os.family' do @@ -584,11 +518,11 @@ machine apt.example.com login aptlogin password supersecret family: 'Debian', name: 'Ubuntu', release: { - major: '16', - full: '16.04', + major: '18', + full: '18.04', }, distro: { - codename: 'xenial', + codename: 'bionic', id: 'Ubuntu', }, }, @@ -621,11 +555,11 @@ machine apt.example.com login aptlogin password supersecret family: 'Debian', name: 'Ubuntu', release: { - major: '16', - full: '16.04', + major: '18', + full: '18.04', }, distro: { - codename: 'xenial', + codename: 'bionic', id: 'Ubuntu', }, }, @@ -658,11 +592,11 @@ machine apt.example.com login aptlogin password supersecret family: 'Debian', name: 'Ubuntu', release: { - major: '16', - full: '16.04', + major: '18', + full: '18.04', }, distro: { - codename: 'xenial', + codename: 'bionic', id: 'Ubuntu', }, }, @@ -686,11 +620,11 @@ machine apt.example.com login aptlogin password supersecret family: 'Debian', name: 'Ubuntu', release: { - major: '16', - full: '16.04', + major: '18', + full: '18.04', }, distro: { - codename: 'xenial', + codename: 'bionic', id: 'Ubuntu', }, }, @@ -714,11 +648,11 @@ machine apt.example.com login aptlogin password supersecret family: 'Debian', name: 'Ubuntu', release: { - major: '16', - full: '16.04', + major: '18', + full: '18.04', }, distro: { - codename: 'xenial', + codename: 'bionic', id: 'Ubuntu', }, }, diff --git a/spec/classes/apt_update_spec.rb b/spec/classes/apt_update_spec.rb index 89ba942..0db9a47 100644 --- a/spec/classes/apt_update_spec.rb +++ b/spec/classes/apt_update_spec.rb @@ -16,11 +16,11 @@ describe 'apt::update', type: :class do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -44,11 +44,11 @@ describe 'apt::update', type: :class do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -68,11 +68,11 @@ describe 'apt::update', type: :class do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -105,11 +105,11 @@ describe 'apt::update', type: :class do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -131,11 +131,11 @@ describe 'apt::update', type: :class do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -159,11 +159,11 @@ describe 'apt::update', type: :class do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -185,11 +185,11 @@ describe 'apt::update', type: :class do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -210,11 +210,11 @@ describe 'apt::update', type: :class do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, diff --git a/spec/defines/conf_spec.rb b/spec/defines/conf_spec.rb index 310e15a..f1e42b5 100644 --- a/spec/defines/conf_spec.rb +++ b/spec/defines/conf_spec.rb @@ -11,11 +11,11 @@ describe 'apt::conf', type: :define do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, diff --git a/spec/defines/key_compat_spec.rb b/spec/defines/key_compat_spec.rb index e2a76e0..d477937 100644 --- a/spec/defines/key_compat_spec.rb +++ b/spec/defines/key_compat_spec.rb @@ -29,11 +29,11 @@ describe 'apt::key', type: :define do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, diff --git a/spec/defines/key_spec.rb b/spec/defines/key_spec.rb index fc40a86..fd63965 100644 --- a/spec/defines/key_spec.rb +++ b/spec/defines/key_spec.rb @@ -50,11 +50,11 @@ describe 'apt::key' do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, diff --git a/spec/defines/mark_spec.rb b/spec/defines/mark_spec.rb index 0d059a5..b451bed 100644 --- a/spec/defines/mark_spec.rb +++ b/spec/defines/mark_spec.rb @@ -13,11 +13,11 @@ describe 'apt::mark', type: :define do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, diff --git a/spec/defines/pin_spec.rb b/spec/defines/pin_spec.rb index 1b6ac33..5edc79c 100644 --- a/spec/defines/pin_spec.rb +++ b/spec/defines/pin_spec.rb @@ -11,11 +11,11 @@ describe 'apt::pin', type: :define do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, diff --git a/spec/defines/ppa_spec.rb b/spec/defines/ppa_spec.rb index 43ee754..b5aadff 100644 --- a/spec/defines/ppa_spec.rb +++ b/spec/defines/ppa_spec.rb @@ -13,8 +13,8 @@ describe 'apt::ppa' do family: 'Debian', name: 'Ubuntu', release: { - major: '14', - full: '14.04', + major: '18', + full: '18.04', }, distro: { codename: 'trusty', @@ -29,8 +29,8 @@ describe 'apt::ppa' do it { is_expected.not_to contain_package('python-software-properties') } it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow+type').that_notifies('Class[Apt::Update]').with(environment: [], - command: '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow+type || (rm /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list && false)', # rubocop:disable Layout/LineLength - unless: '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow_type.gpg', # rubocop:disable Layout/LineLength + command: '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow+type || (rm /etc/apt/sources.list.d/needs-ubuntu-such_substitution-wow_type-trusty.list && false)', # rubocop:disable Layout/LineLength + unless: '/usr/bin/test -f /etc/apt/sources.list.d/needs-ubuntu-such_substitution-wow_type-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs_ubuntu_such_substitution-wow_type.gpg', # rubocop:disable Layout/LineLength user: 'root', logoutput: 'on_failure') } @@ -81,8 +81,8 @@ describe 'apt::ppa' do family: 'Debian', name: 'Ubuntu', release: { - major: '14', - full: '14.04', + major: '18', + full: '18.04', }, distro: { codename: 'trusty', @@ -97,14 +97,14 @@ describe 'apt::ppa' do it { is_expected.to contain_package('software-properties-common') } it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with('environment' => [], - 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow || (rm /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && false)', # rubocop:disable Layout/LineLength - 'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow.gpg', # rubocop:disable Layout/LineLength + 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow || (rm /etc/apt/sources.list.d/needs-ubuntu-such_substitution-wow-trusty.list && false)', # rubocop:disable Layout/LineLength + 'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-ubuntu-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs_ubuntu_such_substitution-wow.gpg', # rubocop:disable Layout/LineLength 'user' => 'root', 'logoutput' => 'on_failure') } it { - is_expected.to contain_file('/etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list').that_requires('Exec[add-apt-repository-ppa:needs/such.substitution/wow]').with('ensure' => 'file') + is_expected.to contain_file('/etc/apt/sources.list.d/needs-ubuntu-such_substitution-wow-trusty.list').that_requires('Exec[add-apt-repository-ppa:needs/such.substitution/wow]').with('ensure' => 'file') # rubocop:disable Layout/LineLength } end @@ -118,8 +118,8 @@ describe 'apt::ppa' do family: 'Debian', name: 'Ubuntu', release: { - major: '14', - full: '14.04', + major: '18', + full: '18.04', }, distro: { codename: 'trusty', @@ -139,14 +139,14 @@ describe 'apt::ppa' do it { is_expected.not_to contain_package('python-software-properties') } it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with('environment' => [], - 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow || (rm /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && false)', # rubocop:disable Layout/LineLength - 'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow.gpg', # rubocop:disable Layout/LineLength + 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow || (rm /etc/apt/sources.list.d/needs-ubuntu-such_substitution-wow-trusty.list && false)', # rubocop:disable Layout/LineLength + 'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-ubuntu-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs_ubuntu_such_substitution-wow.gpg', # rubocop:disable Layout/LineLength 'user' => 'root', 'logoutput' => 'on_failure') } it { - is_expected.to contain_file('/etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list').that_requires('Exec[add-apt-repository-ppa:needs/such.substitution/wow]').with('ensure' => 'file') + is_expected.to contain_file('/etc/apt/sources.list.d/needs-ubuntu-such_substitution-wow-trusty.list').that_requires('Exec[add-apt-repository-ppa:needs/such.substitution/wow]').with('ensure' => 'file') # rubocop:disable Layout/LineLength } end @@ -162,8 +162,8 @@ describe 'apt::ppa' do family: 'Debian', name: 'Ubuntu', release: { - major: '14', - full: '14.04', + major: '18', + full: '18.04', }, distro: { codename: 'trusty', @@ -185,8 +185,8 @@ describe 'apt::ppa' do it { is_expected.to contain_package('software-properties-common') } it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: [], - command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Layout/LineLength - unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Layout/LineLength + command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-ubuntu-foo-trusty.list && false)', # rubocop:disable Layout/LineLength + unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user_ubuntu_foo.gpg', # rubocop:disable Layout/LineLength user: 'root', logoutput: 'on_failure') } @@ -204,8 +204,8 @@ describe 'apt::ppa' do family: 'Debian', name: 'Ubuntu', release: { - major: '14', - full: '14.04', + major: '18', + full: '18.04', }, distro: { codename: 'trusty', @@ -225,8 +225,8 @@ describe 'apt::ppa' do it { is_expected.to contain_package('software-properties-common') } it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: ['http_proxy=http://localhost:8080'], - command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Layout/LineLength - unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Layout/LineLength + command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-ubuntu-foo-trusty.list && false)', # rubocop:disable Layout/LineLength + unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user_ubuntu_foo.gpg', # rubocop:disable Layout/LineLength user: 'root', logoutput: 'on_failure') } @@ -244,8 +244,8 @@ describe 'apt::ppa' do family: 'Debian', name: 'Ubuntu', release: { - major: '14', - full: '14.04', + major: '18', + full: '18.04', }, distro: { codename: 'trusty', @@ -265,8 +265,8 @@ describe 'apt::ppa' do it { is_expected.to contain_package('software-properties-common') } it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: ['http_proxy=http://localhost:8180'], - command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Layout/LineLength - unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Layout/LineLength + command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-ubuntu-foo-trusty.list && false)', # rubocop:disable Layout/LineLength + unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user_ubuntu_foo.gpg', # rubocop:disable Layout/LineLength user: 'root', logoutput: 'on_failure') } @@ -284,8 +284,8 @@ describe 'apt::ppa' do family: 'Debian', name: 'Ubuntu', release: { - major: '14', - full: '14.04', + major: '18', + full: '18.04', }, distro: { codename: 'trusty', @@ -305,8 +305,8 @@ describe 'apt::ppa' do it { is_expected.to contain_package('software-properties-common') } it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: ['http_proxy=http://localhost:8180', 'https_proxy=https://localhost:8180'], - command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Layout/LineLength - unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Layout/LineLength + command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-ubuntu-foo-trusty.list && false)', # rubocop:disable Layout/LineLength + unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user_ubuntu_foo.gpg', # rubocop:disable Layout/LineLength user: 'root', logoutput: 'on_failure') } @@ -322,8 +322,8 @@ describe 'apt::ppa' do family: 'Debian', name: 'Ubuntu', release: { - major: '14', - full: '14.04', + major: '18', + full: '18.04', }, distro: { codename: 'trusty', @@ -340,7 +340,7 @@ describe 'apt::ppa' do end it { - is_expected.to contain_file('/etc/apt/sources.list.d/user-foo-trusty.list').that_notifies('Class[Apt::Update]').with(ensure: 'absent') + is_expected.to contain_file('/etc/apt/sources.list.d/user-ubuntu-foo-trusty.list').that_notifies('Class[Apt::Update]').with(ensure: 'absent') } end @@ -352,8 +352,8 @@ describe 'apt::ppa' do family: 'Debian', name: 'Ubuntu', release: { - major: '14', - full: '14.04', + major: '18', + full: '18.04', }, distro: { codename: nil, diff --git a/spec/defines/setting_spec.rb b/spec/defines/setting_spec.rb index a2fef2e..97ebdc4 100644 --- a/spec/defines/setting_spec.rb +++ b/spec/defines/setting_spec.rb @@ -10,11 +10,11 @@ describe 'apt::setting' do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -86,11 +86,11 @@ describe 'apt::setting' do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, diff --git a/spec/defines/source_compat_spec.rb b/spec/defines/source_compat_spec.rb index bd54fcf..d7dfb78 100644 --- a/spec/defines/source_compat_spec.rb +++ b/spec/defines/source_compat_spec.rb @@ -15,11 +15,11 @@ describe 'apt::source', type: :define do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -35,7 +35,7 @@ describe 'apt::source', type: :define do end it { - is_expected.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb-src http://debian.mirror.iweb.ca/debian/ jessie main\n}) + is_expected.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb-src http://debian.mirror.iweb.ca/debian/ stretch main\n}) } end @@ -80,7 +80,7 @@ describe 'apt::source', type: :define do } end - it { is_expected.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb \[allow-insecure=yes\] http://debian.mirror.iweb.ca/debian/ jessie main\n}) } + it { is_expected.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb \[allow-insecure=yes\] http://debian.mirror.iweb.ca/debian/ stretch main\n}) } end context 'when allow_unsigned true' do @@ -92,7 +92,7 @@ describe 'apt::source', type: :define do } end - it { is_expected.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb \[trusted=yes\] http://debian.mirror.iweb.ca/debian/ jessie main\n}) } + it { is_expected.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb \[trusted=yes\] http://debian.mirror.iweb.ca/debian/ stretch main\n}) } end context 'with architecture equals x86_64' do @@ -104,7 +104,7 @@ describe 'apt::source', type: :define do end it { - is_expected.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb \[arch=x86_64\] http://debian.mirror.iweb.ca/debian/ jessie main\n}) + is_expected.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb \[arch=x86_64\] http://debian.mirror.iweb.ca/debian/ stretch main\n}) } end diff --git a/spec/defines/source_spec.rb b/spec/defines/source_spec.rb index 9a8d4a7..d702f62 100644 --- a/spec/defines/source_spec.rb +++ b/spec/defines/source_spec.rb @@ -19,11 +19,11 @@ describe 'apt::source' do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -58,7 +58,7 @@ describe 'apt::source' do end it { - is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{hello.there jessie main\n}) + is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{hello.there stretch main\n}) } it { is_expected.to contain_file('/etc/apt/sources.list.d/my_source.list').that_notifies('Class[Apt::Update]') } @@ -154,7 +154,7 @@ describe 'apt::source' do end it { - is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb \[allow-insecure=yes\] hello.there jessie main\n}) + is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb \[allow-insecure=yes\] hello.there stretch main\n}) } end @@ -167,7 +167,7 @@ describe 'apt::source' do end it { - is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb \[trusted=yes\] hello.there jessie main\n}) + is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb \[trusted=yes\] hello.there stretch main\n}) } end @@ -182,7 +182,7 @@ describe 'apt::source' do it { is_expected.to contain_apt__setting('list-my_source') .with(ensure: 'present') - .with_content(%r{# my_source\ndeb \[signed-by=/usr/share/keyrings/foo-archive-keyring.gpg\] hello.there jessie main\n}) + .with_content(%r{# my_source\ndeb \[signed-by=/usr/share/keyrings/foo-archive-keyring.gpg\] hello.there stretch main\n}) } end @@ -199,7 +199,7 @@ describe 'apt::source' do it { is_expected.to contain_apt__setting('list-my_source') .with(ensure: 'present') - .with_content(%r{# my_source\ndeb \[arch=amd64 trusted=yes signed-by=/usr/share/keyrings/foo-archive-keyring.gpg\] hello.there jessie main\n}) + .with_content(%r{# my_source\ndeb \[arch=amd64 trusted=yes signed-by=/usr/share/keyrings/foo-archive-keyring.gpg\] hello.there stretch main\n}) } end @@ -223,11 +223,11 @@ describe 'apt::source' do family: 'Debian', name: 'Debian', release: { - major: '8', - full: '8.0', + major: '9', + full: '9.0', }, distro: { - codename: 'jessie', + codename: 'stretch', id: 'Debian', }, }, @@ -318,7 +318,7 @@ describe 'apt::source' do end it { - is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb-src hello.there jessie main\n}) + is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb-src hello.there stretch main\n}) } end @@ -331,7 +331,7 @@ describe 'apt::source' do end it { - is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb hello.there jessie main\ndeb-src hello.there jessie main\n}) + is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# my_source\ndeb hello.there stretch main\ndeb-src hello.there stretch main\n}) } end @@ -358,9 +358,9 @@ describe 'apt::source' do end it { - is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{deb-src hello.there jessie main\n}) + is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{deb-src hello.there stretch main\n}) } - it { is_expected.to contain_apt__setting('list-my_source').without_content(%r{deb hello.there jessie main\n}) } + it { is_expected.to contain_apt__setting('list-my_source').without_content(%r{deb hello.there stretch main\n}) } end context 'with ensure => absent' do diff --git a/spec/unit/facter/apt_dist_has_updates_spec.rb b/spec/unit/facter/apt_dist_has_updates_spec.rb index 17b6d81..f630241 100644 --- a/spec/unit/facter/apt_dist_has_updates_spec.rb +++ b/spec/unit/facter/apt_dist_has_updates_spec.rb @@ -32,8 +32,8 @@ describe 'apt_has_dist_updates fact' do allow(Facter::Util::Resolution).to receive(:exec).with('/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade 2>&1').and_return('test') apt_output = "Inst extremetuxracer [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ "Conf extremetuxracer (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ - "Inst planet.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ - "Conf planet.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" + "Inst planet.rb [13-1.1] (22-2~bpo8+1 Debian Backports:stretch-backports [all])\n" \ + "Conf planet.rb (22-2~bpo8+1 Debian Backports:stretch-backports [all])\n" allow(Facter::Util::Resolution).to receive(:exec).with('/usr/bin/apt-get -s -o Debug::NoLocking=true dist-upgrade 2>&1').and_return(apt_output) end it { is_expected.to be true } diff --git a/spec/unit/facter/apt_dist_package_security_updates_spec.rb b/spec/unit/facter/apt_dist_package_security_updates_spec.rb index 418c953..2a5bfcc 100644 --- a/spec/unit/facter/apt_dist_package_security_updates_spec.rb +++ b/spec/unit/facter/apt_dist_package_security_updates_spec.rb @@ -29,8 +29,8 @@ describe 'apt_package_security_dist_updates fact' do let(:apt_get_upgrade_output) do "Inst extremetuxracer [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ "Conf extremetuxracer (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ - "Inst planet.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ - "Conf planet.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ + "Inst planet.rb [13-1.1] (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ + "Conf planet.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ "Inst vim [7.52.1-5] (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64]) []\n" \ "Conf vim (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64])\n" \ end @@ -40,12 +40,12 @@ describe 'apt_package_security_dist_updates fact' do describe 'on Ubuntu' do let(:apt_get_upgrade_output) do - "Inst extremetuxracer [2016f-0ubuntu0.16.04] (2016j-0ubuntu0.16.04 Ubuntu:16.04/xenial-security, Ubuntu:16.04/xenial-updates [all])\n" \ - "Conf extremetuxracer (2016j-0ubuntu0.16.04 Ubuntu:16.04/xenial-security, Ubuntu:16.04/xenial-updates [all])\n" \ - "Inst vim [7.47.0-1ubuntu2] (7.47.0-1ubuntu2.2 Ubuntu:16.04/xenial-security [amd64]) []\n" \ - "Conf vim (7.47.0-1ubuntu2.2 Ubuntu:16.04/xenial-security [amd64])\n" \ - "Inst onioncircuits [2:3.3.10-4ubuntu2] (2:3.3.10-4ubuntu2.3 Ubuntu:16.04/xenial-updates [amd64])\n" \ - "Conf onioncircuits (2:3.3.10-4ubuntu2.3 Ubuntu:16.04/xenial-updates [amd64])\n" + "Inst extremetuxracer [2016f-0ubuntu0.18.04] (2016j-0ubuntu0.18.04 Ubuntu:18.04/xenial-security, Ubuntu:18.04/xenial-updates [all])\n" \ + "Conf extremetuxracer (2016j-0ubuntu0.18.04 Ubuntu:18.04/xenial-security, Ubuntu:18.04/xenial-updates [all])\n" \ + "Inst vim [7.47.0-1ubuntu2] (7.47.0-1ubuntu2.2 Ubuntu:18.04/xenial-security [amd64]) []\n" \ + "Conf vim (7.47.0-1ubuntu2.2 Ubuntu:18.04/xenial-security [amd64])\n" \ + "Inst onioncircuits [2:3.3.10-4ubuntu2] (2:3.3.10-4ubuntu2.3 Ubuntu:18.04/xenial-updates [amd64])\n" \ + "Conf onioncircuits (2:3.3.10-4ubuntu2.3 Ubuntu:18.04/xenial-updates [amd64])\n" end it { is_expected.to eq(['extremetuxracer', 'vim']) } diff --git a/spec/unit/facter/apt_dist_package_updates_spec.rb b/spec/unit/facter/apt_dist_package_updates_spec.rb index 952bf5c..013c16d 100644 --- a/spec/unit/facter/apt_dist_package_updates_spec.rb +++ b/spec/unit/facter/apt_dist_package_updates_spec.rb @@ -24,8 +24,8 @@ describe 'apt_package_dist_updates fact' do allow(File).to receive(:executable?).with('/usr/bin/apt-get').and_return(true) apt_output = "Inst extremetuxracer [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ "Conf extremetuxracer (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ - "Inst planet.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ - "Conf planet.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" + "Inst planet.rb [13-1.1] (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ + "Conf planet.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n" allow(Facter::Util::Resolution).to receive(:exec).with('/usr/bin/apt-get -s -o Debug::NoLocking=true dist-upgrade 2>&1').and_return(apt_output) end it { is_expected.to eq(['extremetuxracer', 'planet.rb']) } diff --git a/spec/unit/facter/apt_dist_security_updates_spec.rb b/spec/unit/facter/apt_dist_security_updates_spec.rb index c75df88..abeeccb 100644 --- a/spec/unit/facter/apt_dist_security_updates_spec.rb +++ b/spec/unit/facter/apt_dist_security_updates_spec.rb @@ -29,8 +29,8 @@ describe 'apt_security_updates fact' do let(:apt_get_upgrade_output) do "Inst extremetuxracer [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ "Conf extremetuxracer (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ - "Inst planet.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ - "Conf planet.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ + "Inst planet.rb [13-1.1] (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ + "Conf planet.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ "Inst vim [7.52.1-5] (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64]) []\n" \ "Conf vim (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64])\n" \ end @@ -40,12 +40,12 @@ describe 'apt_security_updates fact' do describe 'on Ubuntu' do let(:apt_get_upgrade_output) do - "Inst extremetuxracer [2016f-0ubuntu0.16.04] (2016j-0ubuntu0.16.04 Ubuntu:16.04/xenial-security, Ubuntu:16.04/xenial-updates [all])\n" \ - "Conf extremetuxracer (2016j-0ubuntu0.16.04 Ubuntu:16.04/xenial-security, Ubuntu:16.04/xenial-updates [all])\n" \ - "Inst vim [7.47.0-1ubuntu2] (7.47.0-1ubuntu2.2 Ubuntu:16.04/xenial-security [amd64]) []\n" \ - "Conf vim (7.47.0-1ubuntu2.2 Ubuntu:16.04/xenial-security [amd64])\n" \ - "Inst onioncircuits [2:3.3.10-4ubuntu2] (2:3.3.10-4ubuntu2.3 Ubuntu:16.04/xenial-updates [amd64])\n" \ - "Conf onioncircuits (2:3.3.10-4ubuntu2.3 Ubuntu:16.04/xenial-updates [amd64])\n" + "Inst extremetuxracer [2016f-0ubuntu0.18.04] (2016j-0ubuntu0.18.04 Ubuntu:18.04/xenial-security, Ubuntu:18.04/xenial-updates [all])\n" \ + "Conf extremetuxracer (2016j-0ubuntu0.18.04 Ubuntu:18.04/xenial-security, Ubuntu:18.04/xenial-updates [all])\n" \ + "Inst vim [7.47.0-1ubuntu2] (7.47.0-1ubuntu2.2 Ubuntu:18.04/xenial-security [amd64]) []\n" \ + "Conf vim (7.47.0-1ubuntu2.2 Ubuntu:18.04/xenial-security [amd64])\n" \ + "Inst onioncircuits [2:3.3.10-4ubuntu2] (2:3.3.10-4ubuntu2.3 Ubuntu:18.04/xenial-updates [amd64])\n" \ + "Conf onioncircuits (2:3.3.10-4ubuntu2.3 Ubuntu:18.04/xenial-updates [amd64])\n" end it { is_expected.to eq(2) } diff --git a/spec/unit/facter/apt_dist_updates_spec.rb b/spec/unit/facter/apt_dist_updates_spec.rb index 2bce358..d8a2696 100644 --- a/spec/unit/facter/apt_dist_updates_spec.rb +++ b/spec/unit/facter/apt_dist_updates_spec.rb @@ -24,8 +24,8 @@ describe 'apt_updates fact' do allow(File).to receive(:executable?).with('/usr/bin/apt-get').and_return(true) apt_output = "Inst extremetuxracer [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ "Conf extremetuxracer (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ - "Inst planet.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ - "Conf planet.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" + "Inst planet.rb [13-1.1] (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ + "Conf planet.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n" allow(Facter::Util::Resolution).to receive(:exec).with('/usr/bin/apt-get -s -o Debug::NoLocking=true dist-upgrade 2>&1').and_return(apt_output) end it { is_expected.to eq(2) } diff --git a/spec/unit/facter/apt_has_updates_spec.rb b/spec/unit/facter/apt_has_updates_spec.rb index 1fc5ab6..d0813c8 100644 --- a/spec/unit/facter/apt_has_updates_spec.rb +++ b/spec/unit/facter/apt_has_updates_spec.rb @@ -31,8 +31,8 @@ describe 'apt_has_updates fact' do allow(File).to receive(:executable?).with('/usr/bin/apt-get').and_return(true) apt_output = "Inst tzdata [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ "Conf tzdata (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ - "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ - "Conf unhide.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" + "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ + "Conf unhide.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n" allow(Facter::Util::Resolution).to receive(:exec).with('/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade 2>&1').and_return(apt_output) end it { is_expected.to be true } diff --git a/spec/unit/facter/apt_package_security_updates_spec.rb b/spec/unit/facter/apt_package_security_updates_spec.rb index 699eb61..d9d4643 100644 --- a/spec/unit/facter/apt_package_security_updates_spec.rb +++ b/spec/unit/facter/apt_package_security_updates_spec.rb @@ -27,8 +27,8 @@ describe 'apt_package_security_updates fact' do let(:apt_get_upgrade_output) do "Inst tzdata [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ "Conf tzdata (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ - "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ - "Conf unhide.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ + "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ + "Conf unhide.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ "Inst curl [7.52.1-5] (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64]) []\n" \ "Conf curl (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64])\n" \ end @@ -38,12 +38,12 @@ describe 'apt_package_security_updates fact' do describe 'on Ubuntu' do let(:apt_get_upgrade_output) do - "Inst tzdata [2016f-0ubuntu0.16.04] (2016j-0ubuntu0.16.04 Ubuntu:16.04/xenial-security, Ubuntu:16.04/xenial-updates [all])\n" \ - "Conf tzdata (2016j-0ubuntu0.16.04 Ubuntu:16.04/xenial-security, Ubuntu:16.04/xenial-updates [all])\n" \ - "Inst curl [7.47.0-1ubuntu2] (7.47.0-1ubuntu2.2 Ubuntu:16.04/xenial-security [amd64]) []\n" \ - "Conf curl (7.47.0-1ubuntu2.2 Ubuntu:16.04/xenial-security [amd64])\n" \ - "Inst procps [2:3.3.10-4ubuntu2] (2:3.3.10-4ubuntu2.3 Ubuntu:16.04/xenial-updates [amd64])\n" \ - "Conf procps (2:3.3.10-4ubuntu2.3 Ubuntu:16.04/xenial-updates [amd64])\n" + "Inst tzdata [2016f-0ubuntu0.18.04] (2016j-0ubuntu0.18.04 Ubuntu:18.04/xenial-security, Ubuntu:18.04/xenial-updates [all])\n" \ + "Conf tzdata (2016j-0ubuntu0.18.04 Ubuntu:18.04/xenial-security, Ubuntu:18.04/xenial-updates [all])\n" \ + "Inst curl [7.47.0-1ubuntu2] (7.47.0-1ubuntu2.2 Ubuntu:18.04/xenial-security [amd64]) []\n" \ + "Conf curl (7.47.0-1ubuntu2.2 Ubuntu:18.04/xenial-security [amd64])\n" \ + "Inst procps [2:3.3.10-4ubuntu2] (2:3.3.10-4ubuntu2.3 Ubuntu:18.04/xenial-updates [amd64])\n" \ + "Conf procps (2:3.3.10-4ubuntu2.3 Ubuntu:18.04/xenial-updates [amd64])\n" end it { is_expected.to eq(['tzdata', 'curl']) } diff --git a/spec/unit/facter/apt_package_updates_spec.rb b/spec/unit/facter/apt_package_updates_spec.rb index 267e2bf..d32339f 100644 --- a/spec/unit/facter/apt_package_updates_spec.rb +++ b/spec/unit/facter/apt_package_updates_spec.rb @@ -22,8 +22,8 @@ describe 'apt_package_updates fact' do allow(File).to receive(:executable?).with('/usr/bin/apt-get').and_return(true) apt_output = "Inst tzdata [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ "Conf tzdata (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ - "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ - "Conf unhide.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" + "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ + "Conf unhide.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n" allow(Facter::Util::Resolution).to receive(:exec).with('/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade 2>&1').and_return(apt_output) end it { is_expected.to eq(['tzdata', 'unhide.rb']) } diff --git a/spec/unit/facter/apt_security_updates_spec.rb b/spec/unit/facter/apt_security_updates_spec.rb index 8942120..4baeb81 100644 --- a/spec/unit/facter/apt_security_updates_spec.rb +++ b/spec/unit/facter/apt_security_updates_spec.rb @@ -27,8 +27,8 @@ describe 'apt_security_updates fact' do let(:apt_get_upgrade_output) do "Inst tzdata [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ "Conf tzdata (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ - "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ - "Conf unhide.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ + "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ + "Conf unhide.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ "Inst curl [7.52.1-5] (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64]) []\n" \ "Conf curl (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64])\n" \ end @@ -38,12 +38,12 @@ describe 'apt_security_updates fact' do describe 'on Ubuntu' do let(:apt_get_upgrade_output) do - "Inst tzdata [2016f-0ubuntu0.16.04] (2016j-0ubuntu0.16.04 Ubuntu:16.04/xenial-security, Ubuntu:16.04/xenial-updates [all])\n" \ - "Conf tzdata (2016j-0ubuntu0.16.04 Ubuntu:16.04/xenial-security, Ubuntu:16.04/xenial-updates [all])\n" \ - "Inst curl [7.47.0-1ubuntu2] (7.47.0-1ubuntu2.2 Ubuntu:16.04/xenial-security [amd64]) []\n" \ - "Conf curl (7.47.0-1ubuntu2.2 Ubuntu:16.04/xenial-security [amd64])\n" \ - "Inst procps [2:3.3.10-4ubuntu2] (2:3.3.10-4ubuntu2.3 Ubuntu:16.04/xenial-updates [amd64])\n" \ - "Conf procps (2:3.3.10-4ubuntu2.3 Ubuntu:16.04/xenial-updates [amd64])\n" + "Inst tzdata [2016f-0ubuntu0.18.04] (2016j-0ubuntu0.18.04 Ubuntu:18.04/xenial-security, Ubuntu:18.04/xenial-updates [all])\n" \ + "Conf tzdata (2016j-0ubuntu0.18.04 Ubuntu:18.04/xenial-security, Ubuntu:18.04/xenial-updates [all])\n" \ + "Inst curl [7.47.0-1ubuntu2] (7.47.0-1ubuntu2.2 Ubuntu:18.04/xenial-security [amd64]) []\n" \ + "Conf curl (7.47.0-1ubuntu2.2 Ubuntu:18.04/xenial-security [amd64])\n" \ + "Inst procps [2:3.3.10-4ubuntu2] (2:3.3.10-4ubuntu2.3 Ubuntu:18.04/xenial-updates [amd64])\n" \ + "Conf procps (2:3.3.10-4ubuntu2.3 Ubuntu:18.04/xenial-updates [amd64])\n" end it { is_expected.to eq(2) } diff --git a/spec/unit/facter/apt_updates_spec.rb b/spec/unit/facter/apt_updates_spec.rb index 5114104..280c6af 100644 --- a/spec/unit/facter/apt_updates_spec.rb +++ b/spec/unit/facter/apt_updates_spec.rb @@ -22,8 +22,8 @@ describe 'apt_updates fact' do allow(File).to receive(:executable?).with('/usr/bin/apt-get').and_return(true) apt_output = "Inst tzdata [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ "Conf tzdata (2015g-0+deb8u1 Debian:stable-updates [all])\n" \ - "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \ - "Conf unhide.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" + "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:-backports [all])\n" \ + "Conf unhide.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n" allow(Facter::Util::Resolution).to receive(:exec).with('/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade 2>&1').and_return(apt_output) end it { is_expected.to eq(2) } -- 2.32.3