@@ -75,13 +75,13 @@ health_checks() {
7575 run curl -sfI http://${PROJNAME} .ddev.site:8983
7676 assert_success
7777 assert_output --partial " HTTP/1.1 302"
78- assert_output --partial " Location: http://${PROJNAME} .ddev.site:8983/solr/"
78+ assert_output --regexp " Location: ( http://${PROJNAME} \\ .ddev\\ .site:8983)? /solr/"
7979
8080 # Make sure the solr admin UI via HTTPS from outside is redirected to HTTPS /solr/
8181 run curl -sfI https://${PROJNAME} .ddev.site:8943
8282 assert_success
8383 assert_output --partial " HTTP/2 302"
84- assert_output --partial " location: https://${PROJNAME} .ddev.site:8943/solr/"
84+ assert_output --regexp " [Ll]ocation: ( https://${PROJNAME} \\ .ddev\\ .site:8943)? /solr/"
8585
8686 # Make sure the solr admin UI is working from outside
8787 run curl -sfL https://${PROJNAME} .ddev.site:8943
@@ -102,6 +102,11 @@ health_checks() {
102102 DDEV_DEBUG=true run ddev solr-admin
103103 assert_success
104104 assert_output --partial " FULLURL https://${PROJNAME} .ddev.site:8943"
105+
106+ # `ddev solr-zk` should work
107+ run ddev solr-zk ls /
108+ assert_success
109+ assert_output --partial " security.json"
105110}
106111
107112teardown () {
@@ -162,3 +167,35 @@ teardown() {
162167
163168 health_checks
164169}
170+
171+ @test " install from directory Solr 9" {
172+ set -eu -o pipefail
173+
174+ echo " ⚡ Setting Solr base image to Solr 9" >&3
175+ run ddev dotenv set .ddev/.env.solr --solr-base-image " solr:9"
176+ assert_success
177+ assert_file_exist .ddev/.env.solr
178+
179+ echo " # ddev add-on get ${DIR} with project ${PROJNAME} in $( pwd) " >&3
180+ run ddev add-on get " ${DIR} "
181+ assert_success
182+
183+ run ddev restart -y
184+ assert_success
185+
186+ echo " 🔍 Retrieving Solr version..." >&3
187+ echo $( ddev solr --version) >&3
188+ SOLR_VERSION=$( ddev solr --version | grep -oE ' 9\.[0-9]+\.[0-9]+' || { printf " ❌ Failed to get Solr version\n" >&2 ; exit 1; })
189+
190+ echo " 🔍 Retrieved Solr version: '$SOLR_VERSION '" >&3
191+
192+ # Validate that the version starts with 9.x.x
193+ if ! [[ $SOLR_VERSION =~ ^9\. [0-9]+\. [0-9]+$ ]]; then
194+ echo " ❌ Expected version matching '9.x.x' but got '$SOLR_VERSION '" >&2
195+ exit 1
196+ fi
197+
198+ echo " ✅ Solr 9.x.x version check passed!" >&3
199+
200+ health_checks
201+ }
0 commit comments