| | |
| | | import com.gitblit.Constants; |
| | | import com.gitblit.transport.ssh.IPublicKeyManager; |
| | | import com.gitblit.transport.ssh.MemoryKeyManager; |
| | | import com.gitblit.transport.ssh.SshKey; |
| | | |
| | | public class SshDaemonTest extends GitblitUnitTest { |
| | | |
| | |
| | | @Before |
| | | public void prepare() { |
| | | MemoryKeyManager keyMgr = getKeyManager(); |
| | | keyMgr.addKey("admin", pair.getPublic()); |
| | | keyMgr.addKey("admin", new SshKey(pair.getPublic())); |
| | | } |
| | | |
| | | @After |
| | |
| | | pair.getPublic().getEncoded(); |
| | | assertTrue(session.authPublicKey("admin", pair).await().isSuccess()); |
| | | |
| | | ClientChannel channel = session.createChannel(ClientChannel.CHANNEL_EXEC, "gitblit version"); |
| | | ClientChannel channel = session.createChannel(ClientChannel.CHANNEL_EXEC, "version"); |
| | | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| | | Writer w = new OutputStreamWriter(baos); |
| | | w.close(); |