Add test for adding node to cluster

Signed-off-by: a.y.volkov <a.y.volkov@yadro.com>
This commit is contained in:
a.y.volkov 2022-08-03 18:20:50 +03:00 committed by Vladimir Domnich
parent b468a06f4e
commit f97bfed183
9 changed files with 218 additions and 30 deletions

View file

@ -1,5 +1,7 @@
#!/usr/bin/python3.9
import sys
import allure
from robot.api import logger
from robot.api.deco import keyword
@ -28,18 +30,27 @@ def tick_epoch():
# If neofs-adm is available, then we tick epoch with it (to be consistent with UAT tests)
cmd = f"{NEOFS_ADM_EXEC} morph force-new-epoch -c {NEOFS_ADM_CONFIG_PATH}"
logger.info(f"Executing shell command: {cmd}")
out = ''
err = ''
try:
out = wrappers.run_sh(cmd)
logger.info(f"Command completed with output: {out}")
except Exception as exc:
logger.error(exc)
err = str(exc)
raise RuntimeError("Failed to tick epoch") from exc
finally:
if 'allure' in sys.modules:
allure.attach((
f'COMMAND: {cmd}\n'
f'OUTPUT:\n {out}\n'
f'ERROR: {err}\n'
), 'Tick Epoch', allure.attachment_type.TEXT)
return
# Otherwise we tick epoch using transaction
cur_epoch = get_epoch()
return contract.invoke_contract_multisig(
contract.get_netmap_contract_hash(MORPH_ENDPOINT),
f"newEpoch int:{cur_epoch+1}",
f"newEpoch int:{cur_epoch + 1}",
IR_WALLET_PATH, IR_WALLET_PASS, MORPH_ENDPOINT)