Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ljblancoredborder committed Aug 16, 2024
1 parent ed29893 commit af2542b
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions spec/services/logstash_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,35 @@

describe "Checking service status for #{service}..." do
regex = '^- pipeline\.id: .*-pipeline$'
has_pipelines = command("grep --perl-regex '#{regex}' #{PIPELINES_PATH}")
has_pipelines = command("grep --perl-regex '#{regex}' #{PIPELINES_PATH}").exit_status == 0

unless has_pipelines.exit_status == 0
if has_pipelines
describe service(service) do
it { should_not be_enabled }
it { should_not be_running }
it { should be_enabled }
it { should be_running }
end
describe port(port) do
it { should_not be_listening }
it { should be_listening }
end

packages.each do |package|
describe package(package) do
it { should_not be_installed }
it { should be_installed }
end
end

end

if has_pipelines.exit_status == 0
else
describe service(service) do
it { should be_enabled }
it { should be_running }
it { should_not be_enabled }
it { should_not be_running }
end
describe port(port) do
it { should be_listening }
it { should_not be_listening }
end

packages.each do |package|
describe package(package) do
it { should be_installed }
it { should_not be_installed }
end
end

end
end

0 comments on commit af2542b

Please sign in to comment.