summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkjnash <k.j.nash@usa.net>2022-11-07 21:35:41 (GMT)
committerkjnash <k.j.nash@usa.net>2022-11-07 21:35:41 (GMT)
commitaed83779fd0befd6315d01433e60ba27a324fc31 (patch)
treeadd48426d7a6be701f015c1f41efd56685cbc05f
parentd9c7aa01ef0cbb122ca994cbaf9b633720a41464 (diff)
downloadtcl-aed83779fd0befd6315d01433e60ba27a324fc31.zip
tcl-aed83779fd0befd6315d01433e60ba27a324fc31.tar.gz
tcl-aed83779fd0befd6315d01433e60ba27a324fc31.tar.bz2
tests/httpProxy.test - test for leftover socket placeholders, improve result layout, for https fetch with status 407 expect result SecureProxyFailed not SecureProxy.
-rw-r--r--tests/httpProxy.test236
1 files changed, 144 insertions, 92 deletions
diff --git a/tests/httpProxy.test b/tests/httpProxy.test
index 90fe828..d9e865a 100644
--- a/tests/httpProxy.test
+++ b/tests/httpProxy.test
@@ -85,40 +85,44 @@ test httpProxy-1.1.$ThreadLevel {squid is running - ipv4 noauth} -constraints {n
} -body {
set token [http::geturl http://$n4host:$n4port/]
set ri [http::responseInfo $token]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
-} -result {complete ok 400 none} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed]"
+} -result {complete ok 400 -- none} -cleanup {
http::cleanup $token
- unset -nocomplain ri res
+ unset -nocomplain token ri res
}
test httpProxy-1.2.$ThreadLevel {squid is running - ipv6 noauth} -constraints {needsSquid} -setup {
} -body {
set token [http::geturl http://\[$n6host\]:$n6port/]
set ri [http::responseInfo $token]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
-} -result {complete ok 400 none} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed]"
+} -result {complete ok 400 -- none} -cleanup {
http::cleanup $token
- unset -nocomplain ri res
+ unset -nocomplain token ri res
}
test httpProxy-1.3.$ThreadLevel {squid is running - ipv4 auth} -constraints {needsSquid} -setup {
} -body {
set token [http::geturl http://$a4host:$a4port/]
set ri [http::responseInfo $token]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
-} -result {complete ok 400 none} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed]"
+} -result {complete ok 400 -- none} -cleanup {
http::cleanup $token
- unset -nocomplain ri res
+ unset -nocomplain token ri res
}
test httpProxy-1.4.$ThreadLevel {squid is running - ipv6 auth} -constraints {needsSquid} -setup {
} -body {
set token [http::geturl http://\[$a6host\]:$a6port/]
set ri [http::responseInfo $token]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
-} -result {complete ok 400 none} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed]"
+} -result {complete ok 400 -- none} -cleanup {
http::cleanup $token
- unset -nocomplain ri res
+ unset -nocomplain token ri res
}
test httpProxy-2.1.$ThreadLevel {http no-proxy no-auth} -constraints {needsSquid} -setup {
@@ -126,10 +130,12 @@ test httpProxy-2.1.$ThreadLevel {http no-proxy no-auth} -constraints {needsSquid
} -body {
set token [http::geturl http://www.google.com/]
set ri [http::responseInfo $token]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
-} -result {complete ok 200 none} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- none -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res
+ unset -nocomplain token ri res
}
test httpProxy-2.2.$ThreadLevel {https no-proxy no-auth} -constraints {needsSquid needsTls} -setup {
@@ -137,10 +143,12 @@ test httpProxy-2.2.$ThreadLevel {https no-proxy no-auth} -constraints {needsSqui
} -body {
set token [http::geturl https://www.google.com/]
set ri [http::responseInfo $token]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
-} -result {complete ok 200 none} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- none -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res
+ unset -nocomplain token ri res
}
test httpProxy-2.3.$ThreadLevel {http with-proxy ipv4 no-auth} -constraints {needsSquid} -setup {
@@ -148,10 +156,12 @@ test httpProxy-2.3.$ThreadLevel {http with-proxy ipv4 no-auth} -constraints {nee
} -body {
set token [http::geturl http://www.google.com/]
set ri [http::responseInfo $token]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
-} -result {complete ok 200 HttpProxy} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- HttpProxy -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res
+ unset -nocomplain token ri res
http::config -proxyhost {} -proxyport {} -proxynot {}
}
@@ -160,34 +170,40 @@ test httpProxy-2.4.$ThreadLevel {https with-proxy ipv4 no-auth} -constraints {ne
} -body {
set token [http::geturl https://www.google.com/]
set ri [http::responseInfo $token]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
-} -result {complete ok 200 SecureProxy} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- SecureProxy -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res
+ unset -nocomplain token ri res
http::config -proxyhost {} -proxyport {} -proxynot {}
}
test httpProxy-2.5.$ThreadLevel {http with-proxy ipv6 no-auth} -constraints {needsSquid} -setup {
- http::config -proxyhost $n6host -proxyport $n6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+ http::config -proxyhost $n6host -proxyport $n6port -proxynot {::1 localhost} -proxyauth {}
} -body {
set token [http::geturl http://www.google.com/]
set ri [http::responseInfo $token]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
-} -result {complete ok 200 HttpProxy} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- HttpProxy -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res
+ unset -nocomplain token ri res
http::config -proxyhost {} -proxyport {} -proxynot {}
}
test httpProxy-2.6.$ThreadLevel {https with-proxy ipv6 no-auth} -constraints {needsSquid needsTls} -setup {
- http::config -proxyhost $n6host -proxyport $n6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+ http::config -proxyhost $n6host -proxyport $n6port -proxynot {::1 localhost} -proxyauth {}
} -body {
set token [http::geturl https://www.google.com/]
set ri [http::responseInfo $token]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
-} -result {complete ok 200 SecureProxy} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- SecureProxy -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res
+ unset -nocomplain token ri res
http::config -proxyhost {} -proxyport {} -proxynot {}
}
@@ -198,10 +214,12 @@ test httpProxy-3.1.$ThreadLevel {http no-proxy with-auth valid-creds-provided} -
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 200 none 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- none 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
@@ -212,10 +230,12 @@ test httpProxy-3.2.$ThreadLevel {https no-proxy with-auth valid-creds-provided}
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 200 none 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- none 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
@@ -226,10 +246,12 @@ test httpProxy-3.3.$ThreadLevel {http with-proxy ipv4 with-auth valid-creds-prov
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 200 HttpProxy 1 1} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- HttpProxy 1 1 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
@@ -240,38 +262,44 @@ test httpProxy-3.4.$ThreadLevel {https with-proxy ipv4 with-auth valid-creds-pro
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 200 SecureProxy 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- SecureProxy 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
test httpProxy-3.5.$ThreadLevel {http with-proxy ipv6 with-auth valid-creds-provided} -constraints {needsSquid} -setup {
- http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $aliceCreds
} -body {
set token [http::geturl http://www.google.com/]
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 200 HttpProxy 1 1} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- HttpProxy 1 1 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
test httpProxy-3.6.$ThreadLevel {https with-proxy ipv6 with-auth valid-creds-provided} -constraints {needsSquid needsTls} -setup {
- http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $aliceCreds
} -body {
set token [http::geturl https://www.google.com/]
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 200 SecureProxy 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- SecureProxy 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
@@ -282,10 +310,12 @@ test httpProxy-4.1.$ThreadLevel {http no-proxy with-auth no-creds-provided} -con
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 200 none 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- none 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
@@ -296,10 +326,12 @@ test httpProxy-4.2.$ThreadLevel {https no-proxy with-auth no-creds-provided} -co
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 200 none 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- none 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
@@ -310,10 +342,12 @@ test httpProxy-4.3.$ThreadLevel {http with-proxy ipv4 with-auth no-creds-provide
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 407 HttpProxy 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 407 -- HttpProxy 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
@@ -324,38 +358,44 @@ test httpProxy-4.4.$ThreadLevel {https with-proxy ipv4 with-auth no-creds-provid
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 407 SecureProxy 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 407 -- SecureProxyFailed 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
test httpProxy-4.5.$ThreadLevel {http with-proxy ipv6 with-auth no-creds-provided} -constraints {needsSquid} -setup {
- http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth {}
} -body {
set token [http::geturl http://www.google.com/]
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 407 HttpProxy 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 407 -- HttpProxy 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
test httpProxy-4.6.$ThreadLevel {https with-proxy ipv6 with-auth no-creds-provided} -constraints {needsSquid needsTls} -setup {
- http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth {}
} -body {
set token [http::geturl https://www.google.com/]
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 407 SecureProxy 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 407 -- SecureProxyFailed 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
@@ -366,10 +406,12 @@ test httpProxy-5.1.$ThreadLevel {http no-proxy with-auth bad-creds-provided} -co
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 200 none 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- none 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
@@ -380,10 +422,12 @@ test httpProxy-5.2.$ThreadLevel {https no-proxy with-auth bad-creds-provided} -c
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 200 none 0 0} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 200 -- none 0 0 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
@@ -394,10 +438,12 @@ test httpProxy-5.3.$ThreadLevel {http with-proxy ipv4 with-auth bad-creds-provid
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 407 HttpProxy 1 1} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 407 -- HttpProxy 1 1 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
@@ -408,38 +454,44 @@ test httpProxy-5.4.$ThreadLevel {https with-proxy ipv4 with-auth bad-creds-provi
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 407 SecureProxy 1 1} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 407 -- SecureProxyFailed 1 1 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
test httpProxy-5.5.$ThreadLevel {http with-proxy ipv6 with-auth bad-creds-provided} -constraints {needsSquid} -setup {
- http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $badCreds
} -body {
set token [http::geturl http://www.google.com/]
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 407 HttpProxy 1 1} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 407 -- HttpProxy 1 1 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}
test httpProxy-5.6.$ThreadLevel {https with-proxy ipv6 with-auth bad-creds-provided} -constraints {needsSquid needsTls} -setup {
- http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $badCreds
} -body {
set token [http::geturl https://www.google.com/]
set ri [http::responseInfo $token]
set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
- set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
-} -result {complete ok 407 SecureProxy 1 1} -cleanup {
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\
+ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\
+ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]"
+} -result {complete ok 407 -- SecureProxyFailed 1 1 -- -1} -cleanup {
http::cleanup $token
- unset -nocomplain ri res pos1 pos2
+ unset -nocomplain token ri res pos1 pos2
http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
}