1 require 'spec_helper_acceptance'
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
10 describe 'opendaylight class' do
11 describe 'testing install methods' do
12 # Call specialized helper fn to install OpenDaylight
15 # Run checks specific to install type, via env var passed from Rakefile
16 if :osfamily == 'RedHat'
17 # Call specialized helper fn for RPM-type install validations
19 elsif :osfamily == 'Debian'
20 # Call specialized helper fn for Deb-type install validations
24 # Use helper fn to run generic validations
28 describe 'testing Karaf config file' do
29 describe 'using default features' do
30 context 'and not passing extra features' do
31 # Call specialized helper fn to install OpenDaylight
34 # Call specialized helper fn for Karaf config validations
35 karaf_config_validations
38 context 'and passing extra features' do
39 # These are real but arbitrarily chosen features
40 extra_features = ['odl-base-all', 'odl-ovsdb-all']
42 # Call specialized helper fn to install OpenDaylight
43 install_odl(extra_features: extra_features)
45 # Call specialized helper fn for Karaf config validations
46 karaf_config_validations(extra_features: extra_features)
50 describe 'overriding default features' do
51 # These are real but arbitrarily chosen features
52 default_features = ['standard', 'ssh']
54 context 'and not passing extra features' do
55 # Call specialized helper fn to install OpenDaylight
56 install_odl(default_features: default_features)
58 # Call specialized helper fn for Karaf config validations
59 karaf_config_validations(default_features: default_features)
62 context 'and passing extra features' do
63 # These are real but arbitrarily chosen features
64 extra_features = ['odl-base-all', 'odl-ovsdb-all']
66 # Call specialized helper fn to install OpenDaylight
67 install_odl(default_features: default_features,
68 extra_features: extra_features)
70 # Call specialized helper fn for Karaf config validations
71 karaf_config_validations(default_features: default_features,
72 extra_features: extra_features)
77 describe 'testing REST port config file' do
78 context 'using default port' do
79 # Call specialized helper fn to install OpenDaylight
82 # Call specialized helper fn for REST port config validations
83 port_config_validations
86 context 'overriding default port' do
87 # Call specialized helper fn to install OpenDaylight
88 install_odl(odl_rest_port: 7777)
90 # Call specialized helper fn for REST port config validations
91 port_config_validations(odl_rest_port: 7777)
95 describe 'testing custom logging verbosity' do
96 context 'using default log levels' do
97 # Call specialized helper fn to install OpenDaylight
100 # Call specialized helper fn for custom logger verbosity validations
101 log_level_validations
104 context 'adding one custom log level' do
105 custom_log_levels = { 'org.opendaylight.ovsdb' => 'TRACE' }
107 # Call specialized helper fn to install OpenDaylight
108 install_odl(log_levels: custom_log_levels)
110 # Call specialized helper fn for custom logger verbosity validations
111 log_level_validations(log_levels: custom_log_levels)
114 context 'adding two custom log level' do
115 custom_log_levels = { 'org.opendaylight.ovsdb' => 'TRACE',
116 'org.opendaylight.ovsdb.lib' => 'INFO' }
118 # Call specialized helper fn to install OpenDaylight
119 install_odl(log_levels: custom_log_levels)
121 # Call specialized helper fn for custom logger verbosity validations
122 log_level_validations(log_levels: custom_log_levels)
126 describe 'testing odl username/password' do
127 context 'using default username/password' do
128 context 'using default log levels' do
129 # Call specialized helper fn to install OpenDaylight
130 install_odl({:extra_features => ['odl-restconf']})
132 # Call specialized helper fn for username/password validations
133 username_password_validations