aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/test_node.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2018-02-07 10:51:13 -0500
committerJohn Newbery <john@johnnewbery.com>2018-05-09 10:39:31 -0400
commitbeee49ba1f17937539aa4b543d5b28a9d76c0f4a (patch)
treeaa446e7a681dd3d971f1ccc8ccf69899d2f8b86e /test/functional/test_framework/test_node.py
parente5036715c8f56170e1674f8aa4eb4b54565bb451 (diff)
downloadbitcoin-beee49ba1f17937539aa4b543d5b28a9d76c0f4a.tar.xz
[tests] Allow stderr to be tested against specified string
Allow bitcoind's stderr to be tested against a specified string on shutdown.
Diffstat (limited to 'test/functional/test_framework/test_node.py')
-rwxr-xr-xtest/functional/test_framework/test_node.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index 440e4586b7..eac6057de6 100755
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -188,7 +188,7 @@ class TestNode():
wallet_path = "wallet/%s" % wallet_name
return self.rpc / wallet_path
- def stop_node(self):
+ def stop_node(self, expected_stderr=''):
"""Stop the node."""
if not self.running:
return
@@ -197,6 +197,13 @@ class TestNode():
self.stop()
except http.client.CannotSendRequest:
self.log.exception("Unable to stop node.")
+
+ # Check that stderr is as expected
+ self.stderr.seek(0)
+ stderr = self.stderr.read().decode('utf-8').strip()
+ if stderr != expected_stderr:
+ raise AssertionError("Unexpected stderr {} != {}".format(stderr, expected_stderr))
+
del self.p2ps[:]
def is_node_stopped(self):