Merge pull request #1 from nspcc-dev/feature/update_steps_216_and_223

Update testcases by result of NeoFS bug fixing
This commit is contained in:
anatoly-bogatyrev 2020-12-02 11:35:57 +03:00 committed by GitHub
commit ee4c775ef4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 83 additions and 155 deletions

View file

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

View file

@ -1,68 +0,0 @@
{
"records": [
{
"operation": "GET",
"action": "DENY",
"targets": [
{
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ]
}
]
},
{
"operation": "HEAD",
"action": "DENY",
"targets": [
{
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ]
}
]
},
{
"operation": "PUT",
"action": "DENY",
"targets": [
{
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ]
}
]
},
{
"operation": "DELETE",
"action": "DENY",
"targets": [
{
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ]
}
]
},
{
"operation": "SEARCH",
"action": "DENY",
"targets": [
{
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ]
}
]
},
{
"operation": "GETRANGE",
"action": "DENY",
"targets": [
{
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ]
}
]
},
{
"operation": "GETRANGEHASH",
"action": "DENY",
"targets": [
{
"keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ]
}
]
}
]
}

View file

@ -24,7 +24,7 @@ CLI_PREFIX = ""
@keyword('Form WIF from String')
def form_wif_from_string(private_key: str):
wif = ""
Cmd = f'neofs-cli util keyer -u {private_key}'
Cmd = f'neofs-cli util keyer {private_key}'
logger.info("Cmd: %s" % Cmd)
complProc = subprocess.run(Cmd, check=True, universal_newlines=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')
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}'
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:
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) ):
logger.warn("Node is unavailable")

View file

@ -31,9 +31,9 @@ BearerToken Operations
Check Bearer
Check Container Inaccessible 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 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 *
... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
# https://github.com/nspcc-dev/neofs-node/issues/215
# Search is allowed without filter condition.
Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H}
Run Keyword And Expect Error *
... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER}
Run Keyword And Expect Error *
... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl
# 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 Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256
# TODO: Issue - observe and validate - Do not work and with allowed search operation!
# 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
#Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user
#Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer_allow_all_user
# https://github.com/nspcc-dev/neofs-node/issues/215
# Head object ${USER_KEY} ${CID} ${S_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 *
... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
# Search is allowed.
Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER}
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} bearer_allow_all_user local_file_eacl
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256
# Search is allowed without filter condition.
Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H}
#Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user
#Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer_allow_all_user
# https://github.com/nspcc-dev/neofs-node/issues/215
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 *
... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256
Run Keyword And Expect Error *
... Get Range ${USER_KEY} ${CID} ${S_OID_USER_2} s_get_range bearer_allow_all_user 0:256
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
#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 for big object

View file

@ -33,9 +33,7 @@ Check Actions
Check eACL Deny and Allow All Other
Check eACL Deny and Allow All User
Check eACL Deny and Allow All System
#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
@ -288,8 +286,8 @@ Check eACL Deny All Other and Allow All Pubkey
Get Range ${EACL_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Delete object ${EACL_KEY} ${CID} ${D_OID_USER} ${EMPTY}
Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_Pubkey}
Sleep ${MORPH_BLOCK_TIMEOUT}
Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_Pubkey} --await
Get eACL ${USER_KEY} ${CID}
Run Keyword And Expect Error *
... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
@ -309,7 +307,7 @@ Check eACL Deny All Other and Allow All Pubkey
Search object ${EACL_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H}
Head object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY}
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} ${S_OID_USER} ${EMPTY}
Check eACL Deny and Allow All

View file

@ -15,60 +15,53 @@ NeoFS Simple Netmap
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}
Validate Policy REP 3 IN X CBF 1 SELECT 3 FROM * AS X 3 @{EMPTY}
Validate Policy REP 3 IN X CBF 1 SELECT 3 FROM * AS X 3 @{EMPTY}
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}
Validate Policy REP 2 IN X CBF 1 SELECT 4 FROM * AS X 2 @{EMPTY}
Validate Policy REP 2 IN X CBF 1 SELECT 4 FROM * AS X 2 @{EMPTY}
@{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 s03.neofs.devenv:8080 s04.neofs.devenv:8080
Validate Policy REP 4 IN X CBF 1 SELECT 4 FROM * AS X 4 @{EXPECTED}
@{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 s03.neofs.devenv:8080 s04.neofs.devenv:8080
Validate Policy REP 4 IN X CBF 1 SELECT 4 FROM * AS X 4 @{EXPECTED}
@{EXPECTED} = Create List s03.neofs.devenv:8080
Validate Policy REP 1 IN LOC_PLACE CBF 1 SELECT 1 FROM LOC_SW AS LOC_PLACE FILTER Country EQ Sweden AS LOC_SW 1 @{EXPECTED}
@{EXPECTED} = Create List s03.neofs.devenv:8080
Validate Policy REP 1 IN LOC_PLACE CBF 1 SELECT 1 FROM LOC_SW AS LOC_PLACE FILTER Country EQ Sweden AS LOC_SW 1 @{EXPECTED}
@{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}
@{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}
@{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
# 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}
@{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}
# 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
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}
@{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}
@{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}
# https://github.com/nspcc-dev/neofs-api-go/issues/213
# @{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}
@{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 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
# 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
@{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 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}
*** Keywords ***
*** Keywords ***
Generate file
@ -111,5 +104,5 @@ Validate Policy
Container Existing ${PRIV_KEY} ${CID}
${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}
# Can be on each of nodes

View file

@ -10,7 +10,7 @@ ${FILE_USR_HEADER_OTH} = key1=2
*** Test cases ***
NeoFS Simple Object Operations
NeoFS Complex Object Operations
[Documentation] Testcase to validate NeoFS operations with simple object.
[Tags] Object NeoFS NeoCLI
[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}
# 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_H} = Create List ${H_OID}
@{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} ${H_OID} ${EMPTY} h_file_read
@ -106,8 +104,7 @@ NeoFS Simple Object Operations
Cleanup File s_get_range
Cleanup File h_get_range
# 4.86192020