1 require 'spec_helper_acceptance'
3 if fact('operatingsystem') == 'Ubuntu'
8 shell('rm /etc/apt/sources.list.d/canonical-kernel-team-ppa-*', :acceptable_exit_codes => [0,1,2])
9 shell('rm /etc/apt/sources.list.d/raravena80-collectd5-*', :acceptable_exit_codes => [0,1,2])
13 context 'adding a ppa that doesnt exist' do
14 it 'should work with no errors' do
17 apt::ppa { 'ppa:canonical-kernel-team/ppa': }
20 apply_manifest(pp, :catch_failures => true)
23 describe 'contains the source file' do
24 it 'contains a kernel ppa source' do
25 shell('ls /etc/apt/sources.list.d/canonical-kernel-team-ppa-*', :acceptable_exit_codes => [0])
30 context 'readding a removed ppa.' do
32 shell('add-apt-repository -y ppa:raravena80/collectd5')
33 # This leaves a blank file
34 shell('add-apt-repository --remove ppa:raravena80/collectd5')
37 it 'should readd it successfully' do
40 apt::ppa { 'ppa:raravena80/collectd5': }
43 apply_manifest(pp, :catch_failures => true)
48 it 'removes added ppas' do
49 shell('rm /etc/apt/sources.list.d/canonical-kernel-team-ppa-*')
50 shell('rm /etc/apt/sources.list.d/raravena80-collectd5-*')
56 it 'works without failure' do
59 apt::ppa { 'ppa:canonical-kernel-team/ppa': ensure => present }
62 apply_manifest(pp, :catch_failures => true)
65 describe 'contains the source file' do
66 it 'contains a kernel ppa source' do
67 shell('ls /etc/apt/sources.list.d/canonical-kernel-team-ppa-*', :acceptable_exit_codes => [0])
75 it 'works without failure' do
78 apt::ppa { 'ppa:canonical-kernel-team/ppa': ensure => absent }
81 apply_manifest(pp, :catch_failures => true)
84 describe 'doesnt contain the source file' do
86 shell('ls /etc/apt/sources.list.d/canonical-kernel-team-ppa-*', :acceptable_exit_codes => [2])
94 it 'works without failure' do
97 apt::ppa { 'ppa:canonical-kernel-team/ppa':
103 shell('rm -rf /etc/apt/sources.list.d/canonical-kernel-team-ppa*', :acceptable_exit_codes => [0,1,2])
104 apply_manifest(pp, :catch_failures => true)
107 describe file('/etc/apt/sources.list.d/canonical-kernel-team-ppa-precise.list') do
108 it { should be_file }
115 it 'works without failure' do
118 apt::ppa { 'ppa:canonical-kernel-team/ppa':
125 shell('rm -rf /etc/apt/sources.list.d/canonical-kernel-team-ppa*', :acceptable_exit_codes => [0,1,2])
126 apply_manifest(pp, :catch_failures => true)
129 describe file('/etc/apt/sources.list.d/canonical-kernel-team-ppa-precise.list') do
130 it { should be_file }
136 it { shell('rm -rf /etc/apt/sources.list.d/canonical-kernel-team-ppa*', :acceptable_exit_codes => [0,1,2]) }