You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ad...@apache.org on 2026/04/07 12:45:18 UTC

(ozone) branch master updated: HDDS-7373. Add Robot tests for `ozone --validate classpath` (#10051)

This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 33a5320e4ec HDDS-7373. Add Robot tests for `ozone --validate classpath` (#10051)
33a5320e4ec is described below

commit 33a5320e4ec43725287309a0b10a37a3d679b6a6
Author: Arun Sarin <ar...@gmail.com>
AuthorDate: Tue Apr 7 18:15:11 2026 +0530

    HDDS-7373. Add Robot tests for `ozone --validate classpath` (#10051)
---
 .../dist/src/main/smoketest/cli/classpath.robot    | 47 +++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/hadoop-ozone/dist/src/main/smoketest/cli/classpath.robot b/hadoop-ozone/dist/src/main/smoketest/cli/classpath.robot
index 6991d8bf8a2..b54f03d3ca7 100644
--- a/hadoop-ozone/dist/src/main/smoketest/cli/classpath.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/cli/classpath.robot
@@ -14,12 +14,29 @@
 # limitations under the License.
 
 *** Settings ***
-Documentation       Test ozone classpath command
+Documentation       Test ozone classpath command and --validate classpath checks (HDDS-7373)
 Library             BuiltIn
 Resource            ../lib/os.robot
 Resource            ../ozone-lib/shell.robot
 Test Timeout        5 minutes
 
+*** Variables ***
+${TEMP_DIR}    /tmp
+
+*** Keywords ***
+Append missing jar path to classpath descriptor
+    [arguments]    ${ozone_home}    ${artifact}    ${bogus_jar}
+    ${cp_file} =    Set Variable    ${ozone_home}/share/ozone/classpath/${artifact}.classpath
+    Execute    sed -i 's_$_:${bogus_jar}_' '${cp_file}'
+
+Copy Ozone install and inject missing jar classpath entry
+    [arguments]    ${copy_subdir}    ${bogus_jar_basename}    ${artifact}
+    ${OZONE_COPY} =    Set Variable    ${TEMP_DIR}/${copy_subdir}
+    ${bogus_jar} =    Set Variable    ${TEMP_DIR}/${bogus_jar_basename}
+    Copy Directory    ${OZONE_DIR}    ${OZONE_COPY}
+    Append missing jar path to classpath descriptor    ${OZONE_COPY}    ${artifact}    ${bogus_jar}
+    [return]    ${OZONE_COPY}    ${bogus_jar}
+
 *** Test Cases ***
 Ignores HADOOP_CLASSPATH if OZONE_CLASSPATH is set
     [setup]    Create File         ${TEMP_DIR}/hadoop-classpath.jar
@@ -48,3 +65,31 @@ Adds optional dir entries
                         Should Contain   ${output}   ${jars_dir}/ozone-insight/optional.jar
 
     [teardown]    Remove Directory    ${OZONE_COPY}    recursive=True
+
+Validate classpath succeeds when all jars are present
+    ${output} =         Execute          ozone --validate classpath ozone-insight
+                        Should Contain   ${output}   Validating classpath file:
+                        Should Contain   ${output}   Validation SUCCESSFUL
+
+Validate classpath fails when classpath descriptor is missing
+    ${output} =         Execute and checkrc    ozone --validate classpath hdds-nonexistent-artifact-7373    1
+                        Should Contain   ${output}   ERROR: Classpath file descriptor
+
+Validate classpath fails when a listed jar is missing
+    ${OZONE_COPY}    ${bogus_jar} =    Copy Ozone install and inject missing jar classpath entry
+    ...    ozone-validate-missing-jar    ozone-robot-missing-7373.jar    ozone-insight
+    ${output} =         Execute and checkrc    ${OZONE_COPY}/bin/ozone --validate classpath ozone-insight    1
+                        Should Contain   ${output}   ERROR: Jar file ${bogus_jar} is missing
+                        Should Contain   ${output}   Validation FAILED due to missing jar files!
+    [teardown]    Remove Directory    ${OZONE_COPY}    recursive=True
+
+Validate with wrong subcommand prints usage
+    ${output} =         Execute and checkrc    ozone --validate version    1
+                        Should Contain   ${output}   Usage I: ozone --validate classpath
+
+Validate continue allows daemon command after failed classpath check
+    ${OZONE_COPY}    ${bogus_jar} =    Copy Ozone install and inject missing jar classpath entry
+    ...    ozone-validate-continue    ozone-robot-missing-scm-7373.jar    hdds-server-scm
+    ${output} =         Execute And Ignore Error    ${OZONE_COPY}/bin/ozone --validate continue --daemon status scm
+                        Should Contain   ${output}   Validation FAILED due to missing jar files! Continuing command execution
+    [teardown]    Remove Directory    ${OZONE_COPY}    recursive=True


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org