Skip to content

Commit

Permalink
Added upgrade tests for hsync
Browse files Browse the repository at this point in the history
  • Loading branch information
hemantk-12 committed Aug 21, 2024
1 parent 88b88ff commit 6a926e4
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hadoop-ozone/dist/src/main/compose/ozone/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ execute_robot_test scm -v SCHEME:o3fs -v BUCKET_TYPE:bucket -N ozonefs-o3fs-buck
execute_robot_test s3g grpc/grpc-om-s3-metrics.robot

execute_robot_test scm --exclude pre-finalized-snapshot-tests snapshot

execute_robot_test scm --exclude pre-finalized-hsync-tests hsync/upgrade-hsync-check.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/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.

source "$TEST_DIR"/testlib.sh

with_this_version_pre_finalized() {
# New layout features were added in this version, so OM and SCM should be pre-finalized.
execute_robot_test "$SCM" -N "${OUTPUT_NAME}-check-finalization" --include pre-finalized upgrade/check-finalization.robot
# Test that HSync is disabled when pre-finalized.
execute_robot_test "$SCM" -N "${OUTPUT_NAME}-hsync" --include pre-finalized-hsync-tests hsync/upgrade-hsync-check.robot
}

with_this_version_finalized() {
execute_robot_test "$SCM" -N "${OUTPUT_NAME}-check-finalization" --include finalized upgrade/check-finalization.robot
execute_robot_test "$SCM" -N "${OUTPUT_NAME}-hsync" debug/ozone-debug-lease-recovery.robot
}
51 changes: 51 additions & 0 deletions hadoop-ozone/dist/src/main/smoketest/freon/hsync.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# 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 ***
Documentation Test HSync via freon CLI.
Library OperatingSystem
Library String
Library BuiltIn
Resource ../ozone-lib/freon.robot
Test Timeout 5 minutes

*** Variables ***
${VOLUME}
${BUCKET}

*** Test Cases ***
Create volume for HSync
${random} = Generate Random String 5 [LOWER]
${volume} = Set Variable vol-${random}
${result} = Execute ozone sh volume create /${volume}
Should not contain ${result} Failed
Set Suite Variable ${VOLUME} ${volume}

Create bucket for HSync
${random} = Generate Random String 5 [LOWER]
${bucket} = Set Variable buc-${random}
${result} = Execute ozone sh bucket create -l FILE_SYSTEM_OPTIMIZED /${volume}/${bucket}
Should not contain ${result} Failed
Set Suite Variable ${BUCKET} ${bucket}

Create 1000 keys of size 10KB using hsync
${result} = Execute ozone freon dfsg --sync=HSYNC --path=o3fs://${BUCKET}.${VOLUME}
Should contain ${result} Successful executions: 1000
Should Contain ${result} Failures: 0

Create 1000 keys of size 10KB using hflush
${result} = Execute ozone freon dfsg --sync=HFLUSH --path=o3fs://${BUCKET}.${VOLUME}
Should contain ${result} Successful executions: 1000
Should Contain ${result} Failures: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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 ***
Documentation Test HSync during upgrade
Library OperatingSystem
Library String
Library BuiltIn
Resource hsync-setup.robot
Default Tags pre-finalized-hsync-tests
Suite Setup Run Keyword if '${SECURITY_ENABLED}' == 'true' Kinit test user testuser testuser.keytab

*** Variables ***
${VOLUME}
${BUCKET}
${KEY}

*** Test Cases ***
Create volume for HSync upgrade test
${random} = Generate Random String 5 [LOWER]
${volume} = Set Variable vol-${random}
${result} = Execute ozone sh volume create /${volume}
Should not contain ${result} Failed
Set Suite Variable ${VOLUME} ${volume}

Create bucket for HSync upgrade test
${random} = Generate Random String 5 [LOWER]
${bucket} = Set Variable buc-${random}
${result} = Execute ozone sh bucket create -l FILE_SYSTEM_OPTIMIZED /${volume}/${bucket}
Should not contain ${result} Failed
Set Suite Variable ${BUCKET} ${bucket}

Create key for HSync upgrade test
${random} = Generate Random String 5 [LOWER]
${key} = Set Variable key-${random}
${result} = Execute ozone sh key put /${volume}/${bucket}/${key} /etc/hosts
Set Suite Variable ${KEY} ${key}

Test HSync Prior To Finalization
${result} = Execute ozone debug recover --path=ofs://om/${VOLUME}/${BUCKET}/${KEY}
Should contain ${result} NOT_SUPPORTED_OPERATION
${result} = Execute ozone debug recover --path=o3fs://${BUCKET}.${VOLUME}.om/${KEY}
Should contain ${result} NOT_SUPPORTED_OPERATION

0 comments on commit 6a926e4

Please sign in to comment.