@@ -237,35 +237,35 @@ def test_getnetworkinfo(self):
237
237
def test_addnode_getaddednodeinfo (self ):
238
238
self .log .info ("Test addnode and getaddednodeinfo" )
239
239
assert_equal (self .nodes [0 ].getaddednodeinfo (), [])
240
- # add a node (node2) to node0
240
+ self . log . info ( "Add a node (node2) to node0" )
241
241
ip_port = "127.0.0.1:{}" .format (p2p_port (2 ))
242
242
self .nodes [0 ].addnode (node = ip_port , command = 'add' )
243
- # try to add an equivalent ip
244
- # ( note that OpenBSD doesn't support the IPv4 shorthand notation with omitted zero-bytes)
243
+ self . log . info ( "Try to add an equivalent ip and check it fails" )
244
+ self . log . debug ( "( note that OpenBSD doesn't support the IPv4 shorthand notation with omitted zero-bytes)" )
245
245
if platform .system () != "OpenBSD" :
246
246
ip_port2 = "127.1:{}" .format (p2p_port (2 ))
247
247
assert_raises_rpc_error (- 23 , "Node already added" , self .nodes [0 ].addnode , node = ip_port2 , command = 'add' )
248
- # check that the node has indeed been added
248
+ self . log . info ( "Check that the node has indeed been added" )
249
249
added_nodes = self .nodes [0 ].getaddednodeinfo ()
250
250
assert_equal (len (added_nodes ), 1 )
251
251
assert_equal (added_nodes [0 ]['addednode' ], ip_port )
252
- # check that filtering by node works
252
+ self . log . info ( "Check that filtering by node works" )
253
253
self .nodes [0 ].addnode (node = "11.22.33.44" , command = 'add' )
254
254
first_added_node = self .nodes [0 ].getaddednodeinfo (node = ip_port )
255
255
assert_equal (added_nodes , first_added_node )
256
256
assert_equal (len (self .nodes [0 ].getaddednodeinfo ()), 2 )
257
- # check that node cannot be added again
257
+ self . log . info ( "Check that node cannot be added again" )
258
258
assert_raises_rpc_error (- 23 , "Node already added" , self .nodes [0 ].addnode , node = ip_port , command = 'add' )
259
- # check that node can be removed
259
+ self . log . info ( "Check that node can be removed" )
260
260
self .nodes [0 ].addnode (node = ip_port , command = 'remove' )
261
261
added_nodes = self .nodes [0 ].getaddednodeinfo ()
262
262
assert_equal (len (added_nodes ), 1 )
263
263
assert_equal (added_nodes [0 ]['addednode' ], "11.22.33.44" )
264
- # check that an invalid command returns an error
264
+ self . log . info ( "Check that an invalid command returns an error" )
265
265
assert_raises_rpc_error (- 1 , 'addnode "node" "command"' , self .nodes [0 ].addnode , node = ip_port , command = 'abc' )
266
- # check that trying to remove the node again returns an error
266
+ self . log . info ( "Check that trying to remove the node again returns an error" )
267
267
assert_raises_rpc_error (- 24 , "Node could not be removed" , self .nodes [0 ].addnode , node = ip_port , command = 'remove' )
268
- # check that a non-existent node returns an error
268
+ self . log . info ( "Check that a non-existent node returns an error" )
269
269
assert_raises_rpc_error (- 24 , "Node has not been added" , self .nodes [0 ].getaddednodeinfo , '1.1.1.1' )
270
270
271
271
def test_service_flags (self ):
0 commit comments