aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-05-18 09:17:28 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-05-19 10:41:44 -0400
commitfaf45d1f1f997c316fc4c611a23c4456533eefe9 (patch)
treec206b774bea2956b6a1fd947946273afaf7adb16 /test
parentfa12a37b27f0570a551b8c103ea6537ee4a8e399 (diff)
http: Avoid crash when g_thread_http was never started
g_thread_http can not be joined when it is not joinable. Avoid crashing the node by adding the required check and add a test.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/rpc_users.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/rpc_users.py b/test/functional/rpc_users.py
index 976065f3fc..daf02fc4f3 100755
--- a/test/functional/rpc_users.py
+++ b/test/functional/rpc_users.py
@@ -99,5 +99,13 @@ class HTTPBasicsTest(BitcoinTestFramework):
self.test_auth(self.nodes[1], self.rpcuser, self.rpcpassword)
+ self.log.info('Check that failure to write cookie file will abort the node gracefully')
+ self.stop_node(0)
+ cookie_file = os.path.join(get_datadir_path(self.options.tmpdir, 0), self.chain, '.cookie.tmp')
+ os.mkdir(cookie_file)
+ init_error = 'Error: Unable to start HTTP server. See debug log for details.'
+ self.nodes[0].assert_start_raises_init_error(expected_msg=init_error)
+
+
if __name__ == '__main__':
HTTPBasicsTest().main()