Skip to content

Commit

Permalink
rpm: indent
Browse files Browse the repository at this point in the history
Signed-off-by: Kentaro Hayashi <[email protected]>
  • Loading branch information
kenhys committed Jul 29, 2024
1 parent 258e60f commit 7631ab3
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions serverspec/kafka/confluent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
require "rdkafka"

if ["redhat", "amazon"].include?(os[:family])
describe "rdkafka" do
it "can receive message via Rdkafka client" do
config = {
"bootstrap.servers": "localhost:9092",
"group.id": "test"
}
consumer = Rdkafka::Config.new(config).consumer
consumer.subscribe("test")
describe "rdkafka" do
it "can receive message via Rdkafka client" do
config = {
"bootstrap.servers": "localhost:9092",
"group.id": "test"
}
consumer = Rdkafka::Config.new(config).consumer
consumer.subscribe("test")

wait_for_consumer_assignment(consumer)
wait_for_consumer_assignment(consumer)

`echo "Hello, rdkafka" | /usr/bin/kafka-console-producer --broker-list localhost:9092 --topic test`
`echo "Hello, rdkafka" | /usr/bin/kafka-console-producer --broker-list localhost:9092 --topic test`

message = consumer.each { |message| break message }
expect(message.payload).to eq "Hello, rdkafka"
message = consumer.each { |message| break message }
expect(message.payload).to eq "Hello, rdkafka"
end
end
end

describe "fluent-plugin-kafka" do
it "can receive message via fluent-plugin-kafka" do
`echo "Hello, fluent-plugin-kafka" | /usr/bin/kafka-console-producer --broker-list localhost:9092 --topic test`
Dir.glob("/tmp/log/td-agent/*.log") do |path|
File.open(path) do |file|
expect(JSON.parse(file.readlines.last)["message"]).to eq "Hello, fluent-plugin-kafka"
describe "fluent-plugin-kafka" do
it "can receive message via fluent-plugin-kafka" do
`echo "Hello, fluent-plugin-kafka" | /usr/bin/kafka-console-producer --broker-list localhost:9092 --topic test`
Dir.glob("/tmp/log/td-agent/*.log") do |path|
File.open(path) do |file|
expect(JSON.parse(file.readlines.last)["message"]).to eq "Hello, fluent-plugin-kafka"
end
end
end
end
end
end

0 comments on commit 7631ab3

Please sign in to comment.