The Trunk: NetworkTests-dtl.35.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: NetworkTests-dtl.35.mcz

commits-2
David T. Lewis uploaded a new version of NetworkTests to project The Trunk:
http://source.squeak.org/trunk/NetworkTests-dtl.35.mcz

==================== Summary ====================

Name: NetworkTests-dtl.35
Author: dtl
Time: 15 November 2012, 8:06:29.937 am
UUID: 7dfbff49-ba92-43d2-9c29-e22b2c12bfe3
Ancestors: NetworkTests-dtl.34

Revert change to SocketTest>>testSocketReuse because it fails on the squeakci.org test server. To be updated and/or resubmitted to inbox when a better update is available.

=============== Diff against NetworkTests-dtl.34 ===============

Item was changed:
  ----- Method: SocketTest>>testSocketReuse (in category 'tests') -----
  testSocketReuse
+ "Test for SO_REUSEADDR/SO_REUSEPORT"
- "Test for SO_REUSEADDR/SO_REUSEPORT. Test will fail if the platform does
- not implement these socket options. Support for SO_REUSEPORT is not
- present on many systems, and a failure on setting this socket option reflects
- a limitation of the underlying platform."
 
  | address port udp1 send1 udp2 recv2 sendProc recvProc received |
  address := #[255 255 255 255]. "broadcast"
  port := 31259.
  [
  udp1 := Socket newUDP.
+ udp1 setOption: 'SO_REUSEADDR' value: 1.
+ udp1 setOption: 'SO_REUSEPORT' value: 1.
- self assert: (udp1 setOption: 'SO_REUSEADDR' value: 1) notNil
- description: 'SO_REUSEADDR not supported'.
- self assert: (udp1 setOption: 'SO_REUSEPORT' value: 1) notNil
- description: 'SO_REUSEPORT not supported'.
  udp1 setPort: port.
+ udp1 setOption: 'SO_BROADCAST' value: 1.
- self assert: (udp1 setOption: 'SO_BROADCAST' value: 1) notNil
- description: 'SO_BROADCAST not supported'.
  send1 := UUID new.
 
  udp2 := Socket newUDP.
+ udp2 setOption: 'SO_REUSEADDR' value: 1.
+ udp2 setOption: 'SO_REUSEPORT' value: 1.
- self assert: (udp2 setOption: 'SO_REUSEADDR' value: 1) notNil
- description: 'SO_REUSEADDR not supported'.
- self assert: (udp2 setOption: 'SO_REUSEPORT' value: 1) notNil
- description: 'SO_REUSEPORT not supported'.
  udp2 setPort: port.
+ udp2 setOption: 'SO_BROADCAST' value: 1.
- self assert: (udp2 setOption: 'SO_BROADCAST' value: 1) notNil
- description: 'SO_BROADCAST not supported'.
  recv2 := UUID new.
 
  received := 0.
  recvProc := [
  [received < 16] whileTrue:[
  received := received + (udp2 receiveDataInto: recv2 startingAt: received + 1).
  ]
  ] fork.
  sendProc := [
  udp1 setPeer: address port: port.
  udp1 sendData: send1 count: 16.
  ] fork.
  (Delay forMilliseconds: 200) wait.
  self should: [recvProc isTerminated].
  self should: [sendProc isTerminated].
  self should: [send1 = recv2].
  ] ensure:[
+ udp1 destroy.
+ udp2 destroy.
- udp1 ifNotNilDo: [:s | s destroy].
- udp2 ifNotNilDo: [:s | s destroy].
  ].
  !