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' }
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').that_notifies('Class[Apt::Update]').with({
23 :command => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow',
24 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow-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 => false' do
81 :lsbdistrelease => '11.04',
82 :lsbdistcodename => 'natty',
83 :operatingsystem => 'Ubuntu',
84 :osfamily => 'Debian',
85 :lsbdistid => 'Ubuntu',
86 :puppetversion => Puppet.version,
91 :package_manage => false,
95 let(:title) { 'ppa:needs/such.substitution/wow' }
96 it { is_expected.to_not contain_package('python-software-properties') }
97 it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with({
99 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow',
100 'unless' => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list',
102 'logoutput' => 'on_failure',
106 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({
112 describe 'apt included, no proxy' do
113 let :pre_condition do
115 apt::ppa { "ppa:foo2": }
120 :lsbdistrelease => '14.04',
121 :lsbdistcodename => 'trusty',
122 :operatingsystem => 'Ubuntu',
123 :lsbdistid => 'Ubuntu',
124 :osfamily => 'Debian',
125 :puppetversion => Puppet.version,
131 :package_manage => true,
132 :require => 'Apt::Ppa[ppa:foo2]',
135 let(:title) { 'ppa:foo' }
136 it { is_expected.to compile.with_all_deps }
137 it { is_expected.to contain_package('software-properties-common') }
138 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Class[Apt::Update]').with({
140 :command => '/usr/bin/add-apt-repository ppa:foo',
141 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
143 :logoutput => 'on_failure',
148 describe 'apt included, proxy host' do
149 let :pre_condition do
151 proxy => { "host" => "localhost" },
156 :lsbdistrelease => '14.04',
157 :lsbdistcodename => 'trusty',
158 :operatingsystem => 'Ubuntu',
159 :lsbdistid => 'Ubuntu',
160 :osfamily => 'Debian',
161 :puppetversion => Puppet.version,
167 'package_manage' => true,
170 let(:title) { 'ppa:foo' }
171 it { is_expected.to contain_package('software-properties-common') }
172 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Class[Apt::Update]').with({
173 :environment => ['http_proxy=http://localhost:8080'],
174 :command => '/usr/bin/add-apt-repository ppa:foo',
175 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
177 :logoutput => 'on_failure',
182 describe 'apt included, proxy host and port' do
183 let :pre_condition do
185 proxy => { "host" => "localhost", "port" => 8180 },
190 :lsbdistrelease => '14.04',
191 :lsbdistcodename => 'trusty',
192 :operatingsystem => 'Ubuntu',
193 :lsbdistid => 'Ubuntu',
194 :osfamily => 'Debian',
195 :puppetversion => Puppet.version,
201 :package_manage => true,
204 let(:title) { 'ppa:foo' }
205 it { is_expected.to contain_package('software-properties-common') }
206 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Class[Apt::Update]').with({
207 :environment => ['http_proxy=http://localhost:8180'],
208 :command => '/usr/bin/add-apt-repository ppa:foo',
209 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
211 :logoutput => 'on_failure',
216 describe 'apt included, proxy host and port and https' do
217 let :pre_condition do
219 proxy => { "host" => "localhost", "port" => 8180, "https" => true },
224 :lsbdistrelease => '14.04',
225 :lsbdistcodename => 'trusty',
226 :operatingsystem => 'Ubuntu',
227 :lsbdistid => 'Ubuntu',
228 :osfamily => 'Debian',
229 :puppetversion => Puppet.version,
235 :package_manage => true,
238 let(:title) { 'ppa:foo' }
239 it { is_expected.to contain_package('software-properties-common') }
240 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Class[Apt::Update]').with({
241 :environment => ['http_proxy=http://localhost:8180', 'https_proxy=https://localhost:8180'],
242 :command => '/usr/bin/add-apt-repository ppa:foo',
243 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
245 :logoutput => 'on_failure',
250 describe 'ensure absent' do
251 let :pre_condition do
256 :lsbdistrelease => '14.04',
257 :lsbdistcodename => 'trusty',
258 :operatingsystem => 'Ubuntu',
259 :lsbdistid => 'Ubuntu',
260 :osfamily => 'Debian',
261 :puppetversion => Puppet.version,
264 let(:title) { 'ppa:foo' }
270 it { is_expected.to contain_file('/etc/apt/sources.list.d/foo-trusty.list').that_notifies('Class[Apt::Update]').with({
276 context 'validation' do
277 describe 'no release' do
280 :lsbdistrelease => '14.04',
281 :operatingsystem => 'Ubuntu',
282 :lsbdistid => 'Ubuntu',
283 :osfamily => 'Debian',
284 :lsbdistcodeanme => nil,
285 :puppetversion => Puppet.version,
288 let(:title) { 'ppa:foo' }
292 }.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
296 describe 'not ubuntu' do
299 :lsbdistrelease => '6.0.7',
300 :lsbdistcodename => 'wheezy',
301 :operatingsystem => 'Debian',
302 :lsbdistid => 'debian',
303 :osfamily => 'Debian',
304 :puppetversion => Puppet.version,
307 let(:title) { 'ppa:foo' }
311 }.to raise_error(Puppet::Error, /not currently supported on Debian/)