Skip to content

Commit

Permalink
HDDS-11134. Create compatibility test for FSO bucket usage (apache#7350)
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroszlai authored Oct 28, 2024
1 parent 30906d1 commit 7a27db2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
18 changes: 14 additions & 4 deletions hadoop-ozone/dist/src/main/compose/xcompat/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ COMPOSE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export COMPOSE_DIR
basename=$(basename ${COMPOSE_DIR})

current_version="${ozone.version}"
# version is used in bucket name, which does not allow uppercase
current_version="$(echo "${ozone.version}" | sed -e 's/-SNAPSHOT//' | tr '[:upper:]' '[:lower:]')"
# TODO: debug acceptance test failures for client versions 1.0.0 on secure clusters
old_versions="1.1.0 1.2.1 1.3.0 1.4.0" # container is needed for each version in clients.yaml

Expand Down Expand Up @@ -55,13 +56,22 @@ _init() {

_write() {
_kinit
execute_robot_test ${container} -N "xcompat-cluster-${cluster_version}-client-${client_version}-write" -v SUFFIX:${client_version} compatibility/write.robot
execute_robot_test ${container} -N "xcompat-cluster-${cluster_version}-client-${client_version}-write" \
-v CLIENT_VERSION:${client_version} \
-v CLUSTER_VERSION:${cluster_version} \
-v SUFFIX:${client_version} \
compatibility/write.robot
}

_read() {
_kinit
local data_version="$1"
execute_robot_test ${container} -N "xcompat-cluster-${cluster_version}-client-${client_version}-read-${data_version}" -v SUFFIX:${data_version} compatibility/read.robot
execute_robot_test ${container} -N "xcompat-cluster-${cluster_version}-client-${client_version}-read-${data_version}" \
-v CLIENT_VERSION:${client_version} \
-v CLUSTER_VERSION:${cluster_version} \
-v DATA_VERSION:${data_version} \
-v SUFFIX:${data_version} \
compatibility/read.robot
}

test_bucket_encryption() {
Expand All @@ -70,7 +80,7 @@ test_bucket_encryption() {
}

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

OZONE_KEEP_RESULTS=true start_docker_env

Expand Down
10 changes: 9 additions & 1 deletion hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,12 @@ Dir Can Be Listed Using Shell
File Can Be Get
Execute ozone fs -get o3fs://bucket1.vol1/dir-${SUFFIX}/file-${SUFFIX} /tmp/
Execute diff -q ${TESTFILE} /tmp/file-${SUFFIX}
[teardown] Execute rm /tmp/file-${SUFFIX}
[teardown] Execute rm -f /tmp/file-${SUFFIX}

FSO Bucket Can Be Read
Pass Execution If '${DATA_VERSION}' < '${FSO_VERSION}' Skipped write test case
Pass Execution If '${CLIENT_VERSION}' < '${FSO_VERSION}' Client does not support FSO
Pass Execution If '${CLUSTER_VERSION}' < '${FSO_VERSION}' Cluster does not support FSO
Execute ozone fs -get ofs://om/vol1/fso-bucket-${SUFFIX}/dir/subdir/file ${TEMP_DIR}/
Execute diff -q ${TESTFILE} ${TEMP_DIR}/file
[teardown] Execute rm -f ${TEMP_DIR}/file
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Resource ../ozone-lib/shell.robot

*** Variables ***
${SUFFIX} ${EMPTY}
${FSO_VERSION} 1.3.0


*** Keywords ***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ Dir Can Be Created

File Can Be Put
Execute ozone fs -put ${TESTFILE} o3fs://bucket1.vol1/dir-${SUFFIX}/file-${SUFFIX}

FSO Bucket Can Be Created and Used
Pass Execution If '${CLIENT_VERSION}' < '${FSO_VERSION}' Client does not support FSO
Pass Execution If '${CLUSTER_VERSION}' < '${FSO_VERSION}' Cluster does not support FSO
Execute ozone sh bucket create --layout FILE_SYSTEM_OPTIMIZED /vol1/fso-bucket-${SUFFIX}
Execute ozone fs -mkdir -p ofs://om/vol1/fso-bucket-${SUFFIX}/dir/subdir
Execute ozone fs -put ${TESTFILE} ofs://om/vol1/fso-bucket-${SUFFIX}/dir/subdir/file

0 comments on commit 7a27db2

Please sign in to comment.