-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add integration tests #90
add integration tests #90
Conversation
- mix udp tcp - multiple hosts - snmpv3 connection
- mix udp tcp - multiple hosts - snmpv3 connection
- invalid user - multiple inputs with mix tcp udp hosts
- same security name mix of udp tcp hosts - ipv6 connection
Great stuff @kaisecheng! I added a few minor/cosmetic comments. I will be spending more time to run the new testing and followup shortly. |
6743295
to
2fb2fc8
Compare
…nmp into integration-test � Conflicts: � CHANGELOG.md
I believe logstash-plugins/.ci#16 will solve the build problem on 8.0 |
spec/inputs/integration/it_spec.rb
Outdated
end | ||
end | ||
|
||
describe "against snmp server", :integration => true do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe "against snmp server", :integration => true do | |
describe "against single snmp server with snmpv2 and udp", :integration => true do |
spec/inputs/integration/it_spec.rb
Outdated
it_behaves_like "snmp plugin return single event" | ||
end | ||
|
||
describe "against snmpv3 server", :integration => true do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe "against snmpv3 server", :integration => true do | |
describe "against single server with snmpv3 and tcp", :integration => true do |
it_behaves_like "snmp plugin return single event" | ||
end | ||
|
||
describe "invalid user against snmpv3 server", :integration => true do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe "invalid user against snmpv3 server", :integration => true do | |
describe "invalid user against single server with snmpv3 and tcp", :integration => true do |
spec/inputs/integration/it_spec.rb
Outdated
end | ||
end | ||
|
||
describe "single plugin input and mix of udp tcp", :integration => true do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe "single plugin input and mix of udp tcp", :integration => true do | |
describe "single input plugin on single server with snmpv2 and mix of udp and tcp", :integration => true do |
spec/inputs/integration/it_spec.rb
Outdated
plugin.run(queue) | ||
plugin.close | ||
|
||
host_cnt_snmp1 = queue.reduce(0) { |sum, event| sum + (event.get("host") == "snmp1"? 1: 0) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would something like this be simpler and/or easier to understand?
host_cnt_snmp1 = queue.select {|event| event.get("host") == "snmp1"}.size
spec/inputs/integration/it_spec.rb
Outdated
end | ||
end | ||
|
||
describe "single plugin input and multiple udp hosts", :integration => true do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe "single plugin input and multiple udp hosts", :integration => true do | |
describe "single input plugin on multiple udp hosts", :integration => true do |
plugin.run(queue) | ||
plugin.close | ||
|
||
hosts = queue.map { |event| event.get("host") }.sort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or this method here could be used instead of my suggestion with select
for the sake of consitency?
spec/inputs/integration/it_spec.rb
Outdated
it_behaves_like "snmp plugin return one udp event and one tcp event", config | ||
end | ||
|
||
describe "same security name with different credentials and mix of udp tcp hosts", :integration => true do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe "same security name with different credentials and mix of udp tcp hosts", :integration => true do | |
describe "two plugins on different hosts with snmpv3 with same security name with different credentials and mix of udp and tcp", :integration => true do |
spec/inputs/integration/it_spec.rb
Outdated
it_behaves_like "snmp plugin return one udp event and one tcp event", config | ||
end | ||
|
||
describe "ipv6 against snmp1 server", :integration => true do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe "ipv6 against snmp1 server", :integration => true do | |
describe "single host with tcp over ipv6 ", :integration => true do |
@kaisecheng again, this is great work, overall LGTM, left a few minor comments. Once these are addressed and this is rebased we should be good to merge! |
Forgot to add for the record that I successfully tested locally on OSX & Docker and it works great and will be a blessing for future testing!! |
The PR does integration tests against two SNMP dockers with ipv6 to simulate the scenarios below.