From cede85ed22038195fa33599bd6c87e17ea27266b Mon Sep 17 00:00:00 2001 From: Luis Blanco Date: Fri, 24 May 2024 16:43:10 +0100 Subject: [PATCH] check topics definition in config file and check some pipelines are there --- spec/configuration/kafka_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spec/configuration/kafka_spec.rb diff --git a/spec/configuration/kafka_spec.rb b/spec/configuration/kafka_spec.rb new file mode 100644 index 0000000..fc3c34d --- /dev/null +++ b/spec/configuration/kafka_spec.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +require 'spec_helper' +set :os, family: 'redhat', release: '9', arch: 'x86_64' +pipelines = %w[ + rb_flow + rb_nmsp + rb_state + rb_vault + sflow +] + +describe 'Check logstash config' do + describe file('/etc/kafka/topics_definitions.yml') do + it { should exist } + it { should be_file } + it { should be_readable } + it { should be_writable.by_user('kafka') } + it { should_not be_writable.by('others') } + it { should_not be_executable } + pipelines.each do |pipeline| + it { should contain pipeline } + end + end +end