forked from apache/ozone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HDDS-8450. Dedicated acceptance test suite for s3a (apache#6458)
- Loading branch information
1 parent
cba8c85
commit a523fd9
Showing
8 changed files
with
230 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#!/usr/bin/env bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This script runs S3A contract tests against various bucket types on | ||
# a Docker Compose-based Ozone cluster. | ||
# Requires HADOOP_AWS_DIR to point the directory containing hadoop-aws sources. | ||
|
||
if [[ -z ${HADOOP_AWS_DIR} ]] || [[ ! -e ${HADOOP_AWS_DIR} ]]; then | ||
echo "Skipping S3A tests due to missing HADOOP_AWS_DIR (directory with hadoop-aws sources)" >&2 | ||
exit | ||
fi | ||
|
||
# shellcheck source=/dev/null | ||
source "$COMPOSE_DIR/../testlib.sh" | ||
|
||
## @description Run S3A contract tests against Ozone. | ||
## @param Ozone S3 bucket | ||
execute_s3a_tests() { | ||
local bucket="$1" | ||
|
||
pushd "${HADOOP_AWS_DIR}" | ||
|
||
# S3A contract tests are enabled by presence of `auth-keys.xml`. | ||
# https://hadoop.apache.org/docs/r3.3.6/hadoop-aws/tools/hadoop-aws/testing.html#Setting_up_the_tests | ||
cat > src/test/resources/auth-keys.xml <<-EOF | ||
<configuration> | ||
<property> | ||
<name>fs.s3a.endpoint</name> | ||
<value>http://localhost:9878</value> | ||
</property> | ||
<property> | ||
<name>test.fs.s3a.endpoint</name> | ||
<value>http://localhost:9878</value> | ||
</property> | ||
<property> | ||
<name>fs.contract.test.fs.s3a</name> | ||
<value>s3a://${bucket}/</value> | ||
</property> | ||
<property> | ||
<name>test.fs.s3a.name</name> | ||
<value>s3a://${bucket}/</value> | ||
</property> | ||
<property> | ||
<name>test.fs.s3a.sts.enabled</name> | ||
<value>false</value> | ||
</property> | ||
<property> | ||
<name>fs.s3a.path.style.access</name> | ||
<value>true</value> | ||
</property> | ||
<property> | ||
<name>fs.s3a.directory.marker.retention</name> | ||
<value>keep</value> | ||
</property> | ||
</configuration> | ||
EOF | ||
|
||
# Some tests are skipped due to known issues. | ||
# - ITestS3AContractDistCp: HDDS-10616 | ||
# - ITestS3AContractEtag, ITestS3AContractRename: HDDS-10615 | ||
# - ITestS3AContractGetFileStatusV1List: HDDS-10617 | ||
# - ITestS3AContractMkdir: HDDS-10572 | ||
mvn -B -V --fail-never --no-transfer-progress \ | ||
-Dtest='ITestS3AContract*, !ITestS3AContractDistCp, !ITestS3AContractEtag, !ITestS3AContractGetFileStatusV1List, !ITestS3AContractMkdir, !ITestS3AContractRename' \ | ||
clean test | ||
|
||
local target="${RESULT_DIR}/junit/${bucket}/target" | ||
mkdir -p "${target}" | ||
mv -iv target/surefire-reports "${target}"/ | ||
popd | ||
} | ||
|
||
start_docker_env | ||
|
||
if [[ ${SECURITY_ENABLED} == "true" ]]; then | ||
execute_command_in_container s3g kinit -kt /etc/security/keytabs/testuser.keytab "testuser/s3g@EXAMPLE.COM" | ||
access=$(execute_command_in_container s3g ozone s3 getsecret -e) | ||
eval "$access" | ||
else | ||
export AWS_ACCESS_KEY_ID="s3a-contract" | ||
export AWS_SECRET_ACCESS_KEY="unsecure" | ||
fi | ||
|
||
execute_command_in_container s3g ozone sh bucket create --layout OBJECT_STORE /s3v/obs-bucket | ||
execute_command_in_container s3g ozone sh bucket create --layout LEGACY /s3v/leg-bucket | ||
execute_command_in_container s3g ozone sh bucket create --layout FILE_SYSTEM_OPTIMIZED /s3v/fso-bucket | ||
|
||
for bucket in obs-bucket leg-bucket fso-bucket; do | ||
execute_s3a_tests "$bucket" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
#suite:s3a | ||
|
||
COMPOSE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
export COMPOSE_DIR | ||
|
||
export SECURITY_ENABLED=false | ||
|
||
source "$COMPOSE_DIR/../common/s3a-test.sh" |
27 changes: 27 additions & 0 deletions
27
hadoop-ozone/dist/src/main/compose/ozonesecure-ha/test-s3a.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
#suite:s3a | ||
|
||
COMPOSE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
export COMPOSE_DIR | ||
|
||
export SECURITY_ENABLED=true | ||
export OM_SERVICE_ID="omservice" | ||
export SCM=scm1.org | ||
|
||
source "$COMPOSE_DIR/../common/s3a-test.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters