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 ['22', '23'].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 tests 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 tests 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
35 # Run tests that specialize in checking ODL's REST port config
36 # NB: Only testing defaults here, specialized log level tests elsewhere
37 # Note that this function is defined in spec_helper
40 # Run tests that specialize in checking custom log level config
41 # NB: Only testing defaults here, specialized log level tests elsewhere
42 # Note that this function is defined in spec_helper
45 # Run tests that specialize in checking ODL OVSDB HA config
46 # NB: Only testing defaults here, specialized enabling HA tests elsewhere
47 # Note that this function is defined in spec_helper
52 # All tests for unsupported versions of Fedora
53 ['21'].each do |operatingsystemmajrelease|
54 context "#{operatingsystemmajrelease}" do
56 :osfamily => osfamily,
57 :operatingsystem => operatingsystem,
58 :operatingsystemmajrelease => operatingsystemmajrelease,
60 # Run shared tests applicable to all unsupported OSs
61 # Note that this function is defined in spec_helper
62 expected_msg = "Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}"
63 unsupported_os_tests(expected_msg: expected_msg)
68 # All tests for CentOS
70 operatingsystem = 'CentOS'
72 # All tests for supported versions of CentOS
73 ['7'].each do |operatingsystemmajrelease|
74 context "#{operatingsystemmajrelease}" do
76 :osfamily => osfamily,
77 :operatingsystem => operatingsystem,
78 :operatingsystemmajrelease => operatingsystemmajrelease,
80 # Run shared tests applicable to all supported OSs
81 # Note that this function is defined in spec_helper
84 # Run test that specialize in checking rpm-based installs
85 # NB: Only testing defaults here, specialized rpm tests elsewhere
86 # Note that this function is defined in spec_helper
89 # Run test that specialize in checking Karaf feature installs
90 # NB: Only testing defaults here, specialized Karaf tests elsewhere
91 # Note that this function is defined in spec_helper
94 # Run tests that specialize in checking ODL's REST port config
95 # NB: Only testing defaults here, specialized log level tests elsewhere
96 # Note that this function is defined in spec_helper
99 # Run test that specialize in checking custom log level config
100 # NB: Only testing defaults here, specialized log level tests elsewhere
101 # Note that this function is defined in spec_helper
104 # Run tests that specialize in checking ODL OVSDB HA config
105 # NB: Only testing defaults here, specialized enabling HA tests elsewhere
106 # Note that this function is defined in spec_helper
111 # All tests for unsupported versions of CentOS
112 ['6'].each do |operatingsystemmajrelease|
113 context "#{operatingsystemmajrelease}" do
115 :osfamily => osfamily,
116 :operatingsystem => operatingsystem,
117 :operatingsystemmajrelease => operatingsystemmajrelease,
119 # Run shared tests applicable to all unsupported OSs
120 # Note that this function is defined in spec_helper
121 expected_msg = "Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}"
122 unsupported_os_tests(expected_msg: expected_msg)
128 # All tests for OSs in the Debian family (Ubuntu)
129 describe 'OS family Debian' do
132 # All tests for Ubuntu 14.04
134 operatingsystem = 'Ubuntu'
136 # All tests for supported versions of Ubuntu
137 ['14.04'].each do |operatingsystemmajrelease|
138 context "#{operatingsystemmajrelease}" do
140 :osfamily => osfamily,
141 :operatingsystem => operatingsystem,
142 :operatingsystemmajrelease => operatingsystemmajrelease,
143 # TODO: Do more elegantly. Java mod uses codenames to ID version.
144 :lsbdistcodename => 'trusty',
145 :architecture => 'x86_64',
146 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
149 # NB: Only tarball installs are supported for Debian family OSs
151 :install_method => 'tarball',
154 # Run shared tests applicable to all supported OSs
155 # Note that this function is defined in spec_helper
158 # Run test that specialize in checking tarball-based installs
159 # NB: Only testing defaults here, specialized tarball tests elsewhere
160 # Passing osfamily required to do upstart vs systemd (default) checks
161 # Note that this function is defined in spec_helper
162 tarball_install_tests(osfamily: osfamily)
164 # Run test that specialize in checking Karaf feature installs
165 # NB: Only testing defaults here, specialized Karaf tests elsewhere
166 # Note that this function is defined in spec_helper
169 # Run tests that specialize in checking ODL's REST port config
170 # NB: Only testing defaults here, specialized log level tests elsewhere
171 # Note that this function is defined in spec_helper
174 # Run test that specialize in checking custom log level config
175 # NB: Only testing defaults here, specialized log level tests elsewhere
176 # Note that this function is defined in spec_helper
179 # Run tests that specialize in checking ODL OVSDB HA config
180 # NB: Only testing defaults here, specialized enabling HA tests elsewhere
181 # Note that this function is defined in spec_helper
186 # All tests for unsupported versions of Ubuntu
187 ['12.04', '15.10'].each do |operatingsystemmajrelease|
188 context "#{operatingsystemmajrelease}" do
190 :osfamily => osfamily,
191 :operatingsystem => operatingsystem,
192 :operatingsystemmajrelease => operatingsystemmajrelease,
194 # Run shared tests applicable to all unsupported OSs
195 # Note that this function is defined in spec_helper
196 expected_msg = "Unsupported OS: #{operatingsystem} #{operatingsystemmajrelease}"
197 unsupported_os_tests(expected_msg: expected_msg)
203 # All tests for unsupported OS families
204 ['Suse', 'Solaris'].each do |osfamily|
205 context "OS family #{osfamily}" do
207 :osfamily => osfamily,
210 # Run shared tests applicable to all unsupported OSs
211 # Note that this function is defined in spec_helper
212 expected_msg = "Unsupported OS family: #{osfamily}"
213 unsupported_os_tests(expected_msg: expected_msg)
218 # All Karaf feature tests
219 describe 'Karaf feature tests' do
220 # Non-OS-type tests assume CentOS 7
221 # See issue #43 for reasoning:
222 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
224 operatingsystem = 'CentOS'
225 operatingsystemmajrelease = '7'
226 describe 'using default features' do
227 context 'and not passing extra features' do
229 :osfamily => osfamily,
230 :operatingsystem => operatingsystem,
231 :operatingsystemmajrelease => operatingsystemmajrelease,
236 # Run shared tests applicable to all supported OSs
237 # Note that this function is defined in spec_helper
240 # Run test that specialize in checking Karaf feature installs
241 # Note that this function is defined in spec_helper
245 context 'and passing extra features' do
247 :osfamily => osfamily,
248 :operatingsystem => operatingsystem,
249 :operatingsystemmajrelease => operatingsystemmajrelease,
252 # These are real but arbitrarily chosen features
253 extra_features = ['odl-base-all', 'odl-ovsdb-all']
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(extra_features: extra_features)
268 describe 'overriding default features' do
269 default_features = ['standard', 'ssh']
270 context 'and not passing extra features' do
272 :osfamily => osfamily,
273 :operatingsystem => operatingsystem,
274 :operatingsystemmajrelease => operatingsystemmajrelease,
278 :default_features => default_features,
281 # Run shared tests applicable to all supported OSs
282 # Note that this function is defined in spec_helper
285 # Run test that specialize in checking Karaf feature installs
286 # Note that this function is defined in spec_helper
287 karaf_feature_tests(default_features: default_features)
290 context 'and passing extra features' do
292 :osfamily => osfamily,
293 :operatingsystem => operatingsystem,
294 :operatingsystemmajrelease => operatingsystemmajrelease,
297 # These are real but arbitrarily chosen features
298 extra_features = ['odl-base-all', 'odl-ovsdb-all']
300 :default_features => default_features,
301 :extra_features => extra_features,
304 # Run shared tests applicable to all supported OSs
305 # Note that this function is defined in spec_helper
308 # Run test that specialize in checking Karaf feature installs
309 # Note that this function is defined in spec_helper
310 karaf_feature_tests(default_features: default_features, extra_features: extra_features)
315 # All ODL REST port tests
316 describe 'REST port tests' do
317 # Non-OS-type tests assume CentOS 7
318 # See issue #43 for reasoning:
319 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
321 operatingsystem = 'CentOS'
322 operatingsystemmajrelease = '7'
323 context 'using default REST port' do
325 :osfamily => osfamily,
326 :operatingsystem => operatingsystem,
327 :operatingsystemmajrelease => operatingsystemmajrelease,
332 # Run shared tests applicable to all supported OSs
333 # Note that this function is defined in spec_helper
336 # Run test that specialize in checking ODL REST port config
337 # Note that this function is defined in spec_helper
341 context 'overriding default REST port' do
343 :osfamily => osfamily,
344 :operatingsystem => operatingsystem,
345 :operatingsystemmajrelease => operatingsystemmajrelease,
349 :odl_rest_port => 7777,
352 # Run shared tests applicable to all supported OSs
353 # Note that this function is defined in spec_helper
356 # Run test that specialize in checking ODL REST port config
357 # Note that this function is defined in spec_helper
358 odl_rest_port_tests(odl_rest_port: 7777)
362 # All custom log level tests
363 describe 'custom log level tests' do
364 # Non-OS-type tests assume CentOS 7
365 # See issue #43 for reasoning:
366 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
368 operatingsystem = 'CentOS'
369 operatingsystemmajrelease = '7'
370 context 'using default log levels' do
372 :osfamily => osfamily,
373 :operatingsystem => operatingsystem,
374 :operatingsystemmajrelease => operatingsystemmajrelease,
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 custom log level config
384 # Note that this function is defined in spec_helper
388 context 'adding one custom log level' do
390 :osfamily => osfamily,
391 :operatingsystem => operatingsystem,
392 :operatingsystemmajrelease => operatingsystemmajrelease,
395 custom_log_levels = { 'org.opendaylight.ovsdb' => 'TRACE' }
398 :log_levels => custom_log_levels,
401 # Run shared tests applicable to all supported OSs
402 # Note that this function is defined in spec_helper
405 # Run test that specialize in checking log level config
406 # Note that this function is defined in spec_helper
407 log_level_tests(log_levels: custom_log_levels)
410 context 'adding two custom log levels' do
412 :osfamily => osfamily,
413 :operatingsystem => operatingsystem,
414 :operatingsystemmajrelease => operatingsystemmajrelease,
417 custom_log_levels = { 'org.opendaylight.ovsdb' => 'TRACE',
418 'org.opendaylight.ovsdb.lib' => 'INFO' }
421 :log_levels => custom_log_levels,
424 # Run shared tests applicable to all supported OSs
425 # Note that this function is defined in spec_helper
428 # Run test that specialize in checking log level config
429 # Note that this function is defined in spec_helper
430 log_level_tests(log_levels: custom_log_levels)
434 # All OVSDB HA enable/disable tests
435 describe 'OVSDB HA enable/disable tests' do
436 # Non-OS-type tests assume CentOS 7
437 # See issue #43 for reasoning:
438 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
440 operatingsystem = 'CentOS'
441 operatingsystemmajrelease = '7'
442 context 'using enable_ha default' do
444 :osfamily => osfamily,
445 :operatingsystem => operatingsystem,
446 :operatingsystemmajrelease => operatingsystemmajrelease,
451 # Run shared tests applicable to all supported OSs
452 # Note that this function is defined in spec_helper
455 # Run test that specialize in checking ODL OVSDB HA config
456 # Note that this function is defined in spec_helper
460 context 'using false for enable_ha' do
462 :osfamily => osfamily,
463 :operatingsystem => operatingsystem,
464 :operatingsystemmajrelease => operatingsystemmajrelease,
471 # Run shared tests applicable to all supported OSs
472 # Note that this function is defined in spec_helper
475 # Run test that specialize in checking ODL OVSDB HA config
476 # Note that this function is defined in spec_helper
477 enable_ha_tests(enable_ha: false)
480 context 'using true for enable_ha' do
481 context 'using ha_node_count >=2' do
483 :osfamily => osfamily,
484 :operatingsystem => operatingsystem,
485 :operatingsystemmajrelease => operatingsystemmajrelease,
490 :ha_node_ips => ['0.0.0.0', '127.0.0.1']
493 # Run shared tests applicable to all supported OSs
494 # Note that this function is defined in spec_helper
497 # Run test that specialize in checking ODL OVSDB HA config
498 # Note that this function is defined in spec_helper
499 enable_ha_tests(enable_ha: true, ha_node_ips: ['0.0.0.0', '127.0.0.1'])
505 # All install method tests
506 describe 'install method tests' do
507 # Non-OS-type tests assume CentOS 7
508 # See issue #43 for reasoning:
509 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
511 operatingsystem = 'CentOS'
512 operatingsystemrelease = '7.0'
513 operatingsystemmajrelease = '7'
515 # All tests for RPM install method
517 context 'installing default RPM' do
519 :osfamily => osfamily,
520 :operatingsystem => operatingsystem,
521 :operatingsystemmajrelease => operatingsystemmajrelease,
525 :install_method => 'rpm',
528 # Run shared tests applicable to all supported OSs
529 # Note that this function is defined in spec_helper
532 # Run test that specialize in checking RPM-based installs
533 # Note that this function is defined in spec_helper
537 context 'installing Beryllium RPM' do
538 rpm_repo = 'opendaylight-40-release'
540 :osfamily => osfamily,
541 :operatingsystem => operatingsystem,
542 :operatingsystemmajrelease => operatingsystemmajrelease,
546 :install_method => 'rpm',
547 :rpm_repo => rpm_repo,
550 # Run shared tests applicable to all supported OSs
551 # Note that this function is defined in spec_helper
554 # Run test that specialize in checking RPM-based installs
555 # Note that this function is defined in spec_helper
556 rpm_install_tests(rpm_repo: rpm_repo)
560 # All tests for tarball install method
561 describe 'tarball' do
562 describe 'using default tarball_url' do
563 context 'using default unitfile_url' do
565 :osfamily => osfamily,
566 :operatingsystem => operatingsystem,
567 :operatingsystemrelease => operatingsystemrelease,
568 :operatingsystemmajrelease => operatingsystemmajrelease,
569 :architecture => 'x86_64',
570 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
574 :install_method => 'tarball',
577 # Run shared tests applicable to all supported OSs
578 # Note that this function is defined in spec_helper
581 # Run test that specialize in checking tarball-based installs
582 # Note that this function is defined in spec_helper
583 tarball_install_tests
586 context 'overriding default unitfile_url' do
587 # Doesn't matter if this is valid, just that it honors what we pass
588 unitfile_url = 'fake_unitfile'
590 :osfamily => osfamily,
591 :operatingsystem => operatingsystem,
592 :operatingsystemrelease => operatingsystemrelease,
593 :operatingsystemmajrelease => operatingsystemmajrelease,
594 :architecture => 'x86_64',
595 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
599 :install_method => 'tarball',
600 :unitfile_url => unitfile_url,
603 # Run shared tests applicable to all supported OSs
604 # Note that this function is defined in spec_helper
607 # Run test that specialize in checking tarball-based installs
608 # Note that this function is defined in spec_helper
609 tarball_install_tests(unitfile_url: unitfile_url)
613 describe 'overriding default tarball_url' do
614 # Doesn't matter if this is valid, just that it honors what we pass
615 tarball_url = 'fake_tarball'
616 context 'using default unitfile_url' do
617 unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz'
619 :osfamily => osfamily,
620 :operatingsystem => operatingsystem,
621 :operatingsystemrelease => operatingsystemrelease,
622 :operatingsystemmajrelease => operatingsystemmajrelease,
623 :architecture => 'x86_64',
624 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
628 :install_method => 'tarball',
629 :tarball_url => tarball_url,
632 # Run shared tests applicable to all supported OSs
633 # Note that this function is defined in spec_helper
636 # Run test that specialize in checking tarball-based installs
637 # Note that this function is defined in spec_helper
638 tarball_install_tests(tarball_url: tarball_url)
641 context 'overriding default unitfile_url' do
642 # Doesn't matter if this is valid, just that it honors what we pass
643 unitfile_url = 'fake_unitfile'
645 :osfamily => osfamily,
646 :operatingsystem => operatingsystem,
647 :operatingsystemrelease => operatingsystemrelease,
648 :operatingsystemmajrelease => operatingsystemmajrelease,
649 :architecture => 'x86_64',
650 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
654 :install_method => 'tarball',
655 :tarball_url => tarball_url,
656 :unitfile_url => unitfile_url,
659 # Run shared tests applicable to all supported OSs
660 # Note that this function is defined in spec_helper
663 # Run test that specialize in checking tarball-based installs
664 # Note that this function is defined in spec_helper
665 tarball_install_tests(tarball_url: tarball_url, unitfile_url: unitfile_url)
670 # Security Group Tests
671 describe 'security group tests' do
672 # Non-OS-type tests assume CentOS 7
673 # See issue #43 for reasoning:
674 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
676 operatingsystem = 'CentOS'
677 operatingsystemmajrelease = '7'
678 context 'using supported stateful' do
680 :osfamily => osfamily,
681 :operatingsystem => operatingsystem,
682 :operatingsystemmajrelease => operatingsystemmajrelease,
683 :operatingsystemrelease => '7.3',
687 :security_group_mode => 'stateful',
688 :extra_features => ['odl-netvirt-openstack'],
691 # Run shared tests applicable to all supported OSs
692 # Note that this function is defined in spec_helper
695 # Run test that specialize in checking security groups
696 # Note that this function is defined in spec_helper
697 enable_sg_tests('stateful', '7.3')
700 context 'using unsupported stateful' do
702 :osfamily => osfamily,
703 :operatingsystem => operatingsystem,
704 :operatingsystemmajrelease => operatingsystemmajrelease,
705 :operatingsystemrelease => '7.2.1511',
709 :security_group_mode => 'stateful',
710 :extra_features => ['odl-netvirt-openstack'],
713 # Run shared tests applicable to all supported OSs
714 # Note that this function is defined in spec_helper
717 # Run test that specialize in checking security groups
718 # Note that this function is defined in spec_helper
719 enable_sg_tests('stateful', '7.2.1511')
722 context 'using transparent with unsupported stateful' do
724 :osfamily => osfamily,
725 :operatingsystem => operatingsystem,
726 :operatingsystemmajrelease => operatingsystemmajrelease,
727 :operatingsystemrelease => '7.2.1511',
731 :security_group_mode => 'transparent',
732 :extra_features => ['odl-netvirt-openstack'],
735 # Run shared tests applicable to all supported OSs
736 # Note that this function is defined in spec_helper
739 # Run test that specialize in checking security groups
740 # Note that this function is defined in spec_helper
741 enable_sg_tests('transparent', '7.2.1511')