'threaded auth - CURVE'

def test_curve(self):

    self.auth.allow('127.0.0.1')
    certs = self.load_certs(self.secret_keys_dir)
    (server_public, server_secret, client_public, client_secret) = certs
    server = self.socket(zmq.PUSH)
    server.curve_publickey = server_public
    server.curve_secretkey = server_secret
    server.curve_server = True
    client = self.socket(zmq.PULL)
    client.curve_publickey = client_public
    client.curve_secretkey = client_secret
    client.curve_serverkey = server_public
    self.assertFalse(self.can_connect(server, client))
    self.auth.configure_curve(domain='*', location=zmq.auth.CURVE_ALLOW_ANY)
    server = self.socket(zmq.PUSH)
    server.curve_publickey = server_public
    server.curve_secretkey = server_secret
    server.curve_server = True
    client = self.socket(zmq.PULL)
    client.curve_publickey = client_public
    client.curve_secretkey = client_secret
    client.curve_serverkey = server_public
    self.assertTrue(self.can_connect(server, client))
    self.auth.configure_curve(domain='*', location=self.public_keys_dir)
    server = self.socket(zmq.PULL)
    server.curve_publickey = server_public
    server.curve_secretkey = server_secret
    server.curve_server = True
    client = self.socket(zmq.PUSH)
    client.curve_publickey = client_public
    client.curve_secretkey = client_secret
    client.curve_serverkey = server_public
    assert self.can_connect(client, server)
    self.auth.stop()
    self.auth = None
    server = self.socket(zmq.PUSH)
    client = self.socket(zmq.PULL)
    self.assertTrue(self.can_connect(server, client))
