Skip to content

Commit

Permalink
fuzz: set nMaxOutboundLimit in connman target
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoerg committed Jan 5, 2024
1 parent 65c05db commit e5b9ee0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/fuzz/connman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e5b9ee0

Please sign in to comment.