Skip to content

Commit c608b6d

Browse files
committed
Merge pull request #6097
7b7f258 rpc-tests: remove python-bitcoinrpc directory (Jonas Schnelli) a85b2e2 pull-tester/rpc-tests.sh: disable script_test.py test (Jonas Schnelli) 3e875b1 pull-tester/rpc-tests.sh: allow passing throug of arguments (Jonas Schnelli) 00706a5 update rpc-tests readme.md (Jonas Schnelli) 344e08e extend rpc-tests.sh control script with non-travis tests (Jonas Schnelli) 64937fe [QA] restructure rpc tests directory (Jonas Schnelli)
2 parents 68aff60 + 7b7f258 commit c608b6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+125
-124
lines changed

qa/pull-tester/rpc-tests.sh

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,45 @@ testScripts=(
3131
'proxy_test.py'
3232
'merkle_blocks.py'
3333
'signrawtransactions.py'
34+
);
35+
testScriptsExt=(
36+
'bipdersig-p2p.py'
37+
'bipdersig.py'
38+
'getblocktemplate_longpoll.py'
39+
'getblocktemplate_proposals.py'
40+
'pruning.py'
41+
'forknotify.py'
42+
'invalidateblock.py'
43+
'keypool.py'
44+
'receivedby.py'
45+
'reindex.py'
46+
'rpcbind_test.py'
47+
# 'script_test.py'
48+
'smartfees.py'
3449
'maxblocksinflight.py'
3550
'invalidblockrequest.py'
3651
'rawtransactions.py'
3752
# 'forknotify.py'
3853
);
54+
55+
extArg="-extended"
56+
passOn=${@#$extArg}
57+
3958
if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
4059
for (( i = 0; i < ${#testScripts[@]}; i++ ))
4160
do
42-
if [ -z "$1" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
61+
if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
4362
then
4463
echo -e "Running testscript \033[1m${testScripts[$i]}...\033[0m"
45-
${BUILDDIR}/qa/rpc-tests/${testScripts[$i]} --srcdir "${BUILDDIR}/src"
64+
${BUILDDIR}/qa/rpc-tests/${testScripts[$i]} --srcdir "${BUILDDIR}/src" ${passOn}
65+
fi
66+
done
67+
for (( i = 0; i < ${#testScriptsExt[@]}; i++ ))
68+
do
69+
if [ "$1" == $extArg ] || [ "$1" == "${testScriptsExt[$i]}" ] || [ "$1.py" == "${testScriptsExt[$i]}" ]
70+
then
71+
echo -e "Running \033[1m2nd level\033[0m testscript \033[1m${testScriptsExt[$i]}...\033[0m"
72+
${BUILDDIR}/qa/rpc-tests/${testScriptsExt[$i]} --srcdir "${BUILDDIR}/src" ${passOn}
4673
fi
4774
done
4875
else

qa/rpc-tests/README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,37 @@ Git subtree of [https://github.com/jgarzik/python-bitcoinrpc](https://github.com
66
Changes to python-bitcoinrpc should be made upstream, and then
77
pulled here using git subtree.
88

9-
### [test_framework.py](test_framework.py)
9+
### [test_framework/test_framework.py](test_framework/test_framework.py)
1010
Base class for new regression tests.
1111

12-
### [listtransactions.py](listtransactions.py)
13-
Tests for the listtransactions RPC call.
14-
15-
### [util.py](util.py)
12+
### [test_framework/util.py](test_framework/util.py)
1613
Generally useful functions.
1714

1815
Bash-based tests, to be ported to Python:
1916
-----------------------------------------
20-
- wallet.sh : Exercise wallet send/receive code.
21-
- walletbackup.sh : Exercise wallet backup / dump / import
22-
- txnmall.sh : Test proper accounting of malleable transactions
2317
- conflictedbalance.sh : More testing of malleable transaction handling
2418

2519
Notes
2620
=====
2721

22+
You can run a single test by calling `qa/pull-tester/rpc-tests.sh <testname>`.
23+
24+
Run all possible tests with `qa/pull-tester/rpc-tests.sh -extended`.
25+
26+
Possible options:
27+
28+
````
29+
-h, --help show this help message and exit
30+
--nocleanup Leave bitcoinds and test.* datadir on exit or error
31+
--noshutdown Don't stop bitcoinds after the test execution
32+
--srcdir=SRCDIR Source directory containing bitcoind/bitcoin-cli (default:
33+
../../src)
34+
--tmpdir=TMPDIR Root directory for datadirs
35+
--tracerpc Print out all RPC calls as they are made
36+
```
37+
38+
If you set the environment variable `PYTHON_DEBUG=1` you will get some debug output (example: `PYTHON_DEBUG=1 qa/pull-tester/rpc-tests.sh wallet`).
39+
2840
A 200-block -regtest blockchain and wallets for four nodes
2941
is created the first time a regression test is run and
3042
is stored in the cache/ directory. Each node has 25 mature

qa/rpc-tests/bipdersig-p2p.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
#
66

7-
from test_framework import ComparisonTestFramework
8-
from util import *
9-
from mininode import CTransaction, NetworkThread
10-
from blocktools import create_coinbase, create_block
7+
from test_framework.test_framework import ComparisonTestFramework
8+
from test_framework.util import *
9+
from test_framework.mininode import CTransaction, NetworkThread
10+
from test_framework.blocktools import create_coinbase, create_block
11+
from test_framework.comptool import TestInstance, TestManager
12+
from test_framework.script import CScript
1113
from binascii import hexlify, unhexlify
1214
import cStringIO
13-
from comptool import TestInstance, TestManager
14-
from script import CScript
1515
import time
1616

1717
# A canonical signature consists of:

qa/rpc-tests/bipdersig.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
# Test the BIP66 changeover logic
88
#
99

10-
from test_framework import BitcoinTestFramework
11-
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
12-
from util import *
10+
from test_framework.test_framework import BitcoinTestFramework
11+
from test_framework.util import *
1312
import os
1413
import shutil
1514

qa/rpc-tests/forknotify.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
# Test -alertnotify
88
#
99

10-
from test_framework import BitcoinTestFramework
11-
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
12-
from util import *
10+
from test_framework.test_framework import BitcoinTestFramework
11+
from test_framework.util import *
1312
import os
1413
import shutil
1514

qa/rpc-tests/getblocktemplate_longpoll.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

6-
from test_framework import BitcoinTestFramework
7-
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
8-
from util import *
6+
from test_framework.test_framework import BitcoinTestFramework
7+
from test_framework.util import *
98

109

1110
def check_array_result(object_array, to_match, expected):

qa/rpc-tests/getblocktemplate_proposals.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

6-
from test_framework import BitcoinTestFramework
7-
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
8-
from util import *
6+
from test_framework.test_framework import BitcoinTestFramework
7+
from test_framework.util import *
98

109
from binascii import a2b_hex, b2a_hex
1110
from hashlib import sha256

qa/rpc-tests/getchaintips.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# on chains of different lengths, and join the network together again.
88
# This gives us two tips, verify that it works.
99

10-
from test_framework import BitcoinTestFramework
11-
from util import assert_equal
10+
from test_framework.test_framework import BitcoinTestFramework
11+
from test_framework.util import assert_equal
1212

1313
class GetChainTipsTest (BitcoinTestFramework):
1414

qa/rpc-tests/httpbasics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# Test REST interface
88
#
99

10-
from test_framework import BitcoinTestFramework
11-
from util import *
10+
from test_framework.test_framework import BitcoinTestFramework
11+
from test_framework.util import *
1212
import base64
1313

1414
try:

qa/rpc-tests/invalidateblock.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
# Test InvalidateBlock code
88
#
99

10-
from test_framework import BitcoinTestFramework
11-
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
12-
from util import *
10+
from test_framework.test_framework import BitcoinTestFramework
11+
from test_framework.util import *
1312

1413
class InvalidateTest(BitcoinTestFramework):
1514

0 commit comments

Comments
 (0)