Example #1
0
def testClientRequestWithPluginLoaded(cli, validNodeNames,
                                      loadOpVerificationPlugin,
                                      createAllNodes):
    # verify plugin is loaded
    for nodeName, node in cli.nodes.items():
        assert node.opVerifiers is not None
        assert len(node.opVerifiers) == 1
    operation = '{"name": "John", "age": "10", "type": "random"}'
    checkRequest(cli, operation)
def testClientRequestWithPluginLoaded(cli,
                                      validNodeNames,
                                      loadOpVerificationPlugin,
                                      createAllNodes):
    # verify plugin is loaded
    for nodeName, node in cli.nodes.items():
        assert node.opVerifiers is not None
        assert len(node.opVerifiers) == 1
    operation = '{"name": "John", "age": "10"}'
    checkRequest(cli, operation)
Example #3
0
def testLogFiltering(cli, validNodeNames, createAllNodes):
    msg = '{"Hello": "There", "type": "greeting"}'
    client, wallet = checkRequest(cli, msg)

    x = client.handleOneNodeMsg

    def handleOneNodeMsg(self, wrappedMsg, excludeFromCli=None):
        return x(wrappedMsg, excludeFromCli=True)

    client.handleOneNodeMsg = types.MethodType(handleOneNodeMsg, client)
    client.nodestack.msgHandler = client.handleOneNodeMsg
    msg = '{"Hello": "Where", "type": "greeting"}'
    cli.enterCmd('client {} send {}'.format(client.name, msg))

    lastRequestId = wallet._getIdData().lastReqId
    waitForSufficientRepliesForRequests(cli.looper,
                                        client,
                                        requestIds=[lastRequestId])

    assert "got msg from node" not in cli.lastCmdOutput
def testLogFiltering(cli, validNodeNames, createAllNodes):
    msg = '{"Hello": "There", "type": "greeting"}'
    client, wallet = checkRequest(cli, msg)

    x = client.handleOneNodeMsg

    def handleOneNodeMsg(self, wrappedMsg, excludeFromCli=None):
        return x(wrappedMsg, excludeFromCli=True)

    client.handleOneNodeMsg = types.MethodType(handleOneNodeMsg, client)
    client.nodestack.msgHandler = client.handleOneNodeMsg
    msg = '{"Hello": "Where", "type": "greeting"}'
    cli.enterCmd('client {} send {}'.format(client.name, msg))
    cli.looper.run(
        eventually(checkSufficientRepliesRecvd,
                   client.inBox,
                   wallet._getIdData().lastReqId,
                   getMaxFailures(len(cli.nodes)),
                   retryWait=2,
                   timeout=10))
    assert "got msg from node" not in cli.lastCmdOutput
def testLogFiltering(cli, validNodeNames, createAllNodes):
    msg = '{"amount": 20, "type": "buy"}'
    client, wallet = checkRequest(cli, msg)

    x = client.handleOneNodeMsg

    def handleOneNodeMsg(self, wrappedMsg, excludeFromCli=None):
        return x(wrappedMsg, excludeFromCli=True)

    client.handleOneNodeMsg = types.MethodType(handleOneNodeMsg, client)
    client.nodestack.msgHandler = client.handleOneNodeMsg
    msg = '{"amount": 30, "type": "buy"}'
    cli.enterCmd('client {} send {}'.format(client.name, msg))

    lastRequestId = client.reqRepStore.lastReqId
    request = Request(identifier=wallet.defaultId,
                      reqId=lastRequestId,
                      protocolVersion=CURRENT_PROTOCOL_VERSION)
    waitForSufficientRepliesForRequests(cli.looper, client, requests=[request])

    assert "got msg from node" not in cli.lastCmdOutput
Example #6
0
def testLogFiltering(cli, validNodeNames, createAllNodes):
    msg = '{"Hello": "There"}'
    client, wallet = checkRequest(cli, msg)

    x = client.handleOneNodeMsg

    def handleOneNodeMsg(self, wrappedMsg, excludeFromCli=None):
        return x(wrappedMsg, excludeFromCli=True)

    client.handleOneNodeMsg = types.MethodType(handleOneNodeMsg, client)
    client.nodestack.msgHandler = client.handleOneNodeMsg
    msg = '{"Hello": "Where"}'
    cli.enterCmd("client {} send {}".format(client.name, msg))
    cli.looper.run(
        eventually(
            checkSufficientRepliesRecvd,
            client.inBox,
            wallet._getIdData().lastReqId,
            getMaxFailures(len(cli.nodes)),
            retryWait=2,
            timeout=10,
        )
    )
    assert "got msg from node" not in cli.lastCmdOutput
Example #7
0
def testClientRequest(cli, validNodeNames, createAllNodes):
    """
    Test client sending request and checking reply and status
    """
    operation = '{"amount": 12, "type": "buy"}'
    checkRequest(cli, operation)
Example #8
0
def testClientRequest(cli, validNodeNames, createAllNodes):
    """
    Test client sending request and checking reply and status
    """
    operation = '{"Hello": "There", "type": "greeting"}'
    checkRequest(cli, operation)
Example #9
0
def testClientRequest(cli, validNodeNames, cliLooper, createAllNodes):
    """
    Test client sending request and checking reply and status
    """
    operation = '{"Hello": "There"}'
    checkRequest(cli, cliLooper, operation)