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 'package_name => software-properties-common' do
42 :package_name => 'software-properties-common',
43 :package_manage => true,
48 :lsbdistrelease => '11.04',
49 :lsbdistcodename => 'natty',
50 :operatingsystem => 'Ubuntu',
51 :osfamily => 'Debian',
52 :lsbdistid => 'Ubuntu',
56 let(:title) { 'ppa:needs/such.substitution/wow' }
57 it { is_expected.to contain_package('software-properties-common') }
58 it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Exec[apt_update]').with({
60 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow',
61 'unless' => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list',
63 'logoutput' => 'on_failure',
67 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({
73 describe 'package_manage => false' do
79 :lsbdistrelease => '11.04',
80 :lsbdistcodename => 'natty',
81 :operatingsystem => 'Ubuntu',
82 :osfamily => 'Debian',
83 :lsbdistid => 'Ubuntu',
88 :package_manage => false,
92 let(:title) { 'ppa:needs/such.substitution/wow' }
93 it { is_expected.to_not contain_package('python-software-properties') }
94 it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Exec[apt_update]').with({
96 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow',
97 'unless' => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list',
99 'logoutput' => 'on_failure',
103 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({
109 describe 'apt included, no proxy' do
110 let :pre_condition do
112 apt::ppa { "ppa:foo2": }
117 :lsbdistrelease => '14.04',
118 :lsbdistcodename => 'trusty',
119 :operatingsystem => 'Ubuntu',
120 :lsbdistid => 'Ubuntu',
121 :osfamily => 'Debian',
127 :package_manage => true,
128 :require => 'Apt::Ppa[ppa:foo2]',
131 let(:title) { 'ppa:foo' }
132 it { is_expected.to compile.with_all_deps }
133 it { is_expected.to contain_package('software-properties-common') }
134 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
136 :command => '/usr/bin/add-apt-repository ppa:foo',
137 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
139 :logoutput => 'on_failure',
144 describe 'apt included, proxy host' do
145 let :pre_condition do
147 proxy => { "host" => "localhost" },
152 :lsbdistrelease => '14.04',
153 :lsbdistcodename => 'trusty',
154 :operatingsystem => 'Ubuntu',
155 :lsbdistid => 'Ubuntu',
156 :osfamily => 'Debian',
162 'package_manage' => true,
165 let(:title) { 'ppa:foo' }
166 it { is_expected.to contain_package('software-properties-common') }
167 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
168 :environment => ['http_proxy=http://localhost:8080'],
169 :command => '/usr/bin/add-apt-repository ppa:foo',
170 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
172 :logoutput => 'on_failure',
177 describe 'apt included, proxy host and port' do
178 let :pre_condition do
180 proxy => { "host" => "localhost", "port" => 8180 },
185 :lsbdistrelease => '14.04',
186 :lsbdistcodename => 'trusty',
187 :operatingsystem => 'Ubuntu',
188 :lsbdistid => 'Ubuntu',
189 :osfamily => 'Debian',
195 :package_manage => true,
198 let(:title) { 'ppa:foo' }
199 it { is_expected.to contain_package('software-properties-common') }
200 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
201 :environment => ['http_proxy=http://localhost:8180'],
202 :command => '/usr/bin/add-apt-repository ppa:foo',
203 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
205 :logoutput => 'on_failure',
210 describe 'apt included, proxy host and port and https' do
211 let :pre_condition do
213 proxy => { "host" => "localhost", "port" => 8180, "https" => true },
218 :lsbdistrelease => '14.04',
219 :lsbdistcodename => 'trusty',
220 :operatingsystem => 'Ubuntu',
221 :lsbdistid => 'Ubuntu',
222 :osfamily => 'Debian',
228 :package_manage => true,
231 let(:title) { 'ppa:foo' }
232 it { is_expected.to contain_package('software-properties-common') }
233 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
234 :environment => ['http_proxy=http://localhost:8180', 'https_proxy=https://localhost:8180'],
235 :command => '/usr/bin/add-apt-repository ppa:foo',
236 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
238 :logoutput => 'on_failure',
243 describe 'ensure absent' do
244 let :pre_condition do
249 :lsbdistrelease => '14.04',
250 :lsbdistcodename => 'trusty',
251 :operatingsystem => 'Ubuntu',
252 :lsbdistid => 'Ubuntu',
253 :osfamily => 'Debian',
256 let(:title) { 'ppa:foo' }
262 it { is_expected.to contain_file('/etc/apt/sources.list.d/foo-trusty.list').that_notifies('Exec[apt_update]').with({
268 context 'validation' do
269 describe 'no release' do
272 :lsbdistrelease => '14.04',
273 :operatingsystem => 'Ubuntu',
274 :lsbdistid => 'Ubuntu',
275 :osfamily => 'Debian',
276 :lsbdistcodeanme => nil,
279 let(:title) { 'ppa:foo' }
283 }.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
287 describe 'not ubuntu' do
290 :lsbdistrelease => '6.0.7',
291 :lsbdistcodename => 'wheezy',
292 :operatingsystem => 'Debian',
293 :lsbdistid => 'debian',
294 :osfamily => 'Debian',
297 let(:title) { 'ppa:foo' }
301 }.to raise_error(Puppet::Error, /not currently supported on Debian/)