Skip to content

Commit

Permalink
Revert "lint"
Browse files Browse the repository at this point in the history
This reverts commit f1299d1.
  • Loading branch information
ljblancoredborder committed Aug 16, 2024
1 parent 0ffe183 commit ed29893
Showing 1 changed file with 30 additions and 15 deletions.
45 changes: 30 additions & 15 deletions spec/services/logstash_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,39 @@

describe "Checking service status for #{service}..." do
regex = '^- pipeline\.id: .*-pipeline$'
has_pipelines = command("grep --perl-regex '#{regex}' #{PIPELINES_PATH}").exit_status == 0
expected_state = has_pipelines ? :be_enabled : :not_be_enabled
expected_running = has_pipelines ? :be_running : :not_be_running
expected_listening = has_pipelines ? :be_listening : :not_be_listening
expected_installed = has_pipelines ? :be_installed : :not_be_installed

describe service(service) do
it { should send(expected_state) }
it { should send(expected_running) }
end
has_pipelines = command("grep --perl-regex '#{regex}' #{PIPELINES_PATH}")

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

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

describe port(port) do
it { should send(expected_listening) }
end

packages.each do |package|
describe package(package) do
it { should send(expected_installed) }
if has_pipelines.exit_status == 0
describe service(service) do
it { should be_enabled }
it { should be_running }
end
describe port(port) do
it { should be_listening }
end

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

end
end

0 comments on commit ed29893

Please sign in to comment.