Skip to content

Commit da349f1

Browse files
committed
test: check ban_duration and time_remaining after setting ban
1 parent d3582f2 commit da349f1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/functional/p2p_disconnect_ban.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ def run_test(self):
7070
self.nodes[1].setmocktime(old_time + 3)
7171
assert_equal(len(self.nodes[1].listbanned()), 3)
7272

73+
self.log.info("Test ban_duration and time_remaining")
74+
for ban in self.nodes[1].listbanned():
75+
if ban["address"] in ["127.0.0.0/32", "127.0.0.0/24"]:
76+
assert_equal(ban["ban_duration"], 86400)
77+
assert_equal(ban["time_remaining"], 86397)
78+
elif ban["address"] == "2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/19":
79+
assert_equal(ban["ban_duration"], 1000)
80+
assert_equal(ban["time_remaining"], 997)
81+
7382
self.restart_node(1)
7483

7584
listAfterShutdown = self.nodes[1].listbanned()

0 commit comments

Comments
 (0)