Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
e1342b6
TEMP only build + xcompat
adoroszlai Nov 21, 2024
2a2a53e
reduce duplication in xcompat clients.yaml
adoroszlai Nov 22, 2024
da8e3f2
share test data via mount instead of copying
adoroszlai Nov 22, 2024
01e627a
extract some test keywords
adoroszlai Nov 22, 2024
9826dea
pass common xcompat variables to EC tests
adoroszlai Nov 22, 2024
bb7715a
fix typo in Read Own Writes tests
adoroszlai Nov 22, 2024
c2ddb56
replace vol<PREFIX>/... with vol1/...-<SUFFIX>
adoroszlai Nov 22, 2024
d7691e3
avoid starting separate cluster for EC compat tests
adoroszlai Nov 22, 2024
d5c9baf
move keywords to ozone-lib/shell
adoroszlai Nov 22, 2024
fa6b7a4
test cases operating on bucket without replication type moved to read…
adoroszlai Nov 22, 2024
4fd4b28
move EC data setup to write.robot
adoroszlai Nov 23, 2024
a5c81f5
move old client EC test cases to read.robot
adoroszlai Nov 23, 2024
798989d
--wip-- [skip ci]
adoroszlai Nov 24, 2024
7d33211
Merge remote-tracking branch 'origin/master' into HDDS-11334-dev
adoroszlai Nov 24, 2024
959573e
TEMP disable repro check
adoroszlai Nov 24, 2024
fa69af8
do not set TMPDIR
adoroszlai Nov 24, 2024
5de9cac
restore OZONE_OPTS; move image to new-config
adoroszlai Nov 24, 2024
c3a7e07
do not override /tmp in containers
adoroszlai Nov 24, 2024
032cd29
set permissions on TEST_DATA_DIR
adoroszlai Nov 24, 2024
ca66f2d
get to /tmp
adoroszlai Nov 24, 2024
d92a0d6
Cannot index array with string "name"
adoroszlai Nov 24, 2024
e01c335
use prefix for bucket list
adoroszlai Nov 24, 2024
65329bc
move key/file put to write.robot
adoroszlai Nov 25, 2024
4b71377
create keys/files with version-specific suffix
adoroszlai Nov 25, 2024
8cbf449
reduce test file size for Ratis
adoroszlai Nov 25, 2024
3e8c1b3
replace SUFFIX with explicit version
adoroszlai Nov 25, 2024
a7d98b5
merge read own key into read key test
adoroszlai Nov 25, 2024
97dc329
extract keyword File Should Match Local File
adoroszlai Nov 25, 2024
488b1fa
use File Should Match Local File in FS client read test
adoroszlai Nov 25, 2024
9316181
split listing compat to bucket/key
adoroszlai Nov 25, 2024
00e8d9f
move "Key Read From Bucket With Replication" closer to other key read…
adoroszlai Nov 25, 2024
d8bdbd8
create TESTFILE in test.sh
adoroszlai Nov 25, 2024
6a016bf
split upgrade and xcompat suites
adoroszlai Nov 25, 2024
b7983de
remove debug
adoroszlai Nov 25, 2024
0c639ab
use small file for all tests
adoroszlai Nov 25, 2024
8dfb3d5
merge "EC Test Info Compat" into "Bucket Replication Config"
adoroszlai Nov 25, 2024
20fb6a5
fixup for 3e8c1b34e5
adoroszlai Nov 25, 2024
91ff18c
split Bucket Replication Config
adoroszlai Nov 25, 2024
f43a124
test fs -get for encrypted bucket
adoroszlai Nov 25, 2024
0c7241a
merge "EC Test FS Compat" into "Dir/File Can Be Listed"
adoroszlai Nov 25, 2024
5b7cdba
Revert "test fs -get for encrypted bucket"
adoroszlai Nov 25, 2024
0e79397
fix logical OR
adoroszlai Nov 25, 2024
402675e
expect error only for old client; use ofs://
adoroszlai Nov 25, 2024
7a80193
fix File Should Match ...
adoroszlai Nov 25, 2024
cc40b3c
test fs -get for encrypted bucket
adoroszlai Nov 25, 2024
38dcb7d
fixup for 402675e847
adoroszlai Nov 25, 2024
26638ea
fix sh key get cmd
adoroszlai Nov 25, 2024
52b82c0
IF must have closing END
adoroszlai Nov 25, 2024
bf63a45
FS ops should put/get file-, not key-
adoroszlai Nov 25, 2024
b816b07
need to run "File Can Be Put To Bucket With Replication Type" for new…
adoroszlai Nov 25, 2024
43afde7
use DATA_VERSION for FS read test
adoroszlai Nov 25, 2024
376320e
fix version in ecbucket name
adoroszlai Nov 25, 2024
27f039d
distinguish null and empty replicationConfig
adoroszlai Nov 25, 2024
ea3bf7a
empty replication config only for old client
adoroszlai Nov 25, 2024
bffdd27
fix ecbucket name
adoroszlai Nov 25, 2024
7afd422
Revert "fix ecbucket name"
adoroszlai Nov 25, 2024
a769fe0
Revert "empty replication config only for old client"
adoroszlai Nov 25, 2024
dcc9237
Revert "distinguish null and empty replicationConfig"
adoroszlai Nov 25, 2024
f140400
fix ecbucket name
adoroszlai Nov 25, 2024
a74cd06
write with all versions, only then test read
adoroszlai Nov 25, 2024
ba1b580
ensure client matching cluster version gets to write first
adoroszlai Nov 25, 2024
3eac100
pad robot filename with 0s
adoroszlai Nov 25, 2024
37ebb76
KEEP_RUNNING and TEST_DATA_DIR do not mix
adoroszlai Nov 25, 2024
a9b4fd4
disable OFS volume list test
adoroszlai Nov 25, 2024
b2bb7d3
Revert "TEMP disable repro check"
adoroszlai Nov 25, 2024
0910d26
Revert "TEMP only build + xcompat"
adoroszlai Nov 25, 2024
38bd470
Merge remote-tracking branch 'origin/master' into HDDS-11334
adoroszlai Nov 25, 2024
0551c03
fix trap
adoroszlai Nov 25, 2024
29aa741
remove unused "Bucket Replication"
adoroszlai Nov 26, 2024
11f1e0c
move "Key List With Replication" to read.robot
adoroszlai Nov 26, 2024
f8615d2
separate jq command to see raw response
adoroszlai Nov 26, 2024
096bde6
keep compatibility in compat suite
adoroszlai Nov 26, 2024
ae81199
further reduce duplication in clients.yaml
adoroszlai Nov 26, 2024
094c37e
remove leftover SUFFIX
adoroszlai Nov 26, 2024
c1bc7b9
Merge remote-tracking branch 'origin/master' into HDDS-11334
adoroszlai Nov 26, 2024
fda24a5
Merge remote-tracking branch 'origin/master' into HDDS-11334
adoroszlai Nov 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 29 additions & 7 deletions hadoop-ozone/dist/src/main/compose/testlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,29 @@ fi

source ${_testlib_dir}/compose_v2_compatibility.sh

: ${OZONE_COMPOSE_RUNNING:=false}
: ${SCM:=scm}

# create temp directory for test data; only once, even if testlib.sh is sourced again
if [[ -z "${TEST_DATA_DIR:-}" ]] && [[ "${KEEP_RUNNING:-false}" == "false" ]]; then
export TEST_DATA_DIR="$(mktemp -d "${TMPDIR:-/tmp}"/robot-data-XXXXXX)"
chmod go+rx "${TEST_DATA_DIR}"
_compose_delete_test_data() {
rm -frv "${TEST_DATA_DIR}"
}

trap _compose_cleanup EXIT HUP INT TERM
fi

_compose_cleanup() {
if [[ "${OZONE_COMPOSE_RUNNING}" == "true" ]]; then
stop_docker_env || true
fi
if [[ "$(type -t _compose_delete_test_data || true)" == "function" ]]; then
_compose_delete_test_data
fi
}

## @description create results directory, purging any prior data
create_results_dir() {
#delete previous results
Expand Down Expand Up @@ -140,13 +161,13 @@ start_docker_env(){

docker-compose --ansi never down --remove-orphans

trap stop_docker_env EXIT HUP INT TERM

opts=""
if has_scalable_datanode; then
opts="--scale datanode=${datanode_count}"
fi

OZONE_COMPOSE_RUNNING=true
trap _compose_cleanup EXIT HUP INT TERM
docker-compose --ansi never up -d $opts

wait_for_safemode_exit
Expand Down Expand Up @@ -184,11 +205,11 @@ execute_robot_test(){
local output_name=$(get_output_name)

# find unique filename
declare -i i=0
OUTPUT_FILE="robot-${output_name}1.xml"
while [[ -f $RESULT_DIR/$OUTPUT_FILE ]]; do
let ++i
OUTPUT_FILE="robot-${output_name}${i}.xml"
for ((i=1; i<1000; i++)); do
OUTPUT_FILE="robot-${output_name}$(printf "%03d" ${i}).xml"
if [[ ! -f $RESULT_DIR/$OUTPUT_FILE ]]; then
break;
fi
done

SMOKETEST_DIR_INSIDE="${OZONE_DIR:-/opt/hadoop}/smoketest"
Expand Down Expand Up @@ -368,6 +389,7 @@ stop_docker_env(){
for i in $(seq 1 $down_repeats)
do
if docker-compose --ansi never --profile "*" down --remove-orphans; then
OZONE_COMPOSE_RUNNING=false
return
fi
if [[ ${i} -eq 1 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion hadoop-ozone/dist/src/main/compose/upgrade/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#suite:compat
#suite:upgrade


TEST_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )
Expand Down
89 changes: 39 additions & 50 deletions hadoop-ozone/dist/src/main/compose/xcompat/clients.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,69 +14,58 @@
# See the License for the specific language governing permissions and
# limitations under the License.

x-common-config:
&common-config
dns_search: .
env_file:
- docker-config
command: ["sleep","1000000"]

x-old-config:
&old-config
<<: *common-config
volumes:
- ../..:/opt/ozone
- ../_keytabs:/etc/security/keytabs
- ./krb5.conf:/etc/krb5.conf
- ${TEST_DATA_DIR}:/testdata

x-new-config:
&new-config
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
<<: *common-config
volumes:
- ../..:/opt/hadoop
- ../_keytabs:/etc/security/keytabs
- ./krb5.conf:/etc/krb5.conf
- ${TEST_DATA_DIR}:/testdata

services:
old_client_1_0_0:
image: ${OZONE_IMAGE}:1.0.0${OZONE_IMAGE_FLAVOR}
env_file:
- docker-config
volumes:
- ../..:/opt/ozone
- ../_keytabs:/etc/security/keytabs
- ./krb5.conf:/etc/krb5.conf
command: ["sleep","1000000"]
<<: *old-config

old_client_1_1_0:
image: ${OZONE_IMAGE}:1.1.0${OZONE_IMAGE_FLAVOR}
env_file:
- docker-config
volumes:
- ../..:/opt/ozone
- ../_keytabs:/etc/security/keytabs
- ./krb5.conf:/etc/krb5.conf
command: ["sleep","1000000"]
<<: *old-config

old_client_1_2_1:
image: ${OZONE_IMAGE}:1.2.1${OZONE_IMAGE_FLAVOR}
env_file:
- docker-config
volumes:
- ../..:/opt/ozone
- ../_keytabs:/etc/security/keytabs
- ./krb5.conf:/etc/krb5.conf
command: ["sleep","1000000"]
<<: *old-config

old_client_1_3_0:
image: ${OZONE_IMAGE}:1.3.0${OZONE_IMAGE_FLAVOR}
env_file:
- docker-config
volumes:
- ../..:/opt/ozone
- ../_keytabs:/etc/security/keytabs
- ./krb5.conf:/etc/krb5.conf
command: ["sleep","1000000"]
<<: *old-config

old_client_1_4_0:
image: ${OZONE_IMAGE}:1.4.0${OZONE_IMAGE_FLAVOR}
env_file:
- docker-config
volumes:
- ../..:/opt/ozone
- ../_keytabs:/etc/security/keytabs
- ./krb5.conf:/etc/krb5.conf
command: ["sleep","1000000"]
<<: *old-config

old_client_1_4_1:
image: ${OZONE_IMAGE}:1.4.1${OZONE_IMAGE_FLAVOR}
env_file:
- docker-config
volumes:
- ../..:/opt/ozone
- ../_keytabs:/etc/security/keytabs
- ./krb5.conf:/etc/krb5.conf
command: ["sleep","1000000"]
<<: *old-config

new_client:
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
env_file:
- docker-config
volumes:
- ../..:/opt/hadoop
- ../_keytabs:/etc/security/keytabs
- ./krb5.conf:/etc/krb5.conf
<<: *new-config
environment:
OZONE_OPTS:
command: ["sleep","1000000"]
94 changes: 27 additions & 67 deletions hadoop-ozone/dist/src/main/compose/xcompat/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ source "${COMPOSE_DIR}/../testlib.sh"
export SECURITY_ENABLED=true
: ${OZONE_BUCKET_KEY_NAME:=key1}

old_client() {
OZONE_DIR=/opt/ozone
container=${client}
"$@"
}
echo 'Compatibility Test' > "${TEST_DATA_DIR}"/small

client() {
if [[ "${client_version}" == "${current_version}" ]]; then
OZONE_DIR=/opt/hadoop
container=new_client
else
OZONE_DIR=/opt/ozone
container="old_client_${client_version//./_}"
fi

new_client() {
OZONE_DIR=/opt/hadoop
container=new_client
client_version=${current_version}
"$@"
}

Expand All @@ -60,7 +61,7 @@ _write() {
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} \
-v TEST_DATA_DIR:/testdata \
compatibility/write.robot
}

Expand All @@ -71,87 +72,46 @@ _read() {
-v CLIENT_VERSION:${client_version} \
-v CLUSTER_VERSION:${cluster_version} \
-v DATA_VERSION:${data_version} \
-v SUFFIX:${data_version} \
-v TEST_DATA_DIR:/testdata \
compatibility/read.robot
}

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

OZONE_KEEP_RESULTS=true start_docker_env
OZONE_KEEP_RESULTS=true start_docker_env 5

execute_command_in_container kms hadoop key create ${OZONE_BUCKET_KEY_NAME}

_init

new_client _write
new_client _read ${current_version}
# first write with client matching cluster version
client_version="${cluster_version}" client _write

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

old_client _write
old_client _read ${client_version}

old_client _read ${current_version}
new_client _read ${client_version}
# skip write, since already done
if [[ "${client_version}" == "${cluster_version}" ]]; then
continue
fi
client _write
done

KEEP_RUNNING=false stop_docker_env
}

test_ec_cross_compatibility() {
echo "Running Erasure Coded storage backward compatibility tests."
# local cluster_versions_with_ec="1.3.0 1.4.0 ${current_version}"
local cluster_versions_with_ec="${current_version}" # until HDDS-11334
# TODO: debug acceptance test failures for client versions 1.0.0 on secure clusters
local non_ec_client_versions="1.1.0 1.2.1"

for cluster_version in ${cluster_versions_with_ec}; do
export COMPOSE_FILE=new-cluster.yaml:clients.yaml cluster_version=${cluster_version}
OZONE_KEEP_RESULTS=true start_docker_env 5

echo -n "Generating data locally... "
dd if=/dev/urandom of=/tmp/1mb bs=1048576 count=1 >/dev/null 2>&1
dd if=/dev/urandom of=/tmp/2mb bs=1048576 count=2 >/dev/null 2>&1
dd if=/dev/urandom of=/tmp/3mb bs=1048576 count=3 >/dev/null 2>&1
echo "done"
echo -n "Copy data into client containers... "
for container in $(docker ps --format '{{.Names}}' | grep client); do
docker cp /tmp/1mb ${container}:/tmp/1mb
docker cp /tmp/2mb ${container}:/tmp/2mb
docker cp /tmp/3mb ${container}:/tmp/3mb
done
echo "done"
rm -f /tmp/1mb /tmp/2mb /tmp/3mb


local prefix=$(LC_CTYPE=C tr -dc '[:alnum:]' < /dev/urandom | head -c 5 | tr '[:upper:]' '[:lower:]')
OZONE_DIR=/opt/hadoop
new_client _kinit
execute_robot_test new_client --include setup-ec-data -N "xcompat-cluster-${cluster_version}-setup-data" -v prefix:"${prefix}" ec/backward-compat.robot
OZONE_DIR=/opt/ozone

for client_version in ${non_ec_client_versions}; do
client="old_client_${client_version//./_}"
unset OUTPUT_PATH
container="${client}" _kinit
execute_robot_test "${client}" --include test-ec-compat -N "xcompat-cluster-${cluster_version}-client-${client_version}-read-${cluster_version}" -v prefix:"${prefix}" ec/backward-compat.robot
for client_version in "$@"; do
for data_version in $(echo "$client_version" "$cluster_version" "$current_version" | xargs -n1 | sort -u); do
client _read ${data_version}
done

KEEP_RUNNING=false stop_docker_env
done

KEEP_RUNNING=false stop_docker_env
}

create_results_dir

# current cluster with various clients
COMPOSE_FILE=new-cluster.yaml:clients.yaml cluster_version=${current_version} test_cross_compatibility ${old_versions}
COMPOSE_FILE=new-cluster.yaml:clients.yaml cluster_version=${current_version} test_cross_compatibility ${old_versions} ${current_version}

# old cluster with clients: same version and current version
for cluster_version in ${old_versions}; do
export OZONE_VERSION=${cluster_version}
COMPOSE_FILE=old-cluster.yaml:clients.yaml test_cross_compatibility ${cluster_version}
COMPOSE_FILE=old-cluster.yaml:clients.yaml test_cross_compatibility ${cluster_version} ${current_version}
done

test_ec_cross_compatibility
Loading