HomePhabricator

[backport#19177] test: Fix and clean p2p_invalid_messages functional tests

Description

[backport#19177] test: Fix and clean p2p_invalid_messages functional tests

Summary:
af2a145e575f23c64909e6cf1fb323c603bda7ca Refactor resource exhaustion test (Troy Giorshev)
5c4648d17ba18e4194959963994cc6b37053f127 Fix "invalid message size" test (Troy Giorshev)
ff1e7b884447a5ba10553b2d964625f94e255bdc Move size limits to module-global (Troy Giorshev)
57890abf2c7919eddfec36178b1136cd44ffe883 Remove two unneeded tests (Troy Giorshev)

Pull request description:

This PR touches only the p2p_invalid_messages.py functional test module.  There are two main goals accomplished here.  First, it fixes the "invalid message size" test, which previously made a message that was invalid for multiple reasons.  Second, it refactors the file into a single consistent style.  This file appears to have originally had two authors, with different styles and some test duplication.

It should now be easier and quicker to understand this module, anticipating the upcoming [BIP324](https://github.com/bitcoin/bitcoin/pull/18242) and [AltNet](https://github.com/bitcoin/bitcoin/issues/18989) changes.

This should probably go in ahead of #19107, but the two are not strictly related.

Depends on D9511

Backport of core#19177

Test Plan:

ninja all && ./test/functional/test_runner.py p2p_invalid_messages

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D9519

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Jun 12 2020, 19:29
majcostaCommitted on May 13 2021, 12:30
majcostaPushed on May 13 2021, 12:30
Reviewer
Restricted Project
Differential Revision
D9519: [backport#19177] test: Fix and clean p2p_invalid_messages functional tests
Parents
rABCf5b30883d748: [backport#19083] test: msg_mempool, fRelay, and other bloomfilter tests
Branches
Unknown
Tags
Unknown