logstash-plugins / logstash-integration-snmp

Logstash Integration Plugin for SNMP, including SNMP input and SNMP Trap Plugins
Apache License 2.0
0 stars 3 forks source link

[Test Failure] Tests are failing on Logstash 8.x #35

Closed robbavey closed 4 months ago

robbavey commented 2 years ago

SNMP unit tests are failing on Logstash 8.x, likely due to ECS compatibility set by default

snmp_ls     | Failures:
snmp_ls     | 
snmp_ls     |   1) LogStash::Inputs::Snmp two plugins on different hosts with snmpv3 with same security name with different credentials and mix of udp and tcp behaves like snmp plugin return one udp event and one tcp event should have one udp from snmp1 and one tcp from snmp2
snmp_ls     |      Failure/Error: expect(event.get("[@metadata][host_protocol]")).to eq("tcp")
snmp_ls     |      
snmp_ls     |        expected: "tcp"
snmp_ls     |             got: nil
snmp_ls     |      
snmp_ls     |        (compared using ==)
snmp_ls     |      Shared Example Group: "snmp plugin return one udp event and one tcp event" called from ./spec/inputs/integration/it_spec.rb:188
snmp_ls     |      # ./spec/inputs/integration/it_spec.rb:36:in `block in /usr/share/plugins/plugin/spec/inputs/integration/it_spec.rb'
snmp_ls     |      # ./spec/inputs/integration/it_spec.rb:28:in `block in /usr/share/plugins/plugin/spec/inputs/integration/it_spec.rb'
snmp_ls     | 
snmp_ls     |   2) LogStash::Inputs::Snmp single input plugin on single server with snmpv2 and mix of udp and tcp should return two events 
snmp_ls     |      Failure/Error: expect(host_cnt_snmp1).to eq(2)
snmp_ls     |      
snmp_ls     |        expected: 2
snmp_ls     |             got: 0
snmp_ls     |      
snmp_ls     |        (compared using ==)
snmp_ls     |      # ./spec/inputs/integration/it_spec.rb:97:in `block in <main>'
snmp_ls     | 
snmp_ls     |   3) LogStash::Inputs::Snmp multiple plugin inputs and mix of udp tcp hosts behaves like snmp plugin return one udp event and one tcp event should have one udp from snmp1 and one tcp from snmp2
snmp_ls     |      Failure/Error: expect(event.get("[@metadata][host_protocol]")).to eq("tcp")
snmp_ls     |      
snmp_ls     |        expected: "tcp"
snmp_ls     |             got: nil
snmp_ls     |      
snmp_ls     |        (compared using ==)
snmp_ls     |      Shared Example Group: "snmp plugin return one udp event and one tcp event" called from ./spec/inputs/integration/it_spec.rb:159
snmp_ls     |      # ./spec/inputs/integration/it_spec.rb:36:in `block in <main>'
snmp_ls     |      # ./spec/inputs/integration/it_spec.rb:28:in `block in <main>'
snmp_ls     | 
snmp_ls     |   4) LogStash::Inputs::Snmp single input plugin on multiple udp hosts should return two events, one per host
snmp_ls     |      Failure/Error: hosts = queue.map { |event| event.get("host") }.sort
snmp_ls     |      
snmp_ls     |      ArgumentError:
snmp_ls     |        comparison of Hash with Hash failed
snmp_ls     |      # ./spec/inputs/integration/it_spec.rb:110:in `block in <main>'
snmp_ls     | 
snmp_ls     |   5) LogStash::Inputs::Snmp multiple pipelines and mix of udp tcp hosts should return two events, one per host
snmp_ls     |      Failure/Error: hosts = [queue.pop, queue2.pop].map { |event| event.get("host") }.sort
snmp_ls     |      
snmp_ls     |      ArgumentError:
snmp_ls     |        comparison of Hash with Hash failed
snmp_ls     |      # ./spec/inputs/integration/it_spec.rb:140:in `block in <main>'
snmp_ls     | 
snmp_ls     | Finished in 49.7 seconds (files took 9.47 seconds to load)
snmp_ls     | 9 examples, 5 failures
snmp_ls     | 
snmp_ls     | Failed examples:
snmp_ls     | 
snmp_ls     | rspec './spec/inputs/integration/it_spec.rb[1:8:1:1]' # LogStash::Inputs::Snmp two plugins on different hosts with snmpv3 with same security name with different credentials and mix of udp and tcp behaves like snmp plugin return one udp event and one tcp event should have one udp from snmp1 and one tcp from snmp2
snmp_ls     | rspec ./spec/inputs/integration/it_spec.rb:88 # LogStash::Inputs::Snmp single input plugin on single server with snmpv2 and mix of udp and tcp should return two events 
snmp_ls     | rspec './spec/inputs/integration/it_spec.rb[1:7:1:1]' # LogStash::Inputs::Snmp multiple plugin inputs and mix of udp tcp hosts behaves like snmp plugin return one udp event and one tcp event should have one udp from snmp1 and one tcp from snmp2
snmp_ls     | rspec ./spec/inputs/integration/it_spec.rb:103 # LogStash::Inputs::Snmp single input plugin on multiple udp hosts should return two events, one per host
snmp_ls     | rspec ./spec/inputs/integration/it_spec.rb:122 # LogStash::Inputs::Snmp multiple pipelines and mix of udp tcp hosts should return two events, one per host
snmp_ls     | 
snmp_ls     | Randomized with seed 15116
edmocosta commented 4 months ago

Fixed