Ejemplo n.º 1
0
        required_headers = elements["headers"]
        assert required_headers.startswith('"'), required_headers
        assert required_headers.endswith('"'), required_headers
        assert "(request-target)" in required_headers, required_headers
        assert "digest" in required_headers, required_headers

    return network


def run(args):
    service_startups(args)
    recovery_shares_scenario(args)


if __name__ == "__main__":
    cr = ConcurrentRunner()

    cr.add(
        "membership",
        run,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.max_nodes(cr.args, f=0),
        initial_user_count=0,
    )

    cr.add(
        "member_client",
        memberclient.run,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.max_nodes(cr.args, f=1),
    )
Ejemplo n.º 2
0
        governance_js.test_vote_failure_reporting(network, args)
        governance_js.test_operator_proposals_and_votes(network, args)
        governance_js.test_apply(network, args)
        governance_js.test_set_constitution(network, args)


if __name__ == "__main__":

    def add(parser):
        parser.add_argument(
            "--jinja-templates-path",
            help="Path to directory containing sample Jinja templates",
            required=True,
        )

    cr = ConcurrentRunner(add)

    cr.add(
        "session_auth",
        gov,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.max_nodes(cr.args, f=0),
        initial_user_count=3,
        authenticate_session=True,
    )

    cr.add(
        "session_noauth",
        gov,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.max_nodes(cr.args, f=0),
Ejemplo n.º 3
0
    run(args)
    if cr.args.consensus != "BFT":
        run_join_old_snapshot(all)


if __name__ == "__main__":

    def add(parser):
        parser.add_argument(
            "--include-2tx-reconfig",
            help="Include tests for the 2-transaction reconfiguration scheme",
            default=False,
            action="store_true",
        )

    cr = ConcurrentRunner(add)

    cr.add(
        "1tx_reconfig",
        run,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.min_nodes(cr.args, f=1),
        reconfiguration_type="OneTransaction",
    )

    if cr.args.include_2tx_reconfig:
        cr.add(
            "2tx_reconfig",
            run,
            package="samples/apps/logging/liblogging",
            nodes=infra.e2e_args.min_nodes(cr.args, f=1),
Ejemplo n.º 4
0
        parser.add_argument(
            "--msgs-per-recovery",
            help="Number of public and private messages between two recoveries",
            type=int,
            default=5,
        )
        parser.add_argument(
            "--with-load",
            help="If set, the service is loaded before being recovered",
            action="store_true",
            default=False,
        )

    args = infra.e2e_args.cli_args(add)

    cr = ConcurrentRunner(add)

    cr.add(
        "recovery",
        run,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.min_nodes(args, f=1),
        ledger_chunk_bytes="50KB",
        snasphot_tx_interval=30,
    )

    # Note: `run_corrupted_ledger` runs with very a specific node configuration
    # so that the contents of recovered (and tampered) ledger chunks
    # can be dictated by the test. In particular, the signature interval is large
    # enough to create in-progress ledger files that do not end on a signature. The
    # test is also in control of the ledger chunking.
Ejemplo n.º 5
0
        network.start_and_join(args)
        governance_js.test_proposal_validation(network, args)
        governance_js.test_proposal_storage(network, args)
        governance_js.test_proposal_withdrawal(network, args)
        governance_js.test_ballot_storage(network, args)
        governance_js.test_pure_proposals(network, args)
        governance_js.test_proposals_with_votes(network, args)
        governance_js.test_vote_failure_reporting(network, args)
        governance_js.test_operator_proposals_and_votes(network, args)
        governance_js.test_apply(network, args)
        governance_js.test_actions(network, args)
        governance_js.test_set_constitution(network, args)


if __name__ == "__main__":
    cr = ConcurrentRunner()

    cr.add(
        "session_auth",
        gov,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.max_nodes(cr.args, f=0),
        initial_user_count=3,
        authenticate_session=True,
    )

    cr.add(
        "session_noauth",
        gov,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.max_nodes(cr.args, f=0),
Ejemplo n.º 6
0
    return network


def run_request_object(args):
    with infra.network.network(args.nodes,
                               args.binary_dir,
                               args.debug_nodes,
                               args.perf_nodes,
                               pdb=args.pdb) as network:
        network.start_and_open(args)
        network = test_request_object_api(network, args)


if __name__ == "__main__":
    cr = ConcurrentRunner()

    cr.add(
        "authz",
        run,
        nodes=infra.e2e_args.nodes(cr.args, 1),
        js_app_bundle=os.path.join(cr.args.js_app_bundle,
                                   "js-custom-authorization"),
    )

    cr.add(
        "limits",
        run_limits,
        nodes=infra.e2e_args.nodes(cr.args, 1),
        js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-limits"),
    )
Ejemplo n.º 7
0
        primary, _ = network.find_primary()
        primary.stop()
        network.wait_for_new_primary(primary)
        test_jwt_key_initial_refresh(network, args)


def run_ca_cert(args):
    with infra.network.network(
        args.nodes, args.binary_dir, args.debug_nodes, args.perf_nodes, pdb=args.pdb
    ) as network:
        network.start_and_join(args)
        ca_certs.test_cert_store(network, args)


if __name__ == "__main__":
    cr = ConcurrentRunner()

    cr.add(
        "auto",
        run_auto,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.min_nodes(cr.args, f=1),
        jwt_key_refresh_interval_s=1,
        issuer_port=12345,
    )

    cr.add(
        "manual",
        run_manual,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.min_nodes(cr.args, f=1),
Ejemplo n.º 8
0
def run_all(args):
    run(args)
    if cr.args.consensus != "bft":
        run_join_old_snapshot(all)


if __name__ == "__main__":

    def add(parser):
        parser.add_argument(
            "--include-2tx-reconfig",
            help="Include tests for the 2-transaction reconfiguration scheme",
            action="store_true",
        )

    cr = ConcurrentRunner(add)

    cr.add(
        "1tx_reconfig",
        run,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.min_nodes(cr.args, f=1),
        reconfiguration_type="1tx",
    )

    if cr.args.include_2tx_reconfig:
        cr.add(
            "2tx_reconfig",
            run,
            package="samples/apps/logging/liblogging",
            nodes=infra.e2e_args.min_nodes(cr.args, f=1),
Ejemplo n.º 9
0
        network = test_network_node_info(network, args)
        network = test_metrics(network, args)
        network = test_memory(network, args)
        # BFT does not handle re-keying yet
        if args.consensus == "cft":
            network = test_liveness(network, args)
            network = test_rekey(network, args)
            network = test_liveness(network, args)
            network = test_random_receipts(network, args, False)
        if args.package == "samples/apps/logging/liblogging":
            network = test_receipts(network, args)
        network = test_historical_receipts(network, args)


if __name__ == "__main__":
    cr = ConcurrentRunner()

    cr.add(
        "js",
        run,
        package="libjs_generic",
        nodes=infra.e2e_args.max_nodes(cr.args, f=0),
        initial_user_count=4,
        initial_member_count=2,
    )

    cr.add(
        "cpp",
        run,
        package="samples/apps/logging/liblogging",
        js_app_bundle=None,
Ejemplo n.º 10
0
Archivo: schema.py Proyecto: lynshi/CCF
            type=str,
        )
        parser.add_argument(
            "--config-samples-dir",
            help="Configuration samples directory",
            type=str,
            default=None,
        )
        parser.add_argument(
            "--config-file-1x",
            help="Path to 1.x configuration file",
            type=str,
            default=None,
        )

    cr = ConcurrentRunner(add)

    cr.add(
        "schema",
        run,
        package="samples/apps/logging/liblogging",
        nodes=infra.e2e_args.nodes(cr.args, 1),
    )

    cr.add(
        "nobuiltins",
        run_nobuiltins,
        package="samples/apps/nobuiltins/libnobuiltins",
        nodes=infra.e2e_args.min_nodes(cr.args, f=1),
    )
Ejemplo n.º 11
0
            try:
                test_kill_primary(network, args)
            except PrimaryNotFound:
                if node_to_stop < nodes_to_stop - 1:
                    raise
                else:
                    primary_is_known = False

        assert not primary_is_known, "Primary is still known"
        LOG.success("Test ended successfully.")


if __name__ == "__main__":

    cr = ConcurrentRunner()

    args = copy.deepcopy(cr.args)

    if cr.args.consensus in ("cft", "all"):
        args.consensus = "cft"
        cr.add(
            "cft",
            run,
            package="samples/apps/logging/liblogging",
            nodes=infra.e2e_args.min_nodes(args, f=1),
            raft_election_timeout_ms=1000,
            consensus="cft",
        )

    if cr.args.consensus in ("bft", "all"):