From 2835cfbc652e37f8daccc36282cfbd5f34cad918 Mon Sep 17 00:00:00 2001 From: Raoul Bhatia Date: Sat, 28 May 2016 16:41:01 +0200 Subject: Ubuntu: Add 16.04 Xenial Xerus and 16.10 Yakkety Yak. --- spec/classes/unattended_upgrades_spec.rb | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'spec') diff --git a/spec/classes/unattended_upgrades_spec.rb b/spec/classes/unattended_upgrades_spec.rb index c3b9673..ecbce37 100644 --- a/spec/classes/unattended_upgrades_spec.rb +++ b/spec/classes/unattended_upgrades_spec.rb @@ -300,6 +300,54 @@ describe 'unattended_upgrades' do end end + context 'with defaults on Ubuntu 16.04 Xenial Xerus' do + let(:facts) do + { + osfamily: 'Debian', + lsbdistid: 'Ubuntu', + lsbdistcodename: 'xenial', + lsbrelease: '16.04', + lsbdistrelease: '16.04' + } + end + it do + should create_file(file_unattended).with( + owner: 'root', + group: 'root', + mode: '0644' + ).with_content( + # This is the only section that's different for Ubuntu compared to Debian + /\Unattended-Upgrade::Allowed-Origins\ {\n + \t"\${distro_id}\:\${distro_codename}-security";\n + };/x + ) + end + end + + context 'with defaults on Ubuntu 16.10 Yakkety Yak' do + let(:facts) do + { + osfamily: 'Debian', + lsbdistid: 'Ubuntu', + lsbdistcodename: 'yakkety', + lsbrelease: '16.10', + lsbdistrelease: '16.10' + } + end + it do + should create_file(file_unattended).with( + owner: 'root', + group: 'root', + mode: '0644' + ).with_content( + # This is the only section that's different for Ubuntu compared to Debian + /\Unattended-Upgrade::Allowed-Origins\ {\n + \t"\${distro_id}\:\${distro_codename}-security";\n + };/x + ) + end + end + context 'with defaults on Raspbian' do let(:facts) do { -- cgit v1.2.3 From cf722ccf9077066a35ab05e5e2f1d9c8302dce16 Mon Sep 17 00:00:00 2001 From: Raoul Bhatia Date: Sat, 28 May 2016 16:55:29 +0200 Subject: =?UTF-8?q?lsbrelease:=20This=20legacy=20fact=20is=20hidden=20by?= =?UTF-8?q?=20default=20in=20Facter=E2=80=99s=20command-line=20output.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://docs.puppet.com/facter/latest/core_facts.html#lsbrelease --- spec/classes/unattended_upgrades_spec.rb | 6 ------ 1 file changed, 6 deletions(-) (limited to 'spec') diff --git a/spec/classes/unattended_upgrades_spec.rb b/spec/classes/unattended_upgrades_spec.rb index ecbce37..e0b2263 100644 --- a/spec/classes/unattended_upgrades_spec.rb +++ b/spec/classes/unattended_upgrades_spec.rb @@ -210,7 +210,6 @@ describe 'unattended_upgrades' do osfamily: 'Debian', lsbdistid: 'Ubuntu', lsbdistcodename: 'precise', - lsbrelease: '12.04', lsbdistrelease: '12.04' } end @@ -234,7 +233,6 @@ describe 'unattended_upgrades' do osfamily: 'Debian', lsbdistid: 'Ubuntu', lsbdistcodename: 'trusty', - lsbrelease: '14.04', lsbdistrelease: '14.04' } end @@ -258,7 +256,6 @@ describe 'unattended_upgrades' do osfamily: 'Debian', lsbdistid: 'Ubuntu', lsbdistcodename: 'vivid', - lsbrelease: '15.04', lsbdistrelease: '15.04' } end @@ -282,7 +279,6 @@ describe 'unattended_upgrades' do osfamily: 'Debian', lsbdistid: 'Ubuntu', lsbdistcodename: 'wily', - lsbrelease: '15.10', lsbdistrelease: '15.10' } end @@ -306,7 +302,6 @@ describe 'unattended_upgrades' do osfamily: 'Debian', lsbdistid: 'Ubuntu', lsbdistcodename: 'xenial', - lsbrelease: '16.04', lsbdistrelease: '16.04' } end @@ -330,7 +325,6 @@ describe 'unattended_upgrades' do osfamily: 'Debian', lsbdistid: 'Ubuntu', lsbdistcodename: 'yakkety', - lsbrelease: '16.10', lsbdistrelease: '16.10' } end -- cgit v1.2.3 From 33fabe02547a8c4b15278fe8636d83fe1354f4ae Mon Sep 17 00:00:00 2001 From: Raoul Bhatia Date: Sat, 28 May 2016 17:01:25 +0200 Subject: Ubuntu: Issue EOL warning for unsupported release. --- spec/classes/unattended_upgrades_spec.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'spec') diff --git a/spec/classes/unattended_upgrades_spec.rb b/spec/classes/unattended_upgrades_spec.rb index e0b2263..d927a55 100644 --- a/spec/classes/unattended_upgrades_spec.rb +++ b/spec/classes/unattended_upgrades_spec.rb @@ -271,6 +271,9 @@ describe 'unattended_upgrades' do };/x ) end + # TODO: implement test case for "warning", similar to + # w = 'Ubuntu 15.04 "vivid" has reached End of Life - please upgrade!' + # it_behaves_like 'has_warning', pp, w end context 'with defaults on Ubuntu 15.10 Wily Werewolf' do -- cgit v1.2.3