mirror of https://github.com/bitcoin/bitcoin
master
27.x
28.x
26.x
25.x
24.x
v27.2
v27.2rc1
v28.0
v28.0rc2
v28.0rc1
v26.2
v26.2rc1
v27.1
v27.1rc1
v23-final
v27.0
v25.2
v26.1
v25.2rc2
v26.1rc2
v27.0rc1
v25.2rc1
v26.1rc1
v26.0
v26.0rc3
v26.0rc2
v26.0rc1
v24.2
v25.1
v24.2rc1
v25.1rc1
v22-final
v25.0
v23.2
v24.1
v23.2rc1
v25.0rc2
v24.1rc3
v25.0rc1
v24.1rc2
v0.21-final
v24.1rc1
v0.20-final
v0.19-final
v0.18-final
v23.1
v24.0.1
v22.1
v22.1rc2
v23.1rc2
v24.0
v24.0rc4
v23.1rc1
v22.1rc1
v24.0rc3
v24.0rc2
v24.0rc1
v23.0
v23.0rc5
v23.0rc4
v23.0rc3
v23.0rc2
v23.0rc1
v0.20.2
v0.17-final
v0.16-final
v0.21.2
v22.0
v0.20.2rc3
v0.21.2rc2
v22.0rc3
v0.21.2rc1
v22.0rc2
v22.0rc1
v0.20.2rc2
v21.99-guixtest1
v0.21.1
v0.21.1rc1
v0.21.0
v0.19.2
v0.21.0rc5
v0.21.0rc4
v0.20.2rc1
v0.19.2rc1
v0.21.0rc3
v0.21.0rc2
v0.21.0rc1
v0.20.1
v0.20.1rc1
v0.20.0
v0.20.0rc2
v0.20.0rc1
v0.19.1
v0.19.1rc2
v0.19.1rc1
v0.19.0.1
v0.19.0
v0.19.0rc3
v0.19.0rc2
v0.19.0rc1
v0.17.2
v0.17.2rc2
v0.17.2rc1
v0.18.1
v0.18.1rc1
v0.18.0
v0.18.0rc4
v0.18.0rc3
v0.18.0rc2
v0.18.0rc1
v0.17.1
v0.17.1rc1
v0.17.0.1
v0.17.0
v0.14.3
v0.15.2
v0.16.3
v0.17.0rc4
v0.17.0rc3
v0.17.0rc2
v0.17.0rc1
v0.16.2
v0.16.2rc2
v0.16.2rc1
v0.16.1
v0.16.1rc2
v0.16.1rc1
noversion
v0.16.0
v0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v0.6.0rc4
v0.5.3
v0.6.0rc3
v0.5.3rc4
v0.6.0rc2
v0.6.0rc1
v0.5.2
v0.5.1
v0.5.1rc2
v0.5.1rc1
v0.5.0
v0.5.0rc7
v0.5.0rc6
v0.5.0rc5
v0.5.0rc4
v0.5.0rc3
v0.5.0rc2
v0.5.0rc1
v0.4.0
v0.4.00rc2
v0.4.00rc1
v0.3.24
v0.3.24rc3
v0.3.24rc2
v0.3.24rc1
v0.3.23
v0.3.23rc1
v0.3.22
v0.3.22rc6
v0.3.22rc5
v0.3.22rc4
v0.3.22rc3
v0.3.22rc2
v0.3.22rc1
v0.3.21
v0.3.21rc
v0.3.20.2
v0.3.20
v0.1.5
v0.1.6test1
v0.12-final
v0.13-final
v0.2.0
v0.2.10
v0.2.11
v0.2.12
v0.2.13
v0.2.2
v0.2.4
v0.2.5
v0.2.6
v0.2.7
v0.2.8
v0.2.9
v0.2rc2
v0.3.0
v0.3.1
v0.3.10
v0.3.11_notexact
v0.3.12
v0.3.13
v0.3.14
v0.3.15
v0.3.17
v0.3.18
v0.3.19
v0.3.1rc1
v0.3.2
v0.3.20.01_closest
v0.3.20.2_closest
v0.3.3
v0.3.6
v0.3.7
v0.3.8
v0.3rc1
v0.3rc2
v0.3rc4
v0.8-final
v0.9-final
${ noResults }
12 Commits (f1bcf3edc5027b501616670db33d8be1f2cb5a11)
Author | SHA1 | Message | Date |
---|---|---|---|
MarcoFalke |
fa3ea3b83c
|
test: Fix intermittent issue in p2p_v2_misbehaving.py
Without the fix, the test could fail intermittently. For example: node0 2024-07-22T16:31:54.104994Z [httpworker.0] [rpc/request.cpp:232] [parse] [rpc] ThreadRPCServer method=setmocktime user=__cookie__ test 2024-07-22T16:31:54.291000Z TestFramework (INFO): Sending first 4 bytes of ellswift which match network magic test 2024-07-22T16:31:54.292000Z TestFramework (INFO): If a response is received, assertion failure would happen in our custom data_received() function test 2024-07-22T16:31:54.292000Z TestFramework.p2p (DEBUG): Connecting to Bitcoin Node: 127.0.0.1:12644 test 2024-07-22T16:31:54.293000Z TestFramework.p2p (DEBUG): Connected & Listening: 127.0.0.1:12644 test 2024-07-22T16:31:54.588000Z TestFramework.p2p (DEBUG): sending 4050 bytes of garbage data test 2024-07-22T16:31:54.588000Z TestFramework (INFO): Sending remaining ellswift and garbage which are different from V1_PREFIX. Since a response is test 2024-07-22T16:31:54.588000Z TestFramework (INFO): expected now, our custom data_received() function wouldn't result in assertion failure node0 2024-07-22T16:31:55.523868Z (mocktime: 2024-07-22T16:31:54Z) [net] [net.cpp:3764] [CNode] [net] Added connection peer=0 node0 2024-07-22T16:31:55.625145Z (mocktime: 2024-07-22T16:31:54Z) [net] [net.cpp:1814] [CreateNodeFromAcceptedSocket] [net] connection from 127.0.0.1:45154 accepted node0 2024-07-22T16:31:55.625769Z (mocktime: 2024-07-22T16:31:54Z) [http] [httpserver.cpp:305] [http_request_cb] [http] Received a POST request for / from 127.0.0.1:33320 node0 2024-07-22T16:31:55.626543Z (mocktime: 2024-07-22T16:31:54Z) [httpworker.1] [rpc/request.cpp:232] [parse] [rpc] ThreadRPCServer method=getpeerinfo user=__cookie__ test 2024-07-22T16:31:55.818000Z TestFramework (ERROR): Unexpected exception caught during testing Traceback (most recent call last): File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 132, in main self.run_test() File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/p2p_v2_misbehaving.py", line 133, in run_test self.test_earlykeyresponse() File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/p2p_v2_misbehaving.py", line 151, in test_earlykeyresponse self.wait_until(lambda: node0.getpeerinfo()[-1]["bytesrecv"] > 4) File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 791, in wait_until return wait_until_helper_internal(test_function, timeout=timeout, timeout_factor=self.options.timeout_factor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/util.py", line 289, in wait_until_helper_internal if predicate(): ^^^^^^^^^^^ File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/p2p_v2_misbehaving.py", line 151, in <lambda> self.wait_until(lambda: node0.getpeerinfo()[-1]["bytesrecv"] > 4) ~~~~~~~~~~~~~~~~~~~^^^^ IndexError: list index out of range |
4 months ago |
glozow |
3a29ff5dea
|
Merge bitcoin/bitcoin#30463: qa: Functional test improvements
|
4 months ago |
stratospher | c322bddd08 |
test: bump mocktime after node has received and sent bytes
a different error message "socket no message in first %i seconds" will be displayed if m_last_send=0 or if m_last_recv is 0. make the test robust by ensuring that they will not be 0 before bumping mocktime. |
4 months ago |
Hennadii Stepanov |
a0473442d1
|
scripted-diff: Add `__file__` argument to `BitcoinTestFramework.init()`
-BEGIN VERIFY SCRIPT- sed -i -e 's/\s*().main\s*()/(__file__).main()/' $(git ls-files test/functional/*.py) sed -i -e 's/def __init__(self)/def __init__(self, test_file)/' test/functional/test_framework/test_framework.py -END VERIFY SCRIPT- |
4 months ago |
stratospher | c6d43367a1 |
test: Fix intermittent failure in p2p_v2_misbehaving.py
The ellswift bytes are computed in the NetworkThread and sent in the MainThread. Add a `wait_until()` to make sure that ellswift computation is completed in NetworkThread before sending it in the MainThread. Also wait until bytes sent are actually received and use mocktime for more robust disconnection checking. |
4 months ago |
stratospher | c9dacd958d |
test: Check that non empty version packet is ignored and no disconnection happens
This test type is represented using SEND_NON_EMPTY_VERSION_PACKET. |
5 months ago |
stratospher | 997cc00b95 |
test: Check that disconnection happens when AAD isn't filled
This test type is represented using SEND_NO_AAD. If AAD of the first encrypted packet sent after the garbage terminator (optional decoy packet/version packet) hasn't been filled, disconnection happens. |
5 months ago |
stratospher | b5e6238fdb |
test: Check that disconnection happens when garbage sent/received are different
This test type is represented using WRONG_GARBAGE. Here, garbage bytes sent to TestNode are assumed to be tampered with and do not correspond to the garbage bytes which P2PInterface calculated and uses. |
5 months ago |
stratospher | ad1482d5a2 |
test: Check that disconnection happens when wrong garbage terminator is sent
This test type is represented using WRONG_GARBAGE_TERMINATOR. since the wrong garbage terminator is sent to TestNode, TestNode will interpret all of the gabage bytes, wrong garbage terminator, decoy messages and version packet it receives as garbage bytes. If the length of all these is more than 4095 + 16, it will result in a missing garbage terminator error. otherwise, it will result in a V2 handshake timeout error. Send only MAX_GARBAGE_LEN//2 bytes of garbage data to TestNode so that the total length received by the TestNode is at max = (MAX_GARBAGE_LEN//2) + 16 + 10*120 + 20 = 3283 bytes (which is less than 4095 + 16 bytes) and we get a consistent V2 handshake timeout error message. If we do not limit the garbage length sent, we will intermittently get both missing garbage terminator error and V2 handshake timeout error based on the garbage length and decoy packets length which are chosen at random. |
5 months ago |
stratospher | e351576862 |
test: Check that disconnection happens when >4095 garbage bytes is sent
This test type is represented using EXCESS_GARBAGE. |
5 months ago |
stratospher | e075fd131d |
test: Introduce test types and modify v2 handshake function accordingly
Prior to this commit, TestEncryptedP2PState would always send initial_v2_handshake bytes in 2 parts (as required by early key response test). For generalising this test and having different v2 handshake behaviour based on the test type, special behaviours like sending initial_v2_handshake bytes in 2 parts are executed only if test_type is set to EARLY_KEY_RESPONSE. |
5 months ago |
stratospher | bf9669af9c |
test: Rename early key response test and move random_bitflip to util
Early key response test is a special kind of test which requires modified v2 handshake functions. More such tests can be added where v2 handshake functions send incorrect garbage terminator, excess garbage bytes etc.. Hence, rename p2p_v2_earlykey.py to a general test file name - p2p_v2_misbehaving.py. random_bitflip function (used in signature tests prior to this commit) can be used in p2p_v2_misbehaving test to generate wrong garbage terminator, wrong garbage bytes etc.. So, move the function to util. |
8 months ago |