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 -s /etc/apt/sources.list.d/needs-such_substitution-wow_type-natty.list',
26 :logoutput => 'on_failure',
31 describe 'ppa depending on ppa, MODULES-1156' do
37 describe 'package_name => software-properties-common' do
43 :package_name => 'software-properties-common',
44 :package_manage => true,
49 :lsbdistrelease => '11.04',
50 :lsbdistcodename => 'natty',
51 :operatingsystem => 'Ubuntu',
52 :osfamily => 'Debian',
53 :lsbdistid => 'Ubuntu',
54 :puppetversion => Puppet.version,
58 let(:title) { 'ppa:needs/such.substitution/wow' }
59 it { is_expected.to contain_package('software-properties-common') }
60 it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with({
62 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow',
63 'unless' => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list',
65 'logoutput' => 'on_failure',
69 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({
75 describe 'package_manage => true, multiple ppas, MODULES-2873' do
78 apt::ppa {"ppa:user/foo":
79 package_manage => true
84 :lsbdistrelease => '11.04',
85 :lsbdistcodename => 'natty',
86 :operatingsystem => 'Ubuntu',
87 :osfamily => 'Debian',
88 :lsbdistid => 'Ubuntu',
89 :puppetversion => Puppet.version,
94 :package_manage => true,
98 let(:title) { 'ppa:user/bar' }
99 it { is_expected.to contain_package('python-software-properties') }
100 it { is_expected.to contain_exec('add-apt-repository-ppa:user/bar').that_notifies('Class[Apt::Update]').with({
102 'command' => '/usr/bin/add-apt-repository -y ppa:user/bar',
103 'unless' => '/usr/bin/test -s /etc/apt/sources.list.d/user-bar-natty.list',
105 'logoutput' => 'on_failure',
109 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({
115 describe 'package_manage => false' do
116 let :pre_condition do
121 :lsbdistrelease => '11.04',
122 :lsbdistcodename => 'natty',
123 :operatingsystem => 'Ubuntu',
124 :osfamily => 'Debian',
125 :lsbdistid => 'Ubuntu',
126 :puppetversion => Puppet.version,
131 :package_manage => false,
135 let(:title) { 'ppa:needs/such.substitution/wow' }
136 it { is_expected.to_not contain_package('python-software-properties') }
137 it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with({
139 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow',
140 'unless' => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list',
142 'logoutput' => 'on_failure',
146 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({
152 describe 'apt included, no proxy' do
153 let :pre_condition do
155 apt::ppa { "ppa:user/foo2": }
160 :lsbdistrelease => '14.04',
161 :lsbdistcodename => 'trusty',
162 :operatingsystem => 'Ubuntu',
163 :lsbdistid => 'Ubuntu',
164 :osfamily => 'Debian',
165 :puppetversion => Puppet.version,
171 :package_manage => true,
172 :require => 'Apt::Ppa[ppa:user/foo2]',
175 let(:title) { 'ppa:user/foo' }
176 it { is_expected.to compile.with_all_deps }
177 it { is_expected.to contain_package('software-properties-common') }
178 it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({
180 :command => '/usr/bin/add-apt-repository ppa:user/foo',
181 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/user-foo-trusty.list',
183 :logoutput => 'on_failure',
188 describe 'apt included, proxy host' do
189 let :pre_condition do
191 proxy => { "host" => "localhost" },
196 :lsbdistrelease => '14.04',
197 :lsbdistcodename => 'trusty',
198 :operatingsystem => 'Ubuntu',
199 :lsbdistid => 'Ubuntu',
200 :osfamily => 'Debian',
201 :puppetversion => Puppet.version,
207 'package_manage' => true,
210 let(:title) { 'ppa:user/foo' }
211 it { is_expected.to contain_package('software-properties-common') }
212 it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({
213 :environment => ['http_proxy=http://localhost:8080'],
214 :command => '/usr/bin/add-apt-repository ppa:user/foo',
215 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/user-foo-trusty.list',
217 :logoutput => 'on_failure',
222 describe 'apt included, proxy host and port' do
223 let :pre_condition do
225 proxy => { "host" => "localhost", "port" => 8180 },
230 :lsbdistrelease => '14.04',
231 :lsbdistcodename => 'trusty',
232 :operatingsystem => 'Ubuntu',
233 :lsbdistid => 'Ubuntu',
234 :osfamily => 'Debian',
235 :puppetversion => Puppet.version,
241 :package_manage => true,
244 let(:title) { 'ppa:user/foo' }
245 it { is_expected.to contain_package('software-properties-common') }
246 it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({
247 :environment => ['http_proxy=http://localhost:8180'],
248 :command => '/usr/bin/add-apt-repository ppa:user/foo',
249 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/user-foo-trusty.list',
251 :logoutput => 'on_failure',
256 describe 'apt included, proxy host and port and https' do
257 let :pre_condition do
259 proxy => { "host" => "localhost", "port" => 8180, "https" => true },
264 :lsbdistrelease => '14.04',
265 :lsbdistcodename => 'trusty',
266 :operatingsystem => 'Ubuntu',
267 :lsbdistid => 'Ubuntu',
268 :osfamily => 'Debian',
269 :puppetversion => Puppet.version,
275 :package_manage => true,
278 let(:title) { 'ppa:user/foo' }
279 it { is_expected.to contain_package('software-properties-common') }
280 it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({
281 :environment => ['http_proxy=http://localhost:8180', 'https_proxy=https://localhost:8180'],
282 :command => '/usr/bin/add-apt-repository ppa:user/foo',
283 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/user-foo-trusty.list',
285 :logoutput => 'on_failure',
290 describe 'ensure absent' do
291 let :pre_condition do
296 :lsbdistrelease => '14.04',
297 :lsbdistcodename => 'trusty',
298 :operatingsystem => 'Ubuntu',
299 :lsbdistid => 'Ubuntu',
300 :osfamily => 'Debian',
301 :puppetversion => Puppet.version,
304 let(:title) { 'ppa:user/foo' }
310 it { is_expected.to contain_file('/etc/apt/sources.list.d/user-foo-trusty.list').that_notifies('Class[Apt::Update]').with({
316 context 'validation' do
317 describe 'no release' do
320 :lsbdistrelease => '14.04',
321 :operatingsystem => 'Ubuntu',
322 :lsbdistid => 'Ubuntu',
323 :osfamily => 'Debian',
324 :lsbdistcodeanme => nil,
325 :puppetversion => Puppet.version,
328 let(:title) { 'ppa:user/foo' }
332 }.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
336 describe 'not ubuntu' do
339 :lsbdistrelease => '6.0.7',
340 :lsbdistcodename => 'wheezy',
341 :operatingsystem => 'Debian',
342 :lsbdistid => 'debian',
343 :osfamily => 'Debian',
344 :puppetversion => Puppet.version,
347 let(:title) { 'ppa:user/foo' }
351 }.to raise_error(Puppet::Error, /not currently supported on Debian/)