forked from TrueCloudLab/frostfs-testcases
Config file optimized (#50)
* With all envvar added. * neofs_int_vars.py deleted * Variables put in common.py * Variables put in common.py * Update common.py * Update common.py * Update common.py * Update common.py * Update common.py * Update common.py * Update common.py
This commit is contained in:
parent
7a4ca9b7cc
commit
f72f1c6bbf
8 changed files with 35 additions and 169 deletions
22
README.md
22
README.md
|
@ -89,28 +89,6 @@ The following UserScenarios and testcases are available for execution:
|
|||
* s3_gate.robot
|
||||
|
||||
|
||||
## Smoke test execution
|
||||
|
||||
There is a suite with smoke tests for CDN gates `robot/testsuites/smoke/selectelcdn_smoke.robot`.
|
||||
|
||||
By default, keywords use variables from a file `robot/resources/lib/neofs_int_vars.py`.
|
||||
```
|
||||
robot --outputdir artifacts/ robot/testsuites/smoke/selectelcdn_smoke.robot
|
||||
```
|
||||
|
||||
### Initial preparation
|
||||
|
||||
1. It requires separate variables, unlike the NeoFS suites, which run on
|
||||
dev-env. In order for the keyword libraries to use them, you need to set the environment variable
|
||||
```
|
||||
export ROBOT_PROFILE=selectel_smoke
|
||||
```
|
||||
|
||||
Dev-env is not needed. But you need to install neo-go.
|
||||
|
||||
2. To run smoke test: `robot --outputdir artifacts/ robot/testsuites/smoke/selectelcdn_smoke.robot`
|
||||
|
||||
|
||||
## Generation of documentation
|
||||
|
||||
To generate Keywords documentation:
|
||||
|
|
|
@ -15,16 +15,11 @@ from robot.api import logger
|
|||
import robot.errors
|
||||
from robot.libraries.BuiltIn import BuiltIn
|
||||
|
||||
from common import *
|
||||
|
||||
|
||||
ROBOT_AUTO_KEYWORDS = False
|
||||
|
||||
if os.getenv('ROBOT_PROFILE') == 'selectel_smoke':
|
||||
from selectelcdn_smoke_vars import (NEOGO_CLI_PREFIX, NEO_MAINNET_ENDPOINT,
|
||||
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, HTTP_GATE, S3_GATE)
|
||||
else:
|
||||
from neofs_int_vars import (NEOGO_CLI_PREFIX, NEO_MAINNET_ENDPOINT,
|
||||
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, HTTP_GATE, S3_GATE)
|
||||
|
||||
CDNAUTH_EXEC = os.getenv('CDNAUTH_EXEC', 'cdn-authmate')
|
||||
|
||||
@keyword('Init S3 Credentials')
|
||||
|
|
|
@ -19,13 +19,7 @@ import shutil
|
|||
import time
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
if os.getenv('ROBOT_PROFILE') == 'selectel_smoke':
|
||||
from selectelcdn_smoke_vars import (NEOGO_CLI_PREFIX, NEO_MAINNET_ENDPOINT,
|
||||
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, NEOFS_NETMAP, TEMP_DIR)
|
||||
else:
|
||||
from neofs_int_vars import (NEOGO_CLI_PREFIX, NEO_MAINNET_ENDPOINT,
|
||||
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, NEOFS_NETMAP, TEMP_DIR)
|
||||
from common import *
|
||||
|
||||
ROBOT_AUTO_KEYWORDS = False
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
NEOFS_ENDPOINT = "s01.neofs.devenv:8080"
|
||||
NEOGO_CLI_PREFIX = "docker exec -it main_chain neo-go"
|
||||
NEO_MAINNET_ENDPOINT = "http://main_chain.neofs.devenv:30333"
|
||||
|
||||
NEOFS_NEO_API_ENDPOINT = 'http://morph_chain.neofs.devenv:30333'
|
||||
HTTP_GATE = 'http://http.neofs.devenv'
|
||||
S3_GATE = 'https://s3.neofs.devenv:8080'
|
||||
NEOFS_NETMAP = ['s01.neofs.devenv:8080', 's02.neofs.devenv:8080','s03.neofs.devenv:8080','s04.neofs.devenv:8080']
|
||||
|
||||
GAS_HASH = '0xd2a4cff31913016155e38e474a2c06d08be276cf'
|
||||
NEOFS_CONTRACT = "1e6d8b8e1a7c976649dc630062d8b281cb9c2615"
|
||||
DEF_WALLET_ADDR = "NVUzCUvrbuWadAm6xBoyZ2U7nCmS9QBZtb"
|
||||
TEMP_DIR = "TemporaryDir/"
|
|
@ -15,16 +15,10 @@ from robot.api import logger
|
|||
import robot.errors
|
||||
from robot.libraries.BuiltIn import BuiltIn
|
||||
|
||||
from common import *
|
||||
|
||||
ROBOT_AUTO_KEYWORDS = False
|
||||
|
||||
|
||||
if os.getenv('ROBOT_PROFILE') == 'selectel_smoke':
|
||||
from selectelcdn_smoke_vars import (NEO_MAINNET_ENDPOINT,
|
||||
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, GAS_HASH, NEOFS_CONTRACT, TEMP_DIR)
|
||||
else:
|
||||
from neofs_int_vars import (NEO_MAINNET_ENDPOINT,
|
||||
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, GAS_HASH, NEOFS_CONTRACT, TEMP_DIR)
|
||||
|
||||
# path to neofs-cli executable
|
||||
NEOFS_CLI_EXEC = os.getenv('NEOFS_CLI_EXEC', 'neofs-cli')
|
||||
NEOGO_CLI_EXEC = os.getenv('NEOGO_CLI_EXEC', 'neo-go')
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
NEOFS_ENDPOINT = "92.53.71.51:18080"
|
||||
NEOGO_CLI_PREFIX = "neo-go"
|
||||
NEO_MAINNET_ENDPOINT = "http://92.53.71.51:20332"
|
||||
|
||||
# selectel main chain on lobachevsky-1
|
||||
NEOFS_NEO_API_ENDPOINT = "http://92.53.71.51:20332"
|
||||
HTTP_GATE = 'http://92.53.71.51:38080'
|
||||
S3_GATE = 'https://92.53.71.51:28080'
|
||||
NEOFS_NETMAP = ['92.53.71.51:18080', '92.53.71.52:18080','92.53.71.53:18080','92.53.71.54:18080', '92.53.71.55:18080']
|
||||
|
||||
GAS_HASH = '668e0c1f9d7b70a99dd9e06eadd4c784d641afbc'
|
||||
NEOFS_CONTRACT = "ce96811ca25577c058484dab10dd8db2defc5eed"
|
|
@ -1,92 +0,0 @@
|
|||
# -*- coding: robot -*-
|
||||
|
||||
*** Settings ***
|
||||
Variables ../../variables/common.py
|
||||
|
||||
|
||||
Library Collections
|
||||
Library ${RESOURCES}/neofs.py
|
||||
Library ${RESOURCES}/payment_neogo.py
|
||||
Library ${RESOURCES}/gates.py
|
||||
|
||||
|
||||
*** Variables ***
|
||||
# wallet that has assets in selectel mainnet
|
||||
${WALLET_ROOT} = wallets/selectel_mainnet_wallet.json
|
||||
|
||||
|
||||
*** Test cases ***
|
||||
|
||||
NeoFS Storage Smoke
|
||||
[Documentation] Creates container and does PUT, GET and LIST on it via CLI and via HTTP Gate
|
||||
[Timeout] 5 min
|
||||
|
||||
# user.key, container owner
|
||||
${PRIV_KEY} = Form WIF from String 1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb
|
||||
|
||||
${WALLET} = Init wallet
|
||||
|
||||
Generate wallet from WIF ${WALLET} ${PRIV_KEY}
|
||||
${ADDR} = Dump Address ${WALLET}
|
||||
Dump PrivKey ${WALLET} ${ADDR}
|
||||
${SCRIPT_HASH} = Get ScriptHash ${PRIV_KEY}
|
||||
|
||||
|
||||
|
||||
${TX} = Transfer Mainnet Gas ${WALLET_ROOT} NbTiM6h8r99kpRtb428XcsUk1TzKed2gTc ${ADDR} 2 one
|
||||
Wait Until Keyword Succeeds 2 min 15 sec
|
||||
... Transaction accepted in block ${TX}
|
||||
|
||||
Get Transaction ${TX}
|
||||
|
||||
|
||||
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 1
|
||||
Wait Until Keyword Succeeds 1 min 15 sec
|
||||
... Transaction accepted in block ${TX_DEPOSIT}
|
||||
Get Transaction ${TX_DEPOSIT}
|
||||
Get Balance ${PRIV_KEY}
|
||||
|
||||
${CID}
|
||||
... ${BUCKET}
|
||||
... ${ACCESS_KEY_ID}
|
||||
... ${SEC_ACCESS_KEY}
|
||||
... ${OWNER_PRIV_KEY} = Init S3 Credentials ${PRIV_KEY} keys/s3_selectel_hcs.pub.key
|
||||
|
||||
${S3_CLIENT} = Config S3 client ${ACCESS_KEY_ID} ${SEC_ACCESS_KEY}
|
||||
|
||||
|
||||
|
||||
${CONTEINERS_LIST} = Container List ${PRIV_KEY}
|
||||
List Should Contain Value ${CONTEINERS_LIST} ${CID}
|
||||
|
||||
${FILE_S3} = Generate file of bytes ${SIMPLE_OBJ_SIZE}
|
||||
${FILE_S3_HASH} = Get file hash ${FILE_S3}
|
||||
${FILE_S3_NAME} = Get file name ${FILE_S3}
|
||||
|
||||
${FILE_FS} = Generate file of bytes ${SIMPLE_OBJ_SIZE}
|
||||
${FILE_FS_HASH} = Get file hash ${FILE_FS}
|
||||
${FILE_FS_NAME} = Get file name ${FILE_FS}
|
||||
|
||||
${OID_FS} = Put object ${PRIV_KEY} ${FILE_FS} ${CID} ${EMPTY} ${EMPTY}
|
||||
Put object S3 ${S3_CLIENT} ${BUCKET} ${FILE_S3}
|
||||
|
||||
${OID_LIST_S3} = Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} FileName=${FILE_S3_NAME}
|
||||
${OID_S3} = Get From List ${OID_LIST_S3} 0
|
||||
|
||||
Get object ${PRIV_KEY} ${CID} ${OID_FS} ${EMPTY} s_file_read
|
||||
Get object S3 ${S3_CLIENT} ${BUCKET} ${FILE_FS_NAME} fs_obj_get_s3
|
||||
${FILEPATH_FS} = Get via HTTP Gate ${CID} ${OID_FS}
|
||||
|
||||
Verify file hash fs_obj_get_s3 ${FILE_FS_HASH}
|
||||
Verify file hash s_file_read ${FILE_FS_HASH}
|
||||
Verify file hash ${FILEPATH_FS} ${FILE_FS_HASH}
|
||||
|
||||
Get object ${PRIV_KEY} ${CID} ${OID_S3} ${EMPTY} s_file_read
|
||||
Get object S3 ${S3_CLIENT} ${BUCKET} ${FILE_S3_NAME} s3_obj_get_s3
|
||||
${FILEPATH_S3} = Get via HTTP Gate ${CID} ${OID_S3}
|
||||
|
||||
Verify file hash s3_obj_get_s3 ${FILE_S3_HASH}
|
||||
Verify file hash s_file_read ${FILE_S3_HASH}
|
||||
Verify file hash ${FILEPATH_S3} ${FILE_S3_HASH}
|
||||
|
||||
[Teardown] Cleanup Files
|
|
@ -1,10 +1,10 @@
|
|||
#!/usr/bin/python3
|
||||
import os
|
||||
|
||||
ROOT='../..'
|
||||
|
||||
RESOURCES="%s/resources/lib" % ROOT
|
||||
CERT="%s/../../ca" % ROOT
|
||||
|
||||
# path from repo root is required for object put and get
|
||||
# in case when test is run from root in docker
|
||||
ABSOLUTE_FILE_PATH="/robot/testsuites/integration"
|
||||
|
@ -13,13 +13,39 @@ MAINNET_WALLET_PATH = "wallets/wallet.json"
|
|||
NEOFS_CONTRACT_DEPOSIT_GAS_FEE = 0.1679897
|
||||
NEOFS_CONTRACT_WITHDRAW_GAS_FEE = 0.0382514
|
||||
NEOFS_CREATE_CONTAINER_GAS_FEE = -1e-08
|
||||
NEOFS_EPOCH_TIMEOUT = "5min"
|
||||
BASENET_BLOCK_TIME = "15s"
|
||||
# NEOFS_EPOCH_TIMEOUT can be declared from neofs-dev-env env variables as NEOFS_IR_TIMERS_EPOCH
|
||||
# (high priority is accepted for env as NEOFS_EPOCH_TIMEOUT)
|
||||
NEOFS_EPOCH_TIMEOUT = (os.getenv("NEOFS_EPOCH_TIMEOUT") if os.getenv("NEOFS_EPOCH_TIMEOUT")
|
||||
else os.getenv("NEOFS_IR_TIMERS_EPOCH", "300s"))
|
||||
BASENET_BLOCK_TIME = os.getenv('BASENET_BLOCK_TIME', "15s")
|
||||
BASENET_WAIT_TIME = "1min"
|
||||
MORPH_BLOCK_TIME = "1s"
|
||||
MORPH_BLOCK_TIME = os.getenv("MORPH_BLOCK_TIME", '1s')
|
||||
NEOFS_CONTRACT_CACHE_TIMEOUT = "30s"
|
||||
NEOFS_IR_WIF = "KxyjQ8eUa4FHt3Gvioyt1Wz29cTUrE4eTqX3yFSk1YFCsPL8uNsY"
|
||||
NEOFS_SN_WIF = "Kwk6k2eC3L3QuPvD8aiaNyoSXgQ2YL1bwS5CP1oKoA9waeAze97s"
|
||||
DEF_WALLET_ADDR = "NVUzCUvrbuWadAm6xBoyZ2U7nCmS9QBZtb"
|
||||
SIMPLE_OBJ_SIZE = 1024
|
||||
COMPLEX_OBJ_SIZE = 70000000
|
||||
|
||||
NEOFS_ENDPOINT = "s01.neofs.devenv:8080"
|
||||
NEOGO_CLI_PREFIX = "docker exec -it main_chain neo-go"
|
||||
# NEO_MAINNET_ENDPOINT can be declared from neofs-dev-env env variables as NEOFS_IR_MAINNET_ENDPOINT_CLIENT
|
||||
# (high priority is accepted for env as NEO_MAINNET_ENDPOINT)
|
||||
NEO_MAINNET_ENDPOINT = (os.getenv("NEO_MAINNET_ENDPOINT") if os.getenv("NEO_MAINNET_ENDPOINT")
|
||||
else os.getenv("NEOFS_IR_MAINNET_ENDPOINT_CLIENT", 'http://main_chain.neofs.devenv:30333'))
|
||||
|
||||
# NEOFS_NEO_API_ENDPOINT can be declared from neofs-dev-env env variables as NEOFS_IR_MORPH_ENDPOINT_CLIENT
|
||||
# (high priority is accepted for env as NEOFS_NEO_API_ENDPOINT)
|
||||
NEOFS_NEO_API_ENDPOINT = (os.getenv("NEOFS_NEO_API_ENDPOINT") if os.getenv("NEOFS_NEO_API_ENDPOINT")
|
||||
else os.getenv("NEOFS_IR_MORPH_ENDPOINT_CLIENT", 'http://morph_chain.neofs.devenv:30333'))
|
||||
HTTP_GATE = 'http://http.neofs.devenv'
|
||||
S3_GATE = 'https://s3.neofs.devenv:8080'
|
||||
NEOFS_NETMAP = ['s01.neofs.devenv:8080', 's02.neofs.devenv:8080','s03.neofs.devenv:8080','s04.neofs.devenv:8080']
|
||||
|
||||
GAS_HASH = '0xd2a4cff31913016155e38e474a2c06d08be276cf'
|
||||
|
||||
# NEOFS_CONTRACT can be declared from neofs-dev-env env variables as NEOFS_IR_CONTRACTS_NEOFS
|
||||
# (high priority is accepted for env as NEOFS_CONTRACT)
|
||||
NEOFS_CONTRACT = (os.getenv("NEOFS_CONTRACT") if os.getenv("NEOFS_CONTRACT")
|
||||
else os.getenv("NEOFS_IR_CONTRACTS_NEOFS", '1e6d8b8e1a7c976649dc630062d8b281cb9c2615'))
|
||||
TEMP_DIR = "TemporaryDir/"
|
||||
|
|
Loading…
Reference in a new issue