Skip to content
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

Merged
merged 2 commits into from
Mar 8, 2017

Conversation

atomic111
Copy link
Member

Signed-off-by: Patrick Münch [email protected]

it { should be_enabled }
end
when '16.04'
describe systemd_service(postgres.service) do
Copy link
Member

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

describe processes('postgres') do
its('list.length') { should eq 1 }
end
elsif os[:family] == 'redhat'
Copy link
Member

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?

@atomic111 atomic111 changed the title WIP: adjust the service for each os type and correct the control 10 adjust the service for each os type and correct the control 10 Mar 8, 2017
else
describe processes('postgres') do
its('list.length') { should eq 1 }
end
Copy link
Member

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

Copy link
Member Author

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

describe command('/etc/init.d/postgresql status') do
its('stdout') { should include 'online' }
end
# describe upstart_service(postgres.service) do
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i agree.

@atomic111 atomic111 force-pushed the master branch 3 times, most recently from 2de5473 to 8bd8ddf Compare March 8, 2017 10:29
Signed-off-by: Patrick Münch <[email protected]>
Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @atomic111

@chris-rock chris-rock merged commit 0b83be5 into dev-sec:master Mar 8, 2017
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants