protected AuthenticationInfo getAuthInfo()
{
try
{
AuthenticationInfo authInfo = super.getAuthInfo();
// user : guest/guest123 - passphrase : toto01
authInfo.setUserName( "guest" );
File sshKeysTarget = new File( "target/ssh-keys" );
FileUtils.copyDirectory( new File( "src/test/ssh-keys" ), sshKeysTarget );
// ssh keys need to 700 permissions
// to prevent WARNING: UNPROTECTED PRIVATE KEY FILE!
Commandline commandline = new Commandline( "chmod" );
commandline.createArg().setValue( "-R" );
commandline.createArg().setValue( "700" );
commandline.createArg().setValue( sshKeysTarget.getCanonicalPath() );
CommandLineUtils.StringStreamConsumer out = new CommandLineUtils.StringStreamConsumer();
CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer();
int exitCode = CommandLineUtils.executeCommandLine( commandline, out, err );
Streams streams = new Streams();
streams.setOut( out.getOutput() );
streams.setErr( err.getOutput() );
if ( exitCode != 0 )
{
throw new RuntimeException(
"fail to chmod exit code " + exitCode + ", error" + streams.getErr() + ", out "
+ streams.getOut() );
}
authInfo.setPrivateKey( new File( sshKeysTarget, "id_rsa" ).getCanonicalPath() );
return authInfo;
}
catch ( Exception e )
{