Fossil SCM
Unset all likely system proxy variables before any tests run. Distribution CI pipelines often set a proxy, and that upsets many tests.
Commit
b2b6abcb38016a80cfb08f0b256866d57058716671af103ccecbbd5c6f3f9a51
Parent
62fd811949268d7…
3 files changed
+4
-5
+9
-10
+4
-5
| --- test/http.test | ||
| +++ test/http.test | ||
| @@ -17,16 +17,15 @@ | ||
| 17 | 17 | } |
| 18 | 18 | if {![loopback_available]} { |
| 19 | 19 | test_skip "the tests need a TCP connection over the loopback interface" |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | -# fossil must not use a proxy or a certificate store from the environment | |
| 23 | -# of the test run, so these variables are unset until the end of this | |
| 24 | -# file. | |
| 22 | +# fossil must not use a certificate store from the environment of the | |
| 23 | +# test run, so SSL_CERT_FILE and SSL_CERT_DIR are unset until the end of | |
| 24 | +# this file. | |
| 25 | 25 | # |
| 26 | -foreach var {http_proxy HTTP_PROXY https_proxy HTTPS_PROXY all_proxy | |
| 27 | - ALL_PROXY SSL_CERT_FILE SSL_CERT_DIR} { | |
| 26 | +foreach var {SSL_CERT_FILE SSL_CERT_DIR} { | |
| 28 | 27 | if {[info exists env($var)]} { |
| 29 | 28 | set httpSavedEnv($var) $env($var) |
| 30 | 29 | unset env($var) |
| 31 | 30 | } |
| 32 | 31 | } |
| 33 | 32 |
| --- test/http.test | |
| +++ test/http.test | |
| @@ -17,16 +17,15 @@ | |
| 17 | } |
| 18 | if {![loopback_available]} { |
| 19 | test_skip "the tests need a TCP connection over the loopback interface" |
| 20 | } |
| 21 | |
| 22 | # fossil must not use a proxy or a certificate store from the environment |
| 23 | # of the test run, so these variables are unset until the end of this |
| 24 | # file. |
| 25 | # |
| 26 | foreach var {http_proxy HTTP_PROXY https_proxy HTTPS_PROXY all_proxy |
| 27 | ALL_PROXY SSL_CERT_FILE SSL_CERT_DIR} { |
| 28 | if {[info exists env($var)]} { |
| 29 | set httpSavedEnv($var) $env($var) |
| 30 | unset env($var) |
| 31 | } |
| 32 | } |
| 33 |
| --- test/http.test | |
| +++ test/http.test | |
| @@ -17,16 +17,15 @@ | |
| 17 | } |
| 18 | if {![loopback_available]} { |
| 19 | test_skip "the tests need a TCP connection over the loopback interface" |
| 20 | } |
| 21 | |
| 22 | # fossil must not use a certificate store from the environment of the |
| 23 | # test run, so SSL_CERT_FILE and SSL_CERT_DIR are unset until the end of |
| 24 | # this file. |
| 25 | # |
| 26 | foreach var {SSL_CERT_FILE SSL_CERT_DIR} { |
| 27 | if {[info exists env($var)]} { |
| 28 | set httpSavedEnv($var) $env($var) |
| 29 | unset env($var) |
| 30 | } |
| 31 | } |
| 32 |
+9
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -48,10 +48,19 @@ | ||
| 48 | 48 | } |
| 49 | 49 | if {![file isfile $fossilexe]} { |
| 50 | 50 | puts stderr "usage: tclsh [info script] FOSSIL ?OPTIONS? ?TESTFILE ...?" |
| 51 | 51 | exit 1 |
| 52 | 52 | } |
| 53 | + | |
| 54 | +# fossil must not use a proxy from the environment of the test run. A | |
| 55 | +# test of a proxy variable sets it and unsets it again. | |
| 56 | +# | |
| 57 | +foreach var {http_proxy HTTP_PROXY https_proxy HTTPS_PROXY all_proxy | |
| 58 | + ALL_PROXY} { | |
| 59 | + unset -nocomplain ::env($var) | |
| 60 | +} | |
| 61 | +unset var | |
| 53 | 62 | |
| 54 | 63 | set dirty_ckout 1 |
| 55 | 64 | if {!$outside_fossil_repo} { |
| 56 | 65 | set savedPwd [pwd] |
| 57 | 66 | cd $testfiledir |
| 58 | 67 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -48,10 +48,19 @@ | |
| 48 | } |
| 49 | if {![file isfile $fossilexe]} { |
| 50 | puts stderr "usage: tclsh [info script] FOSSIL ?OPTIONS? ?TESTFILE ...?" |
| 51 | exit 1 |
| 52 | } |
| 53 | |
| 54 | set dirty_ckout 1 |
| 55 | if {!$outside_fossil_repo} { |
| 56 | set savedPwd [pwd] |
| 57 | cd $testfiledir |
| 58 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -48,10 +48,19 @@ | |
| 48 | } |
| 49 | if {![file isfile $fossilexe]} { |
| 50 | puts stderr "usage: tclsh [info script] FOSSIL ?OPTIONS? ?TESTFILE ...?" |
| 51 | exit 1 |
| 52 | } |
| 53 | |
| 54 | # fossil must not use a proxy from the environment of the test run. A |
| 55 | # test of a proxy variable sets it and unsets it again. |
| 56 | # |
| 57 | foreach var {http_proxy HTTP_PROXY https_proxy HTTPS_PROXY all_proxy |
| 58 | ALL_PROXY} { |
| 59 | unset -nocomplain ::env($var) |
| 60 | } |
| 61 | unset var |
| 62 | |
| 63 | set dirty_ckout 1 |
| 64 | if {!$outside_fossil_repo} { |
| 65 | set savedPwd [pwd] |
| 66 | cd $testfiledir |
| 67 |
-10
| --- test/url.test | ||
| +++ test/url.test | ||
| @@ -25,19 +25,10 @@ | ||
| 25 | 25 | |
| 26 | 26 | if {![loopback_available]} { |
| 27 | 27 | test_skip "the tests need a TCP connection over the loopback interface" |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -# fossil must not use a proxy from the environment of the test run. | |
| 31 | -foreach urlVar {http_proxy HTTP_PROXY https_proxy HTTPS_PROXY all_proxy | |
| 32 | - ALL_PROXY} { | |
| 33 | - if {[info exists env($urlVar)]} { | |
| 34 | - set urlSavedEnv($urlVar) $env($urlVar) | |
| 35 | - unset env($urlVar) | |
| 36 | - } | |
| 37 | -} | |
| 38 | - | |
| 39 | 30 | test_setup |
| 40 | 31 | set urlRepo [file join [pwd] .rep.fossil] |
| 41 | 32 | set urlDir [pwd] |
| 42 | 33 | |
| 43 | 34 | ############################################################################### |
| @@ -1730,7 +1721,6 @@ | ||
| 1730 | 1721 | unset env(URL_SSH_DIR) |
| 1731 | 1722 | } |
| 1732 | 1723 | |
| 1733 | 1724 | ############################################################################### |
| 1734 | 1725 | |
| 1735 | -array set env [array get urlSavedEnv] | |
| 1736 | 1726 | test_cleanup |
| 1737 | 1727 |
| --- test/url.test | |
| +++ test/url.test | |
| @@ -25,19 +25,10 @@ | |
| 25 | |
| 26 | if {![loopback_available]} { |
| 27 | test_skip "the tests need a TCP connection over the loopback interface" |
| 28 | } |
| 29 | |
| 30 | # fossil must not use a proxy from the environment of the test run. |
| 31 | foreach urlVar {http_proxy HTTP_PROXY https_proxy HTTPS_PROXY all_proxy |
| 32 | ALL_PROXY} { |
| 33 | if {[info exists env($urlVar)]} { |
| 34 | set urlSavedEnv($urlVar) $env($urlVar) |
| 35 | unset env($urlVar) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | test_setup |
| 40 | set urlRepo [file join [pwd] .rep.fossil] |
| 41 | set urlDir [pwd] |
| 42 | |
| 43 | ############################################################################### |
| @@ -1730,7 +1721,6 @@ | |
| 1730 | unset env(URL_SSH_DIR) |
| 1731 | } |
| 1732 | |
| 1733 | ############################################################################### |
| 1734 | |
| 1735 | array set env [array get urlSavedEnv] |
| 1736 | test_cleanup |
| 1737 |
| --- test/url.test | |
| +++ test/url.test | |
| @@ -25,19 +25,10 @@ | |
| 25 | |
| 26 | if {![loopback_available]} { |
| 27 | test_skip "the tests need a TCP connection over the loopback interface" |
| 28 | } |
| 29 | |
| 30 | test_setup |
| 31 | set urlRepo [file join [pwd] .rep.fossil] |
| 32 | set urlDir [pwd] |
| 33 | |
| 34 | ############################################################################### |
| @@ -1730,7 +1721,6 @@ | |
| 1721 | unset env(URL_SSH_DIR) |
| 1722 | } |
| 1723 | |
| 1724 | ############################################################################### |
| 1725 | |
| 1726 | test_cleanup |
| 1727 |