summaryrefslogtreecommitdiff
path: root/spec/classes/unattended_upgrades_spec.rb
blob: d53f7d59eda4b64bd2f1380c38041d07abece1b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'spec_helper'

describe 'unattended_upgrades' do
  let(:file_unattended) { '/etc/apt/apt.conf.d/50unattended-upgrades' }
  let(:file_periodic) { '/etc/apt/apt.conf.d/10periodic' }
  let(:facts) { {
    :osfamily => 'Debian',
    :lsbdistid => 'Debian',
    :lsbistcodename => 'wheezy',
    :lsbrelease => '7.0.3',
  } }

  it { should contain_package("unattended-upgrades") }

  it { should contain_apt__conf('unattended-upgrades').with({
      "require" => "Package[unattended-upgrades]",
  })
  }

  it { should contain_apt__conf('periodic').with({
      "require" => "Package[unattended-upgrades]",
  })
  }

  it {
    should create_file(file_unattended).with({
      "owner"   => "root",
      "group"   => "root",
      "mode"    => "0644",
    })
  }

  it {
    should create_file(file_periodic).with({
      "owner"   => "root",
      "group"   => "root",
      "mode"    => "0644",
    })
  }
end