jojochuang commented on code in PR #11645: URL: https://github.com/apache/ozone/pull/11645#discussion_r4341394043
########## hadoop-ozone/dist/src/main/smoketest/upgrade/snapshot.robot: ########## @@ -0,0 +1,52 @@ +# 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 Create a snapshot, read earlier snapshots and diff against the previous one +Library OperatingSystem +Library String +Library BuiltIn +Resource ../commonlib.robot +Suite Setup Kinit test user testuser testuser.keytab +Test Timeout 5 minutes + +*** Variables *** +${PREFIX} +${SNAPSHOT} +${FROM_SNAPSHOT} +${EARLIER_SNAPSHOTS} + +*** Keywords *** +Snapshot diff should be done + ${output} = Execute ozone sh snapshot diff --get-report --json /${PREFIX}-volume/${PREFIX}-bucket ${FROM_SNAPSHOT} ${SNAPSHOT} | jq -r '.jobStatus' Review Comment: @smengcl I pushed a suggested fix to my fork: [8fc2f6d02b9](https://github.com/jojochuang/ozone/commit/8fc2f6d02b98e89fc1341cde4b7d1592ebe781d6), on branch `codex/HDDS-17192-snapshot-diff-compat`. It is a single commit based on this PR's current head, so it can be cherry-picked directly. The change tries `--get-report`, falls back to the legacy command when it fails, and checks the completed text report header for the requested snapshots. This avoids requiring `--json` or `jq` and follows the fallback already used by the compatibility suite. Validation: the original keyword fails both simulated old-client cases (1.4.1 and 2.1.1); the fix passes all seven simulated command-response cases, including modern clients, empty reports, and rejection of failed jobs or reports for the wrong snapshots. The actual three-test Robot suite passes dry-run validation, and repository checkstyle passes. These checks use a stub CLI; I have not run the Docker upgrade matrix. Generated-by: Codex (GPT-6) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
