aboutsummaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2014-11-18 14:29:38 -0500
committerGavin Andresen <gavinandresen@gmail.com>2014-11-18 14:31:29 -0500
commitfd3777b0b272ad4ce7fbb152917353aa46879f89 (patch)
tree2c5a27dbd19273204fb4544f3807813863f8cc87 /qa
parente3560029ceb7899b6c8a9d59d803de7190ff65bd (diff)
parent3c30f27f342c15af17c6f7e160be5ee60f28194d (diff)
Merge pull request #5280
3c30f27 travis: disable rpc tests for windows until they're not so flaky (Cory Fields) daf03e7 RPC tests: create initial chain with specific timestamps (Gavin Andresen) a8b2ce5 regression test only setmocktime RPC call (Gavin Andresen)
Diffstat (limited to 'qa')
-rwxr-xr-xqa/pull-tester/rpc-tests.sh5
-rw-r--r--qa/rpc-tests/util.py25
2 files changed, 22 insertions, 8 deletions
diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh
index a0056c141b..0b5ad20642 100755
--- a/qa/pull-tester/rpc-tests.sh
+++ b/qa/pull-tester/rpc-tests.sh
@@ -8,6 +8,11 @@ CURDIR=$(cd $(dirname "$0"); pwd)
export BITCOINCLI=${BUILDDIR}/qa/pull-tester/run-bitcoin-cli
export BITCOIND=${REAL_BITCOIND}
+if [ "x${EXEEXT}" = "x.exe" ]; then
+ echo "Win tests currently disabled"
+ exit 0
+fi
+
#Run the tests
if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py
index 0d5eeefa79..c6d918a81c 100644
--- a/qa/rpc-tests/util.py
+++ b/qa/rpc-tests/util.py
@@ -103,12 +103,17 @@ def initialize_chain(test_dir):
# Create a 200-block-long chain; each of the 4 nodes
# gets 25 mature blocks and 25 immature.
- for i in range(4):
- rpcs[i].setgenerate(True, 25)
- sync_blocks(rpcs)
- for i in range(4):
- rpcs[i].setgenerate(True, 25)
- sync_blocks(rpcs)
+ # blocks are created with timestamps 10 minutes apart, starting
+ # at 1 Jan 2014
+ block_time = 1388534400
+ for i in range(2):
+ for peer in range(4):
+ for j in range(25):
+ set_node_times(rpcs, block_time)
+ rpcs[peer].setgenerate(True, 1)
+ block_time += 10*60
+ # Must sync before next peer starts generating blocks
+ sync_blocks(rpcs)
# Shut them down, and clean up cache directories:
stop_nodes(rpcs)
@@ -179,10 +184,14 @@ def stop_node(node, i):
del bitcoind_processes[i]
def stop_nodes(nodes):
- for i in range(len(nodes)):
- nodes[i].stop()
+ for node in nodes:
+ node.stop()
del nodes[:] # Emptying array closes connections as a side effect
+def set_node_times(nodes, t):
+ for node in nodes:
+ node.setmocktime(t)
+
def wait_bitcoinds():
# Wait for all bitcoinds to cleanly exit
for bitcoind in bitcoind_processes.values():