test: Add mockable steady clock, tests for PCP and NATPMP implementations
Summary:
The first commit was applied to D19759 (*net: Add optional length checking to CService::SetSockAddr*)
util: Add mockable steady_clock
This adds a NodeSteadyClock, which is a steady_clock that can be mocked
with millisecond precision.
net: Use mockable steady clock in PCP implementation
This will be needed for the test harness.
test: Add tests for PCP and NATPMP implementations
Add a mock for a simple scriptable UDP server, and use this to test
various code paths (including successful mappings, timeouts and errors)
in the PCP and NATPMP implementations.
qa: cover PROTOCOL_ERROR variant in PCP unit tests
This concludes backport of core#31022
Depends on D19760
Test Plan: ninja check
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D19761