Merge pull request #7303 from ziggie1984/fuzz_tests_custommessages

Add Custom Message to Fuzz Testing
This commit is contained in:
Oliver Gugger 2023-01-23 10:13:39 +01:00 committed by GitHub
commit 3a6aaf6275
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -225,6 +225,9 @@ data.
* [Decreased the mutex lock
scope](https://github.com/lightningnetwork/lnd/pull/7330) inside `ChannelRouter`.
* [Add Custom Message to the fuzz testsuite
in the lnwire package](https://github.com/lightningnetwork/lnd/pull/7303)
## `lncli`
* [Add an `insecure` flag to skip tls auth as well as a `metadata` string slice
@ -411,3 +414,4 @@ refactor the itest for code health and maintenance.
* Tommy Volk
* Yong Yu
* Yusuke Shimizu
* ziggie1984

View file

@ -807,3 +807,18 @@ func FuzzUpdateFulfillHTLC(f *testing.F) {
harness(t, data)
})
}
func FuzzCustomMessage(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte, customMessageType uint16) {
if customMessageType < uint16(CustomTypeStart) {
customMessageType += uint16(CustomTypeStart)
}
// Prefix with CustomMessage.
data = prefixWithMsgType(data, MessageType(customMessageType))
// Pass the message into our general fuzz harness for wire
// messages!
harness(t, data)
})
}