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 'apt included, no proxy' do
36 :lsbdistrelease => '14.04',
37 :lsbdistcodename => 'trusty',
38 :operatingsystem => 'Ubuntu',
39 :lsbdistid => 'Ubuntu',
40 :osfamily => 'Debian',
46 :package_manage => true,
49 let(:title) { 'ppa:foo' }
50 it { is_expected.to contain_package('software-properties-common') }
51 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
53 :command => '/usr/bin/add-apt-repository ppa:foo',
54 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
56 :logoutput => 'on_failure',
61 describe 'apt included, proxy host' do
64 proxy => { "host" => "localhost" },
69 :lsbdistrelease => '14.04',
70 :lsbdistcodename => 'trusty',
71 :operatingsystem => 'Ubuntu',
72 :lsbdistid => 'Ubuntu',
73 :osfamily => 'Debian',
79 'package_manage' => true,
82 let(:title) { 'ppa:foo' }
83 it { is_expected.to contain_package('software-properties-common') }
84 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
85 :environment => ['http_proxy=http://localhost:8080'],
86 :command => '/usr/bin/add-apt-repository ppa:foo',
87 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
89 :logoutput => 'on_failure',
94 describe 'apt included, proxy host and port' do
97 proxy => { "host" => "localhost", "port" => 8180 },
102 :lsbdistrelease => '14.04',
103 :lsbdistcodename => 'trusty',
104 :operatingsystem => 'Ubuntu',
105 :lsbdistid => 'Ubuntu',
106 :osfamily => 'Debian',
112 :package_manage => true,
115 let(:title) { 'ppa:foo' }
116 it { is_expected.to contain_package('software-properties-common') }
117 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
118 :environment => ['http_proxy=http://localhost:8180'],
119 :command => '/usr/bin/add-apt-repository ppa:foo',
120 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
122 :logoutput => 'on_failure',
127 describe 'apt included, proxy host and port and https' do
128 let :pre_condition do
130 proxy => { "host" => "localhost", "port" => 8180, "https" => true },
135 :lsbdistrelease => '14.04',
136 :lsbdistcodename => 'trusty',
137 :operatingsystem => 'Ubuntu',
138 :lsbdistid => 'Ubuntu',
139 :osfamily => 'Debian',
145 :package_manage => true,
148 let(:title) { 'ppa:foo' }
149 it { is_expected.to contain_package('software-properties-common') }
150 it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({
151 :environment => ['http_proxy=http://localhost:8180', 'https_proxy=https://localhost:8180'],
152 :command => '/usr/bin/add-apt-repository ppa:foo',
153 :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list',
155 :logoutput => 'on_failure',
160 describe 'ensure absent' do
161 let :pre_condition do
166 :lsbdistrelease => '14.04',
167 :lsbdistcodename => 'trusty',
168 :operatingsystem => 'Ubuntu',
169 :lsbdistid => 'Ubuntu',
170 :osfamily => 'Debian',
173 let(:title) { 'ppa:foo' }
179 it { is_expected.to contain_file('/etc/apt/sources.list.d/foo-trusty.list').that_notifies('Exec[apt_update]').with({
185 context 'validation' do
186 describe 'no release' do
189 :lsbdistrelease => '14.04',
190 :operatingsystem => 'Ubuntu',
191 :lsbdistid => 'Ubuntu',
192 :osfamily => 'Debian',
195 let(:title) { 'ppa:foo' }
198 is_expected.to compile
199 }.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
203 describe 'not ubuntu' do
206 :lsbdistrelease => '14.04',
207 :lsbdistcodename => 'trusty',
208 :operatingsystem => 'Debian',
209 :lsbdistid => 'Ubuntu',
210 :osfamily => 'Debian',
213 let(:title) { 'ppa:foo' }
216 is_expected.to compile
217 }.to raise_error(Puppet::Error, /supported on Ubuntu and LinuxMint only/)