Browse Source
0.1641c29f6d1d
qa: Fix python TypeError in script.py (MarcoFalke)7460945e0b
[qa] Delete cookie file before starting node (Suhas Daftuar)0a76ed232a
qa: Cache only chain and wallet for regtest datadir (MarcoFalke)6c26df06ad
[qa] Ensure bitcoind processes are cleaned up when tests end (Suhas Daftuar)df38b130d9
[tests] Test starting bitcoind with -h and -version (John Newbery)4bdb0ce517
[tests] Fix intermittent rpc_net.py failure. (John Newbery)0e98f96e42
test: Use wait_until in tests where time was used for polling (Ben Woosley)1286f3e49a
test: Use wait_until to ensure ping goes out (Ben Woosley)cfebd400ef
[test] Round target fee to 8 decimals in assert_fee_amount (Karl-Johan Alm) Pull request description: Similar to #12967 this contains all relevant bugfixes and improvements to the functional test suite. I didn't include fixes to make the tests run on Windows, since that is still an ongoing effort and doesn't seem worth to backport. As all of these are clean cherry-picks, I suggest reviewers redo the cherry-picks to get the same branch and then run the extended test suite. Tree-SHA512: 70e1bc28d5572f93796f1ac4d97d77e8146869c15dcc1e3b65a730fa2641283050f769cefd9791d800c758e0a92f11fd55ed0797ccec87b897c7e701d0187f34
MarcoFalke
7 years ago
10 changed files with 121 additions and 65 deletions
@ -0,0 +1,46 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
# Copyright (c) 2018 The Bitcoin Core developers |
||||||
|
# Distributed under the MIT software license, see the accompanying |
||||||
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php. |
||||||
|
"""Verify that starting bitcoin with -h works as expected.""" |
||||||
|
import subprocess |
||||||
|
|
||||||
|
from test_framework.test_framework import BitcoinTestFramework |
||||||
|
from test_framework.util import assert_equal |
||||||
|
|
||||||
|
class HelpTest(BitcoinTestFramework): |
||||||
|
def set_test_params(self): |
||||||
|
self.setup_clean_chain = True |
||||||
|
self.num_nodes = 1 |
||||||
|
|
||||||
|
def setup_network(self): |
||||||
|
self.add_nodes(self.num_nodes) |
||||||
|
# Don't start the node |
||||||
|
|
||||||
|
def run_test(self): |
||||||
|
self.log.info("Start bitcoin with -h for help text") |
||||||
|
self.nodes[0].start(extra_args=['-h'], stderr=subprocess.PIPE, stdout=subprocess.PIPE) |
||||||
|
# Node should exit immediately and output help to stdout. |
||||||
|
ret_code = self.nodes[0].process.wait(timeout=1) |
||||||
|
assert_equal(ret_code, 0) |
||||||
|
output = self.nodes[0].process.stdout.read() |
||||||
|
assert b'Options' in output |
||||||
|
self.log.info("Help text received: {} (...)".format(output[0:60])) |
||||||
|
self.nodes[0].running = False |
||||||
|
|
||||||
|
self.log.info("Start bitcoin with -version for version information") |
||||||
|
self.nodes[0].start(extra_args=['-version'], stderr=subprocess.PIPE, stdout=subprocess.PIPE) |
||||||
|
# Node should exit immediately and output version to stdout. |
||||||
|
ret_code = self.nodes[0].process.wait(timeout=1) |
||||||
|
assert_equal(ret_code, 0) |
||||||
|
output = self.nodes[0].process.stdout.read() |
||||||
|
assert b'version' in output |
||||||
|
self.log.info("Version text received: {} (...)".format(output[0:60])) |
||||||
|
# Clean up TestNode state |
||||||
|
self.nodes[0].running = False |
||||||
|
self.nodes[0].process = None |
||||||
|
self.nodes[0].rpc_connected = False |
||||||
|
self.nodes[0].rpc = None |
||||||
|
|
||||||
|
if __name__ == '__main__': |
||||||
|
HelpTest().main() |
Loading…
Reference in new issue