From 38a177107e6e60d1d2061e649a21ac9bbf5a2908 Mon Sep 17 00:00:00 2001 From: Elizaveta Chichindaeva Date: Tue, 6 Sep 2022 13:23:53 +0300 Subject: [PATCH] HOTFIX: FREE_STORAGE condition FREE_STORAGE may be false or true and it affects GAS transfer. Signed-off-by: Elizaveta Chichindaeva --- .../acl/storage_group/test_storagegroup.py | 20 +++++++++++-------- .../lib/python_keywords/storage_group.py | 14 +++++++++---- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/pytest_tests/testsuites/acl/storage_group/test_storagegroup.py b/pytest_tests/testsuites/acl/storage_group/test_storagegroup.py index 2f8ff22e..910478f8 100644 --- a/pytest_tests/testsuites/acl/storage_group/test_storagegroup.py +++ b/pytest_tests/testsuites/acl/storage_group/test_storagegroup.py @@ -7,6 +7,8 @@ from common import ( IR_WALLET_PASS, IR_WALLET_PATH, SIMPLE_OBJ_SIZE, + ASSETS_DIR, + FREE_STORAGE ) from epoch import tick_epoch from typing import Optional @@ -48,11 +50,12 @@ deposit = 30 @pytest.mark.storage_group class TestStorageGroup: @pytest.fixture(autouse=True) - def prepare_two_wallets(self, prepare_wallet_and_deposit, tmp_path): + def prepare_two_wallets(self, prepare_wallet_and_deposit): self.main_wallet = prepare_wallet_and_deposit - self.other_wallet, _, _ = init_wallet(tmp_path) - transfer_mainnet_gas(self.other_wallet, 31) - neofs_deposit(self.other_wallet, 30) + self.other_wallet, _, _ = init_wallet(ASSETS_DIR) + if not FREE_STORAGE: + transfer_mainnet_gas(self.other_wallet, 31) + neofs_deposit(self.other_wallet, 30) @allure.title("Test Storage Group in Private Container") def test_storagegroup_basic_private_container(self, object_size): @@ -204,10 +207,11 @@ class TestStorageGroup: and include an Object created on behalf of some user. We expect that System key is granted to make all operations except PUT and DELETE. """ - transfer_mainnet_gas( - IR_WALLET_PATH, deposit + 1, wallet_password=IR_WALLET_PASS - ) - neofs_deposit(IR_WALLET_PATH, deposit, wallet_password=IR_WALLET_PASS) + if not FREE_STORAGE: + transfer_mainnet_gas( + IR_WALLET_PATH, deposit + 1, wallet_password=IR_WALLET_PASS + ) + neofs_deposit(IR_WALLET_PATH, deposit, wallet_password=IR_WALLET_PASS) storage_group = put_storagegroup(wallet, cid, obj_list) with pytest.raises(Exception, match=OBJECT_ACCESS_DENIED): put_storagegroup( diff --git a/robot/resources/lib/python_keywords/storage_group.py b/robot/resources/lib/python_keywords/storage_group.py index f310623f..45470cf3 100644 --- a/robot/resources/lib/python_keywords/storage_group.py +++ b/robot/resources/lib/python_keywords/storage_group.py @@ -17,7 +17,11 @@ from common import ( from complex_object_actions import get_link_object from neofs_verbs import head_object +import allure +logger = logging.getLogger("NeoLogger") + +@allure.step('Put Storagegroup') def put_storagegroup( wallet: str, cid: str, @@ -51,6 +55,7 @@ def put_storagegroup( return oid +@allure.step('List Storagegroup') def list_storagegroup( wallet: str, cid: str, bearer_token: str = "", wallet_config: str = WALLET_CONFIG ): @@ -77,6 +82,7 @@ def list_storagegroup( return found_objects +@allure.step('Get Storagegroup') def get_storagegroup( wallet: str, cid: str, @@ -122,6 +128,7 @@ def get_storagegroup( return sg_dict +@allure.step('Delete Storagegroup') def delete_storagegroup( wallet: str, cid: str, @@ -152,6 +159,7 @@ def delete_storagegroup( return tombstone_id +@allure.step('Verify list operation over Storagegroup') def verify_list_storage_group( wallet: str, cid: str, @@ -162,12 +170,10 @@ def verify_list_storage_group( storage_groups = list_storagegroup( wallet, cid, bearer_token=bearer, wallet_config=wallet_config ) - try: - storagegroup in storage_groups - except: - logging.error("Storage Group hasn't been persisted") + assert storagegroup in storage_groups +@allure.step('Verify get operation over Storagegroup') def verify_get_storage_group( wallet: str, cid: str,