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 # TODO: Remove this possible source of bugs^^
109 default_features = ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management']
110 context 'and not passing extra features' do
112 :osfamily => osfamily,
113 :operatingsystem => operatingsystem,
114 :operatingsystemmajrelease => operatingsystemmajrelease,
119 # Run shared tests applicable to all supported OSs
120 # Note that this function is defined in spec_helper
121 generic_tests(yum_repo)
123 # Run test that specialize in checking Karaf feature installs
124 # Note that this function is defined in spec_helper
125 karaf_feature_tests(default_features)
128 context 'and passing extra features' do
130 :osfamily => osfamily,
131 :operatingsystem => operatingsystem,
132 :operatingsystemmajrelease => operatingsystemmajrelease,
135 # These are real but arbitrarily chosen features
136 extra_features = ['odl-base-all', 'odl-ovsdb-all']
138 :extra_features => extra_features,
141 # Run shared tests applicable to all supported OSs
142 # Note that this function is defined in spec_helper
143 generic_tests(yum_repo)
145 # Run test that specialize in checking Karaf feature installs
146 # Note that this function is defined in spec_helper
147 karaf_feature_tests(default_features + extra_features)
151 describe 'overriding default features' do
152 default_features = ['standard', 'ssh']
153 context 'and not passing extra features' do
155 :osfamily => osfamily,
156 :operatingsystem => operatingsystem,
157 :operatingsystemmajrelease => operatingsystemmajrelease,
161 :default_features => default_features,
164 # Run shared tests applicable to all supported OSs
165 # Note that this function is defined in spec_helper
166 generic_tests(yum_repo)
168 # Run test that specialize in checking Karaf feature installs
169 # Note that this function is defined in spec_helper
170 karaf_feature_tests(default_features)
173 context 'and passing extra features' do
175 :osfamily => osfamily,
176 :operatingsystem => operatingsystem,
177 :operatingsystemmajrelease => operatingsystemmajrelease,
180 # These are real but arbitrarily chosen features
181 extra_features = ['odl-base-all', 'odl-ovsdb-all']
183 :default_features => default_features,
184 :extra_features => extra_features,
187 # Run shared tests applicable to all supported OSs
188 # Note that this function is defined in spec_helper
189 generic_tests(yum_repo)
191 # Run test that specialize in checking Karaf feature installs
192 # Note that this function is defined in spec_helper
193 karaf_feature_tests(default_features + extra_features)
198 # All install method tests
199 describe 'install method tests' do
200 # Non-OS-type tests assume CentOS 7
201 # See issue #43 for reasoning:
202 # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
204 operatingsystem = 'CentOS'
205 operatingsystemmajrelease = '7'
206 # This is the CentOS 7 Yum repo URL
207 yum_repo = 'https://copr-be.cloud.fedoraproject.org/results/dfarrell07/OpenDaylight/epel-7-$basearch/'
209 # All tests for RPM install method
212 :osfamily => osfamily,
213 :operatingsystem => operatingsystem,
214 :operatingsystemmajrelease => operatingsystemmajrelease,
218 :install_method => 'rpm',
221 # Run shared tests applicable to all supported OSs
222 # Note that this function is defined in spec_helper
223 generic_tests(yum_repo)
225 # Run test that specialize in checking Karaf feature installs
226 # Note that this function is defined in spec_helper
227 install_method_tests('rpm', yum_repo)
230 # All tests for tarball install method
231 describe 'tarball' do
232 describe 'using default tarball_url' do
233 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'
234 context 'using default unitfile_url' do
235 unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz'
237 :osfamily => osfamily,
238 :operatingsystem => operatingsystem,
239 :operatingsystemmajrelease => operatingsystemmajrelease,
240 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
244 :install_method => 'tarball',
247 # Run shared tests applicable to all supported OSs
248 # Note that this function is defined in spec_helper
249 generic_tests(yum_repo)
251 # Run test that specialize in checking Karaf feature installs
252 # Note that this function is defined in spec_helper
253 install_method_tests('tarball', yum_repo, tarball_url, unitfile_url)
256 context 'overriding default unitfile_url' do
257 # Doesn't matter if this is valid, just that it honors what we pass
258 unitfile_url = 'fake_unitfile'
260 :osfamily => osfamily,
261 :operatingsystem => operatingsystem,
262 :operatingsystemmajrelease => operatingsystemmajrelease,
263 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
267 :install_method => 'tarball',
268 :unitfile_url => unitfile_url,
271 # Run shared tests applicable to all supported OSs
272 # Note that this function is defined in spec_helper
273 generic_tests(yum_repo)
275 # Run test that specialize in checking Karaf feature installs
276 # Note that this function is defined in spec_helper
277 install_method_tests('tarball', yum_repo, tarball_url, unitfile_url)
281 describe 'overriding default tarball_url' do
282 # Doesn't matter if this is valid, just that it honors what we pass
283 tarball_url = 'fake_tarball'
284 context 'using default unitfile_url' do
285 unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz'
287 :osfamily => osfamily,
288 :operatingsystem => operatingsystem,
289 :operatingsystemmajrelease => operatingsystemmajrelease,
290 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
294 :install_method => 'tarball',
295 :tarball_url => tarball_url,
298 # Run shared tests applicable to all supported OSs
299 # Note that this function is defined in spec_helper
300 generic_tests(yum_repo)
302 # Run test that specialize in checking Karaf feature installs
303 # Note that this function is defined in spec_helper
304 install_method_tests('tarball', yum_repo, tarball_url, unitfile_url)
307 context 'overriding default unitfile_url' do
308 # Doesn't matter if this is valid, just that it honors what we pass
309 unitfile_url = 'fake_unitfile'
311 :osfamily => osfamily,
312 :operatingsystem => operatingsystem,
313 :operatingsystemmajrelease => operatingsystemmajrelease,
314 :path => ['/usr/local/bin', '/usr/bin', '/bin'],
318 :install_method => 'tarball',
319 :tarball_url => tarball_url,
320 :unitfile_url => unitfile_url,
323 # Run shared tests applicable to all supported OSs
324 # Note that this function is defined in spec_helper
325 generic_tests(yum_repo)
327 # Run test that specialize in checking Karaf feature installs
328 # Note that this function is defined in spec_helper
329 install_method_tests('tarball', yum_repo, tarball_url, unitfile_url)