From 0eef652827fb4bd2cf8b61b8a0eb4f388f201b7c Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Tue, 5 Sep 2023 06:15:26 -0400 Subject: [PATCH] SOLR-16956: fix not being able to stop a solr by port number (#1880) --- solr/bin/solr | 1 + solr/packaging/test/test_start_solr.bats | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/solr/bin/solr b/solr/bin/solr index 8a6d0560757..e11eec4e8d4 100644 --- a/solr/bin/solr +++ b/solr/bin/solr @@ -1301,6 +1301,7 @@ if [ $# -gt 0 ]; then exit 1 fi SOLR_PORT="$2" + PROVIDED_SOLR_PORT="${SOLR_PORT}" PASS_TO_RUN_EXAMPLE+=("-p" "$SOLR_PORT") shift 2 ;; diff --git a/solr/packaging/test/test_start_solr.bats b/solr/packaging/test/test_start_solr.bats index e0d7e5d981e..3b664759da4 100644 --- a/solr/packaging/test/test_start_solr.bats +++ b/solr/packaging/test/test_start_solr.bats @@ -36,3 +36,16 @@ teardown() { run bash -c 'solr stop -all 2>&1' refute_output --partial 'forcefully killing' } + +@test "stop command for single port" { + + solr start + solr start -p 7574 + solr assert --started http://localhost:8983/solr --timeout 5000 + solr assert --started http://localhost:7574/solr --timeout 5000 + + run solr stop -p 7574 + solr assert --not-started http://localhost:7574/solr --timeout 5000 + solr assert --started http://localhost:8983/solr --timeout 5000 + +}