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.rb48
1 files changed, 48 insertions, 0 deletions
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
{