Commit b117721d by Carlos Martín Nieto

proxy: use poxy to test our Windows proxy support

parent 07bd3e57
...@@ -19,6 +19,7 @@ environment: ...@@ -19,6 +19,7 @@ environment:
cache: cache:
- i686-4.9.2-release-win32-sjlj-rt_v3-rev1.7z - i686-4.9.2-release-win32-sjlj-rt_v3-rev1.7z
- x86_64-4.9.2-release-win32-seh-rt_v3-rev1.7z - x86_64-4.9.2-release-win32-seh-rt_v3-rev1.7z
build_script: build_script:
- ps: | - ps: |
mkdir build mkdir build
...@@ -26,6 +27,7 @@ build_script: ...@@ -26,6 +27,7 @@ build_script:
if ($env:GENERATOR -ne "MSYS Makefiles") { if ($env:GENERATOR -ne "MSYS Makefiles") {
cmake -D ENABLE_TRACE=ON -D BUILD_CLAR=ON -D MSVC_CRTDBG=ON .. -G"$env:GENERATOR" cmake -D ENABLE_TRACE=ON -D BUILD_CLAR=ON -D MSVC_CRTDBG=ON .. -G"$env:GENERATOR"
cmake --build . --config Debug cmake --build . --config Debug
Invoke-WebRequest https://github.com/ethomson/poxyproxy/releases/download/v0.1.0/poxyproxy-0.1.0.jar -OutFile poxyproxy.jar
} }
- cmd: | - cmd: |
if "%GENERATOR%"=="MSYS Makefiles" (C:\MinGW\msys\1.0\bin\sh --login /c/projects/libgit2/script/appveyor-mingw.sh) if "%GENERATOR%"=="MSYS Makefiles" (C:\MinGW\msys\1.0\bin\sh --login /c/projects/libgit2/script/appveyor-mingw.sh)
...@@ -36,3 +38,11 @@ test_script: ...@@ -36,3 +38,11 @@ test_script:
$env:GITTEST_REMOTE_URL="https://github.com/libgit2/non-existent" $env:GITTEST_REMOTE_URL="https://github.com/libgit2/non-existent"
$env:GITTEST_REMOTE_USER="libgit2test" $env:GITTEST_REMOTE_USER="libgit2test"
ctest -V -R libgit2_clar-cred_callback ctest -V -R libgit2_clar-cred_callback
Start-Job { java -jar $Env:APPVEYOR_BUILD_FOLDER\build\poxyproxy.jar -d --port 8080 --credentials foo:bar }
ctest -V .
$env:GITTEST_REMOTE_PROXY_URL = "http://foo:bar@localhost:8080/"
.\Debug\libgit2_clar.exe -sonline::clone::proxy_credentials_in_url
$env:GITTEST_REMOTE_PROXY_URL = "http://localhost:8080/"
$env:GITTEST_REMOTE_PROXY_USER = "foo"
$env:GITTEST_REMOTE_PROXY_PASS = "bar"
.\Debug\libgit2_clar.exe -sonline::clone::proxy_credentials_request
...@@ -444,6 +444,7 @@ static void git_smart__free(git_transport *transport) ...@@ -444,6 +444,7 @@ static void git_smart__free(git_transport *transport)
git_pkt_free(p); git_pkt_free(p);
git_vector_free(refs); git_vector_free(refs);
git__free(t->proxy.url);
git_strarray_free(&t->custom_headers); git_strarray_free(&t->custom_headers);
......
...@@ -693,7 +693,6 @@ void test_online_clone__proxy_credentials_in_url(void) ...@@ -693,7 +693,6 @@ void test_online_clone__proxy_credentials_in_url(void)
g_options.fetch_opts.proxy_opts.type = GIT_PROXY_HTTP; g_options.fetch_opts.proxy_opts.type = GIT_PROXY_HTTP;
g_options.fetch_opts.proxy_opts.url = _remote_proxy_url; g_options.fetch_opts.proxy_opts.url = _remote_proxy_url;
g_options.fetch_opts.proxy_opts.credentials = proxy_creds;
called_proxy_creds = 0; called_proxy_creds = 0;
cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options)); cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options));
cl_assert(called_proxy_creds == 0); cl_assert(called_proxy_creds == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment