From 626af0e73e29b97a246b11880df39628e529ff3c Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 7 Aug 2018 20:13:32 +0200 Subject: [PATCH] Getting closer, invalid rpc user/pass instead of wrong port --- qa/rpc-tests/cryptoconditions.py | 10 ++++++--- qa/rpc-tests/test_framework/util.py | 32 +++++++++++++++++++---------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/qa/rpc-tests/cryptoconditions.py b/qa/rpc-tests/cryptoconditions.py index 7e1810085..c9778fd3e 100755 --- a/qa/rpc-tests/cryptoconditions.py +++ b/qa/rpc-tests/cryptoconditions.py @@ -26,20 +26,24 @@ class CryptoConditionsTest (BitcoinTestFramework): self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[ '-regtest', - '-server=1', - '-rpcport=64368', + # TODO: AC.conf instead of komodo.conf + #'-conf='+self.options.tmpdir+'/node0/komodo.conf', '-conf='+self.options.tmpdir+'/node0/REGTEST.conf', + '-port=64367', + '-rpcport=64368', '-ac_name=REGTEST', '-addressindex=1', '-spentindex=1', '-ac_supply=5555555', '-ac_reward=10000000', '-pubkey=02676d00110c2cd14ae24f95969e8598f7ccfaa675498b82654a5b5bd57fc1d8cf', - '-ac_cc=1' + '-ac_cc=1', + '-daemon', ]] * self.num_nodes ) self.is_network_split = split self.sync_all() + print("Done setting up network") def run_test (self): print("Mining blocks...") diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py index 146499d08..16f9e813f 100644 --- a/qa/rpc-tests/test_framework/util.py +++ b/qa/rpc-tests/test_framework/util.py @@ -84,10 +84,10 @@ def initialize_datadir(dirname, n): f.write("showmetrics=0\n"); f.write("rpcuser=rt\n"); f.write("rpcpassword=rt\n"); - f.write("port="+str(p2p_port(n))+"\n"); - rpcport = str(rpc_port(n)) - f.write("rpcport="+rpcport+"\n"); - print "RPC port=" + rpcport + #f.write("port="+str(p2p_port(n))+"\n"); + #rpcport = str(rpc_port(n)) + #f.write("rpcport="+rpcport+"\n"); + #print "RPC port=" + rpcport f.write("listenonion=0\n"); # TODO: maybe make these optional, defaulted to on for now f.write("addressindex=1\n"); @@ -115,8 +115,11 @@ def initialize_chain(test_dir): cmd_args = cmd + " -datadir="+datadir + " -rpcwait getblockcount" if os.getenv("PYTHON_DEBUG", ""): print "initialize_chain: komodod started, calling: " + cmd_args - subprocess.check_call([ cmd, "-datadir="+datadir, - "-rpcwait", "getblockcount"]) #, stdout=devnull) + strcmd = cmd + " " + "-datadir="+datadir + " -rpcwait getblockcount" + + print("Running " + strcmd) + subprocess.check_call(strcmd, shell=True); + #subprocess.check_call([ cmd, "-rpcwait", "getblockcount"], stdout=devnull) if os.getenv("PYTHON_DEBUG", ""): print "initialize_chain: komodo-cli -rpcwait getblockcount completed" devnull.close() @@ -198,13 +201,20 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary= if extra_args is not None: args.extend(extra_args) bitcoind_processes[i] = subprocess.Popen(args) devnull = open("/dev/null", "w+") + cmd = os.getenv("BITCOINCLI", "komodo-cli") - cmd_args = cmd + "-datadir="+datadir + " -rpcwait getblockcount" + print("cmd=" + cmd) + #TODO: + cmd_args = " -datadir="+datadir + " -rpcport=64368 -rpcwait -conf=" +datadir+"/komodo.conf getblockcount " if os.getenv("PYTHON_DEBUG", ""): - print "start_node: komodod started, calling : " + cmd_args - subprocess.check_call([ os.getenv("BITCOINCLI", "komodo-cli"), "-datadir="+datadir] + - _rpchost_to_args(rpchost) + - ["-rpcwait", "getblockcount"], stdout=devnull) + print "start_node: komodod started, calling : " + cmd + " " + cmd_args + strcmd = cmd + " " + cmd_args + + print("Running " + strcmd) + subprocess.check_call(strcmd, shell=True); + #subprocess.check_call([ os.getenv("BITCOINCLI", "komodo-cli"), "-datadir="+datadir] + + # _rpchost_to_args(rpchost) + + # ["-rpcwait", "-rpcport=6438", "getblockcount"], stdout=devnull) if os.getenv("PYTHON_DEBUG", ""): print "start_node: calling komodo-cli -rpcwait getblockcount returned" devnull.close()