|
1 | 1 | #!/usr/bin/env bash
|
2 | 2 |
|
3 |
| -set -ex |
| 3 | +set -e |
4 | 4 | <
8000
code class="diff-text syntax-highlighted-line">
|
5 | 5 | if [ -n "$SKIP_TESTS" ]; then
|
6 | 6 | if [ -z "$SKIP_OFFLINE_TESTS" ]; then SKIP_OFFLINE_TESTS=1; fi
|
@@ -162,14 +162,7 @@ echo ""
|
162 | 162 | if should_run "GITDAEMON_TESTS"; then
|
163 | 163 | echo "Starting git daemon (standard)..."
|
164 | 164 | GIT_STANDARD_DIR=`mktemp -d ${TMPDIR}/git_standard.XXXXXXXX`
|
165 |
| - git init --bare "${GIT_STANDARD_DIR}/test.git" >/dev/null |
166 |
| - git config --file "${GIT_STANDARD_DIR}/test.git/config" receive.advertisePushOptions true |
167 |
| - for f in $(ls ${SOURCE_DIR}/ci/hooks) |
168 |
| - do |
169 |
| - sed "s=%file%=${TMPDIR}/push-option-result-git-daemon=g" "${SOURCE_DIR}/ci/hooks/$f" > "${GIT_STANDARD_DIR}/test.git/hooks/${f}" |
170 |
| - chmod +x "$GIT_STANDARD_DIR/test.git/hooks/${f}" |
171 |
| - done |
172 |
| -
|
| 165 | + cp -R "${SOURCE_DIR}/tests/resources/pushoptions.git" "${GIT_STANDARD_DIR}/test.git" |
173 | 166 | git daemon --listen=localhost --export-all --enable=receive-pack --base-path="${GIT_STANDARD_DIR}" "${GIT_STANDARD_DIR}" 2>/dev/null &
|
174 | 167 |
|
175 | 168 | GIT_STANDARD_PID=$!
|
@@ -204,14 +197,7 @@ if should_run "NTLM_TESTS" || should_run "ONLINE_TESTS"; then
|
204 | 197 |
|
205 | 198 | echo "Starting HTTP server..."
|
206 | 199 | HTTP_DIR=`mktemp -d ${TMPDIR}/http.XXXXXXXX`
|
207 |
| - git init --bare "${HTTP_DIR}/test.git" |
208 |
| - git config --file "${HTTP_DIR}/test.git/config" receive.advertisePushOptions true |
209 |
| -
|
210 |
| - for f in $(ls ${SOURCE_DIR}/ci/hooks) |
211 |
| - do |
212 |
| - sed "s=%file%=${TMPDIR}/push-option-result-git-ntlm=g" "${SOURCE_DIR}/ci/hooks/$f" > "${HTTP_DIR}/test.git/hooks/${f}" |
213 |
| - chmod +x "$HTTP_DIR/test.git/hooks/${f}" |
214 |
| - done |
| 200 | + cp -R "${SOURCE_DIR}/tests/resources/pushoptions.git" "${HTTP_DIR}/test.git" |
215 | 201 |
|
216 | 202 | java -jar poxygit.jar --address 127.0.0.1 --port 9000 --credentials foo:baz --quiet "${HTTP_DIR}" &
|
217 | 203 | HTTP_PID=$!
|
|
220 | 206 | if should_run "SSH_TESTS"; then
|
221 | 207 | echo "Starting SSH server..."
|
222 | 208 | SSHD_DIR=`mktemp -d ${TMPDIR}/sshd.XXXXXXXX`
|
223 |
| - git init --bare "${SSHD_DIR}/test.git" >/dev/null |
224 |
| - git config --file "${SSHD_DIR}/test.git/config" receive.advertisePushOptions true |
225 |
| -
|
226 |
| - for f in $(ls ${SOURCE_DIR}/ci/hooks) |
227 |
| - do |
228 |
| - sed "s=%file%=${TMPDIR}/push-option-result-git-ssh=g" "${SOURCE_DIR}/ci/hooks/$f" > "${SSHD_DIR}/test.git/hooks/${f}" |
229 |
| - chmod +x "$SSHD_DIR/test.git/hooks/${f}" |
230 |
| - done |
| 209 | + cp -R "${SOURCE_DIR}/tests/resources/pushoptions.git" "${SSHD_DIR}/test.git" |
| 210 | + ls -FlasR "${SSHD_DIR}" |
231 | 211 |
|
232 | 212 | cat >"${SSHD_DIR}/sshd_config" <<-EOF
|
233 | 213 | Port 2222
|
@@ -344,13 +324,11 @@ if should_run "GITDAEMON_TESTS"; then
|
344 | 324 | echo "Running gitdaemon (standard) tests"
|
345 | 325 | echo ""
|
346 | 326 |
|
347 |
| - if [[ "$RUN_PUSH_OPTONS_TESTS" = "true " ]]; then |
348 |
| - export GITTEST_PUSH_OPTION_RESULT="${TMPDIR}/push-option-result-git-daemon" |
349 |
| - fi |
350 | 327 | export GITTEST_REMOTE_URL="git://localhost/test.git"
|
| 328 | + export GITTEST_PUSH_OPTIONS=true |
351 | 329 | run_test gitdaemon
|
352 |
| - unset GITTEST_PUSH_OPTION_RESULT |
353 | 330 | unset GITTEST_REMOTE_URL
|
| 331 | + unset GITTEST_PUSH_OPTIONS |
354 | 332 |
|
355 | 333 | echo ""
|
356 | 334 | echo "Running gitdaemon (namespace) tests"
|
@@ -402,33 +380,29 @@ if should_run "NTLM_TESTS"; then
|
402 | 380 | echo "Running NTLM tests (IIS emulation)"
|
403 | 381 | echo ""
|
404 | 382 |
|
405 |
| - if [[ "$RUN_PUSH_OPTONS_TESTS" = "true " ]]; then |
406 |
| - export GITTEST_PUSH_OPTION_RESULT="${TMPDIR}/push-option-result-git-ntlm" |
407 |
| - fi |
408 | 383 | export GITTEST_REMOTE_URL="http://localhost:9000/ntlm/test.git"
|
409 | 384 | export GITTEST_REMOTE_USER="foo"
|
410 | 385 | export GITTEST_REMOTE_PASS="baz"
|
| 386 | + export GITTEST_PUSH_OPTIONS=true |
411 | 387 | run_test auth_clone_and_push
|
412 |
| - unset GITTEST_PUSH_OPTION_RESULT |
413 | 388 | unset GITTEST_REMOTE_URL
|
414 | 389 | unset GITTEST_REMOTE_USER
|
415 | 390 | unset GITTEST_REMOTE_PASS
|
| 391 | + unset GITTEST_PUSH_OPTIONS |
416 | 392 |
|
417 | 393 | echo ""
|
418 | 394 | echo "Running NTLM tests (Apache emulation)"
|
419 | 395 | echo ""
|
420 | 396 |
|
421 |
| - if [[ "$RUN_PUSH_OPTONS_TESTS" == "true " ]]; then |
422 |
| - export GITTEST_PUSH_OPTION_RESULT="${TMPDIR}/push-option-result-git-ntlm" |
423 |
| - fi |
424 | 397 | export GITTEST_REMOTE_URL="http://localhost:9000/broken-ntlm/test.git"
|
425 | 398 | export GITTEST_REMOTE_USER="foo"
|
426 | 399 | export GITTEST_REMOTE_PASS="baz"
|
| 400 | + export GITTEST_PUSH_OPTIONS=true |
427 | 401 | run_test auth_clone_and_push
|
428 |
| - unset GITTEST_PUSH_OPTION_RESULT |
429 | 402 | unset GITTEST_REMOTE_URL
|
430 | 403 | unset GITTEST_REMOTE_USER
|
431 | 404 | unset GITTEST_REMOTE_PASS
|
| 405 | + unset GITTEST_PUSH_OPTIONS |
432 | 406 | fi
|
433 | 407 |
|
434 | 408 | if should_run "NEGOTIATE_TESTS" && -n "$GITTEST_NEGOTIATE_PASSWORD" ; then
|
@@ -477,25 +451,21 @@ if should_run "SSH_TESTS"; then
|
477 | 451 | echo "Running ssh tests"
|
478 | 452 | echo ""
|
479 | 453 |
|
480 |
| - if [[ "$RUN_PUSH_OPTONS_TESTS" == "true " ]]; then |
481 |
| - export GITTEST_PUSH_OPTION_RESULT="${TMPDIR}/push-option-result-ssh" |
482 |
| - fi |
483 | 454 | export GITTEST_REMOTE_URL="ssh://localhost:2222/$SSHD_DIR/test.git"
|
| 455 | + export GITTEST_PUSH_OPTIONS=true |
484 | 456 | run_test ssh
|
485 |
| - unset GITTEST_PUSH_OPTION_RESULT |
486 | 457 | unset GITTEST_REMOTE_URL
|
| 458 | + unset GITTEST_PUSH_OPTIONS |
487 | 459 |
|
488 | 460 | echo ""
|
489 | 461 | echo "Running ssh tests (scp-style paths)"
|
490 | 462 | echo ""
|
491 | 463 |
|
492 |
| - if [[ "$RUN_PUSH_OPTONS_TESTS" == "true " ]]; then |
493 |
| - export GITTEST_PUSH_OPTION_RESULT="${TMPDIR}/push-option-result-ssh" |
494 |
| - fi |
495 | 464 | export GITTEST_REMOTE_URL="[localhost:2222]:$SSHD_DIR/test.git"
|
| 465 | + export GITTEST_PUSH_OPTIONS=true |
496 | 466 | run_test ssh
|
497 |
| - unset GITTEST_PUSH_OPTION_RESULT |
498 | 467 | unset GITTEST_REMOTE_URL
|
| 468 | + unset GITTEST_PUSH_OPTIONS |
499 | 469 |
|
500 | 470 | unset GITTEST_SSH_CMD
|
501 | 471 |
|
|
0 commit comments