Skip to content

Commit

Permalink
HDDS-11702. Merge test_bucket_encryption into robot compatibility test (
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroszlai authored Nov 21, 2024
1 parent d6a5488 commit f4a9ee0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 58 deletions.
2 changes: 1 addition & 1 deletion hadoop-ozone/dist/src/main/compose/testlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ execute_robot_test(){
# shellcheck disable=SC2068
docker-compose exec -T "$CONTAINER" mkdir -p "$RESULT_DIR_INSIDE" \
&& docker-compose exec -T "$CONTAINER" robot \
-v KEY_NAME:"${OZONE_BUCKET_KEY_NAME}" \
-v ENCRYPTION_KEY:"${OZONE_BUCKET_KEY_NAME}" \
-v OM_HA_PARAM:"${OM_HA_PARAM}" \
-v OM_SERVICE_ID:"${OM_SERVICE_ID:-om}" \
-v OZONE_DIR:"${OZONE_DIR}" \
Expand Down
13 changes: 3 additions & 10 deletions hadoop-ozone/dist/src/main/compose/xcompat/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ _kinit() {
}

_init() {
container=scm
_kinit
execute_command_in_container ${container} ozone freon ockg -n1 -t1 -p warmup
}
Expand All @@ -74,29 +75,21 @@ _read() {
compatibility/read.robot
}

test_bucket_encryption() {
_kinit
execute_robot_test ${container} -N "xcompat-cluster-${cluster_version}-client-${client_version}" -v SUFFIX:${client_version} security/bucket-encryption.robot
}

test_cross_compatibility() {
echo "Starting ${cluster_version} cluster with COMPOSE_FILE=${COMPOSE_FILE}"

OZONE_KEEP_RESULTS=true start_docker_env

execute_command_in_container kms hadoop key create ${OZONE_BUCKET_KEY_NAME}
new_client test_bucket_encryption

container=scm _kinit
execute_command_in_container scm ozone freon ockg -n1 -t1 -p warmup
_init

new_client _write
new_client _read ${current_version}

for client_version in "$@"; do
client="old_client_${client_version//./_}"

old_client test_bucket_encryption

old_client _write
old_client _read ${client_version}

Expand Down
3 changes: 3 additions & 0 deletions hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ ${SUFFIX} ${EMPTY}
Key Can Be Read
Key Should Match Local File /vol1/bucket1/key-${SUFFIX} ${TESTFILE}

Encrypted Key Can Be Read
Key Should Match Local File /vol1/encrypted-${SUFFIX}/key ${TESTFILE}

Dir Can Be Listed
Execute ozone fs -ls o3fs://bucket1.vol1/dir-${SUFFIX}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@ Suite Setup Create Local Test File

*** Variables ***
${SUFFIX} ${EMPTY}
${ENCRYPTION_KEY} key1


*** Test Cases ***
Create Encrypted Bucket
Execute ozone sh bucket create -k ${ENCRYPTION_KEY} /vol1/encrypted-${SUFFIX}

Create Key in Encrypted Bucket
Execute ozone sh key put /vol1/encrypted-${SUFFIX}/key ${TESTFILE}

Key Can Be Written
Create Key /vol1/bucket1/key-${SUFFIX} ${TESTFILE}

Expand Down
4 changes: 2 additions & 2 deletions hadoop-ozone/dist/src/main/smoketest/s3/commonawslib.robot
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ${OZONE_S3_HEADER_VERSION} v4
${OZONE_S3_SET_CREDENTIALS} true
${BUCKET} generated
${BUCKET_LAYOUT} OBJECT_STORE
${KEY_NAME} key1
${ENCRYPTION_KEY} key1
${OZONE_S3_TESTS_SET_UP} ${FALSE}
${OZONE_AWS_ACCESS_KEY_ID} ${EMPTY}
${OZONE_S3_ADDRESS_STYLE} path
Expand Down Expand Up @@ -156,7 +156,7 @@ Create encrypted bucket
Return From Keyword if '${SECURITY_ENABLED}' == 'false'
${exists} = Bucket Exists o3://${OM_SERVICE_ID}/s3v/encrypted
Return From Keyword If ${exists}
Execute ozone sh bucket create -k ${KEY_NAME} --layout ${BUCKET_LAYOUT} o3://${OM_SERVICE_ID}/s3v/encrypted
Execute ozone sh bucket create -k ${ENCRYPTION_KEY} --layout ${BUCKET_LAYOUT} o3://${OM_SERVICE_ID}/s3v/encrypted

Create link
[arguments] ${bucket}
Expand Down

This file was deleted.

0 comments on commit f4a9ee0

Please sign in to comment.