-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adjust the service for each os type and correct the control 10 #16
Conversation
Signed-off-by: Patrick Münch <[email protected]>
controls/postgres_spec.rb
Outdated
it { should be_enabled } | ||
end | ||
when '16.04' | ||
describe systemd_service(postgres.service) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be related to inspec/inspec#931, similar things are reported to happen with debian
controls/postgres_spec.rb
Outdated
describe processes('postgres') do | ||
its('list.length') { should eq 1 } | ||
end | ||
elsif os[:family] == 'redhat' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use os.redhat?
and os.debian?
controls/postgres_spec.rb
Outdated
else | ||
describe processes('postgres') do | ||
its('list.length') { should eq 1 } | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe:
if os.redhat? && os.release.include?('6')
pg_command = 'postmaster'
else
pg_command = 'postgres'
end
describe processes('postmaster') do
its('list.length') { should eq 1 }
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the input. i will do the changes
controls/postgres_spec.rb
Outdated
describe command('/etc/init.d/postgresql status') do | ||
its('stdout') { should include 'online' } | ||
end | ||
# describe upstart_service(postgres.service) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets remove those comments and keep the original test commented out, because that is where we want to go back to. InSpec should handle that properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, i agree.
2de5473
to
8bd8ddf
Compare
Signed-off-by: Patrick Münch <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @atomic111
Signed-off-by: Patrick Münch [email protected]