1 require 'spec_helper_acceptance'
5 TIMEOUT_ERROR_MATCHER = %r{no valid OpenPGP data found}
7 everything_everything_pp = <<-MANIFEST
8 if $::lsbdistcodename == 'lucid' {
14 'location' => 'http://apt.puppetlabs.com',
17 'id' => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
18 'server' => 'hkps.pool.sks-keyservers.net',
25 'frequency' => 'always',
30 'sources.list' => true,
31 'sources.list.d' => true,
32 'preferences' => true,
33 'preferences.d' => true,
39 describe 'apt class' do
40 context 'with reset' do
41 it 'fixes the sources.list' do
42 shell('cp /etc/apt/sources.list /tmp')
46 context 'with all the things' do
47 it 'works with no errors' do
48 # Apply the manifest (Retry if timeout error is received from key pool)
49 retry_on_error_matching(MAX_TIMEOUT_RETRY, TIMEOUT_RETRY_WAIT, TIMEOUT_ERROR_MATCHER) do
50 apply_manifest(everything_everything_pp, catch_failures: true)
53 apply_manifest(everything_everything_pp, catch_failures: true)
56 shell('apt-get update')
57 shell('apt-get -y --force-yes upgrade')
61 context 'with reset' do
62 it 'fixes the sources.list' do
63 shell('cp /tmp/sources.list /etc/apt')