Skip to content

Commit 7fa9d1a

Browse files
committed
Add check to presto-admin that id_rsa is present
1 parent b68d55c commit 7fa9d1a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/docker_cluster.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ def _are_centos_container_services_up(self, host):
297297
to start after the container itself is up. This function checks
298298
whether those services are up and returns a boolean accordingly.
299299
Specifically, we check that the app-admin user has been created
300-
and that the ssh daemon is up.
300+
and that the ssh daemon is up, as well as that the SSH keys are
301+
in the right place.
301302
302303
Args:
303304
host: the host to check.
@@ -318,6 +319,10 @@ def _are_centos_container_services_up(self, host):
318319
if 'sshd_bootstrap' in ps_output or 'sshd\n' not in ps_output\
319320
or not user_output:
320321
return False
322+
# check for .ssh being in the right place
323+
ssh_output = self.exec_cmd_on_host(host, 'ls /home/app-admin/.ssh')
324+
if 'id_rsa' not in ssh_output:
325+
return False
321326
return True
322327

323328
def exec_cmd_on_host(self, host, cmd, user=None, raise_error=True,

0 commit comments

Comments
 (0)