'Test that the server disconnects if the client fails authentication
too many times.'

def test_tooManyAttempts(self):

    packet = ''.join([NS('foo'), NS('none'), NS('password'), chr(0), NS('bar')])
    self.authServer.clock = task.Clock()
    for i in range(21):
        d = self.authServer.ssh_USERAUTH_REQUEST(packet)
        self.authServer.clock.advance(2)
    def check(ignored):
        self.assertEqual(self.authServer.transport.packets[(-1)], (transport.MSG_DISCONNECT, (((('\x00' * 3) + chr(transport.DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE)) + NS('too    many    bad    auths')) + NS(''))))
    return d.addCallback(check)
