diff options
author | psykose <alice@ayaya.dev> | 2022-06-28 10:03:30 +0000 |
---|---|---|
committer | psykose <alice@ayaya.dev> | 2022-06-28 12:03:30 +0200 |
commit | ab67ab0733c2fd5bf0f8272f2ef65aee71984cc3 (patch) | |
tree | 58f189d0631bc263e19a9966139a87ab08954060 /tests/setup_proxy_test | |
parent | 2b6126d614658955a358aa8ed78c40af896121e2 (diff) | |
download | alpine-conf-ab67ab0733c2fd5bf0f8272f2ef65aee71984cc3.zip |
setup-proxy: fix empty proxy
the while loop loops until the value of proxyurl is none or a http*://
scheme. however, when proxyurl is set to 'none', it then gets unset here
(`proxyurl= ;`), but the following `if` block checks if it is 'none' and
fails, so we configure an empty http_proxy= in the proxy.sh profile
script. this is then read by some software, and it causes it to crash.
for instance, flatpak via glib reads `http_proxy` from the environment,
and an empty variable is illegal.
Diffstat (limited to 'tests/setup_proxy_test')
-rwxr-xr-x | tests/setup_proxy_test | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/setup_proxy_test b/tests/setup_proxy_test index d0da07b..e825796 100755 --- a/tests/setup_proxy_test +++ b/tests/setup_proxy_test @@ -4,7 +4,8 @@ init_tests \ setup_proxy_usage \ setup_proxy_url \ - setup_proxy_none + setup_proxy_none \ + setup_proxy_interactive_none setup_proxy_usage_body() { test_usage setup-proxy @@ -35,3 +36,18 @@ setup_proxy_none_body() { fi } +setup_proxy_interactive_none_body() { + init_env + + mkdir -p etc/profile.d + touch etc/profile.d/proxy.sh + + echo none | atf_check -s exit:0 \ + -o match:"HTTP/FTP proxy URL" \ + -e empty \ + setup-proxy + + if test -e etc/profile.d/proxy.sh; then + atf_fail "etc/profile.d/proxy.sh was not removed" + fi +} |