From 6e28c76907ca0012b1a4556d9a982dfffb5abaf6 Mon Sep 17 00:00:00 2001 From: Hodlinator <172445034+hodlinator@users.noreply.github.com> Date: Mon, 25 Nov 2024 10:41:50 +0100 Subject: [PATCH] test: Harden testing of cookie file existence --- test/functional/rpc_users.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/functional/rpc_users.py b/test/functional/rpc_users.py index 49eb64abada..45ea7ab0cc5 100755 --- a/test/functional/rpc_users.py +++ b/test/functional/rpc_users.py @@ -166,8 +166,15 @@ class HTTPBasicsTest(BitcoinTestFramework): self.stop_node(0) self.log.info('Check that failure to write cookie file will abort the node gracefully') - (self.nodes[0].chain_path / ".cookie.tmp").mkdir() + cookie_path = self.nodes[0].chain_path / ".cookie" + cookie_path_tmp = self.nodes[0].chain_path / ".cookie.tmp" + cookie_path_tmp.mkdir() self.nodes[0].assert_start_raises_init_error(expected_msg=init_error) + cookie_path_tmp.rmdir() + assert not cookie_path.exists() + self.restart_node(0) + assert cookie_path.exists() + self.stop_node(0) self.test_rpccookieperms()