Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion hadoop-ozone/dist/src/main/compose/ozone/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ start_docker_env
#Disabling for now, audit parser tool during parse getting exception.
#execute_robot_test om auditparser

execute_robot_test scm lib

execute_robot_test scm basic

execute_robot_test scm gdpr

execute_robot_test scm ozonefs/ozonefs.robot
execute_robot_test scm -v SCHEME:ofs ozonefs/ozonefs.robot
execute_robot_test scm -v SCHEME:o3fs ozonefs/ozonefs.robot

execute_robot_test scm security/ozone-secure-token.robot

Expand Down
3 changes: 2 additions & 1 deletion hadoop-ozone/dist/src/main/compose/ozonesecure/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ execute_robot_test scm basic

execute_robot_test scm security

execute_robot_test scm ozonefs/ozonefs.robot
execute_robot_test scm -v SCHEME:ofs ozonefs/ozonefs.robot
execute_robot_test scm -v SCHEME:o3fs ozonefs/ozonefs.robot

execute_robot_test s3g s3

Expand Down
4 changes: 3 additions & 1 deletion hadoop-ozone/dist/src/main/compose/testlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ SMOKETEST_DIR_INSIDE="${OZONE_DIR:-/opt/hadoop}/smoketest"
OM_HA_PARAM=""
if [[ -n "${OM_SERVICE_ID}" ]]; then
OM_HA_PARAM="--om-service-id=${OM_SERVICE_ID}"
else
OM_SERVICE_ID=om
fi

## @description create results directory, purging any prior data
Expand Down Expand Up @@ -113,7 +115,7 @@ execute_robot_test(){
OUTPUT_PATH="$RESULT_DIR_INSIDE/${OUTPUT_FILE}"
# shellcheck disable=SC2068
docker-compose -f "$COMPOSE_FILE" exec -T "$CONTAINER" mkdir -p "$RESULT_DIR_INSIDE" \
&& docker-compose -f "$COMPOSE_FILE" exec -T -e SECURITY_ENABLED="${SECURITY_ENABLED}" -e OM_HA_PARAM="${OM_HA_PARAM}" -e OM_SERVICE_ID="${OM_SERVICE_ID}" "$CONTAINER" robot ${ARGUMENTS[@]} --log NONE -N "$TEST_NAME" --report NONE "${OZONE_ROBOT_OPTS[@]}" --output "$OUTPUT_PATH" "$SMOKETEST_DIR_INSIDE/$TEST"
&& docker-compose -f "$COMPOSE_FILE" exec -T "$CONTAINER" robot -v OM_SERVICE_ID:"${OM_SERVICE_ID}" -v SECURITY_ENABLED:"${SECURITY_ENABLED}" -v OM_HA_PARAM:"${OM_HA_PARAM}" ${ARGUMENTS[@]} --log NONE -N "$TEST_NAME" --report NONE "${OZONE_ROBOT_OPTS[@]}" --output "$OUTPUT_PATH" "$SMOKETEST_DIR_INSIDE/$TEST"
local -i rc=$?

FULL_CONTAINER_NAME=$(docker-compose -f "$COMPOSE_FILE" ps | grep "_${CONTAINER}_" | head -n 1 | awk '{print $1}')
Expand Down
6 changes: 3 additions & 3 deletions hadoop-ozone/dist/src/main/smoketest/commonlib.robot
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Library String
Library BuiltIn

*** Variables ***
${SECURITY_ENABLED} %{SECURITY_ENABLED}
${OM_HA_PARAM} %{OM_HA_PARAM}
${OM_SERVICE_ID} %{OM_SERVICE_ID}
${SECURITY_ENABLED} false
${OM_HA_PARAM} ${EMPTY}
${OM_SERVICE_ID} om

*** Keywords ***
Execute
Expand Down
50 changes: 50 additions & 0 deletions hadoop-ozone/dist/src/main/smoketest/lib/fs.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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.

*** Settings ***
Resource string.robot


*** Variables ***
${OM_SERVICE_ID} om


*** Keywords ***
Format FS URL
[arguments] ${scheme} ${volume} ${bucket} ${path}=${EMPTY}

${url} = Run Keyword If '${scheme}' == 'o3fs' Format o3fs URL ${volume} ${bucket} ${path}
... ELSE IF '${scheme}' == 'ofs' Format ofs URL ${volume} ${bucket} ${path}
... ELSE Fail Unsupported FS scheme: ${scheme}

[return] ${url}

Format o3fs URL
[arguments] ${volume} ${bucket} ${path}=${EMPTY} ${om}=${OM_SERVICE_ID}
${om_with_leading} = Run Keyword If '${om}' != '${EMPTY}' Ensure Leading . ${om}
... ELSE Set Variable ${EMPTY}
[return] o3fs://${bucket}.${volume}${om_with_leading}/${path}

Format ofs URL
[arguments] ${volume} ${bucket} ${path}=${EMPTY} ${om}=${OM_SERVICE_ID}

${om_with_trailing} = Run Keyword If '${om}' != '${EMPTY}' Ensure Trailing / ${om}
... ELSE Set Variable ${EMPTY}

${path_with_leading} = Run Keyword If '${path}' != '${EMPTY}' Ensure Leading / ${path}
... ELSE Set Variable ${EMPTY}

[return] ofs://${om_with_trailing}${volume}/${bucket}${path_with_leading}

63 changes: 63 additions & 0 deletions hadoop-ozone/dist/src/main/smoketest/lib/fs_tests.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 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.

*** Settings ***
Resource fs.robot


*** Test Cases ***

Format o3fs URL without path
${result} = Format o3fs URL vol1 bucket1
Should Be Equal ${result} o3fs://bucket1.vol1.om/

Format o3fs URL with path
${result} = Format o3fs URL vol1 bucket1 dir/file
Should Be Equal ${result} o3fs://bucket1.vol1.om/dir/file

Format o3fs URL with OM
${result} = Format o3fs URL vol1 bucket1 dir/file omservice
Should Be Equal ${result} o3fs://bucket1.vol1.omservice/dir/file


Format ofs URL without path
${result} = Format ofs URL vol1 bucket1
Should Be Equal ${result} ofs://om/vol1/bucket1

Format ofs URL with path
${result} = Format ofs URL vol1 bucket1 dir/file
Should Be Equal ${result} ofs://om/vol1/bucket1/dir/file

Format ofs URL with OM
${result} = Format ofs URL vol1 bucket1 dir/file om:1234
Should Be Equal ${result} ofs://om:1234/vol1/bucket1/dir/file


Format FS URL with ofs scheme
${result} = Format FS URL ofs vol1 bucket1
${expected} = Format ofs URL vol1 bucket1
Should Be Equal ${result} ${expected}

Format FS URL with o3fs scheme
${result} = Format FS URL o3fs vol1 bucket1
${expected} = Format o3fs URL vol1 bucket1
Should Be Equal ${result} ${expected}

Format FS URL with unsupported scheme
${result} = Run Keyword And Expect Error * Format FS URL http org apache
Should Contain ${result} http
Should Contain ${result} nsupported


37 changes: 37 additions & 0 deletions hadoop-ozone/dist/src/main/smoketest/lib/string.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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.

*** Settings ***
Library String


*** Keywords ***
Ensure Leading
[arguments] ${char} ${string}

${first} = Get Substring ${string} 0 1
${result} = Set Variable If '${first}' == '${char}' ${string} ${char}${string}

[return] ${result}


Ensure Trailing
[arguments] ${char} ${string}

${last} = Get Substring ${string} -1
${result} = Set Variable If '${last}' == '${char}' ${string} ${string}${char}

[return] ${result}

46 changes: 46 additions & 0 deletions hadoop-ozone/dist/src/main/smoketest/lib/string_tests.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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.

*** Settings ***
Resource string.robot


*** Test Cases ***

Ensure Leading without Leading
${result} = Ensure Leading / a/b
Should Be Equal ${result} /a/b

Ensure Leading with Leading
${result} = Ensure Leading _ _a_b_c
Should Be Equal ${result} _a_b_c

Ensure Leading for empty
${result} = Ensure Leading | ${EMPTY}
Should Be Equal ${result} |


Ensure Trailing without Trailing
${result} = Ensure Trailing . x.y.z
Should Be Equal ${result} x.y.z.

Ensure Trailing with Trailing
${result} = Ensure Trailing x axbxcx
Should Be Equal ${result} axbxcx

Ensure Trailing for empty
${result} = Ensure Trailing = ${EMPTY}
Should Be Equal ${result} =

Loading