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 ['24', '25'].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 ['23'].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 16.04
134 operatingsystem = 'Ubuntu'
136 # All tests for supported versions of Ubuntu
137 ['16.04'].each do |operatingsystemrelease|
138 context "#{operatingsystemrelease}" do
140 :osfamily => osfamily,
141 :operatingsystem => operatingsystem,
142 :operatingsystemrelease => operatingsystemrelease,
143 :lsbdistid => operatingsystem,
144 :lsbdistrelease => operatingsystemrelease,
145 :lsbdistcodename => 'xenial',
146 :puppetversion => '4.9.0',
147 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
150 # Run shared tests applicable to all supported OSs
151 # Note that this function is defined in spec_helper
154 # Run test that specialize in checking deb-based installs
155 # Note that this function is defined in spec_helper
158 # Run test that specialize in checking Karaf feature installs
159 # NB: Only testing defaults here, specialized Karaf tests elsewhere
160 # Note that this function is defined in spec_helper
163 # Run tests that specialize in checking ODL's REST port config
164 # NB: Only testing defaults here, specialized log level tests elsewhere
165 # Note that this function is defined in spec_helper
168 # Run test that specialize in checking custom log level config
169 # NB: Only testing defaults here, specialized log level tests elsewhere
170 # Note that this function is defined in spec_helper
173 # Run tests that specialize in checking ODL OVSDB HA config
174 # NB: Only testing defaults here, specialized enabling HA tests elsewhere
175 # Note that this function is defined in spec_helper
180 # All tests for unsupported versions of Ubuntu
181 ['12.04', '14.04', '15.10'].each do |operatingsystemrelease|
182 context "#{operatingsystemrelease}" do
184 :osfamily => osfamily,
185 :operatingsystem => operatingsystem,
186 :operatingsystemrelease => operatingsystemrelease,
187 :lsbdistid => operatingsystem,
188 :lsbdistrelease => operatingsystemrelease,
189 :lsbdistcodename => 'xenial',
190 :puppetversion => '4.9.0',
192 # Run shared tests applicable to all unsupported OSs
193 # Note that this function is defined in spec_helper
194 expected_msg = "Unsupported OS: #{operatingsystem} #{operatingsystemrelease}"
195 unsupported_os_tests(expected_msg: expected_msg)
201 # All tests for unsupported OS families
202 ['Suse', 'Solaris'].each do |osfamily|
203 context "OS family #{osfamily}" do
205 :osfamily => osfamily,
208 # Run shared tests applicable to all unsupported OSs
209 # Note that this function is defined in spec_helper
210 expected_msg = "Unsupported OS family: #{osfamily}"
211 unsupported_os_tests(expected_msg: expected_msg)
216 # All Karaf feature tests
217 describe 'Karaf feature tests' do
218 # Non-OS-type tests assume CentOS 7
219 # See issue #43 for reasoning:
220 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
222 operatingsystem = 'CentOS'
223 operatingsystemmajrelease = '7'
224 describe 'using default features' do
225 context 'and not passing extra features' do
227 :osfamily => osfamily,
228 :operatingsystem => operatingsystem,
229 :operatingsystemmajrelease => operatingsystemmajrelease,
234 # Run shared tests applicable to all supported OSs
235 # Note that this function is defined in spec_helper
238 # Run test that specialize in checking Karaf feature installs
239 # Note that this function is defined in spec_helper
243 context 'and passing extra features' do
245 :osfamily => osfamily,
246 :operatingsystem => operatingsystem,
247 :operatingsystemmajrelease => operatingsystemmajrelease,
250 # These are real but arbitrarily chosen features
251 extra_features = ['odl-base-all', 'odl-ovsdb-all']
253 :extra_features => extra_features,
256 # Run shared tests applicable to all supported OSs
257 # Note that this function is defined in spec_helper
260 # Run test that specialize in checking Karaf feature installs
261 # Note that this function is defined in spec_helper
262 karaf_feature_tests(extra_features: extra_features)
266 describe 'overriding default features' do
267 default_features = ['standard', 'ssh']
268 context 'and not passing extra features' do
270 :osfamily => osfamily,
271 :operatingsystem => operatingsystem,
272 :operatingsystemmajrelease => operatingsystemmajrelease,
276 :default_features => default_features,
279 # Run shared tests applicable to all supported OSs
280 # Note that this function is defined in spec_helper
283 # Run test that specialize in checking Karaf feature installs
284 # Note that this function is defined in spec_helper
285 karaf_feature_tests(default_features: default_features)
288 context 'and passing extra features' do
290 :osfamily => osfamily,
291 :operatingsystem => operatingsystem,
292 :operatingsystemmajrelease => operatingsystemmajrelease,
295 # These are real but arbitrarily chosen features
296 extra_features = ['odl-base-all', 'odl-ovsdb-all']
298 :default_features => default_features,
299 :extra_features => extra_features,
302 # Run shared tests applicable to all supported OSs
303 # Note that this function is defined in spec_helper
306 # Run test that specialize in checking Karaf feature installs
307 # Note that this function is defined in spec_helper
308 karaf_feature_tests(default_features: default_features, extra_features: extra_features)
313 # All ODL REST port tests
314 describe 'REST port tests' do
315 # Non-OS-type tests assume CentOS 7
316 # See issue #43 for reasoning:
317 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
319 operatingsystem = 'CentOS'
320 operatingsystemmajrelease = '7'
321 context 'using default REST port' do
323 :osfamily => osfamily,
324 :operatingsystem => operatingsystem,
325 :operatingsystemmajrelease => operatingsystemmajrelease,
330 # Run shared tests applicable to all supported OSs
331 # Note that this function is defined in spec_helper
334 # Run test that specialize in checking ODL REST port config
335 # Note that this function is defined in spec_helper
339 context 'overriding default REST port' do
341 :osfamily => osfamily,
342 :operatingsystem => operatingsystem,
343 :operatingsystemmajrelease => operatingsystemmajrelease,
347 :odl_rest_port => 7777,
350 # Run shared tests applicable to all supported OSs
351 # Note that this function is defined in spec_helper
354 # Run test that specialize in checking ODL REST port config
355 # Note that this function is defined in spec_helper
356 odl_rest_port_tests(odl_rest_port: 7777)
360 # All custom log level tests
361 describe 'custom log level tests' do
362 # Non-OS-type tests assume CentOS 7
363 # See issue #43 for reasoning:
364 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
366 operatingsystem = 'CentOS'
367 operatingsystemmajrelease = '7'
368 context 'using default log levels' do
370 :osfamily => osfamily,
371 :operatingsystem => operatingsystem,
372 :operatingsystemmajrelease => operatingsystemmajrelease,
377 # Run shared tests applicable to all supported OSs
378 # Note that this function is defined in spec_helper
381 # Run test that specialize in checking custom log level config
382 # Note that this function is defined in spec_helper
386 context 'adding one custom log level' do
388 :osfamily => osfamily,
389 :operatingsystem => operatingsystem,
390 :operatingsystemmajrelease => operatingsystemmajrelease,
393 custom_log_levels = { 'org.opendaylight.ovsdb' => 'TRACE' }
396 :log_levels => custom_log_levels,
399 # Run shared tests applicable to all supported OSs
400 # Note that this function is defined in spec_helper
403 # Run test that specialize in checking log level config
404 # Note that this function is defined in spec_helper
405 log_level_tests(log_levels: custom_log_levels)
408 context 'adding two custom log levels' do
410 :osfamily => osfamily,
411 :operatingsystem => operatingsystem,
412 :operatingsystemmajrelease => operatingsystemmajrelease,
415 custom_log_levels = { 'org.opendaylight.ovsdb' => 'TRACE',
416 'org.opendaylight.ovsdb.lib' => 'INFO' }
419 :log_levels => custom_log_levels,
422 # Run shared tests applicable to all supported OSs
423 # Note that this function is defined in spec_helper
426 # Run test that specialize in checking log level config
427 # Note that this function is defined in spec_helper
428 log_level_tests(log_levels: custom_log_levels)
432 # All OVSDB HA enable/disable tests
433 describe 'OVSDB HA enable/disable tests' do
434 # Non-OS-type tests assume CentOS 7
435 # See issue #43 for reasoning:
436 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
438 operatingsystem = 'CentOS'
439 operatingsystemmajrelease = '7'
440 context 'using enable_ha default' do
442 :osfamily => osfamily,
443 :operatingsystem => operatingsystem,
444 :operatingsystemmajrelease => operatingsystemmajrelease,
449 # Run shared tests applicable to all supported OSs
450 # Note that this function is defined in spec_helper
453 # Run test that specialize in checking ODL OVSDB HA config
454 # Note that this function is defined in spec_helper
458 context 'using false for enable_ha' do
460 :osfamily => osfamily,
461 :operatingsystem => operatingsystem,
462 :operatingsystemmajrelease => operatingsystemmajrelease,
469 # Run shared tests applicable to all supported OSs
470 # Note that this function is defined in spec_helper
473 # Run test that specialize in checking ODL OVSDB HA config
474 # Note that this function is defined in spec_helper
475 enable_ha_tests(enable_ha: false)
478 context 'using true for enable_ha' do
479 context 'using ha_node_count >=2' do
481 :osfamily => osfamily,
482 :operatingsystem => operatingsystem,
483 :operatingsystemmajrelease => operatingsystemmajrelease,
488 :ha_node_ips => ['0.0.0.0', '127.0.0.1']
491 # Run shared tests applicable to all supported OSs
492 # Note that this function is defined in spec_helper
495 # Run test that specialize in checking ODL OVSDB HA config
496 # Note that this function is defined in spec_helper
497 enable_ha_tests(enable_ha: true, ha_node_ips: ['0.0.0.0', '127.0.0.1'])
503 # All install method tests
504 describe 'install method tests' do
506 # All tests for RPM install method
508 # Non-OS-type tests assume CentOS 7
509 # See issue #43 for reasoning:
510 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
512 operatingsystem = 'CentOS'
513 operatingsystemrelease = '7.0'
514 operatingsystemmajrelease = '7'
516 context 'installing default RPM' do
518 :osfamily => osfamily,
519 :operatingsystem => operatingsystem,
520 :operatingsystemmajrelease => operatingsystemmajrelease,
523 # Run shared tests applicable to all supported OSs
524 # Note that this function is defined in spec_helper
527 # Run test that specialize in checking RPM-based installs
528 # Note that this function is defined in spec_helper
532 context 'installing Beryllium RPM' do
533 rpm_repo = 'opendaylight-40-release'
535 :osfamily => osfamily,
536 :operatingsystem => operatingsystem,
537 :operatingsystemmajrelease => operatingsystemmajrelease,
541 :rpm_repo => rpm_repo,
544 # Run shared tests applicable to all supported OSs
545 # Note that this function is defined in spec_helper
548 # Run test that specialize in checking RPM-based installs
549 # Note that this function is defined in spec_helper
550 rpm_install_tests(rpm_repo: rpm_repo)
554 # All tests for Deb install method
557 operatingsystem = 'Ubuntu'
558 operatingsystemrelease = '16.04'
559 operatingsystemmajrelease = '16'
560 lsbdistcodename = 'xenial'
562 context 'installing Deb' do
564 :osfamily => osfamily,
565 :operatingsystem => operatingsystem,
566 :operatingsystemrelease => operatingsystemrelease,
567 :operatingsystemmajrelease => operatingsystemmajrelease,
568 :lsbdistid => operatingsystem,
569 :lsbdistrelease => operatingsystemrelease,
570 :lsbmajdistrelease => operatingsystemmajrelease,
571 :lsbdistcodename => lsbdistcodename,
572 :puppetversion => Puppet.version,
575 # Run shared tests applicable to all supported OSs
576 # Note that this function is defined in spec_helper
579 # Run test that specialize in checking RPM-based installs
580 # Note that this function is defined in spec_helper
584 context 'installing Boron Deb' do
585 deb_repo = 'ppa:odl-team/boron'
587 :osfamily => osfamily,
588 :operatingsystem => operatingsystem,
589 :operatingsystemrelease => operatingsystemrelease,
590 :operatingsystemmajrelease => operatingsystemmajrelease,
591 :lsbdistid => operatingsystem,
592 :lsbdistrelease => operatingsystemrelease,
593 :lsbmajdistrelease => operatingsystemmajrelease,
594 :lsbdistcodename => lsbdistcodename,
595 :puppetversion => Puppet.version,
599 :deb_repo => deb_repo,
602 # Run shared tests applicable to all supported OSs
603 # Note that this function is defined in spec_helper
606 # Run test that specialize in checking RPM-based installs
607 # Note that this function is defined in spec_helper
608 deb_install_tests(deb_repo: deb_repo)
614 # Security Group Tests
615 describe 'security group tests' do
616 # Non-OS-type tests assume CentOS 7
617 # See issue #43 for reasoning:
618 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
620 operatingsystem = 'CentOS'
621 operatingsystemmajrelease = '7'
622 context 'using supported stateful' do
624 :osfamily => osfamily,
625 :operatingsystem => operatingsystem,
626 :operatingsystemmajrelease => operatingsystemmajrelease,
627 :operatingsystemrelease => '7.3',
631 :security_group_mode => 'stateful',
632 :extra_features => ['odl-netvirt-openstack'],
635 # Run shared tests applicable to all supported OSs
636 # Note that this function is defined in spec_helper
639 # Run test that specialize in checking security groups
640 # Note that this function is defined in spec_helper
641 enable_sg_tests('stateful', '7.3')
644 context 'using unsupported stateful' do
646 :osfamily => osfamily,
647 :operatingsystem => operatingsystem,
648 :operatingsystemmajrelease => operatingsystemmajrelease,
649 :operatingsystemrelease => '7.2.1511',
653 :security_group_mode => 'stateful',
654 :extra_features => ['odl-netvirt-openstack'],
657 # Run shared tests applicable to all supported OSs
658 # Note that this function is defined in spec_helper
661 # Run test that specialize in checking security groups
662 # Note that this function is defined in spec_helper
663 enable_sg_tests('stateful', '7.2.1511')
666 context 'using transparent with unsupported stateful' do
668 :osfamily => osfamily,
669 :operatingsystem => operatingsystem,
670 :operatingsystemmajrelease => operatingsystemmajrelease,
671 :operatingsystemrelease => '7.2.1511',
675 :security_group_mode => 'transparent',
676 :extra_features => ['odl-netvirt-openstack'],
679 # Run shared tests applicable to all supported OSs
680 # Note that this function is defined in spec_helper
683 # Run test that specialize in checking security groups
684 # Note that this function is defined in spec_helper
685 enable_sg_tests('transparent', '7.2.1511')
689 # VPP routing node config tests
690 describe 'VPP routing node tests' do
691 # Non-OS-type tests assume CentOS 7
692 # See issue #43 for reasoning:
693 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
695 operatingsystem = 'CentOS'
696 operatingsystemmajrelease = '7'
697 context 'using default - no routing node' do
699 :osfamily => osfamily,
700 :operatingsystem => operatingsystem,
701 :operatingsystemmajrelease => operatingsystemmajrelease,
706 # Run shared tests applicable to all supported OSs
707 # Note that this function is defined in spec_helper
710 # Run test that specialize in checking routing-node config
711 # Note that this function is defined in spec_helper
712 vpp_routing_node_tests
715 context 'using node name for routing node' do
717 :osfamily => osfamily,
718 :operatingsystem => operatingsystem,
719 :operatingsystemmajrelease => operatingsystemmajrelease,
723 :vpp_routing_node => 'test-node-1',
726 # Run shared tests applicable to all supported OSs
727 # Note that this function is defined in spec_helper
730 # Run test that specialize in checking routing-node config
731 # Note that this function is defined in spec_helper
732 vpp_routing_node_tests(routing_node: 'test-node-1')