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
27 # All tests for unsupported versions of Fedora
28 ['18', '19', '22'].each do |operatingsystemmajrelease|
29 context "#{operatingsystemmajrelease}" do
31 :osfamily => osfamily,
32 :operatingsystem => operatingsystem,
33 :operatingsystemmajrelease => operatingsystemmajrelease,
35 # Run shared tests applicable to all unsupported OSs
36 # Note that this function is defined in spec_helper
37 expected_msg = "Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}"
38 unsupported_os_tests(expected_msg: expected_msg)
43 # All tests for CentOS
45 operatingsystem = 'CentOS'
47 # All tests for supported versions of CentOS
48 ['7'].each do |operatingsystemmajrelease|
49 context "#{operatingsystemmajrelease}" do
51 :osfamily => osfamily,
52 :operatingsystem => operatingsystem,
53 :operatingsystemmajrelease => operatingsystemmajrelease,
55 # Run shared tests applicable to all supported OSs
56 # Note that this function is defined in spec_helper
61 # All tests for unsupported versions of CentOS
62 ['5', '6', '8'].each do |operatingsystemmajrelease|
63 context "#{operatingsystemmajrelease}" do
65 :osfamily => osfamily,
66 :operatingsystem => operatingsystem,
67 :operatingsystemmajrelease => operatingsystemmajrelease,
69 # Run shared tests applicable to all unsupported OSs
70 # Note that this function is defined in spec_helper
71 expected_msg = "Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}"
72 unsupported_os_tests(expected_msg: expected_msg)
78 # All tests for OSs in the Debian family (Ubuntu)
79 describe 'OS family Debian' do
82 # All tests for Ubuntu 14.04
84 operatingsystem = 'Ubuntu'
86 # All tests for supported versions of Ubuntu
87 ['14.04'].each do |operatingsystemmajrelease|
88 context "#{operatingsystemmajrelease}" do
90 :osfamily => osfamily,
91 :operatingsystem => operatingsystem,
92 :operatingsystemmajrelease => operatingsystemmajrelease,
93 # TODO: Do more elegantly. Java mod uses codenames to ID version.
94 :lsbdistcodename => 'trusty',
95 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
98 # NB: Only tarball installs are supported for Debian family OSs
100 :install_method => 'tarball',
103 # Run shared tests applicable to all supported OSs
104 # Note that this function is defined in spec_helper
107 # Run test that specialize in checking tarball-based installs
108 # Passing osfamily required to do upstart vs systemd (default) checks
109 # Note that this function is defined in spec_helper
110 tarball_install_tests(osfamily: osfamily)
114 # All tests for unsupported versions of Ubuntu
115 ['12.04', '12.10', '13.04', '13.10', '14.10', '15.04'].each do |operatingsystemmajrelease|
116 context "#{operatingsystemmajrelease}" do
118 :osfamily => osfamily,
119 :operatingsystem => operatingsystem,
120 :operatingsystemmajrelease => operatingsystemmajrelease,
122 # Run shared tests applicable to all unsupported OSs
123 # Note that this function is defined in spec_helper
124 expected_msg = "Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}"
125 unsupported_os_tests(expected_msg: expected_msg)
131 # All tests for unsupported OS families
132 ['Suse', 'Solaris'].each do |osfamily|
133 context "OS family #{osfamily}" do
135 :osfamily => osfamily,
138 # Run shared tests applicable to all unsupported OSs
139 # Note that this function is defined in spec_helper
140 expected_msg = "Unsupported OS family: #{osfamily}"
141 unsupported_os_tests(expected_msg: expected_msg)
146 # All Karaf feature tests
147 describe 'Karaf feature tests' do
148 # Non-OS-type tests assume CentOS 7
149 # See issue #43 for reasoning:
150 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
152 operatingsystem = 'CentOS'
153 operatingsystemmajrelease = '7'
154 describe 'using default features' do
155 context 'and not passing extra features' do
157 :osfamily => osfamily,
158 :operatingsystem => operatingsystem,
159 :operatingsystemmajrelease => operatingsystemmajrelease,
164 # Run shared tests applicable to all supported OSs
165 # Note that this function is defined in spec_helper
168 # Run test that specialize in checking Karaf feature installs
169 # Note that this function is defined in spec_helper
173 context 'and passing extra features' do
175 :osfamily => osfamily,
176 :operatingsystem => operatingsystem,
177 :operatingsystemmajrelease => operatingsystemmajrelease,
180 # These are real but arbitrarily chosen features
181 extra_features = ['odl-base-all', 'odl-ovsdb-all']
183 :extra_features => extra_features,
186 # Run shared tests applicable to all supported OSs
187 # Note that this function is defined in spec_helper
190 # Run test that specialize in checking Karaf feature installs
191 # Note that this function is defined in spec_helper
192 karaf_feature_tests(extra_features: extra_features)
196 describe 'overriding default features' do
197 default_features = ['standard', 'ssh']
198 context 'and not passing extra features' do
200 :osfamily => osfamily,
201 :operatingsystem => operatingsystem,
202 :operatingsystemmajrelease => operatingsystemmajrelease,
206 :default_features => default_features,
209 # Run shared tests applicable to all supported OSs
210 # Note that this function is defined in spec_helper
213 # Run test that specialize in checking Karaf feature installs
214 # Note that this function is defined in spec_helper
215 karaf_feature_tests(default_features: default_features)
218 context 'and passing extra features' do
220 :osfamily => osfamily,
221 :operatingsystem => operatingsystem,
222 :operatingsystemmajrelease => operatingsystemmajrelease,
225 # These are real but arbitrarily chosen features
226 extra_features = ['odl-base-all', 'odl-ovsdb-all']
228 :default_features => default_features,
229 :extra_features => extra_features,
232 # Run shared tests applicable to all supported OSs
233 # Note that this function is defined in spec_helper
236 # Run test that specialize in checking Karaf feature installs
237 # Note that this function is defined in spec_helper
238 karaf_feature_tests(default_features: default_features, extra_features: extra_features)
243 # All install method tests
244 describe 'install method tests' do
245 # Non-OS-type tests assume CentOS 7
246 # See issue #43 for reasoning:
247 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
249 operatingsystem = 'CentOS'
250 operatingsystemrelease = '7.0'
251 operatingsystemmajrelease = '7'
253 # All tests for RPM install method
256 :osfamily => osfamily,
257 :operatingsystem => operatingsystem,
258 :operatingsystemmajrelease => operatingsystemmajrelease,
262 :install_method => 'rpm',
265 # Run shared tests applicable to all supported OSs
266 # Note that this function is defined in spec_helper
269 # Run test that specialize in checking RPM-based installs
270 # Note that this function is defined in spec_helper
274 # All tests for tarball install method
275 describe 'tarball' do
276 describe 'using default tarball_url' do
277 context 'using default unitfile_url' do
279 :osfamily => osfamily,
280 :operatingsystem => operatingsystem,
281 :operatingsystemrelease => operatingsystemrelease,
282 :operatingsystemmajrelease => operatingsystemmajrelease,
283 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
287 :install_method => 'tarball',
290 # Run shared tests applicable to all supported OSs
291 # Note that this function is defined in spec_helper
294 # Run test that specialize in checking tarball-based installs
295 # Note that this function is defined in spec_helper
296 tarball_install_tests
299 context 'overriding default unitfile_url' do
300 # Doesn't matter if this is valid, just that it honors what we pass
301 unitfile_url = 'fake_unitfile'
303 :osfamily => osfamily,
304 :operatingsystem => operatingsystem,
305 :operatingsystemrelease => operatingsystemrelease,
306 :operatingsystemmajrelease => operatingsystemmajrelease,
307 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
311 :install_method => 'tarball',
312 :unitfile_url => unitfile_url,
315 # Run shared tests applicable to all supported OSs
316 # Note that this function is defined in spec_helper
319 # Run test that specialize in checking tarball-based installs
320 # Note that this function is defined in spec_helper
321 tarball_install_tests(unitfile_url: unitfile_url)
325 describe 'overriding default tarball_url' do
326 # Doesn't matter if this is valid, just that it honors what we pass
327 tarball_url = 'fake_tarball'
328 context 'using default unitfile_url' do
329 unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz'
331 :osfamily => osfamily,
332 :operatingsystem => operatingsystem,
333 :operatingsystemrelease => operatingsystemrelease,
334 :operatingsystemmajrelease => operatingsystemmajrelease,
335 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
339 :install_method => 'tarball',
340 :tarball_url => tarball_url,
343 # Run shared tests applicable to all supported OSs
344 # Note that this function is defined in spec_helper
347 # Run test that specialize in checking tarball-based installs
348 # Note that this function is defined in spec_helper
349 tarball_install_tests(tarball_url: tarball_url)
352 context 'overriding default unitfile_url' do
353 # Doesn't matter if this is valid, just that it honors what we pass
354 unitfile_url = 'fake_unitfile'
356 :osfamily => osfamily,
357 :operatingsystem => operatingsystem,
358 :operatingsystemrelease => operatingsystemrelease,
359 :operatingsystemmajrelease => operatingsystemmajrelease,
360 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
364 :install_method => 'tarball',
365 :tarball_url => tarball_url,
366 :unitfile_url => unitfile_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, unitfile_url: unitfile_url)