Skip to content

Commit e1f900c

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 e2d7d8c commit e1f900c

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
@@ -867,78 +867,4 @@ test_expect_success NTLM 'access using NTLM auth' '
867867
git ls-remote "$HTTPD_URL/ntlm_auth/repo.git"
868868
'
869869

870-
test_lazy_prereq SPNEGO 'curl --version | grep -qi "SPNEGO\|GSS-API\|Kerberos\|negotiate"'
871-
872-
test_expect_success SPNEGO 'http.emptyAuth=auto attempts Negotiate before credential_fill' '
873-
test_when_finished "per_test_cleanup" &&
874-
875-
set_credential_reply get <<-EOF &&
876-
username=alice
877-
password=secret-passwd
878-
EOF
879-
880-
# Basic base64(alice:secret-passwd)
881-
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
882-
id=1 creds=Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
883-
EOF
884-
885-
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
886-
id=1 status=200
887-
id=default response=WWW-Authenticate: Negotiate
888-
id=default response=WWW-Authenticate: Basic realm="example.com"
889-
EOF
890-
891-
test_config_global credential.helper test-helper &&
892-
GIT_TRACE_CURL="$TRASH_DIRECTORY/trace-auto" \
893-
git -c http.emptyAuth=auto \
894-
ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
895-
896-
# In auto mode with a Negotiate+Basic server, there should be
897-
# three 401 responses: (1) initial no-auth request, (2) empty-auth
898-
# retry where Negotiate fails (no Kerberos ticket), (3) libcurl
899-
# internal Negotiate retry. The fourth attempt uses Basic
900-
# credentials from credential_fill and succeeds.
901-
grep "HTTP/[0-9.]* 401" "$TRASH_DIRECTORY/trace-auto" >actual_401s &&
902-
test_line_count = 3 actual_401s &&
903-
904-
expect_credential_query get <<-EOF
905-
capability[]=authtype
906-
capability[]=state
907-
protocol=http
908-
host=$HTTPD_DEST
909-
wwwauth[]=Negotiate
910-
wwwauth[]=Basic realm="example.com"
911-
EOF
912-
'
913-
914-
test_expect_success SPNEGO 'http.emptyAuth=false skips Negotiate' '
915-
test_when_finished "per_test_cleanup" &&
916-
917-
set_credential_reply get <<-EOF &&
918-
username=alice
919-
password=secret-passwd
920-
EOF
921-
922-
# Basic base64(alice:secret-passwd)
923-
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
924-
id=1 creds=Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
925-
EOF
926-
927-
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
928-
id=1 status=200
929-
id=default response=WWW-Authenticate: Negotiate
930-
id=default response=WWW-Authenticate: Basic realm="example.com"
931-
EOF
932-
933-
test_config_global credential.helper test-helper &&
934-
GIT_TRACE_CURL="$TRASH_DIRECTORY/trace-false" \
935-
git -c http.emptyAuth=false \
936-
ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
937-
938-
# With emptyAuth=false, Negotiate is stripped immediately and
939-
# credential_fill is called right away. Only one 401 response.
940-
grep "HTTP/[0-9.]* 401" "$TRASH_DIRECTORY/trace-false" >actual_401s &&
941-
test_line_count = 1 actual_401s
942-
'
943-
944870
test_done

0 commit comments

Comments
 (0)