diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2018-10-21 21:00:37 +0100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2018-10-21 21:00:37 +0100 |
commit | f449bb9f28e4e7ab3fe95d4f234d4295fa073ed3 (patch) | |
tree | c2a7f45cafc340759d8d454787107e33ee679bc5 | |
parent | ddc4a8ce8a4a1af0d9cfadea13c9fe1c688ec6e8 (diff) | |
download | libgit2-ethomson/ssl_proxy.tar.gz |
tests: PROXY_URL is more accurately PROXY_HOSTethomson/ssl_proxy
Change the `GITTEST_REMOTE_PROXY_URL` environment variable to be
`GITTEST_REMOTE_PROXY_HOST`, since it is a host:port combination, not an
actual URL. (We cannot use a URL here since we may want to include the
username:password combination in the constructed URL.)
-rw-r--r-- | ci/test.ps1 | 2 | ||||
-rwxr-xr-x | ci/test.sh | 4 | ||||
-rw-r--r-- | tests/online/clone.c | 18 |
3 files changed, 12 insertions, 12 deletions
diff --git a/ci/test.ps1 b/ci/test.ps1 index 7a55bff79..1b483894c 100644 --- a/ci/test.ps1 +++ b/ci/test.ps1 @@ -60,7 +60,7 @@ if (-not $Env:SKIP_PROXY_TESTS) { Write-Host "Running proxy tests" Write-Host "" - $Env:GITTEST_REMOTE_PROXY_URL="localhost:8080" + $Env:GITTEST_REMOTE_PROXY_HOST="localhost:8080" $Env:GITTEST_REMOTE_PROXY_USER="foo" $Env:GITTEST_REMOTE_PROXY_PASS="bar" diff --git a/ci/test.sh b/ci/test.sh index e50e6fa9e..9203ea21f 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -158,11 +158,11 @@ if [ -z "$SKIP_PROXY_TESTS" ]; then echo "Running proxy tests" echo "" - export GITTEST_REMOTE_PROXY_URL="localhost:8080" + export GITTEST_REMOTE_PROXY_HOST="localhost:8080" export GITTEST_REMOTE_PROXY_USER="foo" export GITTEST_REMOTE_PROXY_PASS="bar" run_test proxy - unset GITTEST_REMOTE_PROXY_URL + unset GITTEST_REMOTE_PROXY_HOST unset GITTEST_REMOTE_PROXY_USER unset GITTEST_REMOTE_PROXY_PASS fi diff --git a/tests/online/clone.c b/tests/online/clone.c index 09eff4823..0f78991a4 100644 --- a/tests/online/clone.c +++ b/tests/online/clone.c @@ -24,7 +24,7 @@ static char *_remote_ssh_pubkey = NULL; static char *_remote_ssh_privkey = NULL; static char *_remote_ssh_passphrase = NULL; static char *_remote_ssh_fingerprint = NULL; -static char *_remote_proxy_url = NULL; +static char *_remote_proxy_host = NULL; static char *_remote_proxy_user = NULL; static char *_remote_proxy_pass = NULL; @@ -52,7 +52,7 @@ void test_online_clone__initialize(void) _remote_ssh_privkey = cl_getenv("GITTEST_REMOTE_SSH_KEY"); _remote_ssh_passphrase = cl_getenv("GITTEST_REMOTE_SSH_PASSPHRASE"); _remote_ssh_fingerprint = cl_getenv("GITTEST_REMOTE_SSH_FINGERPRINT"); - _remote_proxy_url = cl_getenv("GITTEST_REMOTE_PROXY_URL"); + _remote_proxy_host = cl_getenv("GITTEST_REMOTE_PROXY_HOST"); _remote_proxy_user = cl_getenv("GITTEST_REMOTE_PROXY_USER"); _remote_proxy_pass = cl_getenv("GITTEST_REMOTE_PROXY_PASS"); @@ -74,7 +74,7 @@ void test_online_clone__cleanup(void) git__free(_remote_ssh_privkey); git__free(_remote_ssh_passphrase); git__free(_remote_ssh_fingerprint); - git__free(_remote_proxy_url); + git__free(_remote_proxy_host); git__free(_remote_proxy_user); git__free(_remote_proxy_pass); @@ -728,10 +728,10 @@ void test_online_clone__proxy_credentials_request(void) { git_buf url = GIT_BUF_INIT; - if (!_remote_proxy_url || !_remote_proxy_user || !_remote_proxy_pass) + if (!_remote_proxy_host || !_remote_proxy_user || !_remote_proxy_pass) cl_skip(); - cl_git_pass(git_buf_printf(&url, "http://%s/", _remote_proxy_url)); + cl_git_pass(git_buf_printf(&url, "http://%s/", _remote_proxy_host)); g_options.fetch_opts.proxy_opts.type = GIT_PROXY_SPECIFIED; g_options.fetch_opts.proxy_opts.url = url.ptr; @@ -747,10 +747,10 @@ void test_online_clone__proxy_credentials_in_url(void) { git_buf url = GIT_BUF_INIT; - if (!_remote_proxy_url || !_remote_proxy_user || !_remote_proxy_pass) + if (!_remote_proxy_host || !_remote_proxy_user || !_remote_proxy_pass) cl_skip(); - cl_git_pass(git_buf_printf(&url, "http://%s:%s@%s/", _remote_proxy_user, _remote_proxy_pass, _remote_proxy_url)); + cl_git_pass(git_buf_printf(&url, "http://%s:%s@%s/", _remote_proxy_user, _remote_proxy_pass, _remote_proxy_host)); g_options.fetch_opts.proxy_opts.type = GIT_PROXY_SPECIFIED; g_options.fetch_opts.proxy_opts.url = url.ptr; @@ -765,7 +765,7 @@ void test_online_clone__proxy_credentials_in_environment(void) { git_buf url = GIT_BUF_INIT; - if (!_remote_proxy_url || !_remote_proxy_user || !_remote_proxy_pass) + if (!_remote_proxy_host || !_remote_proxy_user || !_remote_proxy_pass) cl_skip(); _orig_http_proxy = cl_getenv("HTTP_PROXY"); @@ -774,7 +774,7 @@ void test_online_clone__proxy_credentials_in_environment(void) g_options.fetch_opts.proxy_opts.type = GIT_PROXY_AUTO; - cl_git_pass(git_buf_printf(&url, "http://%s:%s@%s/", _remote_proxy_user, _remote_proxy_pass, _remote_proxy_url)); + cl_git_pass(git_buf_printf(&url, "http://%s:%s@%s/", _remote_proxy_user, _remote_proxy_pass, _remote_proxy_host)); cl_setenv("HTTP_PROXY", url.ptr); cl_setenv("HTTPS_PROXY", url.ptr); |