3 describe 'opendaylight' do
4 context 'supported operating systems' do
6 ['20', '21'].each do |operatingsystemmajrelease|
7 operatingsystem = 'Fedora'
8 describe "opendaylight class without any params on #{osfamily}:#{operatingsystem} #{operatingsystemmajrelease}" do
11 :osfamily => osfamily,
12 :operatingsystem => operatingsystem,
13 :operatingsystemmajrelease => operatingsystemmajrelease,
16 # Run shared tests applicable to all supported OSs
17 # Note that this function is defined in spec_helper
20 # The yum repo URLs for Fedora and CentOS are different, so check here
21 it { should contain_yumrepo('opendaylight').with_baseurl('https://copr-be.cloud.fedoraproject.org/results/dfarrell07/OpenDaylight/fedora-$releasever-$basearch/') }
25 ['7'].each do |operatingsystemmajrelease|
26 operatingsystem = 'CentOS'
27 describe "opendaylight class without any params on #{osfamily}:#{operatingsystem} #{operatingsystemmajrelease}" do
30 :osfamily => osfamily,
31 :operatingsystem => operatingsystem,
32 :operatingsystemmajrelease => operatingsystemmajrelease,
35 # Run shared tests applicable to all supported OSs
36 # Note that this function is defined in spec_helper
39 # The yum repo URLs for Fedora and CentOS are different, so check here
40 it { should contain_yumrepo('opendaylight').with_baseurl('https://copr-be.cloud.fedoraproject.org/results/dfarrell07/OpenDaylight/epel-7-$basearch/') }
45 context 'unsupported operating systems' do
46 # Test unsupported versions of Fedora
47 ['18', '19', '22'].each do |operatingsystemmajrelease|
49 operatingsystem = 'Fedora'
50 describe "opendaylight class without any params on #{osfamily}:#{operatingsystem} #{operatingsystemmajrelease}" do
52 :osfamily => osfamily,
53 :operatingsystem => operatingsystem,
54 :operatingsystemmajrelease => operatingsystemmajrelease,
57 # Run shared tests applicable to all unsupported OSs
58 # Note that this function is defined in spec_helper
59 unsupported_os_tests(operatingsystem, operatingsystemmajrelease)
64 # Test unsupported versions of CentOS
65 ['5', '6', '8'].each do |operatingsystemmajrelease|
67 operatingsystem = 'CentOS'
68 describe "opendaylight class without any params on #{osfamily}:#{operatingsystem} #{operatingsystemmajrelease}" do
70 :osfamily => osfamily,
71 :operatingsystem => operatingsystem,
72 :operatingsystemmajrelease => operatingsystemmajrelease,
75 # Run shared tests applicable to all unsupported OSs
76 # Note that this function is defined in spec_helper
77 unsupported_os_tests(operatingsystem, operatingsystemmajrelease)
82 # Test unsupported OS families
83 ['Debian', 'Suse', 'Solaris'].each do |osfamily|
84 describe "opendaylight class without any params on #{osfamily}" do
86 :osfamily => osfamily,
89 # Confirm that classes fail on unsupported OS families
90 it { expect { should contain_class('opendaylight') }.to raise_error(Puppet::Error, /Unsupported OS family: #{osfamily}/) }
91 it { expect { should contain_class('opendaylight::install') }.to raise_error(Puppet::Error, /Unsupported OS family: #{osfamily}/) }
92 it { expect { should contain_class('opendaylight::config') }.to raise_error(Puppet::Error, /Unsupported OS family: #{osfamily}/) }
93 it { expect { should contain_class('opendaylight::service') }.to raise_error(Puppet::Error, /Unsupported OS family: #{osfamily}/) }
95 # Confirm that other resources fail on unsupported OS families
96 it { expect { should contain_yumrepo('opendaylight') }.to raise_error(Puppet::Error, /Unsupported OS family: #{osfamily}/) }
97 it { expect { should contain_package('opendaylight') }.to raise_error(Puppet::Error, /Unsupported OS family: #{osfamily}/) }
98 it { expect { should contain_service('opendaylight') }.to raise_error(Puppet::Error, /Unsupported OS family: #{osfamily}/) }
99 it { expect { should contain_file('org.apache.karaf.features.cfg') }.to raise_error(Puppet::Error, /Unsupported OS family: #{osfamily}/) }