def testLoggingTxnStateForInvalidRequest(looper, txnPoolNodeSet,
                                         clientAndWallet1, client1Connected,
                                         logsearch):

    client, clientWallet = clientAndWallet1

    logsPropagate, _ = logsearch(levels=['INFO'],
                                 files=['propagator.py'],
                                 funcs=['propagate'],
                                 msgs=['propagating.*request.*from client'])

    logsReject, _ = logsearch(
        levels=['WARNING'],
        files=['replica.py'],
        funcs=['processReqDuringBatch'],
        msgs=['encountered exception.*while processing.*will reject'])

    req, wallet = sendAddNewClient(STEWARD, "name", client, clientWallet)

    ensureRejectsRecvd(
        looper,
        txnPoolNodeSet,
        client,
        reason="Only Steward is allowed to do these transactions",
        timeout=waits.expectedReqRejectQuorumTime())

    reqId = str(req.reqId)
    assert any(reqId in record.getMessage() for record in logsPropagate)
    assert any(reqId in record.getMessage() for record in logsReject)
Example #2
0
def checkIdentityRequestFailed(looper, client, req, cause):
    timeout = waits.expectedReqRejectQuorumTime()
    # TODO: Just for now, better to have a generic negative response checker
    try:
        looper.run(eventually(checkRejects,
                              client,
                              req.reqId,
                              cause, retryWait=1, timeout=timeout))
    except AssertionError:
        looper.run(eventually(checkNacks,
                              client,
                              req.reqId,
                              cause, retryWait=1, timeout=timeout))
Example #3
0
def checkIdentityRequestFailed(looper, client, req, cause):
    timeout = waits.expectedReqRejectQuorumTime()
    # TODO: Just for now, better to have a generic negative response checker
    try:
        looper.run(
            eventually(checkRejects,
                       client,
                       req.reqId,
                       cause,
                       retryWait=1,
                       timeout=timeout))
    except AssertionError:
        looper.run(
            eventually(checkNacks,
                       client,
                       req.reqId,
                       cause,
                       retryWait=1,
                       timeout=timeout))
Example #4
0
def waitRejectWithReason(looper, client, reason: str, sender: str):
    timeout = waits.expectedReqRejectQuorumTime()
    return wait_negative_resp(looper, client, reason, sender, timeout,
                              checkRejectWithReason)