Eliot Miranda uploaded a new version of SqueakSSL-Tests to project The Trunk:
http://source.squeak.org/trunk/SqueakSSL-Tests-eem.25.mcz==================== Summary ====================
Name: SqueakSSL-Tests-eem.25
Author: eem
Time: 9 October 2020, 1:10:01.348372 am
UUID: ea83a4ce-1d87-4517-b025-2c015248a433
Ancestors: SqueakSSL-Tests-pre.24
Have the testSSLSockets clean up its droppings.
=============== Diff against SqueakSSL-Tests-pre.24 ===============
Item was changed:
----- Method: SqueakSSLTest>>testSSLSockets (in category 'tests') -----
testSSLSockets
-
"Connect client and server"
+ | client listener server sema connectProcess |
- | client listener server sema |
[listener := SecureSocket newTCP.
listener listenOn: self port backlogSize: 4.
client := SecureSocket newTCP.
client connectTo: #[127 0 0 1] port: self port.
server := listener waitForAcceptFor: 1.
"Perform SSL handshake"
sema := Semaphore new.
+ [connectProcess := Processor activeProcess.
+ client sslConnect.
+ sema signal] fork.
- [client sslConnect.
- sema signal] fork.
server sslAccept: self certName.
sema wait.
"Send data"
client sendData: 'Hello World'.
server waitForDataFor: 1.
+ self assert: server receiveData = 'Hello World']
+ ensure:
+ [listener ifNotNil:[listener destroy].
+ client ifNotNil:[client destroy].
+ server ifNotNil:[server destroy].
+ connectProcess ifNotNil: [connectProcess terminate]]!
- self assert: server receiveData = 'Hello World'.
- ] ensure:[
- listener ifNotNil:[listener destroy].
- client ifNotNil:[client destroy].
- server ifNotNil:[server destroy].
- ].!