From 63a5a91139b0505e7634f11f4f74473b80e0f9d5 Mon Sep 17 00:00:00 2001 From: mchades Date: Wed, 10 Apr 2024 20:09:46 +0800 Subject: [PATCH] test ssh --- .../integration/test/container/HiveContainer.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/integration-test-common/src/test/java/com/datastrato/gravitino/integration/test/container/HiveContainer.java b/integration-test-common/src/test/java/com/datastrato/gravitino/integration/test/container/HiveContainer.java index 26dc124ef16..c33a44da709 100644 --- a/integration-test-common/src/test/java/com/datastrato/gravitino/integration/test/container/HiveContainer.java +++ b/integration-test-common/src/test/java/com/datastrato/gravitino/integration/test/container/HiveContainer.java @@ -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) {