Skip to content

Commit 9c18992

Browse files
committed
test: add coverage for -bantime
1 parent 8c4958b commit 9c18992

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/functional/rpc_setban.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
from test_framework.test_framework import BitcoinTestFramework
88
from test_framework.util import (
9-
p2p_port
9+
p2p_port,
10+
assert_equal,
1011
)
1112

1213
class SetBanTests(BitcoinTestFramework):
@@ -70,6 +71,11 @@ def run_test(self):
7071
assert not self.is_banned(node, tor_addr)
7172
assert not self.is_banned(node, ip_addr)
7273

74+
self.log.info("Test -bantime")
75+
self.restart_node(1, ["-bantime=1234"])
76+
self.nodes[1].setban("127.0.0.1", "add")
77+
banned = self.nodes[1].listbanned()[0]
78+
assert_equal(banned['ban_duration'], 1234)
7379

7480
if __name__ == '__main__':
7581
SetBanTests().main()

0 commit comments

Comments
 (0)