Example #1
0
    def testMethodCallArgDict(self, ssl):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl) as clientFactory:
            with self._client(clientFactory) as client:
                self.assertEqual(self._callTimeout(client, "echo",
                                 {'text': data}, CALL_ID), data)
Example #2
0
    def testMethodCallArgDict(self, ssl):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl) as clientFactory:
            with self._client(clientFactory) as client:
                self.assertEqual(
                    self._callTimeout(client, "echo", {'text': data}, CALL_ID),
                    data)
Example #3
0
    def testMethodCallArgList(self, ssl):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl) as clientFactory:
            with self._client(clientFactory) as client:
                self.log.info("Calling 'echo'")
                self.assertEqual(
                    self._callTimeout(client, "echo", (data, ), CALL_ID), data)
Example #4
0
    def testMethodCallArgList(self, ssl):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl) as clientFactory:
            with self._client(clientFactory) as client:
                self.log.info("Calling 'echo'")
                self.assertEqual(self._callTimeout(client, "echo",
                                                   (data,), CALL_ID), data)
Example #5
0
    def test_echo(self, size, use_ssl):
        data = dummyTextGenerator(size)

        with constructAcceptor(self.log, use_ssl, _SampleBridge()) as acceptor:
            sslctx = DEAFAULT_SSL_CONTEXT if use_ssl else None

            with utils.running(
                StandAloneRpcClient(acceptor._host, acceptor._port, "jms.topic.vdsm_requests", str(uuid4()), sslctx)
            ) as client:
                self.assertEquals(client.callMethod("echo", (data,), str(uuid4())), data)
Example #6
0
    def testMethodCallArgDict(self, ssl, type):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl, type) as clientFactory:
            with self._client(clientFactory) as client:
                if type == "xml":
                    response = client.send("echo", (data,))
                    self.assertEquals(response, data)
                else:
                    self.assertEquals(self._callTimeout(client, "echo", {"text": data}, CALL_ID), data)
Example #7
0
    def testMethodCallArgDict(self, ssl, type):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl, type) as clientFactory:
            with self._client(clientFactory) as client:
                if type == "xml":
                        response = client.send("echo", (data,))
                        self.assertEquals(response, data)
                else:
                    self.assertEquals(self._callTimeout(client, "echo",
                                      {'text': data}, CALL_ID), data)
Example #8
0
    def test_echo(self, size, use_ssl):
        data = dummyTextGenerator(size)
        ssl_ctx = self.ssl_ctx if use_ssl else None

        with constructAcceptor(self.log, ssl_ctx, _SampleBridge()) as acceptor:
            with utils.closing(
                    StandAloneRpcClient(acceptor._host, acceptor._port,
                                        'jms.topic.vdsm_requests',
                                        str(uuid4()), ssl_ctx,
                                        False)) as client:
                self.assertEqual(
                    client.callMethod('echo', (data, ), str(uuid4())), data)
Example #9
0
    def test_echo(self, use_ssl):
        data = dummyTextGenerator(1024)

        with constructAcceptor(self.log, use_ssl, _SampleBridge()) as acceptor:
            sslctx = DEAFAULT_SSL_CONTEXT if use_ssl else None

            with utils.running(
                    StandAloneRpcClient(acceptor._host, acceptor._port,
                                        'jms.topic.vdsm_requests',
                                        str(uuid4()), sslctx)) as client:
                self.assertEquals(
                    client.callMethod('echo', (data, ), str(uuid4())), data)
Example #10
0
    def testMethodCallArgList(self, ssl, type):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl, type) as clientFactory:
            with self._client(clientFactory) as client:
                self.log.info("Calling 'echo'")
                if type == "xml":
                    response = client.send("echo", (data, ))
                    self.assertEquals(response, data)
                else:
                    self.assertEquals(
                        self._callTimeout(client, "echo", (data, ), CALL_ID,
                                          CALL_TIMEOUT), data)
Example #11
0
    def testMethodCallArgList(self, ssl, type):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl, type) as clientFactory:
            with self._client(clientFactory) as client:
                self.log.info("Calling 'echo'")
                if type == "xml":
                    response = client.send("echo", (data,))
                    self.assertEquals(response, data)
                else:
                    self.assertEquals(self._callTimeout(client, "echo",
                                      (data,), CALL_ID,
                                      CALL_TIMEOUT), data)
Example #12
0
    def test_call(self):
        with self._create_client() as client:
            msg = dummyTextGenerator(1024)
            res = client.Test.echo(text=msg)

            self.assertEqual(msg, res)
Example #13
0
    def test_call(self):
        with self._create_client() as client:
            msg = dummyTextGenerator(1024)
            res = client.Test.echo(text=msg)

            self.assertEqual(msg, res)