Skip to content

Commit 9b90eea

Browse files
hodlinatorluke-jr
authored andcommitted
test: Harden testing of cookie file existence
Github-Pull: bitcoin#31212 Rebased-From: 6e28c76
1 parent a613155 commit 9b90eea

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/functional/rpc_users.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,15 @@ def run_test(self):
149149
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=foo$bar$baz'])
150150

151151
self.log.info('Check that failure to write cookie file will abort the node gracefully')
152-
(self.nodes[0].chain_path / ".cookie.tmp").mkdir()
152+
cookie_path = self.nodes[0].chain_path / ".cookie"
153+
cookie_path_tmp = self.nodes[0].chain_path / ".cookie.tmp"
154+
cookie_path_tmp.mkdir()
153155
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error)
156+
cookie_path_tmp.rmdir()
157+
assert not cookie_path.exists()
158+
self.restart_node(0)
159+
assert cookie_path.exists()
160+
self.stop_node(0)
154161

155162
self.test_rpccookieperms()
156163

0 commit comments

Comments
 (0)