diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-03-19 10:13:45 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-03-19 10:14:18 +0100 |
commit | 9225de2cf652fe2bf6e50636824cdb641546f57d (patch) | |
tree | 9a6ba09fdb30f796b65cfae0e0dd9a294de27955 | |
parent | baae3149d63909c527e7b28c52c9124957ce8206 (diff) | |
parent | e722777a4974272fe5d0bd06364aa887b599922b (diff) | |
download | bitcoin-9225de2cf652fe2bf6e50636824cdb641546f57d.tar.xz |
Merge #10024: [trivial] Use log.info() instead of print() in remaining functional test cases.
e722777 fix logging in nulldummy and proxy_test (John Newbery)
1f70653 Use log.info() instead of print() in importmulti.py (John Newbery)
Tree-SHA512: 0e58f0a970cd93bc1e9d73c6f53ca0671b0c5135cbf92e97d8563bd8a063679bf04f8bde511c275d5f84036aed32f70d3d03679a92688952b46dc97929e0405c
-rwxr-xr-x | qa/rpc-tests/importmulti.py | 2 | ||||
-rwxr-xr-x | qa/rpc-tests/nulldummy.py | 4 | ||||
-rwxr-xr-x | qa/rpc-tests/proxy_test.py | 4 | ||||
-rw-r--r-- | qa/rpc-tests/test_framework/socks5.py | 7 |
4 files changed, 10 insertions, 7 deletions
diff --git a/qa/rpc-tests/importmulti.py b/qa/rpc-tests/importmulti.py index ca5d42eced..aa03c6780a 100755 --- a/qa/rpc-tests/importmulti.py +++ b/qa/rpc-tests/importmulti.py @@ -413,7 +413,7 @@ class ImportMultiTest (BitcoinTestFramework): # Importing existing watch only address with new timestamp should replace saved timestamp. assert_greater_than(timestamp, watchonly_timestamp) - print("Should replace previously saved watch only timestamp.") + self.log.info("Should replace previously saved watch only timestamp.") result = self.nodes[1].importmulti([{ "scriptPubKey": { "address": watchonly_address, diff --git a/qa/rpc-tests/nulldummy.py b/qa/rpc-tests/nulldummy.py index 7b19fbfd82..369c593a90 100755 --- a/qa/rpc-tests/nulldummy.py +++ b/qa/rpc-tests/nulldummy.py @@ -81,14 +81,14 @@ class NULLDUMMYTest(BitcoinTestFramework): self.log.info("Test 3: Non-NULLDUMMY base transactions should be accepted in a block before activation [431]") self.block_submit(self.nodes[0], [test2tx], False, True) - self.log.info ("Test 4: Non-NULLDUMMY base multisig transaction is invalid after activation") + self.log.info("Test 4: Non-NULLDUMMY base multisig transaction is invalid after activation") test4tx = self.create_transaction(self.nodes[0], test2tx.hash, self.address, 46) test6txs=[CTransaction(test4tx)] trueDummy(test4tx) assert_raises_jsonrpc(-26, NULLDUMMY_ERROR, self.nodes[0].sendrawtransaction, bytes_to_hex_str(test4tx.serialize_with_witness()), True) self.block_submit(self.nodes[0], [test4tx]) - print ("Test 5: Non-NULLDUMMY P2WSH multisig transaction invalid after activation") + self.log.info("Test 5: Non-NULLDUMMY P2WSH multisig transaction invalid after activation") test5tx = self.create_transaction(self.nodes[0], txid3, self.wit_address, 48) test6txs.append(CTransaction(test5tx)) test5tx.wit.vtxinwit[0].scriptWitness.stack[0] = b'\x01' diff --git a/qa/rpc-tests/proxy_test.py b/qa/rpc-tests/proxy_test.py index 6b2a8ed1c7..748e3e69f6 100755 --- a/qa/rpc-tests/proxy_test.py +++ b/qa/rpc-tests/proxy_test.py @@ -49,6 +49,7 @@ class ProxyTest(BitcoinTestFramework): self.num_nodes = 4 self.setup_clean_chain = False + def setup_nodes(self): self.have_ipv6 = test_ipv6_local() # Create two proxies on different ports # ... one unauthenticated @@ -69,7 +70,7 @@ class ProxyTest(BitcoinTestFramework): self.conf3.unauth = True self.conf3.auth = True else: - print("Warning: testing without local IPv6 support") + self.log.warning("Testing without local IPv6 support") self.serv1 = Socks5Server(self.conf1) self.serv1.start() @@ -79,7 +80,6 @@ class ProxyTest(BitcoinTestFramework): self.serv3 = Socks5Server(self.conf3) self.serv3.start() - def setup_nodes(self): # Note: proxies are not used to connect to local nodes # this is because the proxy to use is based on CService.GetNetwork(), which return NET_UNROUTABLE for localhost args = [ diff --git a/qa/rpc-tests/test_framework/socks5.py b/qa/rpc-tests/test_framework/socks5.py index 450bf3775e..dd7624d454 100644 --- a/qa/rpc-tests/test_framework/socks5.py +++ b/qa/rpc-tests/test_framework/socks5.py @@ -6,6 +6,9 @@ import socket, threading, queue import traceback, sys +import logging + +logger = logging.getLogger("TestFramework.socks5") ### Protocol constants class Command: @@ -112,10 +115,10 @@ class Socks5Connection(object): cmdin = Socks5Command(cmd, atyp, addr, port, username, password) self.serv.queue.put(cmdin) - print('Proxy: ', cmdin) + logger.info('Proxy: %s', cmdin) # Fall through to disconnect except Exception as e: - traceback.print_exc(file=sys.stderr) + logger.exception("socks5 request handling failed.") self.serv.queue.put(e) finally: self.conn.close() |