diff --git a/pytest_tests/testsuites/conftest.py b/pytest_tests/testsuites/conftest.py index ca3cb5b1..6dfbb896 100644 --- a/pytest_tests/testsuites/conftest.py +++ b/pytest_tests/testsuites/conftest.py @@ -12,6 +12,7 @@ from cli_helpers import _cmd_run from common import ASSETS_DIR, FREE_STORAGE, MAINNET_WALLET_PATH, NEOFS_NETMAP_DICT from payment_neogo import neofs_deposit, transfer_mainnet_gas from python_keywords.node_management import node_healthcheck +from sbercloud_helper import SberCloudConfig def robot_keyword_adapter(name=None, tags=(), types=()): @@ -24,8 +25,9 @@ logger = logging.getLogger('NeoLogger') @pytest.fixture(scope='session') -def free_storage_check(): - if os.getenv('FREE_STORAGE', default='False').lower() not in ('true', '1'): +def cloud_infrastructure_check(): + cloud_config = SberCloudConfig.from_env() + if not cloud_config.project_id: pytest.skip('Test only works on SberCloud infrastructure') yield diff --git a/pytest_tests/testsuites/failovers/test_failover_network.py b/pytest_tests/testsuites/failovers/test_failover_network.py index 6790135b..efcbf86d 100644 --- a/pytest_tests/testsuites/failovers/test_failover_network.py +++ b/pytest_tests/testsuites/failovers/test_failover_network.py @@ -62,7 +62,7 @@ def restore_network(): @allure.title('Block Storage node traffic') @pytest.mark.failover @pytest.mark.failover_net -def test_block_storage_node_traffic(prepare_wallet_and_deposit, free_storage_check): +def test_block_storage_node_traffic(prepare_wallet_and_deposit, cloud_infrastructure_check): """ Block storage nodes traffic using iptables and wait for replication for objects. """ diff --git a/pytest_tests/testsuites/failovers/test_failover_storage.py b/pytest_tests/testsuites/failovers/test_failover_storage.py index 18e11bd5..4089af0f 100644 --- a/pytest_tests/testsuites/failovers/test_failover_storage.py +++ b/pytest_tests/testsuites/failovers/test_failover_storage.py @@ -56,7 +56,7 @@ def return_all_storage_nodes(sbercloud_client: SberCloud) -> None: @pytest.mark.parametrize('hard_reboot', [True, False]) @pytest.mark.failover def test_lost_storage_node(prepare_wallet_and_deposit, sbercloud_client: SberCloud, - free_storage_check, hard_reboot: bool): + cloud_infrastructure_check, hard_reboot: bool): wallet = prepare_wallet_and_deposit placement_rule = 'REP 2 IN X CBF 2 SELECT 2 FROM * AS X' source_file_path = generate_file() @@ -88,7 +88,8 @@ def test_lost_storage_node(prepare_wallet_and_deposit, sbercloud_client: SberClo @pytest.mark.parametrize('sequence', [True, False]) @pytest.mark.failover_panic @pytest.mark.failover -def test_panic_storage_node(prepare_wallet_and_deposit, free_storage_check, sequence: bool): +def test_panic_storage_node(prepare_wallet_and_deposit, cloud_infrastructure_check, + sequence: bool): wallet = prepare_wallet_and_deposit placement_rule = 'REP 2 IN X CBF 2 SELECT 2 FROM * AS X' source_file_path = generate_file()