Skip to content

Commit 6e28c76

Browse files
committed
test: Harden testing of cookie file existence
1 parent 75bacab commit 6e28c76

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
@@ -166,8 +166,15 @@ def run_test(self):
166166
self.stop_node(0)
167167

168168
self.log.info('Check that failure to write cookie file will abort the node gracefully')
169-
(self.nodes[0].chain_path / ".cookie.tmp").mkdir()
169+
cookie_path = self.nodes[0].chain_path / ".cookie"
170+
cookie_path_tmp = self.nodes[0].chain_path / ".cookie.tmp"
171+
cookie_path_tmp.mkdir()
170172
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error)
173+
cookie_path_tmp.rmdir()
174+
assert not cookie_path.exists()
175+
self.restart_node(0)
176+
assert cookie_path.exists()
177+
self.stop_node(0)
171178

172179
self.test_rpccookieperms()
173180

0 commit comments

Comments
 (0)