summaryrefslogtreecommitdiff
path: root/spec/classes/unattended_upgrades_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/classes/unattended_upgrades_spec.rb')
-rw-r--r--spec/classes/unattended_upgrades_spec.rb53
1 files changed, 49 insertions, 4 deletions
diff --git a/spec/classes/unattended_upgrades_spec.rb b/spec/classes/unattended_upgrades_spec.rb
index c3b9673..d927a55 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
@@ -274,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
@@ -282,7 +282,6 @@ describe 'unattended_upgrades' do
osfamily: 'Debian',
lsbdistid: 'Ubuntu',
lsbdistcodename: 'wily',
- lsbrelease: '15.10',
lsbdistrelease: '15.10'
}
end
@@ -300,6 +299,52 @@ 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',
+ 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',
+ 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
{