From fec795bb6f363491b832dd3c29a00f4a16e29afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Fri, 6 Feb 2026 01:01:04 +0100 Subject: [PATCH 1/2] Reproduce AdminUI 401 when basicAuth --- solr/packaging/test/test_basic_auth.bats | 32 ++++++++++++++---------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/solr/packaging/test/test_basic_auth.bats b/solr/packaging/test/test_basic_auth.bats index 973aa95f351c..b78c532bea6b 100644 --- a/solr/packaging/test/test_basic_auth.bats +++ b/solr/packaging/test/test_basic_auth.bats @@ -19,14 +19,14 @@ load bats_helper setup() { common_clean_setup - + echo "Starting Solr" solr start -Dsolr.packages.enabled=true - - # The auth command exports some system variables that are injected as basic auth username and password, + + # The auth command exports some system variables that are injected as basic auth username and password, # however that defeats our test so fake that out via --solr-include-file param specifing a bogus path. solr auth enable --type basicAuth --credentials name:password --solr-include-file /force/credentials/to/be/supplied - + solr assert --credentials name:password --cloud http://localhost:${SOLR_PORT} --timeout 5000 } @@ -45,28 +45,28 @@ teardown() { @test "create, config, api, and delete with basic auth" { # Test create - run solr create -u name:password -c COLL_NAME + run solr create -u name:password -c COLL_NAME assert_output --partial "Created collection 'COLL_NAME'" - + # Test config run solr config -u name:password -c COLL_NAME --action set-property --property updateHandler.autoCommit.maxDocs --value 100 --solr-url http://localhost:${SOLR_PORT}/solr assert_output --partial "Successfully set-property updateHandler.autoCommit.maxDocs to 100" - + # Test api run solr api -u name:password --solr-url "http://localhost:${SOLR_PORT}/solr/COLL_NAME/select?q=*:*" --verbose assert_output --partial '"numFound":0' - + # Test delete run solr delete --credentials name:password -c COLL_NAME -z localhost:${ZK_PORT} --delete-config --verbose assert_output --partial "Deleted collection 'COLL_NAME'" refute collection_exists "COLL_NAME" refute config_exists "COLL_NAME" - + } @test "post, postlogs and export with basic auth" { run solr create -c COLL_NAME - run solr create -u name:password -c COLL_NAME + run solr create -u name:password -c COLL_NAME assert_output --partial "Created collection 'COLL_NAME'" # Test post @@ -76,18 +76,24 @@ run solr create -c COLL_NAME # Test postlogs run solr postlogs -u name:password --solr-url http://localhost:${SOLR_PORT} --name COLL_NAME -rootdir ${SOLR_LOGS_DIR}/solr.log assert_output --partial 'Committed' - + # Test export #run solr export -u name:password --solr-url http://localhost:${SOLR_PORT} --name COLL_NAME --query "*:*" --output "${BATS_TEST_TMPDIR}/output" #assert_output --partial 'Export complete' - + } @test "package with basic auth" { - + run solr package deploy PACKAGE_NAME --credentials name:password --collections foo-1.2 # verify that package tool is communicating with Solr via basic auth assert_output --partial "Collection(s) doesn't exist: [foo-1.2]" #assert_output --partial "Deployment successful" #refute_output --partial "Invalid collection" } + +@test "admin UI static content is excepted from basic auth" { + run curl -I -s http://localhost:${SOLR_PORT}/solr/ + assert_output --partial "HTTP/1.1 200" + assert_output --partial "Content-Type: text/html" +} From 11b6efed9e816e10b689cfa496017a92fb19c0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Fri, 6 Feb 2026 01:09:03 +0100 Subject: [PATCH 2/2] Revert whitespace-only changes, keep new admin UI test Reverted whitespace-only edits (trailing space removal) while preserving the new test case for admin UI basic auth exception. Co-Authored-By: Claude Sonnet 4.5 --- solr/packaging/test/test_basic_auth.bats | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/solr/packaging/test/test_basic_auth.bats b/solr/packaging/test/test_basic_auth.bats index b78c532bea6b..ab4932a7f5a1 100644 --- a/solr/packaging/test/test_basic_auth.bats +++ b/solr/packaging/test/test_basic_auth.bats @@ -19,14 +19,14 @@ load bats_helper setup() { common_clean_setup - + echo "Starting Solr" solr start -Dsolr.packages.enabled=true - - # The auth command exports some system variables that are injected as basic auth username and password, + + # The auth command exports some system variables that are injected as basic auth username and password, # however that defeats our test so fake that out via --solr-include-file param specifing a bogus path. solr auth enable --type basicAuth --credentials name:password --solr-include-file /force/credentials/to/be/supplied - + solr assert --credentials name:password --cloud http://localhost:${SOLR_PORT} --timeout 5000 } @@ -45,28 +45,28 @@ teardown() { @test "create, config, api, and delete with basic auth" { # Test create - run solr create -u name:password -c COLL_NAME + run solr create -u name:password -c COLL_NAME assert_output --partial "Created collection 'COLL_NAME'" - + # Test config run solr config -u name:password -c COLL_NAME --action set-property --property updateHandler.autoCommit.maxDocs --value 100 --solr-url http://localhost:${SOLR_PORT}/solr assert_output --partial "Successfully set-property updateHandler.autoCommit.maxDocs to 100" - + # Test api run solr api -u name:password --solr-url "http://localhost:${SOLR_PORT}/solr/COLL_NAME/select?q=*:*" --verbose assert_output --partial '"numFound":0' - + # Test delete run solr delete --credentials name:password -c COLL_NAME -z localhost:${ZK_PORT} --delete-config --verbose assert_output --partial "Deleted collection 'COLL_NAME'" refute collection_exists "COLL_NAME" refute config_exists "COLL_NAME" - + } @test "post, postlogs and export with basic auth" { run solr create -c COLL_NAME - run solr create -u name:password -c COLL_NAME + run solr create -u name:password -c COLL_NAME assert_output --partial "Created collection 'COLL_NAME'" # Test post @@ -76,15 +76,15 @@ run solr create -c COLL_NAME # Test postlogs run solr postlogs -u name:password --solr-url http://localhost:${SOLR_PORT} --name COLL_NAME -rootdir ${SOLR_LOGS_DIR}/solr.log assert_output --partial 'Committed' - + # Test export #run solr export -u name:password --solr-url http://localhost:${SOLR_PORT} --name COLL_NAME --query "*:*" --output "${BATS_TEST_TMPDIR}/output" #assert_output --partial 'Export complete' - + } @test "package with basic auth" { - + run solr package deploy PACKAGE_NAME --credentials name:password --collections foo-1.2 # verify that package tool is communicating with Solr via basic auth assert_output --partial "Collection(s) doesn't exist: [foo-1.2]"