Update testcases by result of NeoFS bug fixing.

This commit is contained in:
anatoly@nspcc.ru 2020-12-02 00:48:20 +03:00
parent 84310cbd8e
commit b032f6d447
6 changed files with 83 additions and 86 deletions

View file

@ -5,7 +5,7 @@
"action": "ALLOW", "action": "ALLOW",
"targets": [ "targets": [
{ {
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] "keys": [ "03db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000" ]
} }
] ]
}, },
@ -14,7 +14,7 @@
"action": "ALLOW", "action": "ALLOW",
"targets": [ "targets": [
{ {
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] "keys": [ "03db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000" ]
} }
] ]
}, },
@ -23,7 +23,7 @@
"action": "ALLOW", "action": "ALLOW",
"targets": [ "targets": [
{ {
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] "keys": [ "03db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000" ]
} }
] ]
}, },
@ -32,7 +32,7 @@
"action": "ALLOW", "action": "ALLOW",
"targets": [ "targets": [
{ {
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] "keys": [ "03db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000" ]
} }
] ]
}, },
@ -41,7 +41,7 @@
"action": "ALLOW", "action": "ALLOW",
"targets": [ "targets": [
{ {
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] "keys": [ "03db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000" ]
} }
] ]
}, },
@ -50,7 +50,7 @@
"action": "ALLOW", "action": "ALLOW",
"targets": [ "targets": [
{ {
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] "keys": [ "03db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000" ]
} }
] ]
}, },
@ -59,7 +59,7 @@
"action": "ALLOW", "action": "ALLOW",
"targets": [ "targets": [
{ {
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] "keys": [ "03db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000" ]
} }
] ]
}, },

View file

@ -24,7 +24,7 @@ CLI_PREFIX = ""
@keyword('Form WIF from String') @keyword('Form WIF from String')
def form_wif_from_string(private_key: str): def form_wif_from_string(private_key: str):
wif = "" wif = ""
Cmd = f'neofs-cli util keyer -u {private_key}' Cmd = f'neofs-cli util keyer {private_key}'
logger.info("Cmd: %s" % Cmd) logger.info("Cmd: %s" % Cmd)
complProc = subprocess.run(Cmd, check=True, universal_newlines=True, complProc = subprocess.run(Cmd, check=True, universal_newlines=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=150, shell=True) stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=150, shell=True)
@ -171,7 +171,7 @@ def validate_storage_policy_for_object(private_key: str, expected_copies: int, c
@keyword('Get eACL') @keyword('Get eACL')
def get_eacl(private_key: bytes, cid: str): def get_eacl(private_key: str, cid: str):
Cmd = f'neofs-cli --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} container get-eacl --cid {cid}' Cmd = f'neofs-cli --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} container get-eacl --cid {cid}'
logger.info("Cmd: %s" % Cmd) logger.info("Cmd: %s" % Cmd)
@ -1005,7 +1005,7 @@ def _search_object(node:str, private_key: str, cid:str, oid: str):
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
if re.search(r'local node is outside of object placement', e.output): if re.search(r'local node is outside of object placement', e.output):
logger.warn("Server is not presented in container.") logger.info("Server is not presented in container.")
elif ( re.search(r'timed out after 30 seconds', e.output) or re.search(r'no route to host', e.output) ): elif ( re.search(r'timed out after 30 seconds', e.output) or re.search(r'no route to host', e.output) ):
logger.warn("Node is unavailable") logger.warn("Node is unavailable")

View file

@ -31,9 +31,9 @@ BearerToken Operations
Check Bearer Check Bearer
Check Container Inaccessible and Allow All Bearer Check Container Inaccessible and Allow All Bearer
Check eACL Deny and Allow All Bearer Check eACL Deny and Allow All Bearer
Check eACL Deny and Allow All Bearer Filter OID Equal Check eACL Deny and Allow All Bearer Filter OID Equal
# Check eACL Deny and Allow All Bearer Filter OID NotEqual
# Check eACL Deny and Allow All Bearer Filter OID NotEqual
@ -210,26 +210,21 @@ Check eACL Deny and Allow All Bearer Filter OID Equal
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
# Search is allowed without filter condition.
# https://github.com/nspcc-dev/neofs-node/issues/215
Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H} Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H}
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER} ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER}
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl
# TODO: Issue - observe and validate - Do not work and with allowed search operation! # Preiodical issue: https://github.com/nspcc-dev/neofs-node/issues/225
# Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl
# Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256 Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256
# https://github.com/nspcc-dev/neofs-node/issues/215
#Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user # Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user
#Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer_allow_all_user # Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer_allow_all_user
@ -266,18 +261,31 @@ Check eACL Deny and Allow All Bearer Filter OID NotEqual
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
# Search is allowed. # Search is allowed without filter condition.
Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H}
Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER} Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER}
Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl
Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256 Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256
Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H} Run Keyword And Expect Error *
#Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user ... Get Range ${USER_KEY} ${CID} ${S_OID_USER_2} s_get_range bearer_allow_all_user 0:256
#Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer_allow_all_user
Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user
Run Keyword And Expect Error *
... Head object ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user
# https://github.com/nspcc-dev/neofs-node/issues/215
# Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer_allow_all_user
# Run Keyword And Expect Error *
# ... Delete object ${USER_KEY} ${CID} ${D_OID_USER_2} bearer_allow_all_user
# https://github.com/nspcc-dev/neofs-node/issues/215
#Check eACL Deny and Allow All Bearer Filter UserHeader Equal #Check eACL Deny and Allow All Bearer Filter UserHeader Equal
#Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual #Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual
#Check eACL Deny and Allow All Bearer for big object #Check eACL Deny and Allow All Bearer for big object

View file

@ -33,9 +33,8 @@ Check Actions
Check eACL Deny and Allow All Other Check eACL Deny and Allow All Other
Check eACL Deny and Allow All User Check eACL Deny and Allow All User
Check eACL Deny and Allow All System Check eACL Deny and Allow All System
# Issue https://github.com/nspcc-dev/neofs-node/issues/224
#https://github.com/nspcc-dev/neofs-node/issues/212 # Check eACL Deny All Other and Allow All Pubkey
#Check eACL Deny All Other and Allow All Pubkey
Check Filters Check Filters
@ -288,8 +287,8 @@ Check eACL Deny All Other and Allow All Pubkey
Get Range ${EACL_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Get Range ${EACL_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Delete object ${EACL_KEY} ${CID} ${D_OID_USER} ${EMPTY} Delete object ${EACL_KEY} ${CID} ${D_OID_USER} ${EMPTY}
Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_Pubkey} Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_Pubkey} --await
Sleep ${MORPH_BLOCK_TIMEOUT} Get eACL ${USER_KEY} ${CID}
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}

View file

@ -15,8 +15,7 @@ NeoFS Simple Netmap
Generate file Generate file
# https://github.com/nspcc-dev/neofs-api-go/issues/212 Validate Policy REP 2 IN X CBF 2 SELECT 2 FROM * AS X 2 @{EMPTY}
# Validate Policy REP 2 IN X CBF 2 SELECT 2 FROM * AS X 2 @{EMPTY}
Validate Policy REP 2 IN X CBF 1 SELECT 2 FROM * AS X 2 @{EMPTY} Validate Policy REP 2 IN X CBF 1 SELECT 2 FROM * AS X 2 @{EMPTY}
@ -24,8 +23,7 @@ NeoFS Simple Netmap
Validate Policy REP 1 IN X CBF 1 SELECT 1 FROM * AS X 1 @{EMPTY} Validate Policy REP 1 IN X CBF 1 SELECT 1 FROM * AS X 1 @{EMPTY}
# https://github.com/nspcc-dev/neofs-api-go/issues/212 Validate Policy REP 1 IN X CBF 2 SELECT 1 FROM * AS X 1 @{EMPTY}
# Validate Policy REP 1 IN X CBF 2 SELECT 1 FROM * AS X 1 @{EMPTY}
Validate Policy REP 4 IN X CBF 1 SELECT 4 FROM * AS X 4 @{EMPTY} Validate Policy REP 4 IN X CBF 1 SELECT 4 FROM * AS X 4 @{EMPTY}
@ -40,37 +38,32 @@ NeoFS Simple Netmap
@{EXPECTED} = Create List s02.neofs.devenv:8080 @{EXPECTED} = Create List s02.neofs.devenv:8080
Validate Policy REP 1 CBF 1 SELECT 1 FROM LOC_SPB FILTER City EQ 'Saint-Petersburg' AS LOC_SPB 1 @{EXPECTED} Validate Policy REP 1 CBF 1 SELECT 1 FROM LOC_SPB FILTER City EQ 'Saint-Petersburg' AS LOC_SPB 1 @{EXPECTED}
@{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080
Validate Policy REP 1 IN LOC_SPB_PLACE REP 1 IN LOC_MSK_PLACE CBF 1 SELECT 1 FROM LOC_SPB AS LOC_SPB_PLACE SELECT 1 FROM LOC_MSK AS LOC_MSK_PLACE FILTER City EQ 'Saint-Petersburg' AS LOC_SPB FILTER City EQ 'Moscow' AS LOC_MSK 2 @{EXPECTED}
# https://github.com/nspcc-dev/neofs-api-go/issues/215 @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 s03.neofs.devenv:8080 s04.neofs.devenv:8080
# @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 Validate Policy REP 4 CBF 1 SELECT 4 FROM LOC_EU FILTER Location EQ Europe AS LOC_EU 4 @{EXPECTED}
# Validate Policy REP 1 IN LOC_SPB_PLACE REP 1 IN LOC_MSK_PLACE CBF 1 SELECT 1 FROM LOC_SPB AS LOC_SPB_PLACE SELECT 1 FROM LOC_MSK AS LOC_MSK_PLACE FILTER City EQ 'Saint-Petersburg' AS LOC_SPB FILTER City EQ 'Moscow' AS LOC_MSK 2 @{EXPECTED}
# https://github.com/nspcc-dev/neofs-api-go/issues/213
# @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 s03.neofs.devenv:8080 s04.neofs.devenv:8080
# Validate Policy REP 4 CBF 1 SELECT 4 FROM LOC_EU FILTER Location EQ Europe AS LOC_EU 4 @{EXPECTED}
@{EXPECTED} = Create List s02.neofs.devenv:8080 @{EXPECTED} = Create List s02.neofs.devenv:8080
Validate Policy REP 1 CBF 1 SELECT 1 FROM LOC_SPB FILTER City NE 'Moscow' AND City NE 'Stockholm' AND City NE 'Helsinki' AS LOC_SPB 1 @{EXPECTED} Validate Policy REP 1 CBF 1 SELECT 1 FROM LOC_SPB FILTER City NE 'Moscow' AND City NE 'Stockholm' AND City NE 'Helsinki' AS LOC_SPB 1 @{EXPECTED}
# https://github.com/nspcc-dev/neofs-api-go/issues/213 @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080
# @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_RU FILTER City NE 'Stockholm' AND City NE 'Helsinki' AS LOC_RU 2 @{EXPECTED}
# Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_RU FILTER City NE 'Stockholm' AND City NE 'Helsinki' AS LOC_RU 2 @{EXPECTED}
@{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080
Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_RU FILTER Country EQ 'Russia' AS LOC_RU 2 @{EXPECTED}
# https://github.com/nspcc-dev/neofs-api-go/issues/214 @{EXPECTED} = Create List s03.neofs.devenv:8080 s04.neofs.devenv:8080
# @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_EU FILTER Country NE 'Russia' AS LOC_EU 2 @{EXPECTED}
# Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_RU FILTER Country EQ 'Russia' AS LOC_RU 2 @{EXPECTED}
Log Put operation should be failed with error "not enough nodes to SELECT from: 'X'"
Run Keyword And Expect Error *
... Validate Policy REP 2 IN X CBF 2 SELECT 6 FROM * AS X 2 @{EMPTY}
# https://github.com/nspcc-dev/neofs-api-go/issues/214
# @{EXPECTED} = Create List s03.neofs.devenv:8080 s04.neofs.devenv:8080
# Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_EU FILTER Country NE 'Russia' AS LOC_EU 2 @{EXPECTED}
# Log Operation should be failed with container rule "RF 1 SELECT 6 Node"
# ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 1 SELECT 6 Node
*** Keywords *** *** Keywords ***
Generate file Generate file
${FILE} = Generate file of bytes 1024 ${FILE} = Generate file of bytes 1024
Set Global Variable ${FILE} ${FILE} Set Global Variable ${FILE} ${FILE}
@ -111,5 +104,5 @@ Validate Policy
Container Existing ${PRIV_KEY} ${CID} Container Existing ${PRIV_KEY} ${CID}
${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY}
Validate storage policy for object ${PRIV_KEY} ${EXPECTED_VAL} ${CID} ${S_OID} @{EXPECTED_LIST} Validate storage policy for object ${PRIV_KEY} ${EXPECTED_VAL} ${CID} ${S_OID} @{EXPECTED_LIST}
# Can be on each of nodes

View file

@ -10,7 +10,7 @@ ${FILE_USR_HEADER_OTH} = key1=2
*** Test cases *** *** Test cases ***
NeoFS Simple Object Operations NeoFS Complex Object Operations
[Documentation] Testcase to validate NeoFS operations with simple object. [Documentation] Testcase to validate NeoFS operations with simple object.
[Tags] Object NeoFS NeoCLI [Tags] Object NeoFS NeoCLI
[Timeout] 20 min [Timeout] 20 min
@ -60,16 +60,14 @@ NeoFS Simple Object Operations
# @{Full_obj_list} = Create List @{Link_obj_S} @{Link_obj_H} ${S_OID} ${H_OID} # @{Full_obj_list} = Create List @{Link_obj_S} @{Link_obj_H} ${S_OID} ${H_OID}
# Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{Full_obj_list} # Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{Full_obj_list}
Run Keyword And Expect Error *
... Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_ALL}
@{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} ${H_OID_OTH} @{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} ${H_OID_OTH}
@{S_OBJ_H} = Create List ${H_OID} @{S_OBJ_H} = Create List ${H_OID}
@{S_OBJ_H_OTH} = Create List ${H_OID_OTH} @{S_OBJ_H_OTH} = Create List ${H_OID_OTH}
Run Keyword And Expect Error *
... Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_ALL}
Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read
Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read
@ -106,7 +104,6 @@ NeoFS Simple Object Operations
Cleanup File s_get_range Cleanup File s_get_range
Cleanup File h_get_range Cleanup File h_get_range
# 4.86192020