diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-12-30 11:10:34 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-12-30 11:10:46 +0100 |
commit | f3d6a5ce772e28b997b6cd88c7e60faa52d158fb (patch) | |
tree | 57e981f789341770ced3286cbb9325bb63c1d23b | |
parent | de28c348a0ef866e6d25c06551a1e1c085f41815 (diff) | |
parent | da349f131a57640340f32c62c5d9b06a415d74ec (diff) |
Merge bitcoin/bitcoin#23879: test: check ban_duration and time_remaining after setting ban
da349f131a57640340f32c62c5d9b06a415d74ec test: check ban_duration and time_remaining after setting ban (brunoerg)
Pull request description:
This PR adds functional test coverage for `ban_duration` and `time_remaining` introduced in #21602
ACKs for top commit:
shaavan:
ACK da349f131a57640340f32c62c5d9b06a415d74ec
theStack:
Tested ACK da349f131a57640340f32c62c5d9b06a415d74ec
Tree-SHA512: 51e63f3a36adb1c81e4d49426486af2cd9c8c4319f94e06a47fa7da8100a8b53c029d28d4a4771bdbf4e0a2bfb4ddd3740b9974bd08d8ff06f2a0fc2b6d8a6b5
-rwxr-xr-x | test/functional/p2p_disconnect_ban.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/p2p_disconnect_ban.py b/test/functional/p2p_disconnect_ban.py index fb8529ad2b..721a5a4c57 100755 --- a/test/functional/p2p_disconnect_ban.py +++ b/test/functional/p2p_disconnect_ban.py @@ -70,6 +70,15 @@ class DisconnectBanTest(BitcoinTestFramework): self.nodes[1].setmocktime(old_time + 3) assert_equal(len(self.nodes[1].listbanned()), 3) + self.log.info("Test ban_duration and time_remaining") + for ban in self.nodes[1].listbanned(): + if ban["address"] in ["127.0.0.0/32", "127.0.0.0/24"]: + assert_equal(ban["ban_duration"], 86400) + assert_equal(ban["time_remaining"], 86397) + elif ban["address"] == "2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/19": + assert_equal(ban["ban_duration"], 1000) + assert_equal(ban["time_remaining"], 997) + self.restart_node(1) listAfterShutdown = self.nodes[1].listbanned() |