spec/inputs/integration/it_spec.rb in logstash-input-snmp-1.3.1 vs spec/inputs/integration/it_spec.rb in logstash-input-snmp-1.3.2
- old
+ new
@@ -1,10 +1,10 @@
require "logstash/devutils/rspec/spec_helper"
require "logstash/inputs/snmp"
describe LogStash::Inputs::Snmp do
- let(:config) { {"get" => ["1.3.6.1.2.1.1.1.0", "1.3.6.1.2.1.1.3.0", "1.3.6.1.2.1.1.5.0"]} }
+ let(:config) { {"get" => %w[1.3.6.1.2.1.1.1.0 1.3.6.1.2.1.1.3.0 1.3.6.1.2.1.1.5.0], "ecs_compatibility" => "disabled" } }
let(:plugin) { LogStash::Inputs::Snmp.new(config)}
shared_examples "snmp plugin return single event" do
it "should have OID value" do
plugin.register
@@ -112,12 +112,12 @@
expect(hosts).to eq(["snmp1", "snmp2"])
end
end
describe "multiple pipelines and mix of udp tcp hosts", :integration => true do
- let(:config) { {"get" => ["1.3.6.1.2.1.1.1.0"], "hosts" => [{"host" => "udp:snmp1/161", "community" => "public"}]} }
- let(:config2) { {"get" => ["1.3.6.1.2.1.1.1.0"], "hosts" => [{"host" => "tcp:snmp2/162", "community" => "public"}]} }
+ let(:config) { {"get" => ["1.3.6.1.2.1.1.1.0"], "hosts" => [{"host" => "udp:snmp1/161", "community" => "public"}], "ecs_compatibility" => "disabled" } }
+ let(:config2) { {"get" => ["1.3.6.1.2.1.1.1.0"], "hosts" => [{"host" => "tcp:snmp2/162", "community" => "public"}], "ecs_compatibility" => "disabled"} }
let(:plugin) { LogStash::Inputs::Snmp.new(config)}
let(:plugin2) { LogStash::Inputs::Snmp.new(config2)}
it "should return two events, one per host" do
plugin.register
@@ -146,14 +146,16 @@
config = <<-CONFIG
input {
snmp {
get => ["1.3.6.1.2.1.1.1.0"]
hosts => [{host => "udp:snmp1/161" community => "public"}]
+ ecs_compatibility => "disabled"
}
snmp {
get => ["1.3.6.1.2.1.1.1.0"]
hosts => [{host => "tcp:snmp2/162" community => "public"}]
+ ecs_compatibility => "disabled"
}
}
CONFIG
it_behaves_like "snmp plugin return one udp event and one tcp event", config
@@ -169,19 +171,21 @@
auth_protocol => "sha"
auth_pass => "STrP@SSPhr@sE"
priv_protocol => "aes"
priv_pass => "STr0ngP@SSWRD161"
security_level => "authPriv"
+ ecs_compatibility => "disabled"
}
snmp {
get => ["1.3.6.1.2.1.1.1.0"]
hosts => [{host => "tcp:snmp2/162" version => "3"}]
security_name => "user_1"
auth_protocol => "sha"
auth_pass => "STrP@SSPhr@sE"
priv_protocol => "aes"
priv_pass => "STr0ngP@SSWRD162"
security_level => "authPriv"
+ ecs_compatibility => "disabled"
}
}
CONFIG
it_behaves_like "snmp plugin return one udp event and one tcp event", config
\ No newline at end of file