@@ -77,6 +77,7 @@ def run_test(self):
7777 self .nodes [1 ].setmocktime (old_time )
7878 self .nodes [1 ].setban ("127.0.0.0/32" , "add" )
7979 self .nodes [1 ].setban ("127.0.0.0/24" , "add" )
80+ self .nodes [1 ].setban ("pg6mmjiyjmcrsslvykfwnntlaru7p5svn6y2ymmju6nubxndf4pscryd.onion" , "add" )
8081 self .nodes [1 ].setban ("192.168.0.1" , "add" , 1 ) # ban for 1 seconds
8182 self .nodes [1 ].setban ("2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/19" , "add" , 1000 ) # ban for 1000 seconds
8283 listBeforeShutdown = self .nodes [1 ].listbanned ()
@@ -85,13 +86,13 @@ def run_test(self):
8586 self .log .info ("setban: test banning with absolute timestamp" )
8687 self .nodes [1 ].setban ("192.168.0.2" , "add" , old_time + 120 , True )
8788
88- # Move time forward by 3 seconds so the third ban has expired
89+ # Move time forward by 3 seconds so the fourth ban has expired
8990 self .nodes [1 ].setmocktime (old_time + 3 )
90- assert_equal (len (self .nodes [1 ].listbanned ()), 4 )
91+ assert_equal (len (self .nodes [1 ].listbanned ()), 5 )
9192
9293 self .log .info ("Test ban_duration and time_remaining" )
9394 for ban in self .nodes [1 ].listbanned ():
94- if ban ["address" ] in ["127.0.0.0/32" , "127.0.0.0/24" ]:
95+ if ban ["address" ] in ["127.0.0.0/32" , "127.0.0.0/24" , "pg6mmjiyjmcrsslvykfwnntlaru7p5svn6y2ymmju6nubxndf4pscryd.onion" ]:
9596 assert_equal (ban ["ban_duration" ], 86400 )
9697 assert_equal (ban ["time_remaining" ], 86397 )
9798 elif ban ["address" ] == "2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/19" :
@@ -108,6 +109,7 @@ def run_test(self):
108109 assert_equal ("127.0.0.0/32" , listAfterShutdown [1 ]['address' ])
109110 assert_equal ("192.168.0.2/32" , listAfterShutdown [2 ]['address' ])
110111 assert_equal ("/19" in listAfterShutdown [3 ]['address' ], True )
112+ assert_equal ("pg6mmjiyjmcrsslvykfwnntlaru7p5svn6y2ymmju6nubxndf4pscryd.onion" , listAfterShutdown [4 ]['address' ])
111113
112114 # Clear ban lists
113115 self .nodes [1 ].clearbanned ()
0 commit comments