Add load_param file, delete old tests, new universal, parametrized test, add stop unused nodes function.

Signed-off-by: a.lipay <a.lipay@yadro.com>
This commit is contained in:
a.lipay 2022-12-12 18:46:29 +03:00 committed by Alipayy
parent 1bb640a0db
commit 15677e89eb
3 changed files with 9 additions and 2 deletions

View file

@ -22,3 +22,6 @@ LOAD_TIME = os.getenv("LOAD_TIME", "200").split(",")
LOAD_TYPE = os.getenv("LOAD_TYPE", "grpc").split(",") LOAD_TYPE = os.getenv("LOAD_TYPE", "grpc").split(",")
LOAD_NODES_COUNT = os.getenv("LOAD_NODES_COUNT", "1").split(",") LOAD_NODES_COUNT = os.getenv("LOAD_NODES_COUNT", "1").split(",")
STORAGE_NODE_COUNT = os.getenv("STORAGE_NODE_COUNT", "4").split(",") STORAGE_NODE_COUNT = os.getenv("STORAGE_NODE_COUNT", "4").split(",")
CONTAINER_PLACEMENT_POLICY = os.getenv(
"STORAGE_NODE_COUNT", "REP 1 IN X CBF 1 SELECT 1 FROM * AS X"
)

View file

@ -39,7 +39,9 @@ def start_stopped_nodes():
@allure.title("Init s3 client") @allure.title("Init s3 client")
def init_s3_client(load_nodes: list, login: str, pkey: str, hosting: Hosting): def init_s3_client(
load_nodes: list, login: str, pkey: str, container_placement_policy: str, hosting: Hosting
):
service_configs = hosting.find_service_configs(STORAGE_NODE_SERVICE_NAME_REGEX) service_configs = hosting.find_service_configs(STORAGE_NODE_SERVICE_NAME_REGEX)
host = hosting.get_host_by_service(service_configs[0].name) host = hosting.get_host_by_service(service_configs[0].name)
wallet_path = service_configs[0].attributes["wallet_path"] wallet_path = service_configs[0].attributes["wallet_path"]
@ -60,7 +62,7 @@ def init_s3_client(load_nodes: list, login: str, pkey: str, hosting: Hosting):
peer=node_endpoint, peer=node_endpoint,
bearer_rules=f"{path}/scenarios/files/rules.json", bearer_rules=f"{path}/scenarios/files/rules.json",
gate_public_key=public_key, gate_public_key=public_key,
container_placement_policy="REP 1 IN X CBF 1 SELECT 1 FROM * AS X", container_placement_policy=container_placement_policy,
container_policy=f"{path}/scenarios/files/policy.json", container_policy=f"{path}/scenarios/files/policy.json",
wallet_password="", wallet_password="",
).stdout ).stdout

View file

@ -17,6 +17,7 @@ from load import (
stop_unused_nodes, stop_unused_nodes,
) )
from load_params import ( from load_params import (
CONTAINER_PLACEMENT_POLICY,
CONTAINERS_COUNT, CONTAINERS_COUNT,
DELETERS, DELETERS,
LOAD_NODE_SSH_PRIVATE_KEY_PATH, LOAD_NODE_SSH_PRIVATE_KEY_PATH,
@ -57,6 +58,7 @@ class TestLoad(ClusterTestBase):
login=LOAD_NODE_SSH_USER, login=LOAD_NODE_SSH_USER,
pkey=LOAD_NODE_SSH_PRIVATE_KEY_PATH, pkey=LOAD_NODE_SSH_PRIVATE_KEY_PATH,
hosting=hosting, hosting=hosting,
container_placement_policy=CONTAINER_PLACEMENT_POLICY,
) )
@pytest.mark.parametrize("obj_size, out_file", list(zip(OBJ_SIZE, OUT_FILE))) @pytest.mark.parametrize("obj_size, out_file", list(zip(OBJ_SIZE, OUT_FILE)))