Skip to content

Commit

Permalink
test ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
mchades committed Apr 10, 2024
1 parent 1b72a55 commit 63a5a91
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ protected boolean checkContainerStatus(int retryLimit) {
int sleepTimeMillis = 10_000;
while (nRetry++ < retryLimit) {
try {
String[] testSSHCommand = new String[] {"ssh", "localhost"};
Container.ExecResult result = executeInContainer(testSSHCommand);
if (result.getExitCode() != 0) {
throw new RuntimeException(
"Failed to execute `ssh localhost` command: stdout="
+ result.getStdout()
+ ", stderr="
+ result.getStderr());
}

String[] commandAndArgs = new String[] {"bash", "/tmp/check-status.sh"};
Container.ExecResult execResult = executeInContainer(commandAndArgs);
if (execResult.getExitCode() != 0) {
Expand Down

0 comments on commit 63a5a91

Please sign in to comment.