HOTFIX: FREE_STORAGE condition

FREE_STORAGE may be false or true and it affects GAS transfer.

Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
This commit is contained in:
Elizaveta Chichindaeva 2022-09-06 13:23:53 +03:00
parent 926a7a5779
commit 38a177107e
2 changed files with 22 additions and 12 deletions

View file

@ -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(

View file

@ -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,