10 :lsbdistrelease => '11.04',
11 :lsbdistcodename => 'natty',
12 :operatingsystem => 'Ubuntu',
13 :osfamily => 'Debian',
14 :lsbdistid => 'Ubuntu',
15 :puppetversion => Puppet.version,
19 let(:title) { 'ppa:needs/such.substitution/wow+type' }
20 it { is_expected.to_not contain_package('python-software-properties') }
21 it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow+type').that_notifies('Class[Apt::Update]').with({
23 :command => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow+type',
24 :unless => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow_type-natty.list',
26 :logoutput => 'on_failure',
31 describe 'Ubuntu 15.10 sources.list filename' do
34 :lsbdistrelease => '15.10',
35 :lsbdistcodename => 'wily',
36 :operatingsystem => 'Ubuntu',
37 :osfamily => 'Debian',
38 :lsbdistid => 'Ubuntu',
39 :puppetversion => Puppet.version,
43 let(:title) { 'ppa:user/foo' }
44 it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({
46 :command => '/usr/bin/add-apt-repository -y ppa:user/foo',
47 :unless => '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-wily.list',
49 :logoutput => 'on_failure',
54 describe 'ppa depending on ppa, MODULES-1156' do
60 describe 'package_name => software-properties-common' do
66 :package_name => 'software-properties-common',
67 :package_manage => true,
72 :lsbdistrelease => '11.04',
73 :lsbdistcodename => 'natty',
74 :operatingsystem => 'Ubuntu',
75 :osfamily => 'Debian',
76 :lsbdistid => 'Ubuntu',
77 :puppetversion => Puppet.version,
81 let(:title) { 'ppa:needs/such.substitution/wow' }
82 it { is_expected.to contain_package('software-properties-common') }
83 it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with({
85 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow',
86 'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list',
88 'logoutput' => 'on_failure',
92 it { is_expected.to contain_file('/etc/apt/sources.list.d/needs-such_substitution-wow-natty.list').that_requires('Exec[add-apt-repository-ppa:needs/such.substitution/wow]').with({
98 describe 'package_manage => true, multiple ppas, MODULES-2873' do
101 apt::ppa {"ppa:user/foo":
102 package_manage => true
107 :lsbdistrelease => '11.04',
108 :lsbdistcodename => 'natty',
109 :operatingsystem => 'Ubuntu',
110 :osfamily => 'Debian',
111 :lsbdistid => 'Ubuntu',
112 :puppetversion => Puppet.version,
117 :package_manage => true,
121 let(:title) { 'ppa:user/bar' }
122 it { is_expected.to contain_package('python-software-properties') }
123 it { is_expected.to contain_exec('add-apt-repository-ppa:user/bar').that_notifies('Class[Apt::Update]').with({
125 'command' => '/usr/bin/add-apt-repository -y ppa:user/bar',
126 'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/user-bar-natty.list',
128 'logoutput' => 'on_failure',
132 it { is_expected.to contain_file('/etc/apt/sources.list.d/user-bar-natty.list').that_requires('Exec[add-apt-repository-ppa:user/bar]').with({
138 describe 'package_manage => false' do
139 let :pre_condition do
144 :lsbdistrelease => '11.04',
145 :lsbdistcodename => 'natty',
146 :operatingsystem => 'Ubuntu',
147 :osfamily => 'Debian',
148 :lsbdistid => 'Ubuntu',
149 :puppetversion => Puppet.version,
154 :package_manage => false,
158 let(:title) { 'ppa:needs/such.substitution/wow' }
159 it { is_expected.to_not contain_package('python-software-properties') }
160 it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with({
162 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow',
163 'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list',
165 'logoutput' => 'on_failure',
169 it { is_expected.to contain_file('/etc/apt/sources.list.d/needs-such_substitution-wow-natty.list').that_requires('Exec[add-apt-repository-ppa:needs/such.substitution/wow]').with({
175 describe 'apt included, no proxy' do
176 let :pre_condition do
178 apt::ppa { "ppa:user/foo2": }
183 :lsbdistrelease => '14.04',
184 :lsbdistcodename => 'trusty',
185 :operatingsystem => 'Ubuntu',
186 :lsbdistid => 'Ubuntu',
187 :osfamily => 'Debian',
188 :puppetversion => Puppet.version,
194 :package_manage => true,
195 :require => 'Apt::Ppa[ppa:user/foo2]',
198 let(:title) { 'ppa:user/foo' }
199 it { is_expected.to compile.with_all_deps }
200 it { is_expected.to contain_package('software-properties-common') }
201 it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({
203 :command => '/usr/bin/add-apt-repository ppa:user/foo',
204 :unless => '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
206 :logoutput => 'on_failure',
211 describe 'apt included, proxy host' do
212 let :pre_condition do
214 proxy => { "host" => "localhost" },
219 :lsbdistrelease => '14.04',
220 :lsbdistcodename => 'trusty',
221 :operatingsystem => 'Ubuntu',
222 :lsbdistid => 'Ubuntu',
223 :osfamily => 'Debian',
224 :puppetversion => Puppet.version,
230 'package_manage' => true,
233 let(:title) { 'ppa:user/foo' }
234 it { is_expected.to contain_package('software-properties-common') }
235 it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({
236 :environment => ['http_proxy=http://localhost:8080'],
237 :command => '/usr/bin/add-apt-repository ppa:user/foo',
238 :unless => '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
240 :logoutput => 'on_failure',
245 describe 'apt included, proxy host and port' do
246 let :pre_condition do
248 proxy => { "host" => "localhost", "port" => 8180 },
253 :lsbdistrelease => '14.04',
254 :lsbdistcodename => 'trusty',
255 :operatingsystem => 'Ubuntu',
256 :lsbdistid => 'Ubuntu',
257 :osfamily => 'Debian',
258 :puppetversion => Puppet.version,
264 :package_manage => true,
267 let(:title) { 'ppa:user/foo' }
268 it { is_expected.to contain_package('software-properties-common') }
269 it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({
270 :environment => ['http_proxy=http://localhost:8180'],
271 :command => '/usr/bin/add-apt-repository ppa:user/foo',
272 :unless => '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
274 :logoutput => 'on_failure',
279 describe 'apt included, proxy host and port and https' do
280 let :pre_condition do
282 proxy => { "host" => "localhost", "port" => 8180, "https" => true },
287 :lsbdistrelease => '14.04',
288 :lsbdistcodename => 'trusty',
289 :operatingsystem => 'Ubuntu',
290 :lsbdistid => 'Ubuntu',
291 :osfamily => 'Debian',
292 :puppetversion => Puppet.version,
298 :package_manage => true,
301 let(:title) { 'ppa:user/foo' }
302 it { is_expected.to contain_package('software-properties-common') }
303 it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({
304 :environment => ['http_proxy=http://localhost:8180', 'https_proxy=https://localhost:8180'],
305 :command => '/usr/bin/add-apt-repository ppa:user/foo',
306 :unless => '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
308 :logoutput => 'on_failure',
313 describe 'ensure absent' do
314 let :pre_condition do
319 :lsbdistrelease => '14.04',
320 :lsbdistcodename => 'trusty',
321 :operatingsystem => 'Ubuntu',
322 :lsbdistid => 'Ubuntu',
323 :osfamily => 'Debian',
324 :puppetversion => Puppet.version,
327 let(:title) { 'ppa:user/foo' }
333 it { is_expected.to contain_file('/etc/apt/sources.list.d/user-foo-trusty.list').that_notifies('Class[Apt::Update]').with({
339 context 'validation' do
340 describe 'no release' do
343 :lsbdistrelease => '14.04',
344 :operatingsystem => 'Ubuntu',
345 :lsbdistid => 'Ubuntu',
346 :osfamily => 'Debian',
347 :lsbdistcodeanme => nil,
348 :puppetversion => Puppet.version,
351 let(:title) { 'ppa:user/foo' }
355 }.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
359 describe 'not ubuntu' do
362 :lsbdistrelease => '6.0.7',
363 :lsbdistcodename => 'wheezy',
364 :operatingsystem => 'Debian',
365 :lsbdistid => 'debian',
366 :osfamily => 'Debian',
367 :puppetversion => Puppet.version,
370 let(:title) { 'ppa:user/foo' }
374 }.to raise_error(Puppet::Error, /not currently supported on Debian/)