Replace prepare_container*** fixtures with a function.

The change is motivated by variety of standard ACLs that will be hard to manage with set of fixtures.

Remove logic that initializes wallet from remote devenv host.
This setup action should be handled outside tests.

Add ability to establish SSH connection using SSH key instead of password.

Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
This commit is contained in:
Vladimir Domnich 2022-07-12 13:59:19 +04:00 committed by Anastasia Prasolova
parent ffa40112a1
commit 84230d12e3
11 changed files with 142 additions and 199 deletions

View file

@ -1,32 +1,20 @@
#!/usr/bin/python3.9
import contract
import sys
from robot.api import logger
from robot.api.deco import keyword
from robot.libraries.BuiltIn import BuiltIn
from common import IR_WALLET_PATH, IR_WALLET_PASS, MORPH_ENDPOINT
ROBOT_AUTO_KEYWORDS = False
if "pytest" in sys.modules:
import os
IR_WALLET_PATH = os.getenv("IR_WALLET_PATH")
IR_WALLET_PASS = os.getenv("IR_WALLET_PASS")
SIDECHAIN_EP = os.getenv("MORPH_ENDPOINT")
else:
IR_WALLET_PATH = BuiltIn().get_variable_value("${IR_WALLET_PATH}")
IR_WALLET_PASS = BuiltIn().get_variable_value("${IR_WALLET_PASS}")
SIDECHAIN_EP = BuiltIn().get_variable_value("${MORPH_ENDPOINT}")
@keyword('Get Epoch')
def get_epoch():
epoch = int(contract.testinvoke_contract(
contract.get_netmap_contract_hash(SIDECHAIN_EP),
'epoch',
SIDECHAIN_EP)
contract.get_netmap_contract_hash(MORPH_ENDPOINT),
"epoch",
MORPH_ENDPOINT)
)
logger.info(f"Got epoch {epoch}")
return epoch
@ -36,6 +24,6 @@ def get_epoch():
def tick_epoch():
cur_epoch = get_epoch()
return contract.invoke_contract_multisig(
contract.get_netmap_contract_hash(SIDECHAIN_EP),
contract.get_netmap_contract_hash(MORPH_ENDPOINT),
f"newEpoch int:{cur_epoch+1}",
IR_WALLET_PATH, IR_WALLET_PASS, SIDECHAIN_EP)
IR_WALLET_PATH, IR_WALLET_PASS, MORPH_ENDPOINT)