From 0d2b73da1a528daed34b9bff1f120145da5799fd Mon Sep 17 00:00:00 2001 From: Raoul Bhatia Date: Wed, 9 Sep 2015 22:52:04 +0200 Subject: Enhance and bugfix tests for Ubuntu Vivid & Wily --- spec/classes/unattended_upgrades_spec.rb | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'spec') diff --git a/spec/classes/unattended_upgrades_spec.rb b/spec/classes/unattended_upgrades_spec.rb index d47ad06..72291d5 100644 --- a/spec/classes/unattended_upgrades_spec.rb +++ b/spec/classes/unattended_upgrades_spec.rb @@ -195,6 +195,46 @@ describe 'unattended_upgrades' do )} end + context 'with defaults on Ubuntu 15.04 Vivid Vervet' do + let(:facts) { { + :osfamily => 'Debian', + :lsbdistid => 'Ubuntu', + :lsbdistcodename => 'vivid', + :lsbrelease => '15.04', + } } + it { + 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 + + context 'with defaults on Ubuntu 15.10 Wily Werewolf' do + let(:facts) { { + :osfamily => 'Debian', + :lsbdistid => 'Ubuntu', + :lsbdistcodename => 'wily', + :lsbrelease => '15.10', + } } + it { + 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 + context 'with defaults on Raspbian' do let(:facts) { { :osfamily => 'Debian', -- cgit v1.2.3