diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-11-20 17:59:07 +0000 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-11-23 16:54:22 +0000 |
commit | 28479f926f21f2a91bec5a06671c60e5b0c55532 (patch) | |
tree | 6b986bb8b54cde9fd0ff999fba4235711b290ebf /test/functional/feature_shutdown.py | |
parent | 8d3f46ec3938e2ba17654fecacd1d2629f9915fd (diff) |
qa: Test bitcond shutdown
Diffstat (limited to 'test/functional/feature_shutdown.py')
-rwxr-xr-x | test/functional/feature_shutdown.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/functional/feature_shutdown.py b/test/functional/feature_shutdown.py new file mode 100755 index 0000000000..b633fabb1f --- /dev/null +++ b/test/functional/feature_shutdown.py @@ -0,0 +1,28 @@ +#!/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. +"""Test bitcoind shutdown.""" + +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, get_rpc_proxy +from threading import Thread + +def test_long_call(node): + block = node.waitfornewblock() + assert_equal(block['height'], 0) + +class ShutdownTest(BitcoinTestFramework): + + def set_test_params(self): + self.setup_clean_chain = True + self.num_nodes = 1 + + def run_test(self): + node = get_rpc_proxy(self.nodes[0].url, 1, timeout=600, coveragedir=self.nodes[0].coverage_dir) + Thread(target=test_long_call, args=(node,)).start() + # wait 1 second to ensure event loop waits for current connections to close + self.stop_node(0, wait=1000) + +if __name__ == '__main__': + ShutdownTest().main() |