1 require 'spec_helper_acceptance'
7 shell('rm /etc/apt/sources.list.d/canonical-kernel-team-ppa-*', :acceptable_exit_codes => [0,1,2])
8 shell('rm /etc/apt/sources.list.d/raravena80-collectd5-*', :acceptable_exit_codes => [0,1,2])
12 context 'adding a ppa that doesnt exist' do
13 it 'should work with no errors' do
16 apt::ppa { 'ppa:canonical-kernel-team/ppa': }
19 apply_manifest(pp, :catch_failures => true)
22 describe 'contains the source file' do
23 it 'contains a kernel ppa source' do
24 shell('ls /etc/apt/sources.list.d/canonical-kernel-team-ppa-*', :acceptable_exit_codes => [0])
29 context 'readding a removed ppa.' do
31 shell('add-apt-repository -y ppa:raravena80/collectd5')
32 # This leaves a blank file
33 shell('add-apt-repository --remove ppa:raravena80/collectd5')
36 it 'should readd it successfully' do
39 apt::ppa { 'ppa:raravena80/collectd5': }
42 apply_manifest(pp, :catch_failures => true)
47 it 'removes added ppas' do
48 shell('rm /etc/apt/sources.list.d/canonical-kernel-team-ppa-*')
49 shell('rm /etc/apt/sources.list.d/raravena80-collectd5-*')
55 it 'works without failure' do
58 apt::ppa { 'ppa:canonical-kernel-team/ppa': ensure => present }
61 apply_manifest(pp, :catch_failures => true)
64 describe 'contains the source file' do
65 it 'contains a kernel ppa source' do
66 shell('ls /etc/apt/sources.list.d/canonical-kernel-team-ppa-*', :acceptable_exit_codes => [0])
74 it 'works without failure' do
77 apt::ppa { 'ppa:canonical-kernel-team/ppa': ensure => absent }
80 apply_manifest(pp, :catch_failures => true)
83 describe 'doesnt contain the source file' do
85 shell('ls /etc/apt/sources.list.d/canonical-kernel-team-ppa-*', :acceptable_exit_codes => [2])
93 it 'works without failure' do
96 apt::ppa { 'ppa:canonical-kernel-team/ppa':
102 shell('rm -rf /etc/apt/sources.list.d/canonical-kernel-team-ppa*', :acceptable_exit_codes => [0,1,2])
103 apply_manifest(pp, :catch_failures => true)
106 describe file('/etc/apt/sources.list.d/canonical-kernel-team-ppa-precise.list') do
107 it { should be_file }
114 it 'works without failure' do
117 apt::ppa { 'ppa:canonical-kernel-team/ppa':
124 shell('rm -rf /etc/apt/sources.list.d/canonical-kernel-team-ppa*', :acceptable_exit_codes => [0,1,2])
125 apply_manifest(pp, :catch_failures => true)
128 describe file('/etc/apt/sources.list.d/canonical-kernel-team-ppa-precise.list') do
129 it { should be_file }
135 it { shell('rm -rf /etc/apt/sources.list.d/canonical-kernel-team-ppa*', :acceptable_exit_codes => [0,1,2]) }