Implement fixtures for deploying FrostFS components

Exported from a private playground repo @ commit
ba8c88d7e11e8e8c17e54ca1317bc2dbf8b52204

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
This commit is contained in:
Vitaliy Potyarkin 2025-05-07 14:35:37 +03:00
parent 1fbd7b7de1
commit 211f9a0abd
13 changed files with 1500 additions and 0 deletions

View file

@ -0,0 +1,74 @@
import random
import re
import pytest
from frostfs_testlib.component_tests.fixtures import adm_customize
@pytest.mark.timeout(30)
def test_sidechain(neogo):
"""
Launch sidechain and wait for blocks to tick up to eleven.
"""
node = neogo[3]
needle = re.compile(r'"height": 11')
node.wait(needle)
@adm_customize(version="0.45.0-rc.10")
def test_frostfs_adm(frostfs_adm):
"""
This is just a demonstration.
Overriding frostfs-adm version from component tests is not recommended
because it will effectively redeploy everything just for that test case:
alphabet wallets depend upon frostfs-adm, and everything else depends on
alphabet wallets.
"""
output = frostfs_adm("--version")
assert "0.45.0-rc.10" in output
def test_contract_fetch(frostfs_contract):
assert (frostfs_contract / "alphabet" / "alphabet_contract.nef").exists()
def test_frostfs_bootstrap(frostfs_bootstrap):
assert len(frostfs_bootstrap) == 6
@pytest.mark.timeout(60)
def test_innerring_startup(innerring):
ir = random.choice(innerring)
block = re.compile(r'new block.*"index": \d+')
blocks_seen = 0
for line in ir.logs():
if block.search(line):
blocks_seen += 1
if blocks_seen > 3:
break
@pytest.mark.timeout(90)
def test_storage_startup(storage):
node = random.choice(storage)
block = re.compile(r'new block.*"index": \d+')
blocks_seen = 0
for line in node.logs():
if block.search(line):
blocks_seen += 1
if blocks_seen > 3:
break
@pytest.mark.timeout(90)
def test_httpgw_startup(httpgw, frostfs_adm):
dummy_cid = "Dxhf4PNprrJHWWTG5RGLdfLkJiSQ3AQqit1MSnEPRkDZ"
dummy_oid = "2m8PtaoricLouCn5zE8hAFr3gZEBDCZFe9BEgVJTSocY"
gateway = random.choice(httpgw)
rc, output = frostfs_adm.exec(f"wget -O - http://{gateway.name}/get/{dummy_cid}/{dummy_oid}")
assert rc == 1
assert "404 Not Found" in str(output)
expected = re.compile(f"{dummy_cid}.*code = 3072.*container not found")
gateway.wait(expected)