1 require 'spec_helper_acceptance'
5 TIMEOUT_ERROR_MATCHER = /no valid OpenPGP data found/
7 describe 'apt class' do
10 it 'fixes the sources.list' do
11 shell('cp /etc/apt/sources.list /tmp')
15 context 'all the things' do
16 it 'should work with no errors' do
18 if $::lsbdistcodename == 'lucid' {
24 'location' => 'http://apt.puppetlabs.com',
27 'id' => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
28 'server' => 'hkps.pool.sks-keyservers.net',
35 'frequency' => 'always',
40 'sources.list' => true,
41 'sources.list.d' => true,
42 'preferences' => true,
43 'preferences.d' => true,
49 #Apply the manifest (Retry if timeout error is received from key pool)
50 retry_on_error_matching(MAX_TIMEOUT_RETRY, TIMEOUT_RETRY_WAIT, TIMEOUT_ERROR_MATCHER) do
51 apply_manifest(pp, :catch_failures => true)
54 apply_manifest(pp, :catch_failures => true)
56 it 'should still work' do
57 shell('apt-get update')
58 shell('apt-get -y --force-yes upgrade')
63 it 'fixes the sources.list' do
64 shell('cp /tmp/sources.list /etc/apt')