aboutsummaryrefslogtreecommitdiff
path: root/t/lib-httpd.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-01-10 10:33:18 -0800
committerJunio C Hamano <gitster@pobox.com>2014-01-10 10:33:19 -0800
commit35a116d740930f34e0d3cd2e07ed266e96a1d165 (patch)
treebbff6134198372d68d2a5b5501059142cda40323 /t/lib-httpd.sh
parent56e648e2534a4eb76713a8843354620599098fa6 (diff)
parentafbf5ca507470aab6716671f2ad207c74cd585fb (diff)
downloadgit-35a116d740930f34e0d3cd2e07ed266e96a1d165.tar.gz
git-35a116d740930f34e0d3cd2e07ed266e96a1d165.tar.xz
Merge branch 'jk/http-auth-tests-robustify'
Using the same username and password during the tests would not catch a potential breakage of sending one when we should be sending the other. * jk/http-auth-tests-robustify: use distinct username/password for http auth tests
Diffstat (limited to 't/lib-httpd.sh')
-rw-r--r--t/lib-httpd.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index c4707843c..bfdff2a8c 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -129,7 +129,7 @@ prepare_httpd() {
HTTPD_DEST=127.0.0.1:$LIB_HTTPD_PORT
HTTPD_URL=$HTTPD_PROTO://$HTTPD_DEST
HTTPD_URL_USER=$HTTPD_PROTO://user%40host@$HTTPD_DEST
- HTTPD_URL_USER_PASS=$HTTPD_PROTO://user%40host:user%40host@$HTTPD_DEST
+ HTTPD_URL_USER_PASS=$HTTPD_PROTO://user%40host:pass%40host@$HTTPD_DEST
if test -n "$LIB_HTTPD_DAV" -o -n "$LIB_HTTPD_SVN"
then
@@ -217,7 +217,15 @@ setup_askpass_helper() {
test_expect_success 'setup askpass helper' '
write_script "$TRASH_DIRECTORY/askpass" <<-\EOF &&
echo >>"$TRASH_DIRECTORY/askpass-query" "askpass: $*" &&
- cat "$TRASH_DIRECTORY/askpass-response"
+ case "$*" in
+ *Username*)
+ what=user
+ ;;
+ *Password*)
+ what=pass
+ ;;
+ esac &&
+ cat "$TRASH_DIRECTORY/askpass-$what"
EOF
GIT_ASKPASS="$TRASH_DIRECTORY/askpass" &&
export GIT_ASKPASS &&
@@ -227,7 +235,8 @@ setup_askpass_helper() {
set_askpass() {
>"$TRASH_DIRECTORY/askpass-query" &&
- echo "$*" >"$TRASH_DIRECTORY/askpass-response"
+ echo "$1" >"$TRASH_DIRECTORY/askpass-user" &&
+ echo "$2" >"$TRASH_DIRECTORY/askpass-pass"
}
expect_askpass() {