Apache Solr open-source search software
SOLR-16232: Fix EnvVar usage in bin/solr (#892)
Houston Putman5cf79e9df551
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 2a4541227f1..900587bbc63 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -168,6 +168,8 @@ Bug Fixes* SOLR-16426: LBHttp2SolrClient (and therefore CloudHttp2SolrClient) now respect requestWriter, responseParser and queryParam changes (Houston Putman)+* SOLR-16232: Fix EnvVar usage in bin/solr (Houston Putman)+Other Changes---------------------* SOLR-16351: Upgrade Carrot2 to 4.4.3, upgrade randomizedtesting to 2.8.0. (Dawid Weiss)diff --git a/solr/bin/solr b/solr/bin/solrindex 83b41e9b58d..d5fb182e05c 100755--- a/solr/bin/solr+++ b/solr/bin/solr@@ -830,7 +830,7 @@ function run_package() {fifi- run_tool package -solrUrl "$runningSolrUrl" $@+ run_tool package -solrUrl "$runningSolrUrl" "$@"#exit $?}@@ -876,7 +876,7 @@ function stop_solr() {STAT=`(ps -o stat='' -p $SOLR_PID || :) | tr -d ' '`if [[ "${STAT:-Z}" != "Z" ]]; then- if [ -n "{$JSTACK:-}" ]; then+ if [ -n "${JSTACK:-}" ]; thenecho -e "Solr process $SOLR_PID is still running; jstacking it now."$JSTACK $SOLR_PIDelif [ "$JATTACH" != "" ]; then@@ -1433,12 +1433,12 @@ fiif [[ "$SCRIPT_CMD" == "export" ]]; then- run_tool export $@+ run_tool export "$@"exit $?fiif [[ "$SCRIPT_CMD" == "package" ]]; then- run_package $@+ run_package "$@"exit $?fi@@ -1574,7 +1574,7 @@ if [[ "$SCRIPT_CMD" == "auth" ]]; thenfidonefi- run_tool auth ${AUTH_PARAMS[@]} -solrUrl "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:${AUTH_PORT:-8983}/solr" -authConfDir "$SOLR_HOME" $VERBOSE+ run_tool auth "${AUTH_PARAMS[@]}" -solrUrl "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:${AUTH_PORT:-8983}/solr" -authConfDir "$SOLR_HOME" $VERBOSEexit $?fi@@ -1987,11 +1987,6 @@ if [[ -n ${SOLR_DATA_HOME:-} ]] && [ ! -e "$SOLR_DATA_HOME" ]; thenecho -e "\nSolr data home directory $SOLR_DATA_HOME not found!\n"exit 1fi-if $verbose ; then- q=""-else- q="-q"-fi# Establish default GC logging opts if no env var set (otherwise init to sensible default)if [ -z ${GC_LOG_OPTS+x} ]; then@@ -2203,17 +2198,17 @@ function start_solr() {echo -e " SOLR_HOST = ${SOLR_HOST:-}"echo -e " SOLR_PORT = $SOLR_PORT"echo -e " STOP_PORT = $STOP_PORT"- echo -e " JAVA_MEM_OPTS = ${JAVA_MEM_OPTS[@]}"- echo -e " GC_TUNE = ${GC_TUNE[@]}"- echo -e " GC_LOG_OPTS = ${GC_LOG_OPTS[@]}"+ echo -e " JAVA_MEM_OPTS = ${JAVA_MEM_OPTS[*]}"+ echo -e " GC_TUNE = ${GC_TUNE[*]}"+ echo -e " GC_LOG_OPTS = ${GC_LOG_OPTS[*]}"echo -e " SOLR_TIMEZONE = $SOLR_TIMEZONE"if [ "$SOLR_MODE" == "solrcloud" ]; then- echo -e " CLOUD_MODE_OPTS = ${CLOUD_MODE_OPTS[@]}"+ echo -e " CLOUD_MODE_OPTS = ${CLOUD_MODE_OPTS[*]}"fiif [ -n "${SOLR_OPTS:-}" ]; then- echo -e " SOLR_OPTS = ${SOLR_OPTS[@]}"+ echo -e " SOLR_OPTS = ${SOLR_OPTS[*]}"fiif [ -n "${SOLR_ADDL_ARGS:-}" ]; then@@ -2222,7 +2217,7 @@ function start_solr() {if [ "${ENABLE_REMOTE_JMX_OPTS:-false}" == "true" ]; thenecho -e " RMI_PORT = ${RMI_PORT:-}"- echo -e " REMOTE_JMX_OPTS = ${REMOTE_JMX_OPTS[@]}"+ echo -e " REMOTE_JMX_OPTS = ${REMOTE_JMX_OPTS[*]}"fiif [ -n "${SOLR_LOG_LEVEL:-}" ]; thendiff --git a/solr/packaging/test/test_export.bats b/solr/packaging/test/test_export.batsnew file mode 100644index 00000000000..e6f1d5fbde1--- /dev/null+++ b/solr/packaging/test/test_export.bats@@ -0,0 +1,37 @@+#!/usr/bin/env bats++# 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.++load bats_helper++setup() {+ common_clean_setup+}++teardown() {+ # save a snapshot of SOLR_HOME for failed tests+ save_home_on_failure++ solr stop -all >/dev/null 2>&1+}++@test "Check export command" {+ run solr start -c -Dsolr.modules=sql+ run solr create_collection -c COLL_NAME+ run solr export -url "http://localhost:8983/solr/COLL_NAME" -query "*:* -id:test" -out "${BATS_TEST_TMPDIR}/output"+ refute_output --partial 'Unrecognized option'+ assert_output --partial 'Export complete'+}