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 # NB: Passing osfamily required to do upstart vs systemd (default) checks
156 # Note that this function is defined in spec_helper
157 deb_install_tests(osfamily: osfamily)
159 # Run test that specialize in checking Karaf feature installs
160 # NB: Only testing defaults here, specialized Karaf tests elsewhere
161 # Note that this function is defined in spec_helper
164 # Run tests that specialize in checking ODL's REST port config
165 # NB: Only testing defaults here, specialized log level tests elsewhere
166 # Note that this function is defined in spec_helper
169 # Run test that specialize in checking custom log level config
170 # NB: Only testing defaults here, specialized log level tests elsewhere
171 # Note that this function is defined in spec_helper
174 # Run tests that specialize in checking ODL OVSDB HA config
175 # NB: Only testing defaults here, specialized enabling HA tests elsewhere
176 # Note that this function is defined in spec_helper
181 # All tests for unsupported versions of Ubuntu
182 ['12.04', '14.04', '15.10'].each do |operatingsystemrelease|
183 context "#{operatingsystemrelease}" do
185 :osfamily => osfamily,
186 :operatingsystem => operatingsystem,
187 :operatingsystemrelease => operatingsystemrelease,
188 :lsbdistid => operatingsystem,
189 :lsbdistrelease => operatingsystemrelease,
190 :lsbdistcodename => 'xenial',
191 :puppetversion => '4.9.0',
193 # Run shared tests applicable to all unsupported OSs
194 # Note that this function is defined in spec_helper
195 expected_msg = "Unsupported OS: #{operatingsystem} #{operatingsystemrelease}"
196 unsupported_os_tests(expected_msg: expected_msg)
202 # All tests for unsupported OS families
203 ['Suse', 'Solaris'].each do |osfamily|
204 context "OS family #{osfamily}" do
206 :osfamily => osfamily,
209 # Run shared tests applicable to all unsupported OSs
210 # Note that this function is defined in spec_helper
211 expected_msg = "Unsupported OS family: #{osfamily}"
212 unsupported_os_tests(expected_msg: expected_msg)
217 # All Karaf feature tests
218 describe 'Karaf feature tests' do
219 # Non-OS-type tests assume CentOS 7
220 # See issue #43 for reasoning:
221 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
223 operatingsystem = 'CentOS'
224 operatingsystemmajrelease = '7'
225 describe 'using default features' do
226 context 'and not passing extra features' do
228 :osfamily => osfamily,
229 :operatingsystem => operatingsystem,
230 :operatingsystemmajrelease => operatingsystemmajrelease,
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
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 :extra_features => extra_features,
257 # Run shared tests applicable to all supported OSs
258 # Note that this function is defined in spec_helper
261 # Run test that specialize in checking Karaf feature installs
262 # Note that this function is defined in spec_helper
263 karaf_feature_tests(extra_features: extra_features)
267 describe 'overriding default features' do
268 default_features = ['standard', 'ssh']
269 context 'and not passing extra features' do
271 :osfamily => osfamily,
272 :operatingsystem => operatingsystem,
273 :operatingsystemmajrelease => operatingsystemmajrelease,
277 :default_features => default_features,
280 # Run shared tests applicable to all supported OSs
281 # Note that this function is defined in spec_helper
284 # Run test that specialize in checking Karaf feature installs
285 # Note that this function is defined in spec_helper
286 karaf_feature_tests(default_features: default_features)
289 context 'and passing extra features' do
291 :osfamily => osfamily,
292 :operatingsystem => operatingsystem,
293 :operatingsystemmajrelease => operatingsystemmajrelease,
296 # These are real but arbitrarily chosen features
297 extra_features = ['odl-base-all', 'odl-ovsdb-all']
299 :default_features => default_features,
300 :extra_features => extra_features,
303 # Run shared tests applicable to all supported OSs
304 # Note that this function is defined in spec_helper
307 # Run test that specialize in checking Karaf feature installs
308 # Note that this function is defined in spec_helper
309 karaf_feature_tests(default_features: default_features, extra_features: extra_features)
314 # All ODL REST port tests
315 describe 'REST port tests' do
316 # Non-OS-type tests assume CentOS 7
317 # See issue #43 for reasoning:
318 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
320 operatingsystem = 'CentOS'
321 operatingsystemmajrelease = '7'
322 context 'using default REST port' do
324 :osfamily => osfamily,
325 :operatingsystem => operatingsystem,
326 :operatingsystemmajrelease => operatingsystemmajrelease,
331 # Run shared tests applicable to all supported OSs
332 # Note that this function is defined in spec_helper
335 # Run test that specialize in checking ODL REST port config
336 # Note that this function is defined in spec_helper
340 context 'overriding default REST port' do
342 :osfamily => osfamily,
343 :operatingsystem => operatingsystem,
344 :operatingsystemmajrelease => operatingsystemmajrelease,
348 :odl_rest_port => 7777,
351 # Run shared tests applicable to all supported OSs
352 # Note that this function is defined in spec_helper
355 # Run test that specialize in checking ODL REST port config
356 # Note that this function is defined in spec_helper
357 odl_rest_port_tests(odl_rest_port: 7777)
361 # All custom log level tests
362 describe 'custom log level tests' do
363 # Non-OS-type tests assume CentOS 7
364 # See issue #43 for reasoning:
365 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
367 operatingsystem = 'CentOS'
368 operatingsystemmajrelease = '7'
369 context 'using default log levels' do
371 :osfamily => osfamily,
372 :operatingsystem => operatingsystem,
373 :operatingsystemmajrelease => operatingsystemmajrelease,
378 # Run shared tests applicable to all supported OSs
379 # Note that this function is defined in spec_helper
382 # Run test that specialize in checking custom log level config
383 # Note that this function is defined in spec_helper
387 context 'adding one custom log level' do
389 :osfamily => osfamily,
390 :operatingsystem => operatingsystem,
391 :operatingsystemmajrelease => operatingsystemmajrelease,
394 custom_log_levels = { 'org.opendaylight.ovsdb' => 'TRACE' }
397 :log_levels => custom_log_levels,
400 # Run shared tests applicable to all supported OSs
401 # Note that this function is defined in spec_helper
404 # Run test that specialize in checking log level config
405 # Note that this function is defined in spec_helper
406 log_level_tests(log_levels: custom_log_levels)
409 context 'adding two custom log levels' do
411 :osfamily => osfamily,
412 :operatingsystem => operatingsystem,
413 :operatingsystemmajrelease => operatingsystemmajrelease,
416 custom_log_levels = { 'org.opendaylight.ovsdb' => 'TRACE',
417 'org.opendaylight.ovsdb.lib' => 'INFO' }
420 :log_levels => custom_log_levels,
423 # Run shared tests applicable to all supported OSs
424 # Note that this function is defined in spec_helper
427 # Run test that specialize in checking log level config
428 # Note that this function is defined in spec_helper
429 log_level_tests(log_levels: custom_log_levels)
433 # All OVSDB HA enable/disable tests
434 describe 'OVSDB HA enable/disable tests' do
435 # Non-OS-type tests assume CentOS 7
436 # See issue #43 for reasoning:
437 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
439 operatingsystem = 'CentOS'
440 operatingsystemmajrelease = '7'
441 context 'using enable_ha default' do
443 :osfamily => osfamily,
444 :operatingsystem => operatingsystem,
445 :operatingsystemmajrelease => operatingsystemmajrelease,
450 # Run shared tests applicable to all supported OSs
451 # Note that this function is defined in spec_helper
454 # Run test that specialize in checking ODL OVSDB HA config
455 # Note that this function is defined in spec_helper
459 context 'using false for enable_ha' do
461 :osfamily => osfamily,
462 :operatingsystem => operatingsystem,
463 :operatingsystemmajrelease => operatingsystemmajrelease,
470 # Run shared tests applicable to all supported OSs
471 # Note that this function is defined in spec_helper
474 # Run test that specialize in checking ODL OVSDB HA config
475 # Note that this function is defined in spec_helper
476 enable_ha_tests(enable_ha: false)
479 context 'using true for enable_ha' do
480 context 'using ha_node_count >=2' do
482 :osfamily => osfamily,
483 :operatingsystem => operatingsystem,
484 :operatingsystemmajrelease => operatingsystemmajrelease,
489 :ha_node_ips => ['0.0.0.0', '127.0.0.1']
492 # Run shared tests applicable to all supported OSs
493 # Note that this function is defined in spec_helper
496 # Run test that specialize in checking ODL OVSDB HA config
497 # Note that this function is defined in spec_helper
498 enable_ha_tests(enable_ha: true, ha_node_ips: ['0.0.0.0', '127.0.0.1'])
504 # All install method tests
505 describe 'install method tests' do
507 # All tests for RPM install method
509 # Non-OS-type tests assume CentOS 7
510 # See issue #43 for reasoning:
511 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
513 operatingsystem = 'CentOS'
514 operatingsystemrelease = '7.0'
515 operatingsystemmajrelease = '7'
517 context 'installing default RPM' do
519 :osfamily => osfamily,
520 :operatingsystem => operatingsystem,
521 :operatingsystemmajrelease => operatingsystemmajrelease,
524 # Run shared tests applicable to all supported OSs
525 # Note that this function is defined in spec_helper
528 # Run test that specialize in checking RPM-based installs
529 # Note that this function is defined in spec_helper
533 context 'installing Beryllium RPM' do
534 rpm_repo = 'opendaylight-40-release'
536 :osfamily => osfamily,
537 :operatingsystem => operatingsystem,
538 :operatingsystemmajrelease => operatingsystemmajrelease,
542 :rpm_repo => rpm_repo,
545 # Run shared tests applicable to all supported OSs
546 # Note that this function is defined in spec_helper
549 # Run test that specialize in checking RPM-based installs
550 # Note that this function is defined in spec_helper
551 rpm_install_tests(rpm_repo: rpm_repo)
555 # All tests for Deb install method
558 operatingsystem = 'Ubuntu'
559 operatingsystemrelease = '16.04'
560 operatingsystemmajrelease = '16'
561 lsbdistcodename = 'xenial'
563 context 'installing Deb' do
565 :osfamily => osfamily,
566 :operatingsystem => operatingsystem,
567 :operatingsystemrelease => operatingsystemrelease,
568 :operatingsystemmajrelease => operatingsystemmajrelease,
569 :lsbdistid => operatingsystem,
570 :lsbdistrelease => operatingsystemrelease,
571 :lsbmajdistrelease => operatingsystemmajrelease,
572 :lsbdistcodename => lsbdistcodename,
573 :puppetversion => Puppet.version,
576 # Run shared tests applicable to all supported OSs
577 # Note that this function is defined in spec_helper
580 # Run test that specialize in checking RPM-based installs
581 # Note that this function is defined in spec_helper
585 context 'installing Boron Deb' do
586 deb_repo = 'ppa:odl-team/boron'
588 :osfamily => osfamily,
589 :operatingsystem => operatingsystem,
590 :operatingsystemrelease => operatingsystemrelease,
591 :operatingsystemmajrelease => operatingsystemmajrelease,
592 :lsbdistid => operatingsystem,
593 :lsbdistrelease => operatingsystemrelease,
594 :lsbmajdistrelease => operatingsystemmajrelease,
595 :lsbdistcodename => lsbdistcodename,
596 :puppetversion => Puppet.version,
600 :deb_repo => deb_repo,
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 RPM-based installs
608 # Note that this function is defined in spec_helper
609 deb_install_tests(deb_repo: deb_repo)
615 # Security Group Tests
616 describe 'security group tests' do
617 # Non-OS-type tests assume CentOS 7
618 # See issue #43 for reasoning:
619 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
621 operatingsystem = 'CentOS'
622 operatingsystemmajrelease = '7'
623 context 'using supported stateful' do
625 :osfamily => osfamily,
626 :operatingsystem => operatingsystem,
627 :operatingsystemmajrelease => operatingsystemmajrelease,
628 :operatingsystemrelease => '7.3',
632 :security_group_mode => 'stateful',
633 :extra_features => ['odl-netvirt-openstack'],
636 # Run shared tests applicable to all supported OSs
637 # Note that this function is defined in spec_helper
640 # Run test that specialize in checking security groups
641 # Note that this function is defined in spec_helper
642 enable_sg_tests('stateful', '7.3')
645 context 'using unsupported stateful' do
647 :osfamily => osfamily,
648 :operatingsystem => operatingsystem,
649 :operatingsystemmajrelease => operatingsystemmajrelease,
650 :operatingsystemrelease => '7.2.1511',
654 :security_group_mode => 'stateful',
655 :extra_features => ['odl-netvirt-openstack'],
658 # Run shared tests applicable to all supported OSs
659 # Note that this function is defined in spec_helper
662 # Run test that specialize in checking security groups
663 # Note that this function is defined in spec_helper
664 enable_sg_tests('stateful', '7.2.1511')
667 context 'using transparent with unsupported stateful' do
669 :osfamily => osfamily,
670 :operatingsystem => operatingsystem,
671 :operatingsystemmajrelease => operatingsystemmajrelease,
672 :operatingsystemrelease => '7.2.1511',
676 :security_group_mode => 'transparent',
677 :extra_features => ['odl-netvirt-openstack'],
680 # Run shared tests applicable to all supported OSs
681 # Note that this function is defined in spec_helper
684 # Run test that specialize in checking security groups
685 # Note that this function is defined in spec_helper
686 enable_sg_tests('transparent', '7.2.1511')
690 # VPP routing node config tests
691 describe 'VPP routing node tests' do
692 # Non-OS-type tests assume CentOS 7
693 # See issue #43 for reasoning:
694 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
696 operatingsystem = 'CentOS'
697 operatingsystemmajrelease = '7'
698 context 'using default - no routing node' do
700 :osfamily => osfamily,
701 :operatingsystem => operatingsystem,
702 :operatingsystemmajrelease => operatingsystemmajrelease,
707 # Run shared tests applicable to all supported OSs
708 # Note that this function is defined in spec_helper
711 # Run test that specialize in checking routing-node config
712 # Note that this function is defined in spec_helper
713 vpp_routing_node_tests
716 context 'using node name for routing node' do
718 :osfamily => osfamily,
719 :operatingsystem => operatingsystem,
720 :operatingsystemmajrelease => operatingsystemmajrelease,
724 :vpp_routing_node => 'test-node-1',
727 # Run shared tests applicable to all supported OSs
728 # Note that this function is defined in spec_helper
731 # Run test that specialize in checking routing-node config
732 # Note that this function is defined in spec_helper
733 vpp_routing_node_tests(routing_node: 'test-node-1')