Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-16956: fix not being able to stop a solr by port number (#1880)

Eric Pugh0eef652827fb
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
+
+}