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 # This is the Fedora Yum repo URL
14 yum_repo = 'https://copr-be.cloud.fedoraproject.org/results/dfarrell07/OpenDaylight/fedora-$releasever-$basearch/'
16 # All tests for supported versions of Fedora
17 ['20', '21'].each do |operatingsystemmajrelease|
18 context "#{operatingsystemmajrelease}" do
20 :osfamily => osfamily,
21 :operatingsystem => operatingsystem,
22 :operatingsystemmajrelease => operatingsystemmajrelease,
24 # Run shared tests applicable to all supported OSs
25 # Note that this function is defined in spec_helper
30 # All tests for unsupported versions of Fedora
31 ['18', '19', '22'].each do |operatingsystemmajrelease|
32 context "#{operatingsystemmajrelease}" do
34 :osfamily => osfamily,
35 :operatingsystem => operatingsystem,
36 :operatingsystemmajrelease => operatingsystemmajrelease,
38 # Run shared tests applicable to all unsupported OSs
39 # Note that this function is defined in spec_helper
40 unsupported_os_tests("Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}")
45 # All tests for CentOS
47 operatingsystem = 'CentOS'
49 # This is the CentOS 7 Yum repo URL
50 yum_repo = 'https://copr-be.cloud.fedoraproject.org/results/dfarrell07/OpenDaylight/epel-7-$basearch/'
52 # All tests for supported versions of CentOS
53 ['7'].each do |operatingsystemmajrelease|
54 context "#{operatingsystemmajrelease}" do
56 :osfamily => osfamily,
57 :operatingsystem => operatingsystem,
58 :operatingsystemmajrelease => operatingsystemmajrelease,
60 # Run shared tests applicable to all supported OSs
61 # Note that this function is defined in spec_helper
66 # All tests for unsupported versions of CentOS
67 ['5', '6', '8'].each do |operatingsystemmajrelease|
68 context "#{operatingsystemmajrelease}" do
70 :osfamily => osfamily,
71 :operatingsystem => operatingsystem,
72 :operatingsystemmajrelease => operatingsystemmajrelease,
74 # Run shared tests applicable to all unsupported OSs
75 # Note that this function is defined in spec_helper
76 unsupported_os_tests("Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}")
82 # All tests for OSs in the Debian family (Ubuntu)
83 describe 'OS family Debian' do
86 # All tests for Ubuntu 14.04
88 operatingsystem = 'Ubuntu'
90 # All tests for supported versions of Ubuntu
91 ['14.04'].each do |operatingsystemmajrelease|
92 context "#{operatingsystemmajrelease}" do
94 :osfamily => osfamily,
95 :operatingsystem => operatingsystem,
96 :operatingsystemmajrelease => operatingsystemmajrelease,
97 :lsbdistcodename => 'trusty',
98 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
101 # Only the tarball method is supported for Debian-based installs
103 :install_method => 'tarball',
106 # Run shared tests applicable to all supported OSs
107 # Note that this function is defined in spec_helper
108 # TODO: These are currently under development
111 # Run Ubuntu-specific tests
112 # Note that this function is defined in spec_helper
117 # All tests for unsupported versions of Ubuntu
118 ['12.04', '12.10', '13.04', '13.10', '14.10', '15.04'].each do |operatingsystemmajrelease|
119 context "#{operatingsystemmajrelease}" do
121 :osfamily => osfamily,
122 :operatingsystem => operatingsystem,
123 :operatingsystemmajrelease => operatingsystemmajrelease,
125 # Run shared tests applicable to all unsupported OSs
126 # Note that this function is defined in spec_helper
127 unsupported_os_tests("Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}")
133 # All tests for unsupported OS families
134 ['Suse', 'Solaris'].each do |osfamily|
135 context "OS family #{osfamily}" do
137 :osfamily => osfamily,
140 # Run shared tests applicable to all unsupported OSs
141 # Note that this function is defined in spec_helper
142 unsupported_os_tests("Unsupported OS family: #{osfamily}")
147 # All Karaf feature tests
148 describe 'Karaf feature tests' do
149 # Non-OS-type tests assume CentOS 7
150 # See issue #43 for reasoning:
151 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
153 operatingsystem = 'CentOS'
154 operatingsystemmajrelease = '7'
155 # This is the CentOS 7 Yum repo URL
156 yum_repo = 'https://copr-be.cloud.fedoraproject.org/results/dfarrell07/OpenDaylight/epel-7-$basearch/'
157 describe 'using default features' do
158 # NB: This list should be the same as the one in opendaylight::params
159 # TODO: Remove this possible source of bugs^^
160 default_features = ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management']
161 context 'and not passing extra features' do
163 :osfamily => osfamily,
164 :operatingsystem => operatingsystem,
165 :operatingsystemmajrelease => operatingsystemmajrelease,
170 # Run shared tests applicable to all supported OSs
171 # Note that this function is defined in spec_helper
174 # Run test that specialize in checking Karaf feature installs
175 # Note that this function is defined in spec_helper
176 karaf_feature_tests(default_features)
179 context 'and passing extra features' do
181 :osfamily => osfamily,
182 :operatingsystem => operatingsystem,
183 :operatingsystemmajrelease => operatingsystemmajrelease,
186 # These are real but arbitrarily chosen features
187 extra_features = ['odl-base-all', 'odl-ovsdb-all']
189 :extra_features => extra_features,
192 # Run shared tests applicable to all supported OSs
193 # Note that this function is defined in spec_helper
196 # Run test that specialize in checking Karaf feature installs
197 # Note that this function is defined in spec_helper
198 karaf_feature_tests(default_features + extra_features)
202 describe 'overriding default features' do
203 default_features = ['standard', 'ssh']
204 context 'and not passing extra features' do
206 :osfamily => osfamily,
207 :operatingsystem => operatingsystem,
208 :operatingsystemmajrelease => operatingsystemmajrelease,
212 :default_features => default_features,
215 # Run shared tests applicable to all supported OSs
216 # Note that this function is defined in spec_helper
219 # Run test that specialize in checking Karaf feature installs
220 # Note that this function is defined in spec_helper
221 karaf_feature_tests(default_features)
224 context 'and passing extra features' do
226 :osfamily => osfamily,
227 :operatingsystem => operatingsystem,
228 :operatingsystemmajrelease => operatingsystemmajrelease,
231 # These are real but arbitrarily chosen features
232 extra_features = ['odl-base-all', 'odl-ovsdb-all']
234 :default_features => default_features,
235 :extra_features => extra_features,
238 # Run shared tests applicable to all supported OSs
239 # Note that this function is defined in spec_helper
242 # Run test that specialize in checking Karaf feature installs
243 # Note that this function is defined in spec_helper
244 karaf_feature_tests(default_features + extra_features)
249 # All install method tests
250 describe 'install method tests' do
251 # Non-OS-type tests assume CentOS 7
252 # See issue #43 for reasoning:
253 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
255 operatingsystem = 'CentOS'
256 operatingsystemrelease = '7.0'
257 operatingsystemmajrelease = '7'
258 # This is the CentOS 7 Yum repo URL
259 yum_repo = 'https://copr-be.cloud.fedoraproject.org/results/dfarrell07/OpenDaylight/epel-7-$basearch/'
261 # All tests for RPM install method
264 :osfamily => osfamily,
265 :operatingsystem => operatingsystem,
266 :operatingsystemmajrelease => operatingsystemmajrelease,
270 :install_method => 'rpm',
273 # Run shared tests applicable to all supported OSs
274 # Note that this function is defined in spec_helper
277 # Run test that specialize in checking Karaf feature installs
278 # Note that this function is defined in spec_helper
279 install_method_tests('rpm', yum_repo)
282 # All tests for tarball install method
283 describe 'tarball' do
284 describe 'using default tarball_url' do
285 tarball_url = 'https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz'
286 context 'using default unitfile_url' do
287 unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz'
289 :osfamily => osfamily,
290 :operatingsystem => operatingsystem,
291 :operatingsystemrelease => operatingsystemrelease,
292 :operatingsystemmajrelease => operatingsystemmajrelease,
293 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
297 :install_method => 'tarball',
300 # Run shared tests applicable to all supported OSs
301 # Note that this function is defined in spec_helper
304 # Run test that specialize in checking Karaf feature installs
305 # Note that this function is defined in spec_helper
306 install_method_tests('tarball', yum_repo, tarball_url, unitfile_url)
309 context 'overriding default unitfile_url' do
310 # Doesn't matter if this is valid, just that it honors what we pass
311 unitfile_url = 'fake_unitfile'
313 :osfamily => osfamily,
314 :operatingsystem => operatingsystem,
315 :operatingsystemrelease => operatingsystemrelease,
316 :operatingsystemmajrelease => operatingsystemmajrelease,
317 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
321 :install_method => 'tarball',
322 :unitfile_url => unitfile_url,
325 # Run shared tests applicable to all supported OSs
326 # Note that this function is defined in spec_helper
329 # Run test that specialize in checking Karaf feature installs
330 # Note that this function is defined in spec_helper
331 install_method_tests('tarball', yum_repo, tarball_url, unitfile_url)
335 describe 'overriding default tarball_url' do
336 # Doesn't matter if this is valid, just that it honors what we pass
337 tarball_url = 'fake_tarball'
338 context 'using default unitfile_url' do
339 unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz'
341 :osfamily => osfamily,
342 :operatingsystem => operatingsystem,
343 :operatingsystemrelease => operatingsystemrelease,
344 :operatingsystemmajrelease => operatingsystemmajrelease,
345 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
349 :install_method => 'tarball',
350 :tarball_url => tarball_url,
353 # Run shared tests applicable to all supported OSs
354 # Note that this function is defined in spec_helper
357 # Run test that specialize in checking Karaf feature installs
358 # Note that this function is defined in spec_helper
359 install_method_tests('tarball', yum_repo, tarball_url, unitfile_url)
362 context 'overriding default unitfile_url' do
363 # Doesn't matter if this is valid, just that it honors what we pass
364 unitfile_url = 'fake_unitfile'
366 :osfamily => osfamily,
367 :operatingsystem => operatingsystem,
368 :operatingsystemrelease => operatingsystemrelease,
369 :operatingsystemmajrelease => operatingsystemmajrelease,
370 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
374 :install_method => 'tarball',
375 :tarball_url => tarball_url,
376 :unitfile_url => unitfile_url,
379 # Run shared tests applicable to all supported OSs
380 # Note that this function is defined in spec_helper
383 # Run test that specialize in checking Karaf feature installs
384 # Note that this function is defined in spec_helper
385 install_method_tests('tarball', yum_repo, tarball_url, unitfile_url)