bitcoin icon indicating copy to clipboard operation
bitcoin copied to clipboard

fuzz: fuzz connman with non-empty addrman + ASMap

Open brunoerg opened this issue 11 months ago • 4 comments

Motivation

Currently, we fuzz connman with an addrman from NodeContext. However, fuzzing connman with only empty addrman might not be effective, especially for functions like GetAddresses and other ones that plays with addrman. Also, we do not fuzz connman with ASMap, what would be good for functions that need GetGroup, or even for addrman. Without it, I do not see how effective would be fuzzing ASMapHealthCheck, for example.

Changes

  • Move AddrManDeterministic and ConsumeNetGroupManager to util.
  • Use ConsumeNetGroupManager in connman target to construct a netgroupmanager and use it for ConnmanTestMsg.
  • Use AddrManDeterministic in connman target to create an addrman. It does not slow down as "filling" the addrman (e.g. with FillAddrman).
  • Add coverage for ASMapHealthCheck.

brunoerg avatar Mar 02 '24 09:03 brunoerg