Fix SNMP trap test race (#7731)

This commit is contained in:
reimda 2020-06-24 12:50:01 -06:00 committed by GitHub
parent 47bc60fba1
commit 7f3c30b8f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -1287,6 +1287,8 @@ func TestReceiveTrap(t *testing.T) {
PrivPassword: tt.privPass,
}
require.Nil(t, s.Init())
// Don't look up oid with snmptranslate.
s.execCmd = fakeExecCmd
var acc testutil.Accumulator
require.Nil(t, s.Start(&acc))
defer s.Stop()
@ -1297,9 +1299,6 @@ func TestReceiveTrap(t *testing.T) {
s.load(entry.oid, entry.e)
}
// Don't look up oid with snmptranslate.
s.execCmd = fakeExecCmd
// Send the trap
sendTrap(t, port, now, tt.trap, tt.version, tt.secLevel, tt.secName, tt.authProto, tt.authPass, tt.privProto, tt.privPass, tt.contextName, tt.engineID)