2020-07-01 02:28:31 +00:00
|
|
|
import os
|
2020-04-30 13:14:32 +00:00
|
|
|
|
2022-10-04 07:52:12 +00:00
|
|
|
import yaml
|
2021-05-07 12:14:37 +00:00
|
|
|
|
2021-10-07 11:28:31 +00:00
|
|
|
CONTAINER_WAIT_INTERVAL = "1m"
|
|
|
|
|
2022-09-09 14:08:43 +00:00
|
|
|
# TODO: Get object size data from a node config
|
|
|
|
SIMPLE_OBJ_SIZE = int(os.getenv("SIMPLE_OBJ_SIZE", "1000"))
|
|
|
|
COMPLEX_OBJ_SIZE = int(os.getenv("COMPLEX_OBJ_SIZE", "2000"))
|
2021-05-07 12:14:37 +00:00
|
|
|
|
2022-09-28 12:07:16 +00:00
|
|
|
MAINNET_BLOCK_TIME = os.getenv("MAINNET_BLOCK_TIME", "1s")
|
|
|
|
MAINNET_TIMEOUT = os.getenv("MAINNET_TIMEOUT", "1min")
|
|
|
|
MORPH_BLOCK_TIME = os.getenv("MORPH_BLOCK_TIME", "1s")
|
2021-04-20 13:11:27 +00:00
|
|
|
NEOFS_CONTRACT_CACHE_TIMEOUT = os.getenv("NEOFS_CONTRACT_CACHE_TIMEOUT", "30s")
|
2021-11-08 09:57:19 +00:00
|
|
|
|
2022-08-15 15:21:23 +00:00
|
|
|
# Time interval that allows a GC pass on storage node (this includes GC sleep interval
|
|
|
|
# of 1min plus 15 seconds for GC pass itself)
|
|
|
|
STORAGE_GC_TIME = os.getenv("STORAGE_GC_TIME", "75s")
|
2021-05-07 12:14:37 +00:00
|
|
|
|
2022-10-09 20:01:59 +00:00
|
|
|
# TODO: we should use hosting instead of these endpoints
|
2021-04-20 13:11:27 +00:00
|
|
|
NEOFS_ENDPOINT = os.getenv("NEOFS_ENDPOINT", "s01.neofs.devenv:8080")
|
2022-09-28 12:07:16 +00:00
|
|
|
NEO_MAINNET_ENDPOINT = os.getenv("NEO_MAINNET_ENDPOINT", "http://main-chain.neofs.devenv:30333")
|
|
|
|
MORPH_ENDPOINT = os.getenv("MORPH_ENDPOINT", "http://morph-chain.neofs.devenv:30333")
|
|
|
|
HTTP_GATE = os.getenv("HTTP_GATE", "http://http.neofs.devenv")
|
|
|
|
S3_GATE = os.getenv("S3_GATE", "https://s3.neofs.devenv:8080")
|
2022-10-09 20:01:59 +00:00
|
|
|
|
2022-10-04 07:52:12 +00:00
|
|
|
GAS_HASH = os.getenv("GAS_HASH", "0xd2a4cff31913016155e38e474a2c06d08be276cf")
|
2021-04-20 09:51:53 +00:00
|
|
|
|
2022-06-13 20:33:09 +00:00
|
|
|
NEOFS_CONTRACT = os.getenv("NEOFS_IR_CONTRACTS_NEOFS")
|
2021-04-25 10:43:39 +00:00
|
|
|
|
2022-08-25 10:57:55 +00:00
|
|
|
ASSETS_DIR = os.getenv("ASSETS_DIR", "TemporaryDir")
|
2022-10-04 07:52:12 +00:00
|
|
|
DEVENV_PATH = os.getenv("DEVENV_PATH", os.path.join("..", "neofs-dev-env"))
|
2021-06-25 13:44:42 +00:00
|
|
|
|
2022-10-04 07:52:12 +00:00
|
|
|
# Password of wallet owned by user on behalf of whom we are running tests
|
|
|
|
WALLET_PASS = os.getenv("WALLET_PASS", "")
|
|
|
|
|
2022-10-18 22:01:42 +00:00
|
|
|
# Load node parameters
|
|
|
|
LOAD_NODES = os.getenv("LOAD_NODES")
|
|
|
|
LOAD_NODE_SSH_USER = os.getenv("LOAD_NODE_SSH_USER")
|
|
|
|
LOAD_NODE_SSH_PRIVATE_KEY_PATH = os.getenv("LOAD_NODE_SSH_PRIVATE_KEY_PATH")
|
|
|
|
|
2022-10-04 07:52:12 +00:00
|
|
|
# Configuration of storage nodes
|
2022-10-09 20:01:59 +00:00
|
|
|
# TODO: we should use hosting instead of all these variables
|
2022-07-11 10:58:40 +00:00
|
|
|
STORAGE_RPC_ENDPOINT_1 = os.getenv("STORAGE_RPC_ENDPOINT_1", "s01.neofs.devenv:8080")
|
|
|
|
STORAGE_RPC_ENDPOINT_2 = os.getenv("STORAGE_RPC_ENDPOINT_2", "s02.neofs.devenv:8080")
|
|
|
|
STORAGE_RPC_ENDPOINT_3 = os.getenv("STORAGE_RPC_ENDPOINT_3", "s03.neofs.devenv:8080")
|
|
|
|
STORAGE_RPC_ENDPOINT_4 = os.getenv("STORAGE_RPC_ENDPOINT_4", "s04.neofs.devenv:8080")
|
2022-07-05 11:55:16 +00:00
|
|
|
|
2022-07-11 10:58:40 +00:00
|
|
|
STORAGE_CONTROL_ENDPOINT_1 = os.getenv("STORAGE_CONTROL_ENDPOINT_1", "s01.neofs.devenv:8081")
|
|
|
|
STORAGE_CONTROL_ENDPOINT_2 = os.getenv("STORAGE_CONTROL_ENDPOINT_2", "s02.neofs.devenv:8081")
|
|
|
|
STORAGE_CONTROL_ENDPOINT_3 = os.getenv("STORAGE_CONTROL_ENDPOINT_3", "s03.neofs.devenv:8081")
|
|
|
|
STORAGE_CONTROL_ENDPOINT_4 = os.getenv("STORAGE_CONTROL_ENDPOINT_4", "s04.neofs.devenv:8081")
|
2022-09-28 12:07:16 +00:00
|
|
|
|
|
|
|
STORAGE_WALLET_PATH_1 = os.getenv(
|
2022-10-04 07:52:12 +00:00
|
|
|
"STORAGE_WALLET_PATH_1", os.path.join(DEVENV_PATH, "services", "storage", "wallet01.json")
|
2022-09-28 12:07:16 +00:00
|
|
|
)
|
|
|
|
STORAGE_WALLET_PATH_2 = os.getenv(
|
2022-10-04 07:52:12 +00:00
|
|
|
"STORAGE_WALLET_PATH_2", os.path.join(DEVENV_PATH, "services", "storage", "wallet02.json")
|
2022-09-28 12:07:16 +00:00
|
|
|
)
|
|
|
|
STORAGE_WALLET_PATH_3 = os.getenv(
|
2022-10-04 07:52:12 +00:00
|
|
|
"STORAGE_WALLET_PATH_3", os.path.join(DEVENV_PATH, "services", "storage", "wallet03.json")
|
2022-09-28 12:07:16 +00:00
|
|
|
)
|
|
|
|
STORAGE_WALLET_PATH_4 = os.getenv(
|
2022-10-04 07:52:12 +00:00
|
|
|
"STORAGE_WALLET_PATH_4", os.path.join(DEVENV_PATH, "services", "storage", "wallet04.json")
|
2022-09-28 12:07:16 +00:00
|
|
|
)
|
2022-07-11 10:58:40 +00:00
|
|
|
STORAGE_WALLET_PATH = STORAGE_WALLET_PATH_1
|
2022-08-01 10:15:02 +00:00
|
|
|
STORAGE_WALLET_PASS = os.getenv("STORAGE_WALLET_PASS", "")
|
2022-07-05 11:55:16 +00:00
|
|
|
|
|
|
|
NEOFS_NETMAP_DICT = {
|
2022-09-28 12:07:16 +00:00
|
|
|
"s01": {
|
|
|
|
"rpc": STORAGE_RPC_ENDPOINT_1,
|
|
|
|
"control": STORAGE_CONTROL_ENDPOINT_1,
|
|
|
|
"wallet_path": STORAGE_WALLET_PATH_1,
|
|
|
|
"UN-LOCODE": "RU MOW",
|
2022-07-05 11:55:16 +00:00
|
|
|
},
|
2022-09-28 12:07:16 +00:00
|
|
|
"s02": {
|
|
|
|
"rpc": STORAGE_RPC_ENDPOINT_2,
|
|
|
|
"control": STORAGE_CONTROL_ENDPOINT_2,
|
|
|
|
"wallet_path": STORAGE_WALLET_PATH_2,
|
|
|
|
"UN-LOCODE": "RU LED",
|
2022-07-05 11:55:16 +00:00
|
|
|
},
|
2022-09-28 12:07:16 +00:00
|
|
|
"s03": {
|
|
|
|
"rpc": STORAGE_RPC_ENDPOINT_3,
|
|
|
|
"control": STORAGE_CONTROL_ENDPOINT_3,
|
|
|
|
"wallet_path": STORAGE_WALLET_PATH_3,
|
|
|
|
"UN-LOCODE": "SE STO",
|
2022-07-05 11:55:16 +00:00
|
|
|
},
|
2022-09-28 12:07:16 +00:00
|
|
|
"s04": {
|
|
|
|
"rpc": STORAGE_RPC_ENDPOINT_4,
|
|
|
|
"control": STORAGE_CONTROL_ENDPOINT_4,
|
|
|
|
"wallet_path": STORAGE_WALLET_PATH_4,
|
|
|
|
"UN-LOCODE": "FI HEL",
|
2022-07-05 11:55:16 +00:00
|
|
|
},
|
|
|
|
}
|
2022-10-04 07:52:12 +00:00
|
|
|
NEOFS_NETMAP = [node["rpc"] for node in NEOFS_NETMAP_DICT.values()]
|
|
|
|
|
2022-10-09 20:01:59 +00:00
|
|
|
# Paths to CLI executables on machine that runs tests
|
2022-09-28 12:07:16 +00:00
|
|
|
NEOGO_EXECUTABLE = os.getenv("NEOGO_EXECUTABLE", "neo-go")
|
|
|
|
NEOFS_CLI_EXEC = os.getenv("NEOFS_CLI_EXEC", "neofs-cli")
|
2022-10-04 07:52:12 +00:00
|
|
|
NEOFS_AUTHMATE_EXEC = os.getenv("NEOFS_AUTHMATE_EXEC", "neofs-authmate")
|
|
|
|
NEOFS_ADM_EXEC = os.getenv("NEOFS_ADM_EXEC", "neofs-adm")
|
2022-07-13 14:30:57 +00:00
|
|
|
|
2022-09-28 12:07:16 +00:00
|
|
|
MAINNET_WALLET_PATH = os.getenv(
|
2022-10-04 07:52:12 +00:00
|
|
|
"MAINNET_WALLET_PATH", os.path.join(DEVENV_PATH, "services", "chain", "node-wallet.json")
|
2022-09-28 12:07:16 +00:00
|
|
|
)
|
2022-07-21 15:05:34 +00:00
|
|
|
MAINNET_SINGLE_ADDR = os.getenv("MAINNET_SINGLE_ADDR", "NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP")
|
2022-07-12 08:23:48 +00:00
|
|
|
MAINNET_WALLET_PASS = os.getenv("MAINNET_WALLET_PASS", "one")
|
2022-07-13 14:30:57 +00:00
|
|
|
|
2022-10-04 07:52:12 +00:00
|
|
|
IR_WALLET_PATH = os.getenv("IR_WALLET_PATH", os.path.join(DEVENV_PATH, "services", "ir", "az.json"))
|
2022-07-12 08:23:48 +00:00
|
|
|
IR_WALLET_PASS = os.getenv("IR_WALLET_PASS", "one")
|
2022-07-13 14:30:57 +00:00
|
|
|
|
2022-09-28 12:07:16 +00:00
|
|
|
S3_GATE_WALLET_PATH = os.getenv(
|
2022-10-04 07:52:12 +00:00
|
|
|
"S3_GATE_WALLET_PATH", os.path.join(DEVENV_PATH, "services", "s3_gate", "wallet.json")
|
2022-09-28 12:07:16 +00:00
|
|
|
)
|
2022-07-12 08:23:48 +00:00
|
|
|
S3_GATE_WALLET_PASS = os.getenv("S3_GATE_WALLET_PASS", "s3")
|
2022-07-01 17:30:07 +00:00
|
|
|
|
2022-10-04 07:52:12 +00:00
|
|
|
# Config for neofs-adm utility. Optional if tests are running against devenv
|
2022-07-13 14:30:57 +00:00
|
|
|
NEOFS_ADM_CONFIG_PATH = os.getenv("NEOFS_ADM_CONFIG_PATH")
|
2022-07-05 10:17:36 +00:00
|
|
|
|
2022-07-14 07:33:45 +00:00
|
|
|
FREE_STORAGE = os.getenv("FREE_STORAGE", "false").lower() == "true"
|
2022-08-08 14:49:08 +00:00
|
|
|
BIN_VERSIONS_FILE = os.getenv("BIN_VERSIONS_FILE")
|
2022-10-04 07:52:12 +00:00
|
|
|
|
2022-10-09 20:01:59 +00:00
|
|
|
HOSTING_CONFIG_FILE = os.getenv("HOSTING_CONFIG_FILE", ".devenv.hosting.yaml")
|
2022-10-18 22:01:42 +00:00
|
|
|
STORAGE_NODE_SERVICE_NAME_REGEX = r"s\d\d"
|
2022-10-09 20:01:59 +00:00
|
|
|
|
2022-10-04 07:52:12 +00:00
|
|
|
# Generate wallet configs
|
|
|
|
# TODO: we should move all info about wallet configs to fixtures
|
|
|
|
WALLET_CONFIG = os.path.join(os.getcwd(), "wallet_config.yml")
|
|
|
|
with open(WALLET_CONFIG, "w") as file:
|
|
|
|
yaml.dump({"password": WALLET_PASS}, file)
|
|
|
|
|
|
|
|
STORAGE_WALLET_CONFIG = os.path.join(os.getcwd(), "storage_wallet_config.yml")
|
|
|
|
with open(STORAGE_WALLET_CONFIG, "w") as file:
|
|
|
|
yaml.dump({"password": STORAGE_WALLET_PASS}, file)
|
|
|
|
|
|
|
|
MAINNET_WALLET_CONFIG = os.path.join(os.getcwd(), "mainnet_wallet_config.yml")
|
|
|
|
with open(MAINNET_WALLET_CONFIG, "w") as file:
|
|
|
|
yaml.dump({"password": MAINNET_WALLET_PASS}, file)
|
|
|
|
|
|
|
|
IR_WALLET_CONFIG = os.path.join(os.getcwd(), "ir_wallet_config.yml")
|
|
|
|
with open(IR_WALLET_CONFIG, "w") as file:
|
|
|
|
yaml.dump({"password": IR_WALLET_PASS}, file)
|