From 6d3b6f0f2fac94e9869a80e0b7333de41892b3e3 Mon Sep 17 00:00:00 2001 From: Yulia Kovshova Date: Tue, 10 Jan 2023 16:02:24 +0300 Subject: [PATCH] Rename neofs to frostfs Signed-off-by: Yulia Kovshova --- CONTRIBUTING.md | 20 ++++----- README.md | 36 +++++++-------- pyproject.toml | 18 ++++---- .../__init__.py | 0 src/frostfs_testlib/blockchain/__init__.py | 2 + .../blockchain/multisig.py | 2 +- .../blockchain/role_designation.py | 2 +- .../blockchain/rpc_client.py | 2 +- src/frostfs_testlib/cli/__init__.py | 4 ++ .../cli/cli_command.py | 2 +- .../cli/frostfs_adm/__init__.py | 1 + src/frostfs_testlib/cli/frostfs_adm/adm.py | 22 ++++++++++ src/frostfs_testlib/cli/frostfs_adm/config.py | 22 ++++++++++ .../cli/frostfs_adm}/morph.py | 20 ++++----- .../cli/frostfs_adm}/storage_config.py | 8 ++-- .../cli/frostfs_adm}/subnet.py | 24 +++++----- .../cli/frostfs_adm}/version.py | 6 +-- .../cli/frostfs_authmate/__init__.py | 1 + .../cli/frostfs_authmate/authmate.py | 14 ++++++ .../cli/frostfs_authmate}/secret.py | 16 +++---- .../cli/frostfs_authmate}/version.py | 6 +-- .../cli/frostfs_cli/__init__.py | 1 + .../cli/frostfs_cli}/accounting.py | 8 ++-- .../cli/frostfs_cli}/acl.py | 8 ++-- src/frostfs_testlib/cli/frostfs_cli/cli.py | 38 ++++++++++++++++ .../cli/frostfs_cli}/container.py | 8 ++-- .../cli/frostfs_cli}/netmap.py | 8 ++-- .../cli/frostfs_cli}/object.py | 12 ++--- .../cli/frostfs_cli}/session.py | 6 +-- .../cli/frostfs_cli}/shards.py | 6 +-- .../cli/frostfs_cli}/storagegroup.py | 14 +++--- .../cli/frostfs_cli}/util.py | 6 +-- .../cli/frostfs_cli/version.py | 13 ++++++ src/frostfs_testlib/cli/neogo/__init__.py | 2 + .../cli/neogo/candidate.py | 4 +- .../cli/neogo/contract.py | 4 +- .../cli/neogo/db.py | 6 +-- .../cli/neogo/go.py | 18 ++++---- .../cli/neogo/nep17.py | 4 +- .../cli/neogo/network_type.py | 0 .../cli/neogo/node.py | 6 +-- .../cli/neogo/query.py | 4 +- .../cli/neogo/version.py | 4 +- .../cli/neogo/wallet.py | 4 +- src/frostfs_testlib/hosting/__init__.py | 3 ++ .../hosting/config.py | 0 .../hosting/docker_host.py | 19 +++----- .../hosting/hosting.py | 8 ++-- .../hosting/interfaces.py | 4 +- .../plugins/__init__.py | 0 .../reporter/__init__.py | 6 +-- .../reporter/allure_handler.py | 2 +- .../reporter/interfaces.py | 0 .../reporter/reporter.py | 6 +-- src/frostfs_testlib/shell/__init__.py | 3 ++ .../shell/command_inspectors.py | 2 +- .../shell/interfaces.py | 0 .../shell/local_shell.py | 6 +-- .../shell/ssh_shell.py | 6 +-- .../utils/__init__.py | 0 .../utils/converters.py | 0 .../utils/wallet.py | 2 +- src/neofs_testlib/blockchain/__init__.py | 2 - src/neofs_testlib/cli/__init__.py | 4 -- src/neofs_testlib/cli/neofs_adm/__init__.py | 1 - src/neofs_testlib/cli/neofs_adm/adm.py | 22 ---------- src/neofs_testlib/cli/neofs_adm/config.py | 22 ---------- .../cli/neofs_authmate/__init__.py | 1 - .../cli/neofs_authmate/authmate.py | 14 ------ src/neofs_testlib/cli/neofs_cli/__init__.py | 1 - src/neofs_testlib/cli/neofs_cli/cli.py | 38 ---------------- src/neofs_testlib/cli/neofs_cli/version.py | 13 ------ src/neofs_testlib/cli/neogo/__init__.py | 2 - src/neofs_testlib/hosting/__init__.py | 3 -- src/neofs_testlib/shell/__init__.py | 3 -- tests/helpers.py | 2 +- tests/test_cli.py | 44 +++++++++---------- tests/test_converters.py | 2 +- tests/test_hosting.py | 2 +- tests/test_local_shell.py | 4 +- tests/test_reporter.py | 2 +- tests/test_ssh_shell.py | 5 ++- tests/test_wallet.py | 2 +- 83 files changed, 330 insertions(+), 338 deletions(-) rename src/{neofs_testlib => frostfs_testlib}/__init__.py (100%) create mode 100644 src/frostfs_testlib/blockchain/__init__.py rename src/{neofs_testlib => frostfs_testlib}/blockchain/multisig.py (97%) rename src/{neofs_testlib => frostfs_testlib}/blockchain/role_designation.py (98%) rename src/{neofs_testlib => frostfs_testlib}/blockchain/rpc_client.py (97%) create mode 100644 src/frostfs_testlib/cli/__init__.py rename src/{neofs_testlib => frostfs_testlib}/cli/cli_command.py (96%) create mode 100644 src/frostfs_testlib/cli/frostfs_adm/__init__.py create mode 100644 src/frostfs_testlib/cli/frostfs_adm/adm.py create mode 100644 src/frostfs_testlib/cli/frostfs_adm/config.py rename src/{neofs_testlib/cli/neofs_adm => frostfs_testlib/cli/frostfs_adm}/morph.py (94%) rename src/{neofs_testlib/cli/neofs_adm => frostfs_testlib/cli/frostfs_adm}/storage_config.py (68%) rename src/{neofs_testlib/cli/neofs_adm => frostfs_testlib/cli/frostfs_adm}/subnet.py (92%) rename src/{neofs_testlib/cli/neofs_adm => frostfs_testlib/cli/frostfs_adm}/version.py (55%) create mode 100644 src/frostfs_testlib/cli/frostfs_authmate/__init__.py create mode 100644 src/frostfs_testlib/cli/frostfs_authmate/authmate.py rename src/{neofs_testlib/cli/neofs_authmate => frostfs_testlib/cli/frostfs_authmate}/secret.py (86%) rename src/{neofs_testlib/cli/neofs_authmate => frostfs_testlib/cli/frostfs_authmate}/version.py (54%) create mode 100644 src/frostfs_testlib/cli/frostfs_cli/__init__.py rename src/{neofs_testlib/cli/neofs_cli => frostfs_testlib/cli/frostfs_cli}/accounting.py (79%) rename src/{neofs_testlib/cli/neofs_cli => frostfs_testlib/cli/frostfs_cli}/acl.py (88%) create mode 100644 src/frostfs_testlib/cli/frostfs_cli/cli.py rename src/{neofs_testlib/cli/neofs_cli => frostfs_testlib/cli/frostfs_cli}/container.py (97%) rename src/{neofs_testlib/cli/neofs_cli => frostfs_testlib/cli/frostfs_cli}/netmap.py (95%) rename src/{neofs_testlib/cli/neofs_cli => frostfs_testlib/cli/frostfs_cli}/object.py (98%) rename src/{neofs_testlib/cli/neofs_cli => frostfs_testlib/cli/frostfs_cli}/session.py (88%) rename src/{neofs_testlib/cli/neofs_cli => frostfs_testlib/cli/frostfs_cli}/shards.py (96%) rename src/{neofs_testlib/cli/neofs_cli => frostfs_testlib/cli/frostfs_cli}/storagegroup.py (93%) rename src/{neofs_testlib/cli/neofs_cli => frostfs_testlib/cli/frostfs_cli}/util.py (92%) create mode 100644 src/frostfs_testlib/cli/frostfs_cli/version.py create mode 100644 src/frostfs_testlib/cli/neogo/__init__.py rename src/{neofs_testlib => frostfs_testlib}/cli/neogo/candidate.py (97%) rename src/{neofs_testlib => frostfs_testlib}/cli/neogo/contract.py (99%) rename src/{neofs_testlib => frostfs_testlib}/cli/neogo/db.py (92%) rename src/{neofs_testlib => frostfs_testlib}/cli/neogo/go.py (70%) rename src/{neofs_testlib => frostfs_testlib}/cli/neogo/nep17.py (98%) rename src/{neofs_testlib => frostfs_testlib}/cli/neogo/network_type.py (100%) rename src/{neofs_testlib => frostfs_testlib}/cli/neogo/node.py (67%) rename src/{neofs_testlib => frostfs_testlib}/cli/neogo/query.py (96%) rename src/{neofs_testlib => frostfs_testlib}/cli/neogo/version.py (66%) rename src/{neofs_testlib => frostfs_testlib}/cli/neogo/wallet.py (99%) create mode 100644 src/frostfs_testlib/hosting/__init__.py rename src/{neofs_testlib => frostfs_testlib}/hosting/config.py (100%) rename src/{neofs_testlib => frostfs_testlib}/hosting/docker_host.py (93%) rename src/{neofs_testlib => frostfs_testlib}/hosting/hosting.py (92%) rename src/{neofs_testlib => frostfs_testlib}/hosting/interfaces.py (97%) rename src/{neofs_testlib => frostfs_testlib}/plugins/__init__.py (100%) rename src/{neofs_testlib => frostfs_testlib}/reporter/__init__.py (67%) rename src/{neofs_testlib => frostfs_testlib}/reporter/allure_handler.py (94%) rename src/{neofs_testlib => frostfs_testlib}/reporter/interfaces.py (100%) rename src/{neofs_testlib => frostfs_testlib}/reporter/reporter.py (93%) create mode 100644 src/frostfs_testlib/shell/__init__.py rename src/{neofs_testlib => frostfs_testlib}/shell/command_inspectors.py (82%) rename src/{neofs_testlib => frostfs_testlib}/shell/interfaces.py (100%) rename src/{neofs_testlib => frostfs_testlib}/shell/local_shell.py (96%) rename src/{neofs_testlib => frostfs_testlib}/shell/ssh_shell.py (98%) rename src/{neofs_testlib => frostfs_testlib}/utils/__init__.py (100%) rename src/{neofs_testlib => frostfs_testlib}/utils/converters.py (100%) rename src/{neofs_testlib => frostfs_testlib}/utils/wallet.py (95%) delete mode 100644 src/neofs_testlib/blockchain/__init__.py delete mode 100644 src/neofs_testlib/cli/__init__.py delete mode 100644 src/neofs_testlib/cli/neofs_adm/__init__.py delete mode 100644 src/neofs_testlib/cli/neofs_adm/adm.py delete mode 100644 src/neofs_testlib/cli/neofs_adm/config.py delete mode 100644 src/neofs_testlib/cli/neofs_authmate/__init__.py delete mode 100644 src/neofs_testlib/cli/neofs_authmate/authmate.py delete mode 100644 src/neofs_testlib/cli/neofs_cli/__init__.py delete mode 100644 src/neofs_testlib/cli/neofs_cli/cli.py delete mode 100644 src/neofs_testlib/cli/neofs_cli/version.py delete mode 100644 src/neofs_testlib/cli/neogo/__init__.py delete mode 100644 src/neofs_testlib/hosting/__init__.py delete mode 100644 src/neofs_testlib/shell/__init__.py diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5426511..f290592 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,8 +3,8 @@ First, thank you for contributing! We love and encourage pull requests from everyone. Please follow the guidelines: -- Check the open [issues](https://github.com/nspcc-dev/neofs-testlib/issues) and - [pull requests](https://github.com/nspcc-dev/neofs-testlib/pulls) for existing +- Check the open [issues](https://github.com/TrueCloudLab/frostfs-testlib/issues) and + [pull requests](https://github.com/TrueCloudLab/frostfs-testlib/pulls) for existing discussions. - Open an issue first, to discuss a new feature or enhancement. @@ -22,12 +22,12 @@ everyone. Please follow the guidelines: ## Development Workflow -Start by forking the `neofs-testlib` repository, make changes in a branch and then +Start by forking the `frostfs-testlib` repository, make changes in a branch and then send a pull request. We encourage pull requests to discuss code changes. Here are the steps in details: ### Set up your GitHub Repository -Fork [NeoFS testlib upstream](https://github.com/nspcc-dev/neofs-testlib/fork) source +Fork [FrostFS testlib upstream](https://github.com/TrueCloudLab/frostfs-testlib/fork) source repository to your own personal repository. Copy the URL of your fork and clone it: ```shell @@ -36,13 +36,13 @@ $ git clone ### Set up git remote as ``upstream`` ```shell -$ cd neofs-testlib -$ git remote add upstream https://github.com/nspcc-dev/neofs-testlib +$ cd frostfs-testlib +$ git remote add upstream https://github.com/TrueCloudLab/frostfs-testlib $ git fetch upstream ``` ### Set up development environment -To setup development environment for `neofs-testlib`, please, take the following steps: +To setup development environment for `frostfs-testlib`, please, take the following steps: 1. Prepare virtualenv ```shell @@ -183,9 +183,9 @@ Do not use relative imports. Even if the module is in the same package, use the To format docstrings, please, use [Google Style Docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html). Type annotations should be specified in the code and not in docstrings (please, refer to [this sample](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/index.html#type-annotations)). ## Editable installation -If you would like to modify code of the library in the integration with your test suite, you can use editable installation. For that, in virtual environment of your test suite (not in the virtual environment of the testlib itself!) run the following command (path to `neofs-testlib` directory might be different on your machine): +If you would like to modify code of the library in the integration with your test suite, you can use editable installation. For that, in virtual environment of your test suite (not in the virtual environment of the testlib itself!) run the following command (path to `frostfs-testlib` directory might be different on your machine): ```shell -$ pip install -e ../neofs-testlib +$ pip install -e ../frostfs-testlib ``` # Maintaining guide @@ -225,7 +225,7 @@ To check that package description will be correctly rendered at PyPI, please, us $ twine check dist/* ``` -To upload package to [test PyPI](https://test.pypi.org/project/neofs-testlib/), please, use command: +To upload package to [test PyPI](https://test.pypi.org/project/frostfs-testlib/), please, use command: ```shell $ twine upload -r testpypi dist/* ``` diff --git a/README.md b/README.md index 3cb43fb..ddd2620 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# neofs-testlib -This library provides building blocks and utilities to facilitate development of automated tests for NeoFS system. +# frostfs-testlib +This library provides building blocks and utilities to facilitate development of automated tests for FrostFS system. ## Installation Library can be installed via pip: ```shell -$ pip install neofs-testlib +$ pip install frostfs-testlib ``` ## Configuration @@ -16,7 +16,7 @@ Reporter is a singleton component that is used by the library to store test arti Reporter sends artifacts to handlers that are responsible for actual storing in particular system. By default reporter is initialized without any handlers and won't take any actions to store the artifacts. To add handlers directly via code you can use method `register_handler`: ```python -from neofs_testlib.reporter import AllureHandler, get_reporter +from frostfs_testlib.reporter import AllureHandler, get_reporter get_reporter().register_handler(AllureHandler()) ``` @@ -30,10 +30,10 @@ get_reporter().configure({ "handlers": [{"plugin_name": "allure"}] }) ``` ### Hosting Configuration -Hosting component is a class that represents infrastructure (machines/containers/services) where neoFS is hosted. Interaction with specific infrastructure instance (host) is encapsulated in classes that implement interface `neofs_testlib.hosting.Host`. To pass information about hosts to the `Hosting` class in runtime we use method `configure`: +Hosting component is a class that represents infrastructure (machines/containers/services) where neoFS is hosted. Interaction with specific infrastructure instance (host) is encapsulated in classes that implement interface `frostfs_testlib.hosting.Host`. To pass information about hosts to the `Hosting` class in runtime we use method `configure`: ```python -from neofs_testlib.hosting import Hosting +from frostfs_testlib.hosting import Hosting hosting = Hosting() hosting.configure({ "hosts": [{ "address": "localhost", "plugin_name": "docker" ... }]}) @@ -41,18 +41,18 @@ hosting.configure({ "hosts": [{ "address": "localhost", "plugin_name": "docker" ## Plugins Testlib uses [entrypoint specification](https://docs.python.org/3/library/importlib.metadata.html) for plugins. Testlib supports the following entrypoint groups for plugins: - - `neofs.testlib.reporter` - group for reporter handler plugins. Plugin should be a class that implements interface `neofs_testlib.reporter.interfaces.ReporterHandler`. + - `frostfs.testlib.reporter` - group for reporter handler plugins. Plugin should be a class that implements interface `frostfs_testlib.reporter.interfaces.ReporterHandler`. ### Example reporter plugin In this example we will consider two Python projects: - - Project "my_neofs_plugins" where we will build a plugin that extends testlib functionality. - - Project "my_neofs_tests" that uses "neofs_testlib" and "my_neofs_plugins" to build some tests. + - Project "my_frostfs_plugins" where we will build a plugin that extends testlib functionality. + - Project "my_frostfs_tests" that uses "frostfs_testlib" and "my_frostfs_plugins" to build some tests. Let's say we want to implement some custom reporter handler that can be used as a plugin for testlib. Pseudo-code of implementation can look like that: ```python -# File my_neofs_plugins/src/foo/bar/custom_handler.py +# File my_frostfs_plugins/src/foo/bar/custom_handler.py from contextlib import AbstractContextManager -from neofs_testlib.reporter import ReporterHandler +from frostfs_testlib.reporter import ReporterHandler class CustomHandler(ReporterHandler): @@ -63,18 +63,18 @@ class CustomHandler(ReporterHandler): ... some implementation ... ``` -Then in the file `pyproject.toml` of "my_neofs_plugins" we should register entrypoint for this plugin. Entrypoint must belong to the group `neofs.testlib.reporter`: +Then in the file `pyproject.toml` of "my_frostfs_plugins" we should register entrypoint for this plugin. Entrypoint must belong to the group `frostfs.testlib.reporter`: ```yaml -# File my_neofs_plugins/pyproject.toml -[project.entry-points."neofs.testlib.reporter"] +# File my_frostfs_plugins/pyproject.toml +[project.entry-points."frostfs.testlib.reporter"] my_custom_handler = "foo.bar.custom_handler:CustomHandler" ``` -Finally, to use this handler in our test project "my_neofs_tests", we should configure reporter with name of the handler plugin: +Finally, to use this handler in our test project "my_frostfs_tests", we should configure reporter with name of the handler plugin: ```python -# File my_neofs_tests/src/conftest.py -from neofs_testlib.reporter import get_reporter +# File my_frostfs_tests/src/conftest.py +from frostfs_testlib.reporter import get_reporter get_reporter().configure({ "handlers": [{"plugin_name": "my_custom_handler"}] }) ``` @@ -92,4 +92,4 @@ The library provides the following primary components: ## Contributing -Any contributions to the library should conform to the [contribution guideline](https://github.com/nspcc-dev/neofs-testlib/blob/master/CONTRIBUTING.md). +Any contributions to the library should conform to the [contribution guideline](https://github.com/TrueCloudLab/frostfs-testlib/blob/master/CONTRIBUTING.md). diff --git a/pyproject.toml b/pyproject.toml index 1b796b4..e9d69ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,9 +3,9 @@ requires = ["setuptools>=65.0.0", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "neofs-testlib" +name = "frostfs-testlib" version = "1.1.1" -description = "Building blocks and utilities to facilitate development of automated tests for NeoFS system" +description = "Building blocks and utilities to facilitate development of automated tests for FrostFS system" readme = "README.md" authors = [{ name = "NSPCC", email = "info@nspcc.ru" }] license = { text = "GNU General Public License v3 (GPLv3)" } @@ -14,7 +14,7 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", ] -keywords = ["neofs", "test"] +keywords = ["frostfs", "test"] dependencies = [ "allure-python-commons>=2.9.45", "docker>=4.4.0", @@ -30,13 +30,13 @@ requires-python = ">=3.10" dev = ["black", "bumpver", "isort", "pre-commit"] [project.urls] -Homepage = "https://github.com/nspcc-dev/neofs-testlib" +Homepage = "https://github.com/TrueCloudLab/frostfs-testlib" -[project.entry-points."neofs.testlib.reporter"] -allure = "neofs_testlib.reporter.allure_handler:AllureHandler" +[project.entry-points."frostfs.testlib.reporter"] +allure = "frostfs_testlib.reporter.allure_handler:AllureHandler" -[project.entry-points."neofs.testlib.hosting"] -docker = "neofs_testlib.hosting.docker_host:DockerHost" +[project.entry-points."frostfs.testlib.hosting"] +docker = "frostfs_testlib.hosting.docker_host:DockerHost" [tool.isort] profile = "black" @@ -57,4 +57,4 @@ push = false [tool.bumpver.file_patterns] "pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"'] -"src/neofs_testlib/__init__.py" = ["{version}"] +"src/frostfs_testlib/__init__.py" = ["{version}"] diff --git a/src/neofs_testlib/__init__.py b/src/frostfs_testlib/__init__.py similarity index 100% rename from src/neofs_testlib/__init__.py rename to src/frostfs_testlib/__init__.py diff --git a/src/frostfs_testlib/blockchain/__init__.py b/src/frostfs_testlib/blockchain/__init__.py new file mode 100644 index 0000000..ceca6a2 --- /dev/null +++ b/src/frostfs_testlib/blockchain/__init__.py @@ -0,0 +1,2 @@ +from frostfs_testlib.blockchain.multisig import Multisig +from frostfs_testlib.blockchain.rpc_client import RPCClient diff --git a/src/neofs_testlib/blockchain/multisig.py b/src/frostfs_testlib/blockchain/multisig.py similarity index 97% rename from src/neofs_testlib/blockchain/multisig.py rename to src/frostfs_testlib/blockchain/multisig.py index 229f2a0..cd71f68 100644 --- a/src/neofs_testlib/blockchain/multisig.py +++ b/src/frostfs_testlib/blockchain/multisig.py @@ -1,4 +1,4 @@ -from neofs_testlib.cli import NeoGo +from frostfs_testlib.cli import NeoGo class Multisig: diff --git a/src/neofs_testlib/blockchain/role_designation.py b/src/frostfs_testlib/blockchain/role_designation.py similarity index 98% rename from src/neofs_testlib/blockchain/role_designation.py rename to src/frostfs_testlib/blockchain/role_designation.py index cfbce29..14d321b 100644 --- a/src/neofs_testlib/blockchain/role_designation.py +++ b/src/frostfs_testlib/blockchain/role_designation.py @@ -6,7 +6,7 @@ from cli import NeoGo from shell import Shell from utils.converters import process_b64_bytearray -from neofs_testlib.blockchain import Multisig +from frostfs_testlib.blockchain import Multisig class RoleDesignation: diff --git a/src/neofs_testlib/blockchain/rpc_client.py b/src/frostfs_testlib/blockchain/rpc_client.py similarity index 97% rename from src/neofs_testlib/blockchain/rpc_client.py rename to src/frostfs_testlib/blockchain/rpc_client.py index 0ca0212..25286d0 100644 --- a/src/neofs_testlib/blockchain/rpc_client.py +++ b/src/frostfs_testlib/blockchain/rpc_client.py @@ -4,7 +4,7 @@ from typing import Any, Dict, Optional import requests -logger = logging.getLogger("neofs.testlib.blockchain") +logger = logging.getLogger("frostfs.testlib.blockchain") class NeoRPCException(Exception): diff --git a/src/frostfs_testlib/cli/__init__.py b/src/frostfs_testlib/cli/__init__.py new file mode 100644 index 0000000..3799be9 --- /dev/null +++ b/src/frostfs_testlib/cli/__init__.py @@ -0,0 +1,4 @@ +from frostfs_testlib.cli.frostfs_adm import FrostfsAdm +from frostfs_testlib.cli.frostfs_authmate import FrostfsAuthmate +from frostfs_testlib.cli.frostfs_cli import FrostfsCli +from frostfs_testlib.cli.neogo import NeoGo, NetworkType diff --git a/src/neofs_testlib/cli/cli_command.py b/src/frostfs_testlib/cli/cli_command.py similarity index 96% rename from src/neofs_testlib/cli/cli_command.py rename to src/frostfs_testlib/cli/cli_command.py index d3ce86d..3600e77 100644 --- a/src/neofs_testlib/cli/cli_command.py +++ b/src/frostfs_testlib/cli/cli_command.py @@ -1,6 +1,6 @@ from typing import Optional -from neofs_testlib.shell import CommandOptions, CommandResult, InteractiveInput, Shell +from frostfs_testlib.shell import CommandOptions, CommandResult, InteractiveInput, Shell class CliCommand: diff --git a/src/frostfs_testlib/cli/frostfs_adm/__init__.py b/src/frostfs_testlib/cli/frostfs_adm/__init__.py new file mode 100644 index 0000000..d592eaf --- /dev/null +++ b/src/frostfs_testlib/cli/frostfs_adm/__init__.py @@ -0,0 +1 @@ +from frostfs_testlib.cli.frostfs_adm.adm import FrostfsAdm diff --git a/src/frostfs_testlib/cli/frostfs_adm/adm.py b/src/frostfs_testlib/cli/frostfs_adm/adm.py new file mode 100644 index 0000000..283069c --- /dev/null +++ b/src/frostfs_testlib/cli/frostfs_adm/adm.py @@ -0,0 +1,22 @@ +from typing import Optional + +from frostfs_testlib.cli.frostfs_adm.config import FrostfsAdmConfig +from frostfs_testlib.cli.frostfs_adm.morph import FrostfsAdmMorph +from frostfs_testlib.cli.frostfs_adm.storage_config import FrostfsAdmStorageConfig +from frostfs_testlib.cli.frostfs_adm.subnet import FrostfsAdmMorphSubnet +from frostfs_testlib.cli.frostfs_adm.version import FrostfsAdmVersion +from frostfs_testlib.shell import Shell + + +class FrostfsAdm: + morph: Optional[FrostfsAdmMorph] = None + subnet: Optional[FrostfsAdmMorphSubnet] = None + storage_config: Optional[FrostfsAdmStorageConfig] = None + version: Optional[FrostfsAdmVersion] = None + + def __init__(self, shell: Shell, frostfs_adm_exec_path: str, config_file: Optional[str] = None): + self.config = FrostfsAdmConfig(shell, frostfs_adm_exec_path, config=config_file) + self.morph = FrostfsAdmMorph(shell, frostfs_adm_exec_path, config=config_file) + self.subnet = FrostfsAdmMorphSubnet(shell, frostfs_adm_exec_path, config=config_file) + self.storage_config = FrostfsAdmStorageConfig(shell, frostfs_adm_exec_path, config=config_file) + self.version = FrostfsAdmVersion(shell, frostfs_adm_exec_path, config=config_file) diff --git a/src/frostfs_testlib/cli/frostfs_adm/config.py b/src/frostfs_testlib/cli/frostfs_adm/config.py new file mode 100644 index 0000000..a29b3ac --- /dev/null +++ b/src/frostfs_testlib/cli/frostfs_adm/config.py @@ -0,0 +1,22 @@ +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult + + +class FrostfsAdmConfig(CliCommand): + def init(self, path: str = "~/.frostfs/adm/config.yml") -> CommandResult: + """Initialize basic frostfs-adm configuration file. + + Args: + path: Path to config (default ~/.frostfs/adm/config.yml). + + Returns: + Command's result. + """ + return self._execute( + "config init", + **{ + param: param_value + for param, param_value in locals().items() + if param not in ["self"] + }, + ) diff --git a/src/neofs_testlib/cli/neofs_adm/morph.py b/src/frostfs_testlib/cli/frostfs_adm/morph.py similarity index 94% rename from src/neofs_testlib/cli/neofs_adm/morph.py rename to src/frostfs_testlib/cli/frostfs_adm/morph.py index 6c67d79..aba147b 100644 --- a/src/neofs_testlib/cli/neofs_adm/morph.py +++ b/src/frostfs_testlib/cli/frostfs_adm/morph.py @@ -1,10 +1,10 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsAdmMorph(CliCommand): +class FrostfsAdmMorph(CliCommand): def deposit_notary( self, rpc_endpoint: str, @@ -88,7 +88,7 @@ class NeofsAdmMorph(CliCommand): container_contract: Optional[str] = None, dump: str = "./testlib_dump_container", ) -> CommandResult: - """Dump NeoFS containers to file. + """Dump FrostFS containers to file. Args: cid: Containers to dump. @@ -129,7 +129,7 @@ class NeofsAdmMorph(CliCommand): def force_new_epoch( self, rpc_endpoint: Optional[str] = None, alphabet: Optional[str] = None ) -> CommandResult: - """Create new NeoFS epoch event in the side chain. + """Create new FrostFS epoch event in the side chain. Args: alphabet: Path to alphabet wallets dir. @@ -218,9 +218,9 @@ class NeofsAdmMorph(CliCommand): alphabet_wallets: Path to alphabet wallets dir. container_alias_fee: Container alias fee (default 500). container_fee: Container registration fee (default 1000). - contracts: Path to archive with compiled NeoFS contracts + contracts: Path to archive with compiled FrostFS contracts (default fetched from latest github release). - epoch_duration: Amount of side chain blocks in one NeoFS epoch (default 240). + epoch_duration: Amount of side chain blocks in one FrostFS epoch (default 240). homomorphic_disabled: Disable object homomorphic hashing. local_dump: Path to the blocks dump file. max_object_size: Max single object size in bytes (default 67108864). @@ -273,7 +273,7 @@ class NeofsAdmMorph(CliCommand): cid: str, dump: str, ) -> CommandResult: - """Restore NeoFS containers from file. + """Restore FrostFS containers from file. Args: alphabet_wallets: Path to alphabet wallets dir. @@ -335,11 +335,11 @@ class NeofsAdmMorph(CliCommand): alphabet_wallets: str, contracts: Optional[str] = None, ) -> CommandResult: - """Update NeoFS contracts. + """Update FrostFS contracts. Args: alphabet_wallets: Path to alphabet wallets dir. - contracts: Path to archive with compiled NeoFS contracts + contracts: Path to archive with compiled FrostFS contracts (default fetched from latest github release). rpc_endpoint: N3 RPC node endpoint. diff --git a/src/neofs_testlib/cli/neofs_adm/storage_config.py b/src/frostfs_testlib/cli/frostfs_adm/storage_config.py similarity index 68% rename from src/neofs_testlib/cli/neofs_adm/storage_config.py rename to src/frostfs_testlib/cli/frostfs_adm/storage_config.py index 75e3e06..81bf210 100644 --- a/src/neofs_testlib/cli/neofs_adm/storage_config.py +++ b/src/frostfs_testlib/cli/frostfs_adm/storage_config.py @@ -1,10 +1,10 @@ -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsAdmStorageConfig(CliCommand): +class FrostfsAdmStorageConfig(CliCommand): def set(self, account: str, wallet: str) -> CommandResult: - """Initialize basic neofs-adm configuration file. + """Initialize basic frostfs-adm configuration file. Args: account: Wallet account. diff --git a/src/neofs_testlib/cli/neofs_adm/subnet.py b/src/frostfs_testlib/cli/frostfs_adm/subnet.py similarity index 92% rename from src/neofs_testlib/cli/neofs_adm/subnet.py rename to src/frostfs_testlib/cli/frostfs_adm/subnet.py index 127136d..fb5935e 100644 --- a/src/neofs_testlib/cli/neofs_adm/subnet.py +++ b/src/frostfs_testlib/cli/frostfs_adm/subnet.py @@ -1,14 +1,14 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsAdmMorphSubnet(CliCommand): +class FrostfsAdmMorphSubnet(CliCommand): def create( self, rpc_endpoint: str, address: str, wallet: str, notary: bool = False ) -> CommandResult: - """Create NeoFS subnet. + """Create FrostFS subnet. Args: address: Address in the wallet, optional. @@ -29,7 +29,7 @@ class NeofsAdmMorphSubnet(CliCommand): ) def get(self, rpc_endpoint: str, subnet: str) -> CommandResult: - """Read information about the NeoFS subnet. + """Read information about the FrostFS subnet. Args: rpc_endpoint: N3 RPC node endpoint. @@ -50,7 +50,7 @@ class NeofsAdmMorphSubnet(CliCommand): def remove( self, rpc_endpoint: str, wallet: str, subnet: str, address: Optional[str] = None ) -> CommandResult: - """Remove NeoFS subnet. + """Remove FrostFS subnet. Args: address: Address in the wallet, optional. @@ -80,7 +80,7 @@ class NeofsAdmMorphSubnet(CliCommand): group: Optional[str] = None, address: Optional[str] = None, ) -> CommandResult: - """Add admin to the NeoFS subnet. + """Add admin to the FrostFS subnet. Args: address: Address in the wallet, optional. @@ -112,7 +112,7 @@ class NeofsAdmMorphSubnet(CliCommand): client: Optional[str] = None, address: Optional[str] = None, ) -> CommandResult: - """Remove admin of the NeoFS subnet. + """Remove admin of the FrostFS subnet. Args: address: Address in the wallet, optional. @@ -143,7 +143,7 @@ class NeofsAdmMorphSubnet(CliCommand): group: Optional[str] = None, address: Optional[str] = None, ) -> CommandResult: - """Add client to the NeoFS subnet. + """Add client to the FrostFS subnet. Args: address: Address in the wallet, optional. @@ -174,7 +174,7 @@ class NeofsAdmMorphSubnet(CliCommand): subnet: str, address: Optional[str] = None, ) -> CommandResult: - """Remove client of the NeoFS subnet. + """Remove client of the FrostFS subnet. Args: address: Address in the wallet, optional. @@ -197,7 +197,7 @@ class NeofsAdmMorphSubnet(CliCommand): ) def node_add(self, rpc_endpoint: str, wallet: str, node: str, subnet: str) -> CommandResult: - """Add node to the NeoFS subnet. + """Add node to the FrostFS subnet. Args: node: Hex-encoded public key of the node. @@ -218,7 +218,7 @@ class NeofsAdmMorphSubnet(CliCommand): ) def node_remove(self, rpc_endpoint: str, wallet: str, node: str, subnet: str) -> CommandResult: - """Remove node from the NeoFS subnet. + """Remove node from the FrostFS subnet. Args: node: Hex-encoded public key of the node. diff --git a/src/neofs_testlib/cli/neofs_adm/version.py b/src/frostfs_testlib/cli/frostfs_adm/version.py similarity index 55% rename from src/neofs_testlib/cli/neofs_adm/version.py rename to src/frostfs_testlib/cli/frostfs_adm/version.py index 502d578..7d09afc 100644 --- a/src/neofs_testlib/cli/neofs_adm/version.py +++ b/src/frostfs_testlib/cli/frostfs_adm/version.py @@ -1,8 +1,8 @@ -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsAdmVersion(CliCommand): +class FrostfsAdmVersion(CliCommand): def get(self) -> CommandResult: """Application version diff --git a/src/frostfs_testlib/cli/frostfs_authmate/__init__.py b/src/frostfs_testlib/cli/frostfs_authmate/__init__.py new file mode 100644 index 0000000..6f2d765 --- /dev/null +++ b/src/frostfs_testlib/cli/frostfs_authmate/__init__.py @@ -0,0 +1 @@ +from frostfs_testlib.cli.frostfs_authmate.authmate import FrostfsAuthmate diff --git a/src/frostfs_testlib/cli/frostfs_authmate/authmate.py b/src/frostfs_testlib/cli/frostfs_authmate/authmate.py new file mode 100644 index 0000000..ba3a3b0 --- /dev/null +++ b/src/frostfs_testlib/cli/frostfs_authmate/authmate.py @@ -0,0 +1,14 @@ +from typing import Optional + +from frostfs_testlib.cli.frostfs_authmate.secret import FrostfsAuthmateSecret +from frostfs_testlib.cli.frostfs_authmate.version import FrostfsAuthmateVersion +from frostfs_testlib.shell import Shell + + +class FrostfsAuthmate: + secret: Optional[FrostfsAuthmateSecret] = None + version: Optional[FrostfsAuthmateVersion] = None + + def __init__(self, shell: Shell, frostfs_authmate_exec_path: str): + self.secret = FrostfsAuthmateSecret(shell, frostfs_authmate_exec_path) + self.version = FrostfsAuthmateVersion(shell, frostfs_authmate_exec_path) diff --git a/src/neofs_testlib/cli/neofs_authmate/secret.py b/src/frostfs_testlib/cli/frostfs_authmate/secret.py similarity index 86% rename from src/neofs_testlib/cli/neofs_authmate/secret.py rename to src/frostfs_testlib/cli/frostfs_authmate/secret.py index 40cfc25..ba5b5f5 100644 --- a/src/neofs_testlib/cli/neofs_authmate/secret.py +++ b/src/frostfs_testlib/cli/frostfs_authmate/secret.py @@ -1,10 +1,10 @@ from typing import Optional, Union -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsAuthmateSecret(CliCommand): +class FrostfsAuthmateSecret(CliCommand): def obtain( self, wallet: str, @@ -15,13 +15,13 @@ class NeofsAuthmateSecret(CliCommand): address: Optional[str] = None, gate_address: Optional[str] = None, ) -> CommandResult: - """Obtain a secret from NeoFS network. + """Obtain a secret from FrostFS network. Args: wallet: Path to the wallet. wallet_password: Wallet password. address: Address of wallet account. - peer: Address of neofs peer to connect to. + peer: Address of frostfs peer to connect to. gate_wallet: Path to the wallet. gate_address: Address of wallet account. access_key_id: Access key id for s3. @@ -55,13 +55,13 @@ class NeofsAuthmateSecret(CliCommand): container_policy: Optional[str] = None, aws_cli_credentials: Optional[str] = None, ) -> CommandResult: - """Obtain a secret from NeoFS network + """Obtain a secret from FrostFS network Args: wallet: Path to the wallet. wallet_password: Wallet password. address: Address of wallet account. - peer: Address of a neofs peer to connect to. + peer: Address of a frostfs peer to connect to. bearer_rules: Rules for bearer token as plain json string. gate_public_key: Public 256r1 key of a gate (send list[str] of keys to use multiple gates). container_id: Auth container id to put the secret into. @@ -73,7 +73,7 @@ class NeofsAuthmateSecret(CliCommand): lifetime: Lifetime of tokens. For example 50h30m (note: max time unit is an hour so to set a day you should use 24h). It will be ceil rounded to the nearest amount of epoch. (default: 720h0m0s). - container_policy: Mapping AWS storage class to NeoFS storage policy as plain json string + container_policy: Mapping AWS storage class to FrostFS storage policy as plain json string or path to json file. aws_cli_credentials: Path to the aws cli credential file. diff --git a/src/neofs_testlib/cli/neofs_authmate/version.py b/src/frostfs_testlib/cli/frostfs_authmate/version.py similarity index 54% rename from src/neofs_testlib/cli/neofs_authmate/version.py rename to src/frostfs_testlib/cli/frostfs_authmate/version.py index ec336dc..d459a06 100644 --- a/src/neofs_testlib/cli/neofs_authmate/version.py +++ b/src/frostfs_testlib/cli/frostfs_authmate/version.py @@ -1,8 +1,8 @@ -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsAuthmateVersion(CliCommand): +class FrostfsAuthmateVersion(CliCommand): def get(self) -> CommandResult: """Application version diff --git a/src/frostfs_testlib/cli/frostfs_cli/__init__.py b/src/frostfs_testlib/cli/frostfs_cli/__init__.py new file mode 100644 index 0000000..e67f887 --- /dev/null +++ b/src/frostfs_testlib/cli/frostfs_cli/__init__.py @@ -0,0 +1 @@ +from frostfs_testlib.cli.frostfs_cli.cli import FrostfsCli diff --git a/src/neofs_testlib/cli/neofs_cli/accounting.py b/src/frostfs_testlib/cli/frostfs_cli/accounting.py similarity index 79% rename from src/neofs_testlib/cli/neofs_cli/accounting.py rename to src/frostfs_testlib/cli/frostfs_cli/accounting.py index b8bdcc2..7b2b9f0 100644 --- a/src/neofs_testlib/cli/neofs_cli/accounting.py +++ b/src/frostfs_testlib/cli/frostfs_cli/accounting.py @@ -1,10 +1,10 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsCliAccounting(CliCommand): +class FrostfsCliAccounting(CliCommand): def balance( self, wallet: Optional[str] = None, @@ -12,7 +12,7 @@ class NeofsCliAccounting(CliCommand): address: Optional[str] = None, owner: Optional[str] = None, ) -> CommandResult: - """Get internal balance of NeoFS account + """Get internal balance of FrostFS account Args: address: Address of wallet account. diff --git a/src/neofs_testlib/cli/neofs_cli/acl.py b/src/frostfs_testlib/cli/frostfs_cli/acl.py similarity index 88% rename from src/neofs_testlib/cli/neofs_cli/acl.py rename to src/frostfs_testlib/cli/frostfs_cli/acl.py index 47f86cb..bd0f80e 100644 --- a/src/neofs_testlib/cli/neofs_cli/acl.py +++ b/src/frostfs_testlib/cli/frostfs_cli/acl.py @@ -1,10 +1,10 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsCliACL(CliCommand): +class FrostfsCliACL(CliCommand): def extended_create( self, cid: str, out: str, file: Optional[str] = None, rule: Optional[list] = None ) -> CommandResult: @@ -22,7 +22,7 @@ class NeofsCliACL(CliCommand): Well-known system object headers start with '$Object:' prefix. User defined headers start without prefix. Read more about filter keys at: - http://github.com/nspcc-dev/neofs-api/blob/master/proto-docs/acl.md#message-eaclrecordfilter + http://github.com/TrueCloudLab/frostfs-api/blob/master/proto-docs/acl.md#message-eaclrecordfilter Match is '=' for matching and '!=' for non-matching filter. Value is a valid unicode string corresponding to object or request header value. diff --git a/src/frostfs_testlib/cli/frostfs_cli/cli.py b/src/frostfs_testlib/cli/frostfs_cli/cli.py new file mode 100644 index 0000000..07986c2 --- /dev/null +++ b/src/frostfs_testlib/cli/frostfs_cli/cli.py @@ -0,0 +1,38 @@ +from typing import Optional + +from frostfs_testlib.cli.frostfs_cli.accounting import FrostfsCliAccounting +from frostfs_testlib.cli.frostfs_cli.acl import FrostfsCliACL +from frostfs_testlib.cli.frostfs_cli.container import FrostfsCliContainer +from frostfs_testlib.cli.frostfs_cli.netmap import FrostfsCliNetmap +from frostfs_testlib.cli.frostfs_cli.object import FrostfsCliObject +from frostfs_testlib.cli.frostfs_cli.session import FrostfsCliSession +from frostfs_testlib.cli.frostfs_cli.shards import FrostfsCliShards +from frostfs_testlib.cli.frostfs_cli.storagegroup import FrostfsCliStorageGroup +from frostfs_testlib.cli.frostfs_cli.util import FrostfsCliUtil +from frostfs_testlib.cli.frostfs_cli.version import FrostfsCliVersion +from frostfs_testlib.shell import Shell + + +class FrostfsCli: + accounting: Optional[FrostfsCliAccounting] = None + acl: Optional[FrostfsCliACL] = None + container: Optional[FrostfsCliContainer] = None + netmap: Optional[FrostfsCliNetmap] = None + object: Optional[FrostfsCliObject] = None + session: Optional[FrostfsCliSession] = None + shards: Optional[FrostfsCliShards] = None + storagegroup: Optional[FrostfsCliStorageGroup] = None + util: Optional[FrostfsCliUtil] = None + version: Optional[FrostfsCliVersion] = None + + def __init__(self, shell: Shell, frostfs_cli_exec_path: str, config_file: Optional[str] = None): + self.accounting = FrostfsCliAccounting(shell, frostfs_cli_exec_path, config=config_file) + self.acl = FrostfsCliACL(shell, frostfs_cli_exec_path, config=config_file) + self.container = FrostfsCliContainer(shell, frostfs_cli_exec_path, config=config_file) + self.netmap = FrostfsCliNetmap(shell, frostfs_cli_exec_path, config=config_file) + self.object = FrostfsCliObject(shell, frostfs_cli_exec_path, config=config_file) + self.session = FrostfsCliSession(shell, frostfs_cli_exec_path, config=config_file) + self.shards = FrostfsCliShards(shell, frostfs_cli_exec_path, config=config_file) + self.storagegroup = FrostfsCliStorageGroup(shell, frostfs_cli_exec_path, config=config_file) + self.util = FrostfsCliUtil(shell, frostfs_cli_exec_path, config=config_file) + self.version = FrostfsCliVersion(shell, frostfs_cli_exec_path, config=config_file) diff --git a/src/neofs_testlib/cli/neofs_cli/container.py b/src/frostfs_testlib/cli/frostfs_cli/container.py similarity index 97% rename from src/neofs_testlib/cli/neofs_cli/container.py rename to src/frostfs_testlib/cli/frostfs_cli/container.py index 1952448..533ff1a 100644 --- a/src/neofs_testlib/cli/neofs_cli/container.py +++ b/src/frostfs_testlib/cli/frostfs_cli/container.py @@ -1,10 +1,10 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsCliContainer(CliCommand): +class FrostfsCliContainer(CliCommand): def create( self, rpc_endpoint: str, @@ -24,7 +24,7 @@ class NeofsCliContainer(CliCommand): timeout: Optional[str] = None, ) -> CommandResult: """ - Create a new container and register it in the NeoFS. + Create a new container and register it in the FrostFS. It will be stored in the sidechain when the Inner Ring accepts it. Args: diff --git a/src/neofs_testlib/cli/neofs_cli/netmap.py b/src/frostfs_testlib/cli/frostfs_cli/netmap.py similarity index 95% rename from src/neofs_testlib/cli/neofs_cli/netmap.py rename to src/frostfs_testlib/cli/frostfs_cli/netmap.py index 0100fc4..7033912 100644 --- a/src/neofs_testlib/cli/neofs_cli/netmap.py +++ b/src/frostfs_testlib/cli/frostfs_cli/netmap.py @@ -1,10 +1,10 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsCliNetmap(CliCommand): +class FrostfsCliNetmap(CliCommand): def epoch( self, rpc_endpoint: str, @@ -43,7 +43,7 @@ class NeofsCliNetmap(CliCommand): xhdr: Optional[dict] = None, ) -> CommandResult: """ - Get information about NeoFS network. + Get information about FrostFS network. Args: address: Address of wallet account diff --git a/src/neofs_testlib/cli/neofs_cli/object.py b/src/frostfs_testlib/cli/frostfs_cli/object.py similarity index 98% rename from src/neofs_testlib/cli/neofs_cli/object.py rename to src/frostfs_testlib/cli/frostfs_cli/object.py index 164076c..1c1d0ac 100644 --- a/src/neofs_testlib/cli/neofs_cli/object.py +++ b/src/frostfs_testlib/cli/frostfs_cli/object.py @@ -1,10 +1,10 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsCliObject(CliCommand): +class FrostfsCliObject(CliCommand): def delete( self, rpc_endpoint: str, @@ -19,7 +19,7 @@ class NeofsCliObject(CliCommand): timeout: Optional[str] = None, ) -> CommandResult: """ - Delete object from NeoFS. + Delete object from FrostFS. Args: address: Address of wallet account. @@ -59,7 +59,7 @@ class NeofsCliObject(CliCommand): timeout: Optional[str] = None, ) -> CommandResult: """ - Get object from NeoFS. + Get object from FrostFS. Args: address: Address of wallet account. @@ -235,7 +235,7 @@ class NeofsCliObject(CliCommand): timeout: Optional[str] = None, ) -> CommandResult: """ - Put object to NeoFS. + Put object to FrostFS. Args: address: Address of wallet account. diff --git a/src/neofs_testlib/cli/neofs_cli/session.py b/src/frostfs_testlib/cli/frostfs_cli/session.py similarity index 88% rename from src/neofs_testlib/cli/neofs_cli/session.py rename to src/frostfs_testlib/cli/frostfs_cli/session.py index 4e33a7a..e21cc23 100644 --- a/src/neofs_testlib/cli/neofs_cli/session.py +++ b/src/frostfs_testlib/cli/frostfs_cli/session.py @@ -1,10 +1,10 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsCliSession(CliCommand): +class FrostfsCliSession(CliCommand): def create( self, rpc_endpoint: str, diff --git a/src/neofs_testlib/cli/neofs_cli/shards.py b/src/frostfs_testlib/cli/frostfs_cli/shards.py similarity index 96% rename from src/neofs_testlib/cli/neofs_cli/shards.py rename to src/frostfs_testlib/cli/frostfs_cli/shards.py index dd57827..bfab6b6 100644 --- a/src/neofs_testlib/cli/neofs_cli/shards.py +++ b/src/frostfs_testlib/cli/frostfs_cli/shards.py @@ -1,10 +1,10 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsCliShards(CliCommand): +class FrostfsCliShards(CliCommand): def flush_cache( self, endpoint: str, diff --git a/src/neofs_testlib/cli/neofs_cli/storagegroup.py b/src/frostfs_testlib/cli/frostfs_cli/storagegroup.py similarity index 93% rename from src/neofs_testlib/cli/neofs_cli/storagegroup.py rename to src/frostfs_testlib/cli/frostfs_cli/storagegroup.py index 514abf5..10f724b 100644 --- a/src/neofs_testlib/cli/neofs_cli/storagegroup.py +++ b/src/frostfs_testlib/cli/frostfs_cli/storagegroup.py @@ -1,10 +1,10 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsCliStorageGroup(CliCommand): +class FrostfsCliStorageGroup(CliCommand): def put( self, rpc_endpoint: str, @@ -18,7 +18,7 @@ class NeofsCliStorageGroup(CliCommand): xhdr: Optional[dict] = None, ) -> CommandResult: """ - Put storage group to NeoFS. + Put storage group to FrostFS. Args: address: Address of wallet account. @@ -54,7 +54,7 @@ class NeofsCliStorageGroup(CliCommand): xhdr: Optional[dict] = None, ) -> CommandResult: """ - Get storage group from NeoFS. + Get storage group from FrostFS. Args: address: Address of wallet account. @@ -89,7 +89,7 @@ class NeofsCliStorageGroup(CliCommand): xhdr: Optional[dict] = None, ) -> CommandResult: """ - List storage groups in NeoFS container. + List storage groups in FrostFS container. Args: address: Address of wallet account. @@ -124,7 +124,7 @@ class NeofsCliStorageGroup(CliCommand): xhdr: Optional[dict] = None, ) -> CommandResult: """ - Delete storage group from NeoFS. + Delete storage group from FrostFS. Args: address: Address of wallet account. diff --git a/src/neofs_testlib/cli/neofs_cli/util.py b/src/frostfs_testlib/cli/frostfs_cli/util.py similarity index 92% rename from src/neofs_testlib/cli/neofs_cli/util.py rename to src/frostfs_testlib/cli/frostfs_cli/util.py index 786c156..99acd0a 100644 --- a/src/neofs_testlib/cli/neofs_cli/util.py +++ b/src/frostfs_testlib/cli/frostfs_cli/util.py @@ -1,10 +1,10 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult -class NeofsCliUtil(CliCommand): +class FrostfsCliUtil(CliCommand): def sign_bearer_token( self, wallet: str, diff --git a/src/frostfs_testlib/cli/frostfs_cli/version.py b/src/frostfs_testlib/cli/frostfs_cli/version.py new file mode 100644 index 0000000..9d22859 --- /dev/null +++ b/src/frostfs_testlib/cli/frostfs_cli/version.py @@ -0,0 +1,13 @@ +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult + + +class FrostfsCliVersion(CliCommand): + def get(self) -> CommandResult: + """ + Application version and FrostFS API compatibility. + + Returns: + Command's result. + """ + return self._execute("", version=True) diff --git a/src/frostfs_testlib/cli/neogo/__init__.py b/src/frostfs_testlib/cli/neogo/__init__.py new file mode 100644 index 0000000..43d305b --- /dev/null +++ b/src/frostfs_testlib/cli/neogo/__init__.py @@ -0,0 +1,2 @@ +from frostfs_testlib.cli.neogo.go import NeoGo +from frostfs_testlib.cli.neogo.network_type import NetworkType diff --git a/src/neofs_testlib/cli/neogo/candidate.py b/src/frostfs_testlib/cli/neogo/candidate.py similarity index 97% rename from src/neofs_testlib/cli/neogo/candidate.py rename to src/frostfs_testlib/cli/neogo/candidate.py index f5e4f33..e4bf6b7 100644 --- a/src/neofs_testlib/cli/neogo/candidate.py +++ b/src/frostfs_testlib/cli/neogo/candidate.py @@ -1,7 +1,7 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult class NeoGoCandidate(CliCommand): diff --git a/src/neofs_testlib/cli/neogo/contract.py b/src/frostfs_testlib/cli/neogo/contract.py similarity index 99% rename from src/neofs_testlib/cli/neogo/contract.py rename to src/frostfs_testlib/cli/neogo/contract.py index 61f4edb..bc56dd9 100644 --- a/src/neofs_testlib/cli/neogo/contract.py +++ b/src/frostfs_testlib/cli/neogo/contract.py @@ -1,7 +1,7 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult class NeoGoContract(CliCommand): diff --git a/src/neofs_testlib/cli/neogo/db.py b/src/frostfs_testlib/cli/neogo/db.py similarity index 92% rename from src/neofs_testlib/cli/neogo/db.py rename to src/frostfs_testlib/cli/neogo/db.py index ae3185d..4b456c3 100644 --- a/src/neofs_testlib/cli/neogo/db.py +++ b/src/frostfs_testlib/cli/neogo/db.py @@ -1,8 +1,8 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.cli.neogo.network_type import NetworkType -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.cli.neogo.network_type import NetworkType +from frostfs_testlib.shell import CommandResult class NeoGoDb(CliCommand): diff --git a/src/neofs_testlib/cli/neogo/go.py b/src/frostfs_testlib/cli/neogo/go.py similarity index 70% rename from src/neofs_testlib/cli/neogo/go.py rename to src/frostfs_testlib/cli/neogo/go.py index 5f216ce..a0634a4 100644 --- a/src/neofs_testlib/cli/neogo/go.py +++ b/src/frostfs_testlib/cli/neogo/go.py @@ -1,14 +1,14 @@ from typing import Optional -from neofs_testlib.cli.neogo.candidate import NeoGoCandidate -from neofs_testlib.cli.neogo.contract import NeoGoContract -from neofs_testlib.cli.neogo.db import NeoGoDb -from neofs_testlib.cli.neogo.nep17 import NeoGoNep17 -from neofs_testlib.cli.neogo.node import NeoGoNode -from neofs_testlib.cli.neogo.query import NeoGoQuery -from neofs_testlib.cli.neogo.version import NeoGoVersion -from neofs_testlib.cli.neogo.wallet import NeoGoWallet -from neofs_testlib.shell import Shell +from frostfs_testlib.cli.neogo.candidate import NeoGoCandidate +from frostfs_testlib.cli.neogo.contract import NeoGoContract +from frostfs_testlib.cli.neogo.db import NeoGoDb +from frostfs_testlib.cli.neogo.nep17 import NeoGoNep17 +from frostfs_testlib.cli.neogo.node import NeoGoNode +from frostfs_testlib.cli.neogo.query import NeoGoQuery +from frostfs_testlib.cli.neogo.version import NeoGoVersion +from frostfs_testlib.cli.neogo.wallet import NeoGoWallet +from frostfs_testlib.shell import Shell class NeoGo: diff --git a/src/neofs_testlib/cli/neogo/nep17.py b/src/frostfs_testlib/cli/neogo/nep17.py similarity index 98% rename from src/neofs_testlib/cli/neogo/nep17.py rename to src/frostfs_testlib/cli/neogo/nep17.py index 7cc00b6..a3dcb12 100644 --- a/src/neofs_testlib/cli/neogo/nep17.py +++ b/src/frostfs_testlib/cli/neogo/nep17.py @@ -1,7 +1,7 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult class NeoGoNep17(CliCommand): diff --git a/src/neofs_testlib/cli/neogo/network_type.py b/src/frostfs_testlib/cli/neogo/network_type.py similarity index 100% rename from src/neofs_testlib/cli/neogo/network_type.py rename to src/frostfs_testlib/cli/neogo/network_type.py diff --git a/src/neofs_testlib/cli/neogo/node.py b/src/frostfs_testlib/cli/neogo/node.py similarity index 67% rename from src/neofs_testlib/cli/neogo/node.py rename to src/frostfs_testlib/cli/neogo/node.py index 8fe4d28..ccc833d 100644 --- a/src/neofs_testlib/cli/neogo/node.py +++ b/src/frostfs_testlib/cli/neogo/node.py @@ -1,6 +1,6 @@ -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.cli.neogo.network_type import NetworkType -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.cli.neogo.network_type import NetworkType +from frostfs_testlib.shell import CommandResult class NeoGoNode(CliCommand): diff --git a/src/neofs_testlib/cli/neogo/query.py b/src/frostfs_testlib/cli/neogo/query.py similarity index 96% rename from src/neofs_testlib/cli/neogo/query.py rename to src/frostfs_testlib/cli/neogo/query.py index 945cd6c..6627790 100644 --- a/src/neofs_testlib/cli/neogo/query.py +++ b/src/frostfs_testlib/cli/neogo/query.py @@ -1,5 +1,5 @@ -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult class NeoGoQuery(CliCommand): diff --git a/src/neofs_testlib/cli/neogo/version.py b/src/frostfs_testlib/cli/neogo/version.py similarity index 66% rename from src/neofs_testlib/cli/neogo/version.py rename to src/frostfs_testlib/cli/neogo/version.py index 0d56bdb..3f6ce3f 100644 --- a/src/neofs_testlib/cli/neogo/version.py +++ b/src/frostfs_testlib/cli/neogo/version.py @@ -1,5 +1,5 @@ -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult class NeoGoVersion(CliCommand): diff --git a/src/neofs_testlib/cli/neogo/wallet.py b/src/frostfs_testlib/cli/neogo/wallet.py similarity index 99% rename from src/neofs_testlib/cli/neogo/wallet.py rename to src/frostfs_testlib/cli/neogo/wallet.py index c3a44b6..2f3e518 100644 --- a/src/neofs_testlib/cli/neogo/wallet.py +++ b/src/frostfs_testlib/cli/neogo/wallet.py @@ -1,7 +1,7 @@ from typing import Optional -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell import CommandResult class NeoGoWallet(CliCommand): diff --git a/src/frostfs_testlib/hosting/__init__.py b/src/frostfs_testlib/hosting/__init__.py new file mode 100644 index 0000000..22a55c7 --- /dev/null +++ b/src/frostfs_testlib/hosting/__init__.py @@ -0,0 +1,3 @@ +from frostfs_testlib.hosting.config import CLIConfig, HostConfig, ServiceConfig +from frostfs_testlib.hosting.hosting import Hosting +from frostfs_testlib.hosting.interfaces import Host diff --git a/src/neofs_testlib/hosting/config.py b/src/frostfs_testlib/hosting/config.py similarity index 100% rename from src/neofs_testlib/hosting/config.py rename to src/frostfs_testlib/hosting/config.py diff --git a/src/neofs_testlib/hosting/docker_host.py b/src/frostfs_testlib/hosting/docker_host.py similarity index 93% rename from src/neofs_testlib/hosting/docker_host.py rename to src/frostfs_testlib/hosting/docker_host.py index 3b36e31..e4c61ac 100644 --- a/src/neofs_testlib/hosting/docker_host.py +++ b/src/frostfs_testlib/hosting/docker_host.py @@ -10,12 +10,12 @@ from typing import Any, Optional import docker from requests import HTTPError -from neofs_testlib.hosting.config import ParsedAttributes -from neofs_testlib.hosting.interfaces import DiskInfo, Host -from neofs_testlib.shell import LocalShell, Shell, SSHShell -from neofs_testlib.shell.command_inspectors import SudoInspector +from frostfs_testlib.hosting.config import ParsedAttributes +from frostfs_testlib.hosting.interfaces import Host +from frostfs_testlib.shell import LocalShell, Shell, SSHShell +from frostfs_testlib.shell.command_inspectors import SudoInspector -logger = logging.getLogger("neofs.testlib.hosting") +logger = logging.getLogger("frostfs.testlib.hosting") @dataclass @@ -142,15 +142,6 @@ class DockerHost(Host): cmd = f"{meta_clean_cmd}{data_clean_cmd}" shell.exec(cmd) - def attach_disk(self, device: str, disk_info: DiskInfo) -> None: - raise NotImplementedError("Not supported for docker") - - def detach_disk(self, device: str) -> DiskInfo: - raise NotImplementedError("Not supported for docker") - - def is_disk_attached(self, device: str, disk_info: DiskInfo) -> bool: - raise NotImplementedError("Not supported for docker") - def dump_logs( self, directory_path: str, diff --git a/src/neofs_testlib/hosting/hosting.py b/src/frostfs_testlib/hosting/hosting.py similarity index 92% rename from src/neofs_testlib/hosting/hosting.py rename to src/frostfs_testlib/hosting/hosting.py index d127f25..d432135 100644 --- a/src/neofs_testlib/hosting/hosting.py +++ b/src/frostfs_testlib/hosting/hosting.py @@ -1,9 +1,9 @@ import re from typing import Any -from neofs_testlib.hosting.config import HostConfig, ServiceConfig -from neofs_testlib.hosting.interfaces import Host -from neofs_testlib.plugins import load_plugin +from frostfs_testlib.hosting.config import HostConfig, ServiceConfig +from frostfs_testlib.hosting.interfaces import Host +from frostfs_testlib.plugins import load_plugin class Hosting: @@ -36,7 +36,7 @@ class Hosting: host_configs = [HostConfig(**host_config) for host_config in config["hosts"]] for host_config in host_configs: - host_class = load_plugin("neofs.testlib.hosting", host_config.plugin_name) + host_class = load_plugin("frostfs.testlib.hosting", host_config.plugin_name) host = host_class(host_config) hosts.append(host) diff --git a/src/neofs_testlib/hosting/interfaces.py b/src/frostfs_testlib/hosting/interfaces.py similarity index 97% rename from src/neofs_testlib/hosting/interfaces.py rename to src/frostfs_testlib/hosting/interfaces.py index 2d36045..269a04e 100644 --- a/src/neofs_testlib/hosting/interfaces.py +++ b/src/frostfs_testlib/hosting/interfaces.py @@ -2,8 +2,8 @@ from abc import ABC, abstractmethod from datetime import datetime from typing import Any, Optional -from neofs_testlib.hosting.config import CLIConfig, HostConfig, ServiceConfig -from neofs_testlib.shell.interfaces import Shell +from frostfs_testlib.hosting.config import CLIConfig, HostConfig, ServiceConfig +from frostfs_testlib.shell.interfaces import Shell class DiskInfo(dict): diff --git a/src/neofs_testlib/plugins/__init__.py b/src/frostfs_testlib/plugins/__init__.py similarity index 100% rename from src/neofs_testlib/plugins/__init__.py rename to src/frostfs_testlib/plugins/__init__.py diff --git a/src/neofs_testlib/reporter/__init__.py b/src/frostfs_testlib/reporter/__init__.py similarity index 67% rename from src/neofs_testlib/reporter/__init__.py rename to src/frostfs_testlib/reporter/__init__.py index ebfb9fd..10e4146 100644 --- a/src/neofs_testlib/reporter/__init__.py +++ b/src/frostfs_testlib/reporter/__init__.py @@ -1,6 +1,6 @@ -from neofs_testlib.reporter.allure_handler import AllureHandler -from neofs_testlib.reporter.interfaces import ReporterHandler -from neofs_testlib.reporter.reporter import Reporter +from frostfs_testlib.reporter.allure_handler import AllureHandler +from frostfs_testlib.reporter.interfaces import ReporterHandler +from frostfs_testlib.reporter.reporter import Reporter __reporter = Reporter() diff --git a/src/neofs_testlib/reporter/allure_handler.py b/src/frostfs_testlib/reporter/allure_handler.py similarity index 94% rename from src/neofs_testlib/reporter/allure_handler.py rename to src/frostfs_testlib/reporter/allure_handler.py index 0fceffb..92a295a 100644 --- a/src/neofs_testlib/reporter/allure_handler.py +++ b/src/frostfs_testlib/reporter/allure_handler.py @@ -6,7 +6,7 @@ from typing import Any import allure from allure import attachment_type -from neofs_testlib.reporter.interfaces import ReporterHandler +from frostfs_testlib.reporter.interfaces import ReporterHandler class AllureHandler(ReporterHandler): diff --git a/src/neofs_testlib/reporter/interfaces.py b/src/frostfs_testlib/reporter/interfaces.py similarity index 100% rename from src/neofs_testlib/reporter/interfaces.py rename to src/frostfs_testlib/reporter/interfaces.py diff --git a/src/neofs_testlib/reporter/reporter.py b/src/frostfs_testlib/reporter/reporter.py similarity index 93% rename from src/neofs_testlib/reporter/reporter.py rename to src/frostfs_testlib/reporter/reporter.py index d12cb05..ea8330b 100644 --- a/src/neofs_testlib/reporter/reporter.py +++ b/src/frostfs_testlib/reporter/reporter.py @@ -2,8 +2,8 @@ from contextlib import AbstractContextManager, contextmanager from types import TracebackType from typing import Any, Optional -from neofs_testlib.plugins import load_plugin -from neofs_testlib.reporter.interfaces import ReporterHandler +from frostfs_testlib.plugins import load_plugin +from frostfs_testlib.reporter.interfaces import ReporterHandler @contextmanager @@ -42,7 +42,7 @@ class Reporter: # Setup handlers from the specified config handler_configs = config.get("handlers", []) for handler_config in handler_configs: - handler_class = load_plugin("neofs.testlib.reporter", handler_config["plugin_name"]) + handler_class = load_plugin("frostfs.testlib.reporter", handler_config["plugin_name"]) self.register_handler(handler_class()) def step(self, name: str) -> AbstractContextManager: diff --git a/src/frostfs_testlib/shell/__init__.py b/src/frostfs_testlib/shell/__init__.py new file mode 100644 index 0000000..0300ff8 --- /dev/null +++ b/src/frostfs_testlib/shell/__init__.py @@ -0,0 +1,3 @@ +from frostfs_testlib.shell.interfaces import CommandOptions, CommandResult, InteractiveInput, Shell +from frostfs_testlib.shell.local_shell import LocalShell +from frostfs_testlib.shell.ssh_shell import SSHShell diff --git a/src/neofs_testlib/shell/command_inspectors.py b/src/frostfs_testlib/shell/command_inspectors.py similarity index 82% rename from src/neofs_testlib/shell/command_inspectors.py rename to src/frostfs_testlib/shell/command_inspectors.py index 9537549..8486f43 100644 --- a/src/neofs_testlib/shell/command_inspectors.py +++ b/src/frostfs_testlib/shell/command_inspectors.py @@ -1,4 +1,4 @@ -from neofs_testlib.shell.interfaces import CommandInspector +from frostfs_testlib.shell.interfaces import CommandInspector class SudoInspector(CommandInspector): diff --git a/src/neofs_testlib/shell/interfaces.py b/src/frostfs_testlib/shell/interfaces.py similarity index 100% rename from src/neofs_testlib/shell/interfaces.py rename to src/frostfs_testlib/shell/interfaces.py diff --git a/src/neofs_testlib/shell/local_shell.py b/src/frostfs_testlib/shell/local_shell.py similarity index 96% rename from src/neofs_testlib/shell/local_shell.py rename to src/frostfs_testlib/shell/local_shell.py index f16339f..12f450a 100644 --- a/src/neofs_testlib/shell/local_shell.py +++ b/src/frostfs_testlib/shell/local_shell.py @@ -6,10 +6,10 @@ from typing import IO, Optional import pexpect -from neofs_testlib.reporter import get_reporter -from neofs_testlib.shell.interfaces import CommandInspector, CommandOptions, CommandResult, Shell +from frostfs_testlib.reporter import get_reporter +from frostfs_testlib.shell.interfaces import CommandInspector, CommandOptions, CommandResult, Shell -logger = logging.getLogger("neofs.testlib.shell") +logger = logging.getLogger("frostfs.testlib.shell") reporter = get_reporter() diff --git a/src/neofs_testlib/shell/ssh_shell.py b/src/frostfs_testlib/shell/ssh_shell.py similarity index 98% rename from src/neofs_testlib/shell/ssh_shell.py rename to src/frostfs_testlib/shell/ssh_shell.py index f4870b4..04d42ee 100644 --- a/src/neofs_testlib/shell/ssh_shell.py +++ b/src/frostfs_testlib/shell/ssh_shell.py @@ -19,10 +19,10 @@ from paramiko import ( ) from paramiko.ssh_exception import AuthenticationException -from neofs_testlib.reporter import get_reporter -from neofs_testlib.shell.interfaces import CommandInspector, CommandOptions, CommandResult, Shell +from frostfs_testlib.reporter import get_reporter +from frostfs_testlib.shell.interfaces import CommandInspector, CommandOptions, CommandResult, Shell -logger = logging.getLogger("neofs.testlib.shell") +logger = logging.getLogger("frostfs.testlib.shell") reporter = get_reporter() diff --git a/src/neofs_testlib/utils/__init__.py b/src/frostfs_testlib/utils/__init__.py similarity index 100% rename from src/neofs_testlib/utils/__init__.py rename to src/frostfs_testlib/utils/__init__.py diff --git a/src/neofs_testlib/utils/converters.py b/src/frostfs_testlib/utils/converters.py similarity index 100% rename from src/neofs_testlib/utils/converters.py rename to src/frostfs_testlib/utils/converters.py diff --git a/src/neofs_testlib/utils/wallet.py b/src/frostfs_testlib/utils/wallet.py similarity index 95% rename from src/neofs_testlib/utils/wallet.py rename to src/frostfs_testlib/utils/wallet.py index 5d4ff4a..60cd2c3 100644 --- a/src/neofs_testlib/utils/wallet.py +++ b/src/frostfs_testlib/utils/wallet.py @@ -4,7 +4,7 @@ import logging from neo3.wallet import wallet as neo3_wallet from neo3.wallet import account as neo3_account -logger = logging.getLogger("neofs.testlib.utils") +logger = logging.getLogger("frostfs.testlib.utils") def init_wallet(wallet_path: str, wallet_password: str): diff --git a/src/neofs_testlib/blockchain/__init__.py b/src/neofs_testlib/blockchain/__init__.py deleted file mode 100644 index 006e8f1..0000000 --- a/src/neofs_testlib/blockchain/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from neofs_testlib.blockchain.multisig import Multisig -from neofs_testlib.blockchain.rpc_client import RPCClient diff --git a/src/neofs_testlib/cli/__init__.py b/src/neofs_testlib/cli/__init__.py deleted file mode 100644 index 63cd5bc..0000000 --- a/src/neofs_testlib/cli/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from neofs_testlib.cli.neofs_adm import NeofsAdm -from neofs_testlib.cli.neofs_authmate import NeofsAuthmate -from neofs_testlib.cli.neofs_cli import NeofsCli -from neofs_testlib.cli.neogo import NeoGo, NetworkType diff --git a/src/neofs_testlib/cli/neofs_adm/__init__.py b/src/neofs_testlib/cli/neofs_adm/__init__.py deleted file mode 100644 index dd91220..0000000 --- a/src/neofs_testlib/cli/neofs_adm/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from neofs_testlib.cli.neofs_adm.adm import NeofsAdm diff --git a/src/neofs_testlib/cli/neofs_adm/adm.py b/src/neofs_testlib/cli/neofs_adm/adm.py deleted file mode 100644 index 4fff981..0000000 --- a/src/neofs_testlib/cli/neofs_adm/adm.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Optional - -from neofs_testlib.cli.neofs_adm.config import NeofsAdmConfig -from neofs_testlib.cli.neofs_adm.morph import NeofsAdmMorph -from neofs_testlib.cli.neofs_adm.storage_config import NeofsAdmStorageConfig -from neofs_testlib.cli.neofs_adm.subnet import NeofsAdmMorphSubnet -from neofs_testlib.cli.neofs_adm.version import NeofsAdmVersion -from neofs_testlib.shell import Shell - - -class NeofsAdm: - morph: Optional[NeofsAdmMorph] = None - subnet: Optional[NeofsAdmMorphSubnet] = None - storage_config: Optional[NeofsAdmStorageConfig] = None - version: Optional[NeofsAdmVersion] = None - - def __init__(self, shell: Shell, neofs_adm_exec_path: str, config_file: Optional[str] = None): - self.config = NeofsAdmConfig(shell, neofs_adm_exec_path, config=config_file) - self.morph = NeofsAdmMorph(shell, neofs_adm_exec_path, config=config_file) - self.subnet = NeofsAdmMorphSubnet(shell, neofs_adm_exec_path, config=config_file) - self.storage_config = NeofsAdmStorageConfig(shell, neofs_adm_exec_path, config=config_file) - self.version = NeofsAdmVersion(shell, neofs_adm_exec_path, config=config_file) diff --git a/src/neofs_testlib/cli/neofs_adm/config.py b/src/neofs_testlib/cli/neofs_adm/config.py deleted file mode 100644 index 86d684b..0000000 --- a/src/neofs_testlib/cli/neofs_adm/config.py +++ /dev/null @@ -1,22 +0,0 @@ -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult - - -class NeofsAdmConfig(CliCommand): - def init(self, path: str = "~/.neofs/adm/config.yml") -> CommandResult: - """Initialize basic neofs-adm configuration file. - - Args: - path: Path to config (default ~/.neofs/adm/config.yml). - - Returns: - Command's result. - """ - return self._execute( - "config init", - **{ - param: param_value - for param, param_value in locals().items() - if param not in ["self"] - }, - ) diff --git a/src/neofs_testlib/cli/neofs_authmate/__init__.py b/src/neofs_testlib/cli/neofs_authmate/__init__.py deleted file mode 100644 index 5d43b3e..0000000 --- a/src/neofs_testlib/cli/neofs_authmate/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from neofs_testlib.cli.neofs_authmate.authmate import NeofsAuthmate diff --git a/src/neofs_testlib/cli/neofs_authmate/authmate.py b/src/neofs_testlib/cli/neofs_authmate/authmate.py deleted file mode 100644 index 5f86a74..0000000 --- a/src/neofs_testlib/cli/neofs_authmate/authmate.py +++ /dev/null @@ -1,14 +0,0 @@ -from typing import Optional - -from neofs_testlib.cli.neofs_authmate.secret import NeofsAuthmateSecret -from neofs_testlib.cli.neofs_authmate.version import NeofsAuthmateVersion -from neofs_testlib.shell import Shell - - -class NeofsAuthmate: - secret: Optional[NeofsAuthmateSecret] = None - version: Optional[NeofsAuthmateVersion] = None - - def __init__(self, shell: Shell, neofs_authmate_exec_path: str): - self.secret = NeofsAuthmateSecret(shell, neofs_authmate_exec_path) - self.version = NeofsAuthmateVersion(shell, neofs_authmate_exec_path) diff --git a/src/neofs_testlib/cli/neofs_cli/__init__.py b/src/neofs_testlib/cli/neofs_cli/__init__.py deleted file mode 100644 index 9911fe2..0000000 --- a/src/neofs_testlib/cli/neofs_cli/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from neofs_testlib.cli.neofs_cli.cli import NeofsCli diff --git a/src/neofs_testlib/cli/neofs_cli/cli.py b/src/neofs_testlib/cli/neofs_cli/cli.py deleted file mode 100644 index cfe8e5d..0000000 --- a/src/neofs_testlib/cli/neofs_cli/cli.py +++ /dev/null @@ -1,38 +0,0 @@ -from typing import Optional - -from neofs_testlib.cli.neofs_cli.accounting import NeofsCliAccounting -from neofs_testlib.cli.neofs_cli.acl import NeofsCliACL -from neofs_testlib.cli.neofs_cli.container import NeofsCliContainer -from neofs_testlib.cli.neofs_cli.netmap import NeofsCliNetmap -from neofs_testlib.cli.neofs_cli.object import NeofsCliObject -from neofs_testlib.cli.neofs_cli.session import NeofsCliSession -from neofs_testlib.cli.neofs_cli.shards import NeofsCliShards -from neofs_testlib.cli.neofs_cli.storagegroup import NeofsCliStorageGroup -from neofs_testlib.cli.neofs_cli.util import NeofsCliUtil -from neofs_testlib.cli.neofs_cli.version import NeofsCliVersion -from neofs_testlib.shell import Shell - - -class NeofsCli: - accounting: Optional[NeofsCliAccounting] = None - acl: Optional[NeofsCliACL] = None - container: Optional[NeofsCliContainer] = None - netmap: Optional[NeofsCliNetmap] = None - object: Optional[NeofsCliObject] = None - session: Optional[NeofsCliSession] = None - shards: Optional[NeofsCliShards] = None - storagegroup: Optional[NeofsCliStorageGroup] = None - util: Optional[NeofsCliUtil] = None - version: Optional[NeofsCliVersion] = None - - def __init__(self, shell: Shell, neofs_cli_exec_path: str, config_file: Optional[str] = None): - self.accounting = NeofsCliAccounting(shell, neofs_cli_exec_path, config=config_file) - self.acl = NeofsCliACL(shell, neofs_cli_exec_path, config=config_file) - self.container = NeofsCliContainer(shell, neofs_cli_exec_path, config=config_file) - self.netmap = NeofsCliNetmap(shell, neofs_cli_exec_path, config=config_file) - self.object = NeofsCliObject(shell, neofs_cli_exec_path, config=config_file) - self.session = NeofsCliSession(shell, neofs_cli_exec_path, config=config_file) - self.shards = NeofsCliShards(shell, neofs_cli_exec_path, config=config_file) - self.storagegroup = NeofsCliStorageGroup(shell, neofs_cli_exec_path, config=config_file) - self.util = NeofsCliUtil(shell, neofs_cli_exec_path, config=config_file) - self.version = NeofsCliVersion(shell, neofs_cli_exec_path, config=config_file) diff --git a/src/neofs_testlib/cli/neofs_cli/version.py b/src/neofs_testlib/cli/neofs_cli/version.py deleted file mode 100644 index 6f22613..0000000 --- a/src/neofs_testlib/cli/neofs_cli/version.py +++ /dev/null @@ -1,13 +0,0 @@ -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell import CommandResult - - -class NeofsCliVersion(CliCommand): - def get(self) -> CommandResult: - """ - Application version and NeoFS API compatibility. - - Returns: - Command's result. - """ - return self._execute("", version=True) diff --git a/src/neofs_testlib/cli/neogo/__init__.py b/src/neofs_testlib/cli/neogo/__init__.py deleted file mode 100644 index 585be9e..0000000 --- a/src/neofs_testlib/cli/neogo/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from neofs_testlib.cli.neogo.go import NeoGo -from neofs_testlib.cli.neogo.network_type import NetworkType diff --git a/src/neofs_testlib/hosting/__init__.py b/src/neofs_testlib/hosting/__init__.py deleted file mode 100644 index d3f1f8f..0000000 --- a/src/neofs_testlib/hosting/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from neofs_testlib.hosting.config import CLIConfig, HostConfig, ServiceConfig -from neofs_testlib.hosting.hosting import Hosting -from neofs_testlib.hosting.interfaces import Host diff --git a/src/neofs_testlib/shell/__init__.py b/src/neofs_testlib/shell/__init__.py deleted file mode 100644 index d0f22d6..0000000 --- a/src/neofs_testlib/shell/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from neofs_testlib.shell.interfaces import CommandOptions, CommandResult, InteractiveInput, Shell -from neofs_testlib.shell.local_shell import LocalShell -from neofs_testlib.shell.ssh_shell import SSHShell diff --git a/tests/helpers.py b/tests/helpers.py index 8ee11b0..8391002 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -1,6 +1,6 @@ import traceback -from neofs_testlib.shell.interfaces import CommandResult +from frostfs_testlib.shell.interfaces import CommandResult def format_error_details(error: Exception) -> str: diff --git a/tests/test_cli.py b/tests/test_cli.py index f607121..6f4d791 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,15 +1,15 @@ from unittest import TestCase from unittest.mock import Mock -from neofs_testlib.cli import NeofsAdm, NeofsCli, NeoGo -from neofs_testlib.cli.cli_command import CliCommand -from neofs_testlib.shell.interfaces import CommandOptions, InteractiveInput +from frostfs_testlib.cli import FrostfsAdm, FrostfsCli, NeoGo +from frostfs_testlib.cli.cli_command import CliCommand +from frostfs_testlib.shell.interfaces import CommandOptions, InteractiveInput class TestCli(TestCase): - neofs_adm_exec_path = "neo-adm-exec" - neofs_go_exec_path = "neo-go-exec" - neofs_cli_exec_path = "neo-cli-exec" + frostfs_adm_exec_path = "neo-adm-exec" + frostfs_go_exec_path = "neo-go-exec" + frostfs_cli_exec_path = "neo-cli-exec" address = "0x0000000000000000000" addresses = ["0x000000", "0xDEADBEEF", "0xBABECAFE"] @@ -30,12 +30,12 @@ class TestCli(TestCase): def test_container_create(self): shell = Mock() - neofs_cli = NeofsCli( + frostfs_cli = FrostfsCli( config_file=self.config_file, - neofs_cli_exec_path=self.neofs_cli_exec_path, + frostfs_cli_exec_path=self.frostfs_cli_exec_path, shell=shell, ) - neofs_cli.container.create( + frostfs_cli.container.create( rpc_endpoint=self.rpc_endpoint, wallet=self.wallet, basic_acl=self.basic_acl, @@ -46,7 +46,7 @@ class TestCli(TestCase): xhdr = ",".join(f"{param}={value}" for param, value in self.xhdr.items()) expected_command = ( - f"{self.neofs_cli_exec_path} --config {self.config_file} container create " + f"{self.frostfs_cli_exec_path} --config {self.config_file} container create " f"--rpc-endpoint '{self.rpc_endpoint}' --wallet '{self.wallet}' " f"--basic-acl '{self.basic_acl}' --await --policy '{self.policy}' " f"--xhdr '{xhdr}'" @@ -57,7 +57,7 @@ class TestCli(TestCase): def test_bad_wallet_argument(self): shell = Mock() neo_go = NeoGo( - shell=shell, config_path=self.config_file, neo_go_exec_path=self.neofs_go_exec_path + shell=shell, config_path=self.config_file, neo_go_exec_path=self.frostfs_go_exec_path ) with self.assertRaises(Exception) as exc_msg: neo_go.contract.add_group( @@ -88,7 +88,7 @@ class TestCli(TestCase): def test_wallet_sign(self): shell = Mock() neo_go = NeoGo( - shell=shell, config_path=self.config_file, neo_go_exec_path=self.neofs_go_exec_path + shell=shell, config_path=self.config_file, neo_go_exec_path=self.frostfs_go_exec_path ) neo_go.wallet.sign( input_file=self.file1, @@ -101,7 +101,7 @@ class TestCli(TestCase): ) expected_command = ( - f"{self.neofs_go_exec_path} --config_path {self.config_file} wallet sign " + f"{self.frostfs_go_exec_path} --config_path {self.config_file} wallet sign " f"--input-file '{self.file1}' --address '{self.address}' " f"--rpc-endpoint '{self.rpc_endpoint}' --wallet '{self.wallet}' " f"--out '{self.file2}' --timeout '{self.timeout}s'" @@ -118,12 +118,12 @@ class TestCli(TestCase): def test_subnet_create(self): shell = Mock() - neofs_adm = NeofsAdm( + frostfs_adm = FrostfsAdm( config_file=self.config_file, - neofs_adm_exec_path=self.neofs_adm_exec_path, + frostfs_adm_exec_path=self.frostfs_adm_exec_path, shell=shell, ) - neofs_adm.subnet.create( + frostfs_adm.subnet.create( address=self.address, rpc_endpoint=self.rpc_endpoint, wallet=self.wallet, @@ -131,7 +131,7 @@ class TestCli(TestCase): ) expected_command = ( - f"{self.neofs_adm_exec_path} --config {self.config_file} morph subnet create " + f"{self.frostfs_adm_exec_path} --config {self.config_file} morph subnet create " f"--rpc-endpoint '{self.rpc_endpoint}' --address '{self.address}' " f"--wallet '{self.wallet}' --notary" ) @@ -141,7 +141,7 @@ class TestCli(TestCase): def test_wallet_nep17_multitransfer(self): shell = Mock() neo_go = NeoGo( - shell=shell, config_path=self.config_file, neo_go_exec_path=self.neofs_go_exec_path + shell=shell, config_path=self.config_file, neo_go_exec_path=self.frostfs_go_exec_path ) neo_go.nep17.multitransfer( wallet=self.wallet, @@ -157,7 +157,7 @@ class TestCli(TestCase): to_address = "".join(f" --to '{address}'" for address in self.addresses) expected_command = ( - f"{self.neofs_go_exec_path} --config_path {self.config_file} " + f"{self.frostfs_go_exec_path} --config_path {self.config_file} " f"wallet nep17 multitransfer --token '{self.token}'" f"{to_address} --sysgas '{self.sysgas}' --rpc-endpoint '{self.rpc_endpoint}' " f"--wallet '{self.wallet}' --from '{self.address}' --force --amount {self.amount} " @@ -168,7 +168,7 @@ class TestCli(TestCase): def test_version(self): shell = Mock() - neofs_adm = NeofsAdm(shell=shell, neofs_adm_exec_path=self.neofs_adm_exec_path) - neofs_adm.version.get() + frostfs_adm = FrostfsAdm(shell=shell, frostfs_adm_exec_path=self.frostfs_adm_exec_path) + frostfs_adm.version.get() - shell.exec.assert_called_once_with(f"{self.neofs_adm_exec_path} --version") + shell.exec.assert_called_once_with(f"{self.frostfs_adm_exec_path} --version") diff --git a/tests/test_converters.py b/tests/test_converters.py index f453c42..7600a5d 100644 --- a/tests/test_converters.py +++ b/tests/test_converters.py @@ -1,6 +1,6 @@ from unittest import TestCase -from neofs_testlib.utils import converters +from frostfs_testlib.utils import converters class TestConverters(TestCase): diff --git a/tests/test_hosting.py b/tests/test_hosting.py index 17cacb4..14be8c5 100644 --- a/tests/test_hosting.py +++ b/tests/test_hosting.py @@ -1,6 +1,6 @@ from unittest import TestCase -from neofs_testlib.hosting import CLIConfig, Hosting, ServiceConfig +from frostfs_testlib.hosting import CLIConfig, Hosting, ServiceConfig class TestHosting(TestCase): diff --git a/tests/test_local_shell.py b/tests/test_local_shell.py index de1e22f..3d05e5b 100644 --- a/tests/test_local_shell.py +++ b/tests/test_local_shell.py @@ -1,7 +1,7 @@ from unittest import TestCase -from neofs_testlib.shell.interfaces import CommandOptions, InteractiveInput -from neofs_testlib.shell.local_shell import LocalShell +from frostfs_testlib.shell.interfaces import CommandOptions, InteractiveInput +from frostfs_testlib.shell.local_shell import LocalShell from tests.helpers import format_error_details, get_output_lines diff --git a/tests/test_reporter.py b/tests/test_reporter.py index 2dec8fb..f5e29d0 100644 --- a/tests/test_reporter.py +++ b/tests/test_reporter.py @@ -4,7 +4,7 @@ from typing import Optional from unittest import TestCase from unittest.mock import MagicMock -from neofs_testlib.reporter import Reporter +from frostfs_testlib.reporter import Reporter class TestLocalShellInteractive(TestCase): diff --git a/tests/test_ssh_shell.py b/tests/test_ssh_shell.py index 0ffeb4d..021014a 100644 --- a/tests/test_ssh_shell.py +++ b/tests/test_ssh_shell.py @@ -1,8 +1,9 @@ import os from unittest import SkipTest, TestCase -from neofs_testlib.shell.interfaces import CommandOptions, InteractiveInput -from neofs_testlib.shell.ssh_shell import SSHShell +from frostfs_testlib.shell.interfaces import CommandOptions, InteractiveInput +from frostfs_testlib.shell.ssh_shell import SSHShell + from tests.helpers import format_error_details, get_output_lines diff --git a/tests/test_wallet.py b/tests/test_wallet.py index 7e688ab..f00a6af 100644 --- a/tests/test_wallet.py +++ b/tests/test_wallet.py @@ -5,7 +5,7 @@ from uuid import uuid4 from neo3.wallet.wallet import Wallet -from neofs_testlib.utils.wallet import init_wallet, get_last_address_from_wallet +from frostfs_testlib.utils.wallet import init_wallet, get_last_address_from_wallet class TestWallet(TestCase):