3 describe 'opendaylight' do
4 # All tests that check OS support/not-support
5 describe 'OS support tests' do
6 # All tests for OSs in the Red Hat family (CentOS, Fedora)
7 describe 'OS family Red Hat ' do
11 operatingsystem = 'Fedora'
13 # All tests for supported versions of Fedora
14 ['20', '21'].each do |operatingsystemmajrelease|
15 context "#{operatingsystemmajrelease}" do
17 :osfamily => osfamily,
18 :operatingsystem => operatingsystem,
19 :operatingsystemmajrelease => operatingsystemmajrelease,
21 # Run shared tests applicable to all supported OSs
22 # Note that this function is defined in spec_helper
25 # Run test that specialize in checking rpm-based installs
26 # NB: Only testing defaults here, specialized rpm tests elsewhere
27 # Note that this function is defined in spec_helper
28 rpm_install_tests(operatingsystem: operatingsystem)
30 # Run test that specialize in checking Karaf feature installs
31 # NB: Only testing defaults here, specialized Karaf tests elsewhere
32 # Note that this function is defined in spec_helper
37 # All tests for unsupported versions of Fedora
38 ['18', '19', '22'].each do |operatingsystemmajrelease|
39 context "#{operatingsystemmajrelease}" do
41 :osfamily => osfamily,
42 :operatingsystem => operatingsystem,
43 :operatingsystemmajrelease => operatingsystemmajrelease,
45 # Run shared tests applicable to all unsupported OSs
46 # Note that this function is defined in spec_helper
47 expected_msg = "Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}"
48 unsupported_os_tests(expected_msg: expected_msg)
53 # All tests for CentOS
55 operatingsystem = 'CentOS'
57 # All tests for supported versions of CentOS
58 ['7'].each do |operatingsystemmajrelease|
59 context "#{operatingsystemmajrelease}" do
61 :osfamily => osfamily,
62 :operatingsystem => operatingsystem,
63 :operatingsystemmajrelease => operatingsystemmajrelease,
65 # Run shared tests applicable to all supported OSs
66 # Note that this function is defined in spec_helper
69 # Run test that specialize in checking rpm-based installs
70 # NB: Only testing defaults here, specialized rpm tests elsewhere
71 # Note that this function is defined in spec_helper
74 # Run test that specialize in checking Karaf feature installs
75 # NB: Only testing defaults here, specialized Karaf tests elsewhere
76 # Note that this function is defined in spec_helper
81 # All tests for unsupported versions of CentOS
82 ['5', '6', '8'].each do |operatingsystemmajrelease|
83 context "#{operatingsystemmajrelease}" do
85 :osfamily => osfamily,
86 :operatingsystem => operatingsystem,
87 :operatingsystemmajrelease => operatingsystemmajrelease,
89 # Run shared tests applicable to all unsupported OSs
90 # Note that this function is defined in spec_helper
91 expected_msg = "Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}"
92 unsupported_os_tests(expected_msg: expected_msg)
98 # All tests for OSs in the Debian family (Ubuntu)
99 describe 'OS family Debian' do
102 # All tests for Ubuntu 14.04
104 operatingsystem = 'Ubuntu'
106 # All tests for supported versions of Ubuntu
107 ['14.04'].each do |operatingsystemmajrelease|
108 context "#{operatingsystemmajrelease}" do
110 :osfamily => osfamily,
111 :operatingsystem => operatingsystem,
112 :operatingsystemmajrelease => operatingsystemmajrelease,
113 # TODO: Do more elegantly. Java mod uses codenames to ID version.
114 :lsbdistcodename => 'trusty',
115 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
118 # NB: Only tarball installs are supported for Debian family OSs
120 :install_method => 'tarball',
123 # Run shared tests applicable to all supported OSs
124 # Note that this function is defined in spec_helper
127 # Run test that specialize in checking tarball-based installs
128 # NB: Only testing defaults here, specialized tarball tests elsewhere
129 # Passing osfamily required to do upstart vs systemd (default) checks
130 # Note that this function is defined in spec_helper
131 tarball_install_tests(osfamily: osfamily)
133 # Run test that specialize in checking Karaf feature installs
134 # NB: Only testing defaults here, specialized Karaf tests elsewhere
135 # Note that this function is defined in spec_helper
140 # All tests for unsupported versions of Ubuntu
141 ['12.04', '12.10', '13.04', '13.10', '14.10', '15.04'].each do |operatingsystemmajrelease|
142 context "#{operatingsystemmajrelease}" do
144 :osfamily => osfamily,
145 :operatingsystem => operatingsystem,
146 :operatingsystemmajrelease => operatingsystemmajrelease,
148 # Run shared tests applicable to all unsupported OSs
149 # Note that this function is defined in spec_helper
150 expected_msg = "Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}"
151 unsupported_os_tests(expected_msg: expected_msg)
157 # All tests for unsupported OS families
158 ['Suse', 'Solaris'].each do |osfamily|
159 context "OS family #{osfamily}" do
161 :osfamily => osfamily,
164 # Run shared tests applicable to all unsupported OSs
165 # Note that this function is defined in spec_helper
166 expected_msg = "Unsupported OS family: #{osfamily}"
167 unsupported_os_tests(expected_msg: expected_msg)
172 # All Karaf feature tests
173 describe 'Karaf feature tests' do
174 # Non-OS-type tests assume CentOS 7
175 # See issue #43 for reasoning:
176 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
178 operatingsystem = 'CentOS'
179 operatingsystemmajrelease = '7'
180 describe 'using default features' do
181 context 'and not passing extra features' do
183 :osfamily => osfamily,
184 :operatingsystem => operatingsystem,
185 :operatingsystemmajrelease => operatingsystemmajrelease,
190 # Run shared tests applicable to all supported OSs
191 # Note that this function is defined in spec_helper
194 # Run test that specialize in checking Karaf feature installs
195 # Note that this function is defined in spec_helper
199 context 'and passing extra features' do
201 :osfamily => osfamily,
202 :operatingsystem => operatingsystem,
203 :operatingsystemmajrelease => operatingsystemmajrelease,
206 # These are real but arbitrarily chosen features
207 extra_features = ['odl-base-all', 'odl-ovsdb-all']
209 :extra_features => extra_features,
212 # Run shared tests applicable to all supported OSs
213 # Note that this function is defined in spec_helper
216 # Run test that specialize in checking Karaf feature installs
217 # Note that this function is defined in spec_helper
218 karaf_feature_tests(extra_features: extra_features)
222 describe 'overriding default features' do
223 default_features = ['standard', 'ssh']
224 context 'and not passing extra features' do
226 :osfamily => osfamily,
227 :operatingsystem => operatingsystem,
228 :operatingsystemmajrelease => operatingsystemmajrelease,
232 :default_features => default_features,
235 # Run shared tests applicable to all supported OSs
236 # Note that this function is defined in spec_helper
239 # Run test that specialize in checking Karaf feature installs
240 # Note that this function is defined in spec_helper
241 karaf_feature_tests(default_features: default_features)
244 context 'and passing extra features' do
246 :osfamily => osfamily,
247 :operatingsystem => operatingsystem,
248 :operatingsystemmajrelease => operatingsystemmajrelease,
251 # These are real but arbitrarily chosen features
252 extra_features = ['odl-base-all', 'odl-ovsdb-all']
254 :default_features => default_features,
255 :extra_features => extra_features,
258 # Run shared tests applicable to all supported OSs
259 # Note that this function is defined in spec_helper
262 # Run test that specialize in checking Karaf feature installs
263 # Note that this function is defined in spec_helper
264 karaf_feature_tests(default_features: default_features, extra_features: extra_features)
269 # All install method tests
270 describe 'install method tests' do
271 # Non-OS-type tests assume CentOS 7
272 # See issue #43 for reasoning:
273 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
275 operatingsystem = 'CentOS'
276 operatingsystemrelease = '7.0'
277 operatingsystemmajrelease = '7'
279 # All tests for RPM install method
282 :osfamily => osfamily,
283 :operatingsystem => operatingsystem,
284 :operatingsystemmajrelease => operatingsystemmajrelease,
288 :install_method => 'rpm',
291 # Run shared tests applicable to all supported OSs
292 # Note that this function is defined in spec_helper
295 # Run test that specialize in checking RPM-based installs
296 # Note that this function is defined in spec_helper
300 # All tests for tarball install method
301 describe 'tarball' do
302 describe 'using default tarball_url' do
303 context 'using default unitfile_url' do
305 :osfamily => osfamily,
306 :operatingsystem => operatingsystem,
307 :operatingsystemrelease => operatingsystemrelease,
308 :operatingsystemmajrelease => operatingsystemmajrelease,
309 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
313 :install_method => 'tarball',
316 # Run shared tests applicable to all supported OSs
317 # Note that this function is defined in spec_helper
320 # Run test that specialize in checking tarball-based installs
321 # Note that this function is defined in spec_helper
322 tarball_install_tests
325 context 'overriding default unitfile_url' do
326 # Doesn't matter if this is valid, just that it honors what we pass
327 unitfile_url = 'fake_unitfile'
329 :osfamily => osfamily,
330 :operatingsystem => operatingsystem,
331 :operatingsystemrelease => operatingsystemrelease,
332 :operatingsystemmajrelease => operatingsystemmajrelease,
333 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
337 :install_method => 'tarball',
338 :unitfile_url => unitfile_url,
341 # Run shared tests applicable to all supported OSs
342 # Note that this function is defined in spec_helper
345 # Run test that specialize in checking tarball-based installs
346 # Note that this function is defined in spec_helper
347 tarball_install_tests(unitfile_url: unitfile_url)
351 describe 'overriding default tarball_url' do
352 # Doesn't matter if this is valid, just that it honors what we pass
353 tarball_url = 'fake_tarball'
354 context 'using default unitfile_url' do
355 unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz'
357 :osfamily => osfamily,
358 :operatingsystem => operatingsystem,
359 :operatingsystemrelease => operatingsystemrelease,
360 :operatingsystemmajrelease => operatingsystemmajrelease,
361 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
365 :install_method => 'tarball',
366 :tarball_url => tarball_url,
369 # Run shared tests applicable to all supported OSs
370 # Note that this function is defined in spec_helper
373 # Run test that specialize in checking tarball-based installs
374 # Note that this function is defined in spec_helper
375 tarball_install_tests(tarball_url: tarball_url)
378 context 'overriding default unitfile_url' do
379 # Doesn't matter if this is valid, just that it honors what we pass
380 unitfile_url = 'fake_unitfile'
382 :osfamily => osfamily,
383 :operatingsystem => operatingsystem,
384 :operatingsystemrelease => operatingsystemrelease,
385 :operatingsystemmajrelease => operatingsystemmajrelease,
386 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
390 :install_method => 'tarball',
391 :tarball_url => tarball_url,
392 :unitfile_url => unitfile_url,
395 # Run shared tests applicable to all supported OSs
396 # Note that this function is defined in spec_helper
399 # Run test that specialize in checking tarball-based installs
400 # Note that this function is defined in spec_helper
401 tarball_install_tests(tarball_url: tarball_url, unitfile_url: unitfile_url)