alex-sherwin commented on PR #222:
URL: https://github.com/apache/mina-sshd/pull/222#issuecomment-1124459535

   @vukzeka I just pushed a commit 
https://github.com/alex-sherwin/mina-sshd/commit/f5966b48e3ac2ab375269aae553c765cf62488cf
   
   It shows how to use testcontainers to build an image w/ ssh-keygen and:
   
   1. How you can use **ssh-keygen** to parse/view a OpenSSH Certificate file 
and check the exit code
   2. How you can use **ssh-keygen** to generate data and copy the contents 
back to Java (this one is not really that useful for what we're discussing 
here, I just created it to see how it would be done)
   
   This test is *not* using the testcontainers JUnit automatic test lifecycle 
stuff (where you define the `GenericContainer` as a class-level property or 
static prop with `@ClassRule` annotations to manage the container lifecycle).
   
   This is because all that stuff is geared towards long-running services, etc.
   
   Instead, the unit test itself is defining the docker image + container, 
starting it, and using a custom wait strategy (which checks for exit, but does 
not assert the exit code itself), so that the unit test function can inspect 
the container exit code and logs and apply junit assertions to them.
   
   If you do add a test using this kind of technique, you should probably set 
it up to be a parameterized test like **GenerateOpenSSHClientCertificateTest** 
with all the cert type variations


-- 
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: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to