forked from TrueCloudLab/frostfs-testcases
Added more allure logs for failovers
This commit is contained in:
parent
378456e6d4
commit
a16576dbdc
1 changed files with 13 additions and 11 deletions
|
@ -20,7 +20,7 @@ stopped_hosts = []
|
|||
@pytest.fixture(scope='session')
|
||||
def free_storage_check():
|
||||
if os.getenv('FREE_STORAGE', default='False').lower() not in ('true', '1'):
|
||||
pytest.skip('Test work only on SberCloud infrastructure')
|
||||
pytest.skip('Test only works on SberCloud infrastructure')
|
||||
yield
|
||||
|
||||
|
||||
|
@ -31,7 +31,6 @@ def sbercloud_client():
|
|||
yield SberCloud(f'{os.getcwd()}/configuration/sbercloud.yaml')
|
||||
except Exception:
|
||||
pytest.fail('SberCloud infrastructure not available')
|
||||
yield None
|
||||
|
||||
|
||||
@pytest.fixture(scope='session', autouse=True)
|
||||
|
@ -40,7 +39,6 @@ def return_all_storage_nodes_fixture(sbercloud_client):
|
|||
return_all_storage_nodes(sbercloud_client)
|
||||
|
||||
|
||||
@allure.title('Hard reboot host via magic SysRq option')
|
||||
def panic_reboot_host(ip: str = None):
|
||||
ssh = HostClient(ip=ip, init_ssh_client=False)
|
||||
ssh.pk = SSH_PK_PATH
|
||||
|
@ -108,15 +106,19 @@ def test_panic_storage_node(prepare_wallet_and_deposit, free_storage_check, sequ
|
|||
cid = create_container(wallet, rule=placement_rule, basic_acl=PUBLIC_ACL)
|
||||
oid = put_object(wallet, source_file_path, cid)
|
||||
|
||||
with allure.step(f'Return storage nodes'):
|
||||
nodes = wait_object_replication(wallet, cid, oid, 2)
|
||||
for node in nodes:
|
||||
nodes = wait_object_replication(wallet, cid, oid, 2)
|
||||
allure.attach.file('\n'.join(nodes), 'Current nodes with object', allure.attachment_type.TEXT)
|
||||
for node in nodes:
|
||||
with allure.step(f'Hard reboot host {node} via magic SysRq option'):
|
||||
panic_reboot_host(ip=node.split(':')[-2])
|
||||
if sequence:
|
||||
wait_object_replication(wallet, cid, oid, 2)
|
||||
new_nodes = wait_object_replication(wallet, cid, oid, 2)
|
||||
allure.attach.file('\n'.join(new_nodes), f'Nodes with object after {node} fail',
|
||||
allure.attachment_type.TEXT)
|
||||
|
||||
if not sequence:
|
||||
wait_object_replication(wallet, cid, oid, 2)
|
||||
if not sequence:
|
||||
new_nodes = wait_object_replication(wallet, cid, oid, 2)
|
||||
allure.attach.file('\n'.join(new_nodes), 'Nodes with object after nodes fail', allure.attachment_type.TEXT)
|
||||
|
||||
got_file_path = get_object(wallet, cid, oid)
|
||||
assert get_file_hash(source_file_path) == get_file_hash(got_file_path)
|
||||
got_file_path = get_object(wallet, cid, oid)
|
||||
assert get_file_hash(source_file_path) == get_file_hash(got_file_path)
|
||||
|
|
Loading…
Add table
Reference in a new issue