aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrunoerg <brunoely.gc@gmail.com>2022-11-29 15:34:59 -0300
committerbrunoerg <brunoely.gc@gmail.com>2023-03-15 12:26:50 -0300
commit9c18992bbaf649f8c5461d5e4dc39eb1a07ffc77 (patch)
tree77997b8554ab984ec6e6a4c5c5b4d3698b555381
parent8c4958bd4c06026dc108bc7f5f063d1f389d279b (diff)
test: add coverage for `-bantime`
-rwxr-xr-xtest/functional/rpc_setban.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/functional/rpc_setban.py b/test/functional/rpc_setban.py
index 97354f480c..b4f3d77e5b 100755
--- a/test/functional/rpc_setban.py
+++ b/test/functional/rpc_setban.py
@@ -6,7 +6,8 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
- p2p_port
+ p2p_port,
+ assert_equal,
)
class SetBanTests(BitcoinTestFramework):
@@ -70,6 +71,11 @@ class SetBanTests(BitcoinTestFramework):
assert not self.is_banned(node, tor_addr)
assert not self.is_banned(node, ip_addr)
+ self.log.info("Test -bantime")
+ self.restart_node(1, ["-bantime=1234"])
+ self.nodes[1].setban("127.0.0.1", "add")
+ banned = self.nodes[1].listbanned()[0]
+ assert_equal(banned['ban_duration'], 1234)
if __name__ == '__main__':
SetBanTests().main()