1 require 'spec_helper_acceptance'
3 # Note that helpers (`should`, `be_running`...) are documented here:
4 # http://serverspec.org/resource_types.html
5 describe 'opendaylight class' do
7 context 'default parameters' do
8 # Using puppet_apply as a helper
9 it 'should work idempotently with no errors' do
11 class { 'opendaylight': }
14 # Run it twice and test for idempotency
15 apply_manifest(pp, :catch_failures => true)
16 apply_manifest(pp, :catch_changes => true)
19 # TODO: It'd be nice to do this independently of install dir name
20 describe file('/opt/opendaylight-0.2.1/') do
21 it { should be_directory }
22 it { should be_owned_by 'odl' }
23 it { should be_grouped_into 'odl' }
24 it { should be_mode '775' }
27 # TODO: It'd be nice to do this independently of install dir name
28 describe file('/opt/opendaylight-0.2.1/etc/org.apache.karaf.features.cfg') do
30 it { should be_owned_by 'odl' }
31 it { should be_grouped_into 'odl' }
32 it { should be_mode '775' }
33 it { should contain 'featuresBoot' }
36 describe yumrepo('opendaylight') do
38 it { should be_enabled }
41 describe package('opendaylight') do
42 it { should be_installed }
45 describe service('opendaylight') do
46 it { should be_enabled }
47 it { should be_enabled.with_level(3) }
48 it { should be_running }
51 # OpenDaylight will appear as a Java process
52 describe process('java') do
53 it { should be_running }
56 describe user('odl') do
58 it { should belong_to_group 'odl' }
59 it { should have_home_directory '/opt/opendaylight-0.2.1' }
62 describe file('/home/odl') do
63 # Home dir shouldn't be created for odl user
64 it { should_not be_directory }