|
|
|
@ -5,10 +5,10 @@
@@ -5,10 +5,10 @@
|
|
|
|
|
|
|
|
|
|
# Base class for RPC testing |
|
|
|
|
|
|
|
|
|
# Add python-bitcoinrpc to module search path: |
|
|
|
|
import logging |
|
|
|
|
import optparse |
|
|
|
|
import os |
|
|
|
|
import sys |
|
|
|
|
|
|
|
|
|
import shutil |
|
|
|
|
import tempfile |
|
|
|
|
import traceback |
|
|
|
@ -25,8 +25,9 @@ from .util import (
@@ -25,8 +25,9 @@ from .util import (
|
|
|
|
|
enable_coverage, |
|
|
|
|
check_json_precision, |
|
|
|
|
initialize_chain_clean, |
|
|
|
|
PortSeed, |
|
|
|
|
) |
|
|
|
|
from .authproxy import AuthServiceProxy, JSONRPCException |
|
|
|
|
from .authproxy import JSONRPCException |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BitcoinTestFramework(object): |
|
|
|
@ -95,7 +96,6 @@ class BitcoinTestFramework(object):
@@ -95,7 +96,6 @@ class BitcoinTestFramework(object):
|
|
|
|
|
self.setup_network(False) |
|
|
|
|
|
|
|
|
|
def main(self): |
|
|
|
|
import optparse |
|
|
|
|
|
|
|
|
|
parser = optparse.OptionParser(usage="%prog [options]") |
|
|
|
|
parser.add_option("--nocleanup", dest="nocleanup", default=False, action="store_true", |
|
|
|
@ -108,18 +108,21 @@ class BitcoinTestFramework(object):
@@ -108,18 +108,21 @@ class BitcoinTestFramework(object):
|
|
|
|
|
help="Root directory for datadirs") |
|
|
|
|
parser.add_option("--tracerpc", dest="trace_rpc", default=False, action="store_true", |
|
|
|
|
help="Print out all RPC calls as they are made") |
|
|
|
|
parser.add_option("--portseed", dest="port_seed", default=os.getpid(), type='int', |
|
|
|
|
help="The seed to use for assigning port numbers (default: current process id)") |
|
|
|
|
parser.add_option("--coveragedir", dest="coveragedir", |
|
|
|
|
help="Write tested RPC commands into this directory") |
|
|
|
|
self.add_options(parser) |
|
|
|
|
(self.options, self.args) = parser.parse_args() |
|
|
|
|
|
|
|
|
|
if self.options.trace_rpc: |
|
|
|
|
import logging |
|
|
|
|
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout) |
|
|
|
|
|
|
|
|
|
if self.options.coveragedir: |
|
|
|
|
enable_coverage(self.options.coveragedir) |
|
|
|
|
|
|
|
|
|
PortSeed.n = self.options.port_seed |
|
|
|
|
|
|
|
|
|
os.environ['PATH'] = self.options.srcdir+":"+self.options.srcdir+"/qt:"+os.environ['PATH'] |
|
|
|
|
|
|
|
|
|
check_json_precision() |
|
|
|
|