'Create a connected SSH client and server protocol pair and return a
L{Deferred} which fires with an L{SSHTestChannel} instance connected to
a channel on that SSH connection.'

def _ourServerOurClientTest(self, name='session', **kwargs):

    result = defer.Deferred()
    self.realm = ConchTestRealm('testuser')
    p = portal.Portal(self.realm)
    sshpc = ConchTestSSHChecker()
    sshpc.registerChecker(ConchTestPasswordChecker())
    sshpc.registerChecker(conchTestPublicKeyChecker())
    p.registerChecker(sshpc)
    fac = ConchTestServerFactory()
    fac.portal = p
    fac.startFactory()
    self.server = fac.buildProtocol(None)
    self.clientTransport = LoopbackRelay(self.server)
    self.client = ConchTestClient((lambda conn: SSHTestChannel(name, result, conn=conn, **kwargs)))
    self.serverTransport = LoopbackRelay(self.client)
    self.server.makeConnection(self.serverTransport)
    self.client.makeConnection(self.clientTransport)
    return result
