Index: tests/tlsIO.test ================================================================== --- tests/tlsIO.test +++ tests/tlsIO.test @@ -68,13 +68,12 @@ package require tcltest namespace import -force ::tcltest::* } # The build dir is added as the first element of $PATH -set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] # Load the tls package -package require tls 1.6 +package require tls set tlsServerPort 8048 # Specify where the certificates are @@ -302,12 +301,12 @@ } {1 {expected integer but got "badport"}} test tlsIO-2.1 {tcp connection} {socket stdio} { removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls set timer [after 2000 "set x timed_out"] } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey 8828 \]" puts $f { @@ -344,12 +343,12 @@ } test tlsIO-2.2 {tcp connection with client port specified} {socket stdio} { removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls set timer [after 2000 "set x done"] } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey 8829 \]" puts $f { @@ -384,12 +383,12 @@ } [list ready "hello $port"] test tlsIO-2.3 {tcp connection with client interface specified} {socket stdio} { removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls set timer [after 2000 "set x done"] } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey 8830 \]" puts $f { @@ -422,12 +421,12 @@ } {ready {hello 127.0.0.1}} test tlsIO-2.4 {tcp connection with server interface specified} {socket stdio} { removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls set timer [after 2000 "set x done"] } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey -myaddr [info hostname] 8831 \]" puts $f { @@ -459,12 +458,12 @@ } {ready hello} test tlsIO-2.5 {tcp connection with redundant server port} {socket stdio} { removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls set timer [after 2000 "set x done"] } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey 8832 \]" puts $f { @@ -506,12 +505,12 @@ } ok test tlsIO-2.7 {echo server, one line} {socket stdio} { removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls set timer [after 2000 "set x done"] } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey 8834 \]" puts $f { @@ -550,12 +549,12 @@ list $x $y } {{hello abcdefghijklmnop} done} test tlsIO-2.8 {echo server, loop 50 times, single connection} {socket stdio} { set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey 8835 \]" puts $f { proc accept {s a p} { @@ -602,12 +601,12 @@ test tlsIO-2.9 {socket conflict} {socket stdio} { set s [tls::socket -server accept 8828] removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts -nonewline $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls tls::socket -server accept 8828 } close $f set f [open "|[list $::tcltest::tcltest script]" r] @@ -689,12 +688,12 @@ {socket stdio unixOnly} { # There is a debug assertion on Windows/SSL that causes a crash when the # certificate isn't specified. removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls set timer [after 2000 "set x timed_out"] set f [tls::socket -server accept 8828] proc accept {file addr port} { global x @@ -722,12 +721,12 @@ } {ready done {}} test tlsIO-3.1 {socket conflict} {socket stdio} { removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey 8828 \]" puts $f { puts ready @@ -747,12 +746,12 @@ } {1 {couldn't open socket: address already in use}} test tlsIO-3.2 {server with several clients} {socket stdio} { removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls set t1 [after 30000 "set x timed_out"] set t2 [after 31000 "set x timed_out"] set t3 [after 32000 "set x timed_out"] set counter 0 @@ -816,12 +815,12 @@ test tlsIO-4.1 {server with several clients} {socket stdio} { # have seen intermittent hangs on Windows removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls gets stdin } puts $f "set s \[tls::socket -certfile $clientCert -cafile $caCert -keyfile $clientKey 127.0.0.1 8828 \]" puts $f { @@ -924,12 +923,12 @@ test tlsIO-6.1 {accept callback error} {socket stdio} { # There is a debug assertion on Windows/SSL that causes a crash when the # certificate isn't specified. removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls gets stdin } puts $f [list tls::socket -cafile $caCert 127.0.0.1 8848] close $f @@ -952,12 +951,12 @@ } {{divide by zero}} test tlsIO-7.1 {testing socket specific options} {socket stdio} { removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls } puts $f [list tls::socket -server accept \ -certfile $serverCert -cafile $caCert -keyfile $serverKey 8820] puts $f { @@ -986,12 +985,12 @@ } {0 0 3} test tlsIO-7.2 {testing socket specific options} {socket stdio} { removeFile script set f [open script w] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls } puts $f "tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey 8821" puts $f { proc accept args { @@ -1758,12 +1757,12 @@ # waits a second, and exits. The server socket will now # be closed unless script1 inherited it. set f [open script2 w] puts $f [list set tclsh $::tcltest::tcltest] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls } puts $f "set f \[tls::socket -server accept \ -certfile $serverCert -cafile $caCert -keyfile $serverKey 8828\]" puts $f { @@ -1815,12 +1814,12 @@ # launches script1 and exits. If the child process inherited the # client socket, the socket will still be open. set f [open script2 w] puts $f [list set tclsh $::tcltest::tcltest] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls } puts $f "set f \[tls::socket -certfile $clientCert -cafile $caCert \ -keyfile $clientKey 127.0.0.1 8829\]" puts $f { @@ -1876,12 +1875,12 @@ } close $f set f [open script2 w] puts $f [list set tclsh $::tcltest::tcltest] + puts $f [list set auto_path $auto_path] puts $f { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls } puts $f "set f \[tls::socket -server accept \ -certfile $serverCert -cafile $caCert -keyfile $serverKey 8930\]" puts $f { @@ -1928,11 +1927,10 @@ # HOBBS: never tested removeFile script threadReap makeFile { - set auto_path [linsert $auto_path 0 [lindex [split $env(PATH) ";:"] 0]] package require tls set f [tls::socket -server accept 8828] proc accept {s a p} { fileevent $s readable [list echo $s] fconfigure $s -buffering line