Skip to content

Commit

Permalink
Add integration test for opengrok_configuration resource.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceilfors committed Aug 18, 2016
1 parent 0aef839 commit d941b83
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions resources/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# TODO: Need to configure OpenGrok web.xml to point to this file when we configure web.xml
template ::File.join(home_path, 'etc/configuration.xml') do
source 'configuration.xml.erb'
cookbook 'opengrok'
owner opengrok_user
group opengrok_group
variables({
Expand All @@ -27,12 +28,14 @@
# TODO: Who is pointing to this logging.properties file?
template ::File.join(home_path, 'logging.properties') do
source 'logging.properties.erb'
cookbook 'opengrok'
owner opengrok_user
group opengrok_group
end

template ::File.join(home_path, 'index.sh') do
source 'index.sh.erb'
cookbook 'opengrok'
owner opengrok_user
group opengrok_group
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
version '100'
opengrok_user 'custom_user'
opengrok_group 'custom_group'
end
end

opengrok_configuration '/var/custom/opengrok' do
opengrok_user 'custom_user'
opengrok_group 'custom_group'
end
17 changes: 17 additions & 0 deletions test/integration/override_properties/inspec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,20 @@
describe command('curl http://localhost:8080/source/') do
its(:stdout) { should match %r(<title>Search</title>) }
end

%w(src data etc log).each do |dir|
describe file("/var/custom/opengrok/#{dir}") do
it { should be_directory }
it { should be_owned_by 'custom_user' }
end
end

describe file('/var/custom/opengrok/etc/configuration.xml') do
it { should be_file }
it { should be_owned_by 'custom_user' }
end

describe file('/var/custom/opengrok/logging.properties') do
it { should be_file }
it { should be_owned_by 'custom_user' }
end

0 comments on commit d941b83

Please sign in to comment.