Exemple #1
0
    def test_unix(self):
        endpoint = config.EndpointConfiguration(
            socket.AF_UNIX, "/tmp/socket")
        protocol = thrift_pool._make_protocol(endpoint)

        socket_transport = protocol.trans.getTransport()
        self.assertTrue(socket_transport._unix_socket)
Exemple #2
0
    def test_inet(self):
        endpoint = config.EndpointConfiguration(
            socket.AF_INET, ("localhost", 1234))
        protocol = thrift_pool._make_protocol(endpoint)

        socket_transport = protocol.trans.getTransport()
        self.assertFalse(socket_transport._unix_socket)
    def test_inet(self):
        endpoint = config.EndpointConfiguration(socket.AF_INET,
                                                ("localhost", 1234))
        protocol = thrift_pool._make_protocol(endpoint)

        socket_transport = protocol.trans.getTransport()
        self.assertFalse(socket_transport._unix_socket)
Exemple #4
0
    def test_unknown(self):
        endpoint = config.EndpointConfiguration(
            socket.AF_UNSPEC, None)

        with self.assertRaises(Exception):
            thrift_pool._make_protocol(endpoint)
    def test_unknown(self):
        endpoint = config.EndpointConfiguration(socket.AF_UNSPEC, None)

        with self.assertRaises(Exception):
            thrift_pool._make_protocol(endpoint)
    def test_unix(self):
        endpoint = config.EndpointConfiguration(socket.AF_UNIX, "/tmp/socket")
        protocol = thrift_pool._make_protocol(endpoint)

        socket_transport = protocol.trans.getTransport()
        self.assertTrue(socket_transport._unix_socket)
Exemple #7
0
def check_thrift_service(endpoint):
    protocol = _make_protocol(endpoint)
    protocol.trans.getTransport().setTimeout(TIMEOUT * 1000.)
    protocol.trans.open()
    client = BaseplateService.Client(protocol)
    assert client.is_healthy(), "service indicated unhealthiness"