commit a72fb3943aac447913520efc133b9b010beb8001 from: Omar Polo via: Thomas Adam date: Mon Jan 23 18:21:06 2023 UTC add a test for ssh connections without a repo path argument would have caught the fixed failure in disposing early-closed connections in gotd. ok jamsek, stsp commit - 214d733a8e368034e6afa52b6c9ac25e071fd0c7 commit + a72fb3943aac447913520efc133b9b010beb8001 blob - 113aa4cf7bd50234a0d5ea376652934c0ef7b007 blob + 2da807fe1e4177665e880f05b69701f7a6bd8cbd --- regress/gotd/request_bad.sh +++ regress/gotd/request_bad.sh @@ -292,7 +292,33 @@ test_request_bad_large_repo_name() { fi test_done "$testroot" "$ret" } + +test_request_bad_no_repo() { + local testroot=`test_init test_request_bad_no_repo` + for i in `seq 10`; do + ssh ${GOTD_DEVUSER}@127.0.0.1 git-upload-pack \ + >/dev/null 2>/dev/null $testroot/stderr + cat < $testroot/stderr.expected +got-fetch-pack: could not find any branches to fetch +got: could not find any branches to fetch +EOF + + if ! cmp -s "$testroot/stderr.expected" "$testroot/stderr"; then + echo "got clone failed for unexpected reason" >&2 + diff -u "$testroot/stderr.expected" "$testroot/stderr" + test_done "$testroot" 1 + return + fi + + test_done "$testroot" 0 +} + test_parseargs "$@" run_test test_request_bad_commit run_test test_request_bad_length_zero @@ -302,3 +328,4 @@ run_test test_request_bad_length_large run_test test_request_bad_capabilities run_test test_request_bad_repository run_test test_request_bad_large_repo_name +run_test test_request_bad_no_repo