From b75cfebf22962190a89fcd9f5210e20ddac21292 Mon Sep 17 00:00:00 2001 From: anastasia prasolova Date: Tue, 17 May 2022 16:54:57 +0300 Subject: [PATCH] get rid of duplicated "create container" keywords for bearer acl suites Signed-off-by: anastasia prasolova --- .../lib/robot/common_steps_acl_bearer.robot | 15 --------------- .../integration/acl/acl_bearer_allow.robot | 5 +++-- .../acl/acl_bearer_allow_storagegroup.robot | 3 ++- .../integration/acl/acl_bearer_compound.robot | 17 +++++++++-------- .../acl/acl_bearer_filter_oid_equal.robot | 5 +++-- .../acl/acl_bearer_filter_oid_not_equal.robot | 5 +++-- .../acl_bearer_filter_userheader_equal.robot | 3 ++- ...acl_bearer_filter_userheader_not_equal.robot | 5 +++-- .../acl/acl_bearer_inaccessible.robot | 6 ++++-- ...acl_bearer_request_filter_xheader_deny.robot | 5 +++-- ...cl_bearer_request_filter_xheader_equal.robot | 3 ++- ...earer_request_filter_xheader_not_equal.robot | 15 ++++++++------- 12 files changed, 42 insertions(+), 45 deletions(-) diff --git a/robot/resources/lib/robot/common_steps_acl_bearer.robot b/robot/resources/lib/robot/common_steps_acl_bearer.robot index 8a8994d..a2af7b6 100644 --- a/robot/resources/lib/robot/common_steps_acl_bearer.robot +++ b/robot/resources/lib/robot/common_steps_acl_bearer.robot @@ -1,22 +1,7 @@ *** Settings *** Variables common.py -Variables wellknown_acl.py - -Library container.py *** Keywords *** -Create Container Public - [Arguments] ${USER_KEY} - ${PUBLIC_CID_GEN} = Create container ${USER_KEY} basic_acl=${PUBLIC_ACL} - [Return] ${PUBLIC_CID_GEN} - - -Create Container Inaccessible - [Arguments] ${USER_KEY} - ${INACCESSIBLE_CID_GEN} = Create container ${USER_KEY} basic_acl=${INACCESSIBLE_ACL} - [Return] ${INACCESSIBLE_CID_GEN} - - Generate file [Arguments] ${SIZE} diff --git a/robot/testsuites/integration/acl/acl_bearer_allow.robot b/robot/testsuites/integration/acl/acl_bearer_allow.robot index 5662901..8fd0282 100644 --- a/robot/testsuites/integration/acl/acl_bearer_allow.robot +++ b/robot/testsuites/integration/acl/acl_bearer_allow.robot @@ -2,9 +2,10 @@ Variables common.py Library Collections +Library acl.py +Library container.py Library neofs.py Library neofs_verbs.py -Library acl.py Library payment_neogo.py Resource eacl_tables.robot @@ -45,7 +46,7 @@ BearerToken Operations Check eACL Deny and Allow All Bearer [Arguments] ${WALLET} ${FILE_S} - ${CID} = Create Container Public ${WALLET} + ${CID} = Create Container ${WALLET} basic_acl=eacl-public-read-write ${S_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} ${D_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL} @{S_OBJ_H} = Create List ${S_OID_USER} diff --git a/robot/testsuites/integration/acl/acl_bearer_allow_storagegroup.robot b/robot/testsuites/integration/acl/acl_bearer_allow_storagegroup.robot index d6b9a49..fc2fabe 100644 --- a/robot/testsuites/integration/acl/acl_bearer_allow_storagegroup.robot +++ b/robot/testsuites/integration/acl/acl_bearer_allow_storagegroup.robot @@ -3,6 +3,7 @@ Variables common.py Library Collections Library acl.py +Library container.py Library neofs.py Library neofs_verbs.py @@ -38,7 +39,7 @@ BearerToken Operations Check eACL Deny and Allow All Bearer [Arguments] ${RUN_TYPE} ${WALLET} ${FILE_S} - ${CID} = Create Container Public ${WALLET} + ${CID} = Create Container ${WALLET} basic_acl=eacl-public-read-write ${OID} = Put object ${WALLET} ${FILE_S} ${CID} @{OBJECTS} = Create List ${OID} diff --git a/robot/testsuites/integration/acl/acl_bearer_compound.robot b/robot/testsuites/integration/acl/acl_bearer_compound.robot index 5340af1..f8ce47c 100644 --- a/robot/testsuites/integration/acl/acl_bearer_compound.robot +++ b/robot/testsuites/integration/acl/acl_bearer_compound.robot @@ -3,6 +3,7 @@ Variables common.py Library Collections Library acl.py +Library container.py Library neofs.py Library neofs_verbs.py Library payment_neogo.py @@ -54,13 +55,13 @@ Check Сompound Operations Check Bearer Сompound Delete ${USER_WALLET} USER ${EACL_DENY_ALL_USER} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} Check Bearer Сompound Delete ${WALLET_SYS} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} - Check Bearer Сompound Get Range Hash ${OTHER_WALLET} OTHERS ${EACL_DENY_ALL_OTHERS} ${USER_WALLET} ${FILE_S} ${WALLET_SYS} + Check Bearer Сompound Get Range Hash ${OTHER_WALLET} OTHERS ${EACL_DENY_ALL_OTHERS} ${USER_WALLET} ${FILE_S} ${WALLET_SYS} Check Bearer Сompound Get Range Hash ${USER_WALLET} USER ${EACL_DENY_ALL_USER} ${USER_WALLET} ${FILE_S} ${WALLET_SYS} Check Bearer Сompound Get Range Hash ${WALLET_SYS} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${USER_WALLET} ${FILE_S} ${WALLET_SYS} Check Bearer Сompound Get [Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} - ${CID} = Create Container Public ${USER_WALLET} + ${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} ${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} @{S_OBJ_H} = Create List ${S_OID_USER} @@ -95,7 +96,7 @@ Check Bearer Сompound Get Check Bearer Сompound Delete [Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} - ${CID} = Create Container Public ${USER_WALLET} + ${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} ${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} ${D_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} @@ -130,13 +131,13 @@ Check Bearer Сompound Delete Check Bearer Сompound Get Range Hash [Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${USER_WALLET} ${FILE_S} ${WALLET_SYS} - ${CID} = Create Container Public ${USER_WALLET} + ${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} - ${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} - Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER} - Get Range hash ${WALLET_SYS} ${CID} ${S_OID_USER} ${EMPTY} 0:256 - Set eACL ${USER_WALLET} ${CID} ${DENY_EACL} + ${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} + Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER} + Get Range hash ${WALLET_SYS} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + Set eACL ${USER_WALLET} ${CID} ${DENY_EACL} # The current ACL cache lifetime is 30 sec Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT} diff --git a/robot/testsuites/integration/acl/acl_bearer_filter_oid_equal.robot b/robot/testsuites/integration/acl/acl_bearer_filter_oid_equal.robot index 0ea11ab..b1a9174 100644 --- a/robot/testsuites/integration/acl/acl_bearer_filter_oid_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_filter_oid_equal.robot @@ -2,9 +2,10 @@ Variables common.py Library Collections +Library acl.py +Library container.py Library neofs.py Library neofs_verbs.py -Library acl.py Library payment_neogo.py Resource eacl_tables.robot @@ -45,7 +46,7 @@ BearerToken Operations with Filter OID Equal Check eACL Deny and Allow All Bearer Filter OID Equal [Arguments] ${WALLET} ${FILE_S} - ${CID} = Create Container Public ${WALLET} + ${CID} = Create Container ${WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} ${S_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} ${S_OID_USER_2} = Put object ${WALLET} ${FILE_S} ${CID} diff --git a/robot/testsuites/integration/acl/acl_bearer_filter_oid_not_equal.robot b/robot/testsuites/integration/acl/acl_bearer_filter_oid_not_equal.robot index c4cc96c..1680185 100644 --- a/robot/testsuites/integration/acl/acl_bearer_filter_oid_not_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_filter_oid_not_equal.robot @@ -2,9 +2,10 @@ Variables common.py Library Collections +Library acl.py +Library container.py Library neofs.py Library neofs_verbs.py -Library acl.py Library payment_neogo.py Resource eacl_tables.robot @@ -43,7 +44,7 @@ BearerToken Operations with Filter OID NotEqual Check eACL Deny and Allow All Bearer Filter OID NotEqual [Arguments] ${WALLET} ${FILE_S} - ${CID} = Create Container Public ${WALLET} + ${CID} = Create Container ${WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} ${S_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} ${S_OID_USER_2} = Put object ${WALLET} ${FILE_S} ${CID} diff --git a/robot/testsuites/integration/acl/acl_bearer_filter_userheader_equal.robot b/robot/testsuites/integration/acl/acl_bearer_filter_userheader_equal.robot index 8498c00..6d37bbf 100644 --- a/robot/testsuites/integration/acl/acl_bearer_filter_userheader_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_filter_userheader_equal.robot @@ -3,6 +3,7 @@ Variables common.py Library Collections Library acl.py +Library container.py Library neofs.py Library neofs_verbs.py Library payment_neogo.py @@ -41,7 +42,7 @@ BearerToken Operations with Filter UserHeader Equal *** Keywords *** Check eACL Deny and Allow All Bearer Filter UserHeader Equal [Arguments] ${WALLET} ${FILE_S} - ${CID} = Create Container Public ${WALLET} + ${CID} = Create Container ${WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} ${S_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} ${S_OID_USER_2} = Put object ${WALLET} ${FILE_S} ${CID} diff --git a/robot/testsuites/integration/acl/acl_bearer_filter_userheader_not_equal.robot b/robot/testsuites/integration/acl/acl_bearer_filter_userheader_not_equal.robot index 3400cfd..00fea47 100644 --- a/robot/testsuites/integration/acl/acl_bearer_filter_userheader_not_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_filter_userheader_not_equal.robot @@ -2,9 +2,10 @@ Variables common.py Library Collections +Library acl.py +Library container.py Library neofs.py Library neofs_verbs.py -Library acl.py Library payment_neogo.py Resource common_steps_acl_bearer.robot @@ -42,7 +43,7 @@ BearerToken Operations Filter UserHeader NotEqual Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual [Arguments] ${WALLET} ${FILE_S} - ${CID} = Create Container Public ${WALLET} + ${CID} = Create Container ${WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} ${S_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER} ${S_OID_USER_2} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} diff --git a/robot/testsuites/integration/acl/acl_bearer_inaccessible.robot b/robot/testsuites/integration/acl/acl_bearer_inaccessible.robot index 564c637..8f4f4c6 100644 --- a/robot/testsuites/integration/acl/acl_bearer_inaccessible.robot +++ b/robot/testsuites/integration/acl/acl_bearer_inaccessible.robot @@ -2,9 +2,10 @@ Variables common.py Library Collections +Library acl.py +Library container.py Library neofs.py Library neofs_verbs.py -Library acl.py Library payment_neogo.py Resource eacl_tables.robot @@ -37,7 +38,8 @@ BearerToken Operations for Inaccessible Container Check Container Inaccessible and Allow All Bearer [Arguments] ${WALLET} ${FILE_S} - ${CID} = Create Container Inaccessible ${WALLET} + # 0x40000000 is inaccessible ACL + ${CID} = Create Container ${WALLET} basic_acl=0x40000000 Prepare eACL Role rules ${CID} Run Keyword And Expect Error * diff --git a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_deny.robot b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_deny.robot index 3d2caa0..7b78e79 100644 --- a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_deny.robot +++ b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_deny.robot @@ -2,9 +2,10 @@ Variables common.py Library Collections +Library acl.py +Library container.py Library neofs.py Library neofs_verbs.py -Library acl.py Library payment_neogo.py Resource eacl_tables.robot @@ -44,7 +45,7 @@ BearerToken Operations Check eACL Allow All Bearer Filter Requst Equal Deny [Arguments] ${WALLET} ${FILE_S} - ${CID} = Create Container Public ${WALLET} + ${CID} = Create Container ${WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} ${S_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} ${S_OID_USER_2} = Put object ${WALLET} ${FILE_S} ${CID} diff --git a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_equal.robot b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_equal.robot index bd50a2e..70d736e 100644 --- a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_equal.robot @@ -3,6 +3,7 @@ Variables common.py Library Collections Library acl.py +Library container.py Library neofs.py Library neofs_verbs.py Library payment_neogo.py @@ -44,7 +45,7 @@ BearerToken Operations with Filter Requst Equal Check eACL Deny and Allow All Bearer Filter Requst Equal [Arguments] ${WALLET} ${FILE_S} - ${CID} = Create Container Public ${WALLET} + ${CID} = Create Container ${WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} ${S_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} ${S_OID_USER_2} = Put object ${WALLET} ${FILE_S} ${CID} diff --git a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_not_equal.robot b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_not_equal.robot index 8df4ab9..ac72093 100644 --- a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_not_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_not_equal.robot @@ -3,6 +3,7 @@ Variables common.py Library Collections Library acl.py +Library container.py Library neofs.py Library neofs_verbs.py Library payment_neogo.py @@ -43,11 +44,11 @@ BearerToken Operations with Filter Requst NotEqual Check eACL Deny and Allow All Bearer Filter Requst NotEqual [Arguments] ${WALLET} ${FILE_S} - ${CID} = Create Container Public ${WALLET} - ${S_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} - ${S_OID_USER_2} = Put object ${WALLET} ${FILE_S} ${CID} - ${D_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL} - @{S_OBJ_H} = Create List ${S_OID_USER} + ${CID} = Create Container ${WALLET} basic_acl=eacl-public-read-write + ${S_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} + ${S_OID_USER_2} = Put object ${WALLET} ${FILE_S} ${CID} + ${D_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL} + @{S_OBJ_H} = Create List ${S_OID_USER} Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} Get object ${WALLET} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl @@ -73,7 +74,7 @@ Check eACL Deny and Allow All Bearer Filter Requst NotEqual ${EACL_TOKEN} = Form BearerToken File ${WALLET} ${CID} ${eACL_gen} Run Keyword And Expect Error * - ... Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} + ... Put object ${WALLET} ${FILE_S} ${CID} Run Keyword And Expect Error * ... Get object ${WALLET} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl #Run Keyword And Expect Error * @@ -85,7 +86,7 @@ Check eACL Deny and Allow All Bearer Filter Requst NotEqual Run Keyword And Expect Error * ... Delete object ${WALLET} ${CID} ${S_OID_USER} - Put object ${WALLET} ${FILE_S} ${CID} bearer=${EACL_TOKEN} user_headers=${USER_HEADER} options=--xhdr a=2 + Put object ${WALLET} ${FILE_S} ${CID} bearer=${EACL_TOKEN} user_headers=${USER_HEADER} options=--xhdr a=2 Get object ${WALLET} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl ${EMPTY} --xhdr a=2 Search object ${WALLET} ${CID} ${EMPTY} ${EACL_TOKEN} ${USER_HEADER} ${EMPTY} --xhdr a=2 Head object ${WALLET} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN} options=--xhdr a=2