diff --git a/hadoop-ozone/dist/src/main/compose/compatibility/docker-config b/hadoop-ozone/dist/src/main/compose/compatibility/docker-config index f7f1c24b8a0c..cae129e8e455 100644 --- a/hadoop-ozone/dist/src/main/compose/compatibility/docker-config +++ b/hadoop-ozone/dist/src/main/compose/compatibility/docker-config @@ -37,5 +37,6 @@ HADOOP_OPTS="-Dhadoop.opts=test" HDFS_STORAGECONTAINERMANAGER_OPTS="-Dhdfs.scm.opts=test" HDFS_OM_OPTS="-Dhdfs.om.opts=test" HDDS_DN_OPTS="-Dhdds.dn.opts=test" +OZONE_SERVER_OPTS="-Dserver.opt=test" no_proxy=om,scm,s3g,recon,kdc,localhost,127.0.0.1 diff --git a/hadoop-ozone/dist/src/main/smoketest/compatibility/dn.robot b/hadoop-ozone/dist/src/main/smoketest/compatibility/dn.robot index c0ec12335fb1..8fbdedc8e6c9 100644 --- a/hadoop-ozone/dist/src/main/smoketest/compatibility/dn.robot +++ b/hadoop-ozone/dist/src/main/smoketest/compatibility/dn.robot @@ -15,13 +15,12 @@ *** Settings *** Documentation Test datanode compatibility -Library BuiltIn -Resource ../lib/os.robot +Resource lib.resource Test Timeout 5 minutes *** Test Cases *** Picks up command line options Pass Execution If '%{HDDS_DN_OPTS}' == '' Command-line option required for process check - ${processes} = List All Processes + ${processes} = Wait for server command-line options Should Contain ${processes} %{HDDS_DN_OPTS} - Should Contain ${processes} %{HADOOP_OPTS} + Check client command-line options diff --git a/hadoop-ozone/dist/src/main/smoketest/compatibility/lib.resource b/hadoop-ozone/dist/src/main/smoketest/compatibility/lib.resource new file mode 100644 index 000000000000..4ab16d39c921 --- /dev/null +++ b/hadoop-ozone/dist/src/main/smoketest/compatibility/lib.resource @@ -0,0 +1,35 @@ +# 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 BuiltIn +Library OperatingSystem +Resource ../lib/os.robot + +*** Keywords *** +Check server command-line options + ${processes} = List All Processes + Should Contain ${processes} %{HADOOP_OPTS} + Should Contain ${processes} %{OZONE_SERVER_OPTS} + RETURN ${processes} + +Wait for server command-line options + ${processes} = Wait Until Keyword Succeeds 3min 2sec Check server command-line options + RETURN ${processes} + +Check client command-line options + Set Environment Variable OZONE_SHELL_SCRIPT_DEBUG true + ${output} = Execute ozone sh --help + Should Not Contain ${output} %{OZONE_SERVER_OPTS} diff --git a/hadoop-ozone/dist/src/main/smoketest/compatibility/om.robot b/hadoop-ozone/dist/src/main/smoketest/compatibility/om.robot index 6b27946e0722..56884bed5007 100644 --- a/hadoop-ozone/dist/src/main/smoketest/compatibility/om.robot +++ b/hadoop-ozone/dist/src/main/smoketest/compatibility/om.robot @@ -15,20 +15,15 @@ *** Settings *** Documentation Test om compatibility -Library BuiltIn -Resource ../lib/os.robot +Resource lib.resource Test Timeout 5 minutes -*** Keywords *** -Check command-line options - ${processes} = List All Processes - Should Contain ${processes} %{HDFS_OM_OPTS} - Should Contain ${processes} %{HADOOP_OPTS} - *** Test Cases *** Picks up command line options Pass Execution If '%{HDFS_OM_OPTS}' == '' Command-line option required for process check - Wait Until Keyword Succeeds 3min 2sec Check command-line options + ${processes} = Wait for server command-line options + Should Contain ${processes} %{HDFS_OM_OPTS} + Check client command-line options Rejects Atomic Key Rewrite Execute ozone freon ockg -n1 -t1 -p rewrite diff --git a/hadoop-ozone/dist/src/main/smoketest/compatibility/recon.robot b/hadoop-ozone/dist/src/main/smoketest/compatibility/recon.robot index 79f7a3518aff..782b8a53aa89 100644 --- a/hadoop-ozone/dist/src/main/smoketest/compatibility/recon.robot +++ b/hadoop-ozone/dist/src/main/smoketest/compatibility/recon.robot @@ -15,16 +15,11 @@ *** Settings *** Documentation Test recon compatibility -Library BuiltIn -Resource ../lib/os.robot +Resource lib.resource Test Timeout 5 minutes -*** Keywords *** -Check command-line options - ${processes} = List All Processes - Should Contain ${processes} %{HADOOP_OPTS} - *** Test Cases *** Picks up command line options Pass Execution If '%{HADOOP_OPTS}' == '' Command-line option required for process check - Wait Until Keyword Succeeds 3min 2sec Check command-line options + Wait for server command-line options + Check client command-line options diff --git a/hadoop-ozone/dist/src/main/smoketest/compatibility/scm.robot b/hadoop-ozone/dist/src/main/smoketest/compatibility/scm.robot index 27546f66aa9e..6499d512e6b0 100644 --- a/hadoop-ozone/dist/src/main/smoketest/compatibility/scm.robot +++ b/hadoop-ozone/dist/src/main/smoketest/compatibility/scm.robot @@ -15,13 +15,12 @@ *** Settings *** Documentation Test scm compatibility -Library BuiltIn -Resource ../lib/os.robot +Resource lib.resource Test Timeout 5 minutes *** Test Cases *** Picks up command line options Pass Execution If '%{HDFS_STORAGECONTAINERMANAGER_OPTS}' == '' Command-line option required for process check - ${processes} = List All Processes + ${processes} = Wait for server command-line options Should Contain ${processes} %{HDFS_STORAGECONTAINERMANAGER_OPTS} - Should Contain ${processes} %{HADOOP_OPTS} + Check client command-line options diff --git a/hadoop-ozone/dist/src/shell/ozone/ozone b/hadoop-ozone/dist/src/shell/ozone/ozone index f875c2050905..f38ba2f11613 100755 --- a/hadoop-ozone/dist/src/shell/ozone/ozone +++ b/hadoop-ozone/dist/src/shell/ozone/ozone @@ -337,6 +337,7 @@ ozone_suppress_shell_log ozone_assemble_classpath ozone_add_client_opts +ozone_add_server_opts if [[ ${OZONE_WORKER_MODE} = true ]]; then ozone_worker_mode_execute "${OZONE_HOME}/bin/ozone" "${OZONE_USER_PARAMS[@]}" diff --git a/hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh b/hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh index 0e357ddbe15e..5eda5777c353 100755 --- a/hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh +++ b/hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh @@ -1563,6 +1563,18 @@ function ozone_add_client_opts fi } +## @description Adds the OZONE_SERVER_OPTS variable to OZONE_OPTS if OZONE_SUBCMD_SUPPORTDAEMONIZATION is true +## @audience public +## @stability stable +## @replaceable yes +function ozone_add_server_opts +{ + if [[ "${OZONE_SUBCMD_SUPPORTDAEMONIZATION}" == "true" ]] && [[ -n "${OZONE_SERVER_OPTS:-}" ]]; then + ozone_debug "Appending OZONE_SERVER_OPTS onto OZONE_OPTS" + OZONE_OPTS="${OZONE_OPTS} ${OZONE_SERVER_OPTS}" + fi +} + ## @description Finish configuring Hadoop specific system properties ## @description prior to executing Java ## @audience private