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
26 generic_tests(yum_repo)
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
62 generic_tests(yum_repo)
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 unsupported OS families
83 ['Debian', 'Suse', 'Solaris'].each do |osfamily|
84 context "OS family #{osfamily}" do
86 :osfamily => osfamily,
89 # Run shared tests applicable to all unsupported OSs
90 # Note that this function is defined in spec_helper
91 unsupported_os_tests("Unsupported OS family: #{osfamily}")
96 # All Karaf feature tests
97 describe 'Karaf feature tests' do
98 # Non-OS-type tests assume CentOS 7
99 # See issue #43 for reasoning:
100 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
102 operatingsystem = 'CentOS'
103 operatingsystemmajrelease = '7'
104 # This is the CentOS 7 Yum repo URL
105 yum_repo = 'https://copr-be.cloud.fedoraproject.org/results/dfarrell07/OpenDaylight/epel-7-$basearch/'
106 describe 'using default features' do
107 # NB: This list should be the same as the one in opendaylight::params
108 default_features = ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management']
109 context 'and not passing extra features' do
111 :osfamily => osfamily,
112 :operatingsystem => operatingsystem,
113 :operatingsystemmajrelease => operatingsystemmajrelease,
118 # Run shared tests applicable to all supported OSs
119 # Note that this function is defined in spec_helper
120 generic_tests(yum_repo)
122 # Run test that specialize in checking Karaf feature installs
123 # Note that this function is defined in spec_helper
124 karaf_feature_tests(default_features)
127 context 'and passing extra features' do
129 :osfamily => osfamily,
130 :operatingsystem => operatingsystem,
131 :operatingsystemmajrelease => operatingsystemmajrelease,
134 # These are real but arbitrarily chosen features
135 extra_features = ['odl-base-all', 'odl-ovsdb-all']
137 :extra_features => extra_features,
140 # Run shared tests applicable to all supported OSs
141 # Note that this function is defined in spec_helper
142 generic_tests(yum_repo)
144 # Run test that specialize in checking Karaf feature installs
145 # Note that this function is defined in spec_helper
146 karaf_feature_tests(default_features + extra_features)
150 describe 'overriding default features' do
151 default_features = ['standard', 'ssh']
152 context 'and not passing extra features' do
154 :osfamily => osfamily,
155 :operatingsystem => operatingsystem,
156 :operatingsystemmajrelease => operatingsystemmajrelease,
160 :default_features => default_features,
163 # Run shared tests applicable to all supported OSs
164 # Note that this function is defined in spec_helper
165 generic_tests(yum_repo)
167 # Run test that specialize in checking Karaf feature installs
168 # Note that this function is defined in spec_helper
169 karaf_feature_tests(default_features)
172 context 'and passing extra features' do
174 :osfamily => osfamily,
175 :operatingsystem => operatingsystem,
176 :operatingsystemmajrelease => operatingsystemmajrelease,
179 # These are real but arbitrarily chosen features
180 extra_features = ['odl-base-all', 'odl-ovsdb-all']
182 :default_features => default_features,
183 :extra_features => extra_features,
186 # Run shared tests applicable to all supported OSs
187 # Note that this function is defined in spec_helper
188 generic_tests(yum_repo)
190 # Run test that specialize in checking Karaf feature installs
191 # Note that this function is defined in spec_helper
192 karaf_feature_tests(default_features + extra_features)
197 # All install method tests
198 describe 'install method tests' do
199 # Non-OS-type tests assume CentOS 7
200 # See issue #43 for reasoning:
201 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
203 operatingsystem = 'CentOS'
204 operatingsystemmajrelease = '7'
205 # This is the CentOS 7 Yum repo URL
206 yum_repo = 'https://copr-be.cloud.fedoraproject.org/results/dfarrell07/OpenDaylight/epel-7-$basearch/'
208 # All tests for RPM install method
211 :osfamily => osfamily,
212 :operatingsystem => operatingsystem,
213 :operatingsystemmajrelease => operatingsystemmajrelease,
217 :install_method => 'rpm',
220 # Run shared tests applicable to all supported OSs
221 # Note that this function is defined in spec_helper
222 generic_tests(yum_repo)
224 # Run test that specialize in checking Karaf feature installs
225 # Note that this function is defined in spec_helper
226 install_method_tests('rpm', yum_repo)
229 # All tests for tarball install method
230 describe 'tarball' do
231 describe 'using default tarball_url' do
232 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'
233 context 'using default unitfile_url' do
234 unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz'
236 :osfamily => osfamily,
237 :operatingsystem => operatingsystem,
238 :operatingsystemmajrelease => operatingsystemmajrelease,
242 :install_method => 'tarball',
245 # Run shared tests applicable to all supported OSs
246 # Note that this function is defined in spec_helper
247 generic_tests(yum_repo)
249 # Run test that specialize in checking Karaf feature installs
250 # Note that this function is defined in spec_helper
251 install_method_tests('tarball', yum_repo, tarball_url, unitfile_url)