|
|
@ -98,5 +98,16 @@ class HTTPBasicsTest (BitcoinTestFramework): |
|
|
|
assert_equal('"error":null' in out1, True) |
|
|
|
assert_equal('"error":null' in out1, True) |
|
|
|
assert_equal(conn.sock!=None, True) #connection must be closed because bitcoind should use keep-alive by default |
|
|
|
assert_equal(conn.sock!=None, True) #connection must be closed because bitcoind should use keep-alive by default |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
########################### |
|
|
|
|
|
|
|
# setban/listbanned tests # |
|
|
|
|
|
|
|
########################### |
|
|
|
|
|
|
|
assert_equal(len(self.nodes[2].getpeerinfo()), 4); #we should have 4 nodes at this point |
|
|
|
|
|
|
|
self.nodes[2].setban("127.0.0.1", "add") |
|
|
|
|
|
|
|
time.sleep(3) #wait till the nodes are disconected |
|
|
|
|
|
|
|
assert_equal(len(self.nodes[2].getpeerinfo()), 0); #all nodes must be disconnected at this point |
|
|
|
|
|
|
|
assert_equal(len(self.nodes[2].listbanned()), 1); |
|
|
|
|
|
|
|
self.nodes[2].clearbanned() |
|
|
|
|
|
|
|
assert_equal(len(self.nodes[2].listbanned()), 0); |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
if __name__ == '__main__': |
|
|
|
HTTPBasicsTest ().main () |
|
|
|
HTTPBasicsTest ().main () |
|
|
|