Do all tarball Beaker tests with a tarball install[
[integration/packaging/puppet-opendaylight.git] / spec / acceptance / class_spec.rb
1 require 'spec_helper_acceptance'
2
3 # NB: There are a large number of helper functions used in these tests.
4 # They make this code much more friendly, but may need to be referenced.
5 #   The serverspec helpers (`should`, `be_running`...) are documented here:
6 #     http://serverspec.org/resource_types.html
7 #   Custom helpers (`install_odl`, `*_validations`) are in:
8 #     <this module>/spec/spec_helper_acceptance.rb
9
10 describe 'opendaylight class' do
11   describe 'testing install methods' do
12     # Call specialized helper fn to install OpenDaylight
13     install_odl
14
15     # Run checks specific to install type, via env var passed from Rakefile
16     if ENV['INSTALL_METHOD'] == 'tarball'
17       # TODO: Call specialized helper fn for tarball-type install validations
18     else
19       # Call specialized helper fn for RPM-type install validations
20       rpm_validations
21     end
22
23     # Use helper fn to run generic validations
24     generic_validations
25   end
26
27   describe 'testing Karaf config file' do
28     describe 'using default features' do
29       context 'and not passing extra features' do
30         # Call specialized helper fn to install OpenDaylight
31         install_odl
32
33         # Call specialized helper fn for Karaf config validations
34         karaf_config_validations
35       end
36
37       context 'and passing extra features' do
38         # These are real but arbitrarily chosen features
39         extra_features = ['odl-base-all', 'odl-ovsdb-all']
40
41         # Call specialized helper fn to install OpenDaylight
42         install_odl(extra_features: extra_features)
43
44         # Call specialized helper fn for Karaf config validations
45         karaf_config_validations(extra_features: extra_features)
46       end
47     end
48
49     describe 'overriding default features' do
50       # These are real but arbitrarily chosen features
51       default_features = ['standard', 'ssh']
52
53       context 'and not passing extra features' do
54         # Call specialized helper fn to install OpenDaylight
55         install_odl(default_features: default_features)
56
57         # Call specialized helper fn for Karaf config validations
58         karaf_config_validations(default_features: default_features)
59       end
60
61       context 'and passing extra features' do
62         # These are real but arbitrarily chosen features
63         extra_features = ['odl-base-all', 'odl-ovsdb-all']
64
65         # Call specialized helper fn to install OpenDaylight
66         install_odl(default_features: default_features,
67                     extra_features: extra_features)
68
69         # Call specialized helper fn for Karaf config validations
70         karaf_config_validations(default_features: default_features,
71                                  extra_features: extra_features)
72       end
73     end
74   end
75 end