1 require 'spec_helper_acceptance'
5 TIMEOUT_ERROR_MATCHER = %r{no valid OpenPGP data found}
7 describe 'apt class' do
9 it 'fixes the sources.list' do
10 shell('cp /etc/apt/sources.list /tmp')
14 context 'all the things' do
15 it 'works with no errors' do
17 if $::lsbdistcodename == 'lucid' {
23 'location' => 'http://apt.puppetlabs.com',
26 'id' => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
27 'server' => 'hkps.pool.sks-keyservers.net',
34 'frequency' => 'always',
39 'sources.list' => true,
40 'sources.list.d' => true,
41 'preferences' => true,
42 'preferences.d' => true,
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(pp, catch_failures: true)
53 apply_manifest(pp, catch_failures: true)
56 shell('apt-get update')
57 shell('apt-get -y --force-yes upgrade')
62 it 'fixes the sources.list' do
63 shell('cp /tmp/sources.list /etc/apt')