JiriOndrusek commented on code in PR #6912:
URL: https://github.com/apache/camel-quarkus/pull/6912#discussion_r1920315832
##########
integration-tests/ssh/src/test/java/org/apache/camel/quarkus/component/ssh/it/SshTestResource.java:
##########
@@ -45,33 +54,77 @@ public Map<String, String> start() {
container = new GenericContainer(SSH_IMAGE)
.withExposedPorts(SSH_PORT)
.withEnv("PASSWORD_ACCESS", "true")
- .withEnv("USER_NAME", "test")
- .withEnv("USER_PASSWORD", "password")
+ .withEnv("USER_NAME", USERNAME)
+ .withEnv("USER_PASSWORD", PASSWORD)
.waitingFor(Wait.forListeningPort());
container.start();
LOGGER.info("Started SSH container to {}:{}", container.getHost(),
container.getMappedPort(SSH_PORT).toString());
- return CollectionHelper.mapOf(
- "quarkus.ssh.host",
- container.getHost(),
- "quarkus.ssh.port",
- container.getMappedPort(SSH_PORT).toString());
+ securedPort = AvailablePortFinder.getNextAvailable();
+
+ var sshd = SshServer.setUpDefaultServer();
+ sshd.setPort(securedPort);
+ sshd.setKeyPairProvider(new
FileKeyPairProvider(Paths.get(getHostKey())));
+ sshd.setCommandFactory(new TestEchoCommandFactory());
+ sshd.setPasswordAuthenticator((username, password, session) ->
true);
+ sshd.setPublickeyAuthenticator((username, key, session) -> true);
+ sshd.start();
+
+ sshds.add(sshd);
+
+ edPort = AvailablePortFinder.getNextAvailable();
+
+ sshd = SshServer.setUpDefaultServer();
+ sshd.setPort(edPort);
+ sshd.setKeyPairProvider(new
FileKeyPairProvider(Paths.get("target/classes/edDSA/key_ed25519.pem")));
Review Comment:
I moved test resources into `src/test/resources` and I'm loading them via
classpath
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]