Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-15960: Find unexported variables with compgen (#2250)

Houston Putmanf23c8deb1886
diff --git a/solr/bin/solr b/solr/bin/solr
index 3e64bdc5dc3..0e2f93ae348 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -113,7 +113,7 @@ elif [ -r "$SOLR_INCLUDE" ]; then
fi
# Export variables we want to make visible to Solr sub-process
-for var in $(compgen -e); do
+for var in $(compgen -v); do
if [[ "$var" =~ ^(SOLR_.*|DEFAULT_CONFDIR|ZK_.*|GCS_BUCKET|GCS_.*|S3_.*|OTEL_.*|AWS_.*)$ ]]; then
export "${var?}"
fi
diff --git a/solr/packaging/test/test_modules.bats b/solr/packaging/test/test_modules.bats
index 4fb71925123..543c6ecc65d 100644
--- a/solr/packaging/test/test_modules.bats
+++ b/solr/packaging/test/test_modules.bats
@@ -61,7 +61,11 @@ teardown() {
}
@test "icu collation in analysis-extras module" {
- run solr start -c -Dsolr.modules=analysis-extras
+ local solr_include_file="${BATS_TEST_TMPDIR}/solr.include"
+ echo "SOLR_MODULES=analysis-extras" > "${solr_include_file}"
+
+ export SOLR_INCLUDE="${solr_include_file}"
+ run solr start -c
run solr create -c COLL_NAME -d test/analysis_extras_config/conf
assert_output --partial "Created collection 'COLL_NAME'"
}