diff options
author | fanquake <fanquake@gmail.com> | 2024-01-09 09:35:04 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2024-01-09 09:43:13 +0000 |
commit | f921d949a0357149596031683cdacaa86c020100 (patch) | |
tree | eb8b6311d3482545898b81549ea298a6ea5d63ca | |
parent | c2d04f1319a6af6140d17339c4814e0cfc605dd2 (diff) | |
parent | e5b9ee0221ec8aa238fb5720fcd6faa01b09fe46 (diff) |
Merge bitcoin/bitcoin#29172: fuzz: set `nMaxOutboundLimit` in connman target
e5b9ee0221ec8aa238fb5720fcd6faa01b09fe46 fuzz: set `nMaxOutboundLimit` in connman target (brunoerg)
Pull request description:
Setting `nMaxOutboundLimit` (`-maxuploadtarget`) will make fuzz to reach more coverage in connman target. This value is used in `GetMaxOutboundTimeLeftInCycle`, `OutboundTargetReached` and `GetOutboundTargetBytesLeft`.
ACKs for top commit:
dergoegge:
utACK e5b9ee0221ec8aa238fb5720fcd6faa01b09fe46
jonatack:
ACK e5b9ee0221ec8aa238fb5720fcd6faa01b09fe46
Tree-SHA512: d19c83602b0a487e6da0e3be539aa2abc95b8bbf36cf9a3e391a4af53b959f68ca38548a96d27d56742e3b772f648da04e2bf8973dfc0ab1cdabf4f2e8d44de6
-rw-r--r-- | src/test/fuzz/connman.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/fuzz/connman.cpp b/src/test/fuzz/connman.cpp index 24f91abd25..66f1e19b65 100644 --- a/src/test/fuzz/connman.cpp +++ b/src/test/fuzz/connman.cpp @@ -38,6 +38,10 @@ FUZZ_TARGET(connman, .init = initialize_connman) *g_setup->m_node.netgroupman, Params(), fuzzed_data_provider.ConsumeBool()}; + + const uint64_t max_outbound_limit{fuzzed_data_provider.ConsumeIntegral<uint64_t>()}; + connman.Init({ .nMaxOutboundLimit = max_outbound_limit }); + CNetAddr random_netaddr; CNode random_node = ConsumeNode(fuzzed_data_provider); CSubNet random_subnet; @@ -125,7 +129,7 @@ FUZZ_TARGET(connman, .init = initialize_connman) (void)connman.GetAddedNodeInfo(fuzzed_data_provider.ConsumeBool()); (void)connman.GetExtraFullOutboundCount(); (void)connman.GetLocalServices(); - (void)connman.GetMaxOutboundTarget(); + assert(connman.GetMaxOutboundTarget() == max_outbound_limit); (void)connman.GetMaxOutboundTimeframe(); (void)connman.GetMaxOutboundTimeLeftInCycle(); (void)connman.GetNetworkActive(); |