10 :lsbdistrelease => '11.04',
11 :lsbdistcodename => 'natty',
12 :operatingsystem => 'Ubuntu',
13 :osfamily => 'Debian',
14 :lsbdistid => 'Ubuntu',
18 let(:title) { 'ppa:needs/such.substitution/wow' }
19 it { is_expected.to_not contain_package('python-software-properties') }
20 it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Exec[apt_update]').with({
22 :command => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow',
23 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list',
25 :logoutput => 'on_failure',
30 describe 'ppa depending on ppa, MODULES-1156' do
36 describe 'apt included, no proxy' do
39 apt::ppa { "ppa:foo2": }
44 :lsbdistrelease => '14.04',
45 :lsbdistcodename => 'trusty',
46 :operatingsystem => 'Ubuntu',
47 :lsbdistid => 'Ubuntu',
48 :osfamily => 'Debian',
54 :package_manage => true,
55 :require => 'Apt::Ppa[ppa:foo2]',
58 let(:title) { 'ppa:foo' }
59 it { is_expected.to compile.with_all_deps }
60 it { is_expected.to contain_package('software-properties-common') }
61 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
63 :command => '/usr/bin/add-apt-repository ppa:foo',
64 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
66 :logoutput => 'on_failure',
71 describe 'apt included, proxy host' do
74 proxy => { "host" => "localhost" },
79 :lsbdistrelease => '14.04',
80 :lsbdistcodename => 'trusty',
81 :operatingsystem => 'Ubuntu',
82 :lsbdistid => 'Ubuntu',
83 :osfamily => 'Debian',
89 'package_manage' => true,
92 let(:title) { 'ppa:foo' }
93 it { is_expected.to contain_package('software-properties-common') }
94 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
95 :environment => ['http_proxy=http://localhost:8080'],
96 :command => '/usr/bin/add-apt-repository ppa:foo',
97 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
99 :logoutput => 'on_failure',
104 describe 'apt included, proxy host and port' do
105 let :pre_condition do
107 proxy => { "host" => "localhost", "port" => 8180 },
112 :lsbdistrelease => '14.04',
113 :lsbdistcodename => 'trusty',
114 :operatingsystem => 'Ubuntu',
115 :lsbdistid => 'Ubuntu',
116 :osfamily => 'Debian',
122 :package_manage => true,
125 let(:title) { 'ppa:foo' }
126 it { is_expected.to contain_package('software-properties-common') }
127 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
128 :environment => ['http_proxy=http://localhost:8180'],
129 :command => '/usr/bin/add-apt-repository ppa:foo',
130 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
132 :logoutput => 'on_failure',
137 describe 'apt included, proxy host and port and https' do
138 let :pre_condition do
140 proxy => { "host" => "localhost", "port" => 8180, "https" => true },
145 :lsbdistrelease => '14.04',
146 :lsbdistcodename => 'trusty',
147 :operatingsystem => 'Ubuntu',
148 :lsbdistid => 'Ubuntu',
149 :osfamily => 'Debian',
155 :package_manage => true,
158 let(:title) { 'ppa:foo' }
159 it { is_expected.to contain_package('software-properties-common') }
160 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
161 :environment => ['http_proxy=http://localhost:8180', 'https_proxy=https://localhost:8180'],
162 :command => '/usr/bin/add-apt-repository ppa:foo',
163 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
165 :logoutput => 'on_failure',
170 describe 'ensure absent' do
171 let :pre_condition do
176 :lsbdistrelease => '14.04',
177 :lsbdistcodename => 'trusty',
178 :operatingsystem => 'Ubuntu',
179 :lsbdistid => 'Ubuntu',
180 :osfamily => 'Debian',
183 let(:title) { 'ppa:foo' }
189 it { is_expected.to contain_file('/etc/apt/sources.list.d/foo-trusty.list').that_notifies('Exec[apt_update]').with({
195 context 'validation' do
196 describe 'no release' do
199 :lsbdistrelease => '14.04',
200 :operatingsystem => 'Ubuntu',
201 :lsbdistid => 'Ubuntu',
202 :osfamily => 'Debian',
203 :lsbdistcodeanme => nil,
206 let(:title) { 'ppa:foo' }
209 is_expected.to compile
210 }.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
214 describe 'not ubuntu' do
217 :lsbdistrelease => '6.0.7',
218 :lsbdistcodename => 'wheezy',
219 :operatingsystem => 'Debian',
220 :lsbdistid => 'debian',
221 :osfamily => 'Debian',
224 let(:title) { 'ppa:foo' }
227 is_expected.to compile
228 }.to raise_error(Puppet::Error, /supported on Ubuntu and LinuxMint only/)