Ejemplo n.º 1
0
    def pool_users(
        self,
        cluster_manager: parallel_run.ClusterManager,
        cluster: clusterlib.ClusterLib,
    ) -> List[clusterlib.PoolUser]:
        """Create pool users."""
        data_key = id(TestExpectedFees)
        cached_value = cluster_manager.cache.test_data.get(data_key)
        if cached_value:
            return cached_value  # type: ignore

        created_users = clusterlib_utils.create_pool_users(
            cluster_obj=cluster,
            name_template=
            f"test_expected_fees_ci{cluster_manager.cluster_instance}",
            no_of_addr=201,
        )
        cluster_manager.cache.test_data[data_key] = created_users

        # fund source addresses
        clusterlib_utils.fund_from_faucet(
            *created_users[:10],
            cluster_obj=cluster,
            faucet_data=cluster_manager.cache.addrs_data["user1"],
        )

        return created_users
Ejemplo n.º 2
0
def pool_users(
    cluster_manager: cluster_management.ClusterManager,
    cluster: clusterlib.ClusterLib,
) -> List[clusterlib.PoolUser]:
    """Create pool users."""
    with cluster_manager.cache_fixture() as fixture_cache:
        if fixture_cache.value:
            return fixture_cache.value  # type: ignore

        created_users = clusterlib_utils.create_pool_users(
            cluster_obj=cluster,
            name_template=
            f"test_delegation_pool_user_ci{cluster_manager.cluster_instance_num}",
            no_of_addr=2,
        )
        fixture_cache.value = created_users

    # fund source addresses
    clusterlib_utils.fund_from_faucet(
        created_users[0],
        cluster_obj=cluster,
        faucet_data=cluster_manager.cache.addrs_data["user1"],
    )

    return created_users
Ejemplo n.º 3
0
    def pool_user(
        self,
        cluster_manager: cluster_management.ClusterManager,
        cluster: clusterlib.ClusterLib,
    ) -> clusterlib.PoolUser:
        """Create pool user."""
        with cluster_manager.cache_fixture() as fixture_cache:
            if fixture_cache.value:
                return fixture_cache.value  # type: ignore

            created_user = clusterlib_utils.create_pool_users(
                cluster_obj=cluster,
                name_template=
                f"test_mir_certs_ci{cluster_manager.cluster_instance}",
                no_of_addr=1,
            )[0]
            fixture_cache.value = created_user

        # fund source addresses
        clusterlib_utils.fund_from_faucet(
            created_user,
            cluster_obj=cluster,
            faucet_data=cluster_manager.cache.addrs_data["user1"],
        )

        return created_user
Ejemplo n.º 4
0
def pool_users_disposable(
    cluster: clusterlib.ClusterLib, ) -> List[clusterlib.PoolUser]:
    """Create function scoped pool users."""
    test_id = common.get_test_id(cluster)
    pool_users = clusterlib_utils.create_pool_users(
        cluster_obj=cluster,
        name_template=f"{test_id}_pool_user",
        no_of_addr=2,
    )
    return pool_users