test_verify.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:RKSV 作者: ztp-at 项目源码 文件源码
def testVerifyMulti(specs, groupLabel, crt, pub, priv, tcDefaultSize,
        proxy):
    """
    Runs all the given test cases against verify.verifyDEP. In addition to
    the elements understood by TestVerify(), this function also understands
    the "closedSystem" element in the root dictionary, which indicates
    whether the system is a closed system (True) or an open system (False).
    This function is a generator to facilitate more responsive output when
    used with many test cases.
    :param specs: A list or generator with test specifications as dict
    structures.
    :param groupLabel: A label to indicate which group the tests belong to
    as a string.
    :param crt: The certificate used to sign the generated receipts if an
    open system is used.
    :param pub: The public key used to sign the generated receipts if a
    closed system is used.
    :param priv: The private key belonging to the given certificate and
    public key.
    :param tcDefaultSize: The turnover counter size in bytes to use if no
    size is given in the test specification.
    :param proxy: An object implementing RKSVVerificationProxyI. This will
    be used to do the actual verification.
    :yield: A tuple containing (in order) the test cases name, the group
    label, a boolean indicating whether the system is a closed (True) or an
    open (False) system, the used turnover counter size in bytes, the
    result of the test as a TestVerifyResult and the generated error
    message or None if no error occurred.
    """
    for s in specs:
        label = s.get('simulationRunLabel', 'Unknown')
        tc_size = s.get('turnoverCounterSize', tcDefaultSize)
        closed = s.get('closedSystem', False)
        if label == 'Unknown':
            result = TestVerifyResult.ERROR
            msg = _('No run label')
        else:
            pc = pub if closed else crt
            result, msg = testVerify(s, pc, priv, closed, proxy)
        yield (label, groupLabel, closed, tc_size, result, msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号