Skip to content

Commit 534e975

Browse files
dschoGit for Windows Build Agent
authored andcommitted
??? t5563: add tests for http.emptyAuth with Negotiate
The downstream NTLM topic (883674c, "t5563: verify that NTLM authentication works") and upstream commit 7e98eb8 ("t5563: add tests for http.emptyAuth with Negotiate") both added SPNEGO tests to the end of t5563. When both topics landed in shears/seen, the SPNEGO tests were duplicated: the first set appears before the NTLM tests (from upstream), the second set after (from the downstream topic). Since GIT_TRACE_CURL appends to the trace file rather than overwriting it, the second set of tests sees the 401 responses from both runs. Test 21 (auto mode) expects 3 lines in trace-auto but finds 6 (3 + 3), and test 22 (false mode) expects 1 but finds 2 (1 + 1), causing all four macOS CI jobs to fail. Remove the duplicate second set; the first (upstream) copy is sufficient. Assisted-by: Claude Opus 4.6 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent b5bc25f commit 534e975

1 file changed

Lines changed: 0 additions & 74 deletions

File tree

t/t5563-simple-http-auth.sh

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -822,78 +822,4 @@ test_expect_success NTLM 'access using NTLM auth' '
822822
git ls-remote "$HTTPD_URL/ntlm_auth/repo.git"
823823
'
824824

825-
test_lazy_prereq SPNEGO 'curl --version | grep -qi "SPNEGO\|GSS-API\|Kerberos\|negotiate"'
826-
827-
test_expect_success SPNEGO 'http.emptyAuth=auto attempts Negotiate before credential_fill' '
828-
test_when_finished "per_test_cleanup" &&
829-
830-
set_credential_reply get <<-EOF &&
831-
username=alice
832-
password=secret-passwd
833-
EOF
834-
835-
# Basic base64(alice:secret-passwd)
836-
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
837-
id=1 creds=Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
838-
EOF
839-
840-
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
841-
id=1 status=200
842-
id=default response=WWW-Authenticate: Negotiate
843-
id=default response=WWW-Authenticate: Basic realm="example.com"
844-
EOF
845-
846-
test_config_global credential.helper test-helper &&
847-
GIT_TRACE_CURL="$TRASH_DIRECTORY/trace-auto" \
848-
git -c http.emptyAuth=auto \
849-
ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
850-
851-
# In auto mode with a Negotiate+Basic server, there should be
852-
# three 401 responses: (1) initial no-auth request, (2) empty-auth
853-
# retry where Negotiate fails (no Kerberos ticket), (3) libcurl
854-
# internal Negotiate retry. The fourth attempt uses Basic
855-
# credentials from credential_fill and succeeds.
856-
grep "HTTP/[0-9.]* 401" "$TRASH_DIRECTORY/trace-auto" >actual_401s &&
857-
test_line_count = 3 actual_401s &&
858-
859-
expect_credential_query get <<-EOF
860-
capability[]=authtype
861-
capability[]=state
862-
protocol=http
863-
host=$HTTPD_DEST
864-
wwwauth[]=Negotiate
865-
wwwauth[]=Basic realm="example.com"
866-
EOF
867-
'
868-
869-
test_expect_success SPNEGO 'http.emptyAuth=false skips Negotiate' '
870-
test_when_finished "per_test_cleanup" &&
871-
872-
set_credential_reply get <<-EOF &&
873-
username=alice
874-
password=secret-passwd
875-
EOF
876-
877-
# Basic base64(alice:secret-passwd)
878-
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
879-
id=1 creds=Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
880-
EOF
881-
882-
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
883-
id=1 status=200
884-
id=default response=WWW-Authenticate: Negotiate
885-
id=default response=WWW-Authenticate: Basic realm="example.com"
886-
EOF
887-
888-
test_config_global credential.helper test-helper &&
889-
GIT_TRACE_CURL="$TRASH_DIRECTORY/trace-false" \
890-
git -c http.emptyAuth=false \
891-
ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
892-
893-
# With emptyAuth=false, Negotiate is stripped immediately and
894-
# credential_fill is called right away. Only one 401 response.
895-
grep "HTTP/[0-9.]* 401" "$TRASH_DIRECTORY/trace-false" >actual_401s &&
896-
test_line_count = 1 actual_401s
897-
'
898-
899825
test_done

0 commit comments

Comments
 (0)