From 1fc2554fa4f5b8509541e2c25d515384e924a53e Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Mon, 19 Aug 2024 20:46:35 -0700 Subject: [PATCH] #65 Debug /opt/kafka/config/ not writable --- .../EventuateKafkaNativeContainer.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/eventuate-messaging-kafka-testcontainers/src/main/java/io/eventuate/messaging/kafka/testcontainers/EventuateKafkaNativeContainer.java b/eventuate-messaging-kafka-testcontainers/src/main/java/io/eventuate/messaging/kafka/testcontainers/EventuateKafkaNativeContainer.java index 83f3ab7..479ac0c 100644 --- a/eventuate-messaging-kafka-testcontainers/src/main/java/io/eventuate/messaging/kafka/testcontainers/EventuateKafkaNativeContainer.java +++ b/eventuate-messaging-kafka-testcontainers/src/main/java/io/eventuate/messaging/kafka/testcontainers/EventuateKafkaNativeContainer.java @@ -45,12 +45,20 @@ public void registerProperties(BiConsumer> registry) { protected void containerIsStarting(InspectContainerResponse containerInfo) { try { ExecResult result = execInContainer("ls", "-ltd", "/opt/kafka/config/"); - System.out.println("ls -ltd /opt/kafka/config/: " + result.getExitCode()); - System.out.println("ls -ltd /opt/kafka/config/: " + result.getStdout()); - System.out.println("ls -ltd /opt/kafka/config/: " + result.getStderr()); + printExecResult(result, "ls -ltd /opt/kafka/config/: "); + result = execInContainer("whoami"); + printExecResult(result, "whoami"); + result = execInContainer("touch", "/opt/kafka/config/foo"); + printExecResult(result, "touch /opt/kafka/config/foo"); } catch (IOException | InterruptedException e) { throw new RuntimeException(e); } super.containerIsStarting(containerInfo); } + + private static void printExecResult(ExecResult result, String command) { + System.out.println(command + result.getExitCode()); + System.out.println(command + result.getStdout()); + System.out.println(command + result.getStderr()); + } }