@@ -148,13 +148,12 @@ def setUp(self):
148
148
def tearDown (self ):
149
149
self .sock .close ()
150
150
151
- @unittest .skipIf (True , 'need to replace these hosts; see bpo-35518' )
152
151
def testConnectTimeout (self ):
153
152
# Testing connect timeout is tricky: we need to have IP connectivity
154
153
# to a host that silently drops our packets. We can't simulate this
155
154
# from Python because it's a function of the underlying TCP/IP stack.
156
- # So, the following Snakebite host has been defined:
157
- blackhole = resolve_address ('blackhole.snakebite .net' , 56666 )
155
+ # So, the following port on the pythontest.net host has been defined:
156
+ blackhole = resolve_address ('pythontest .net' , 56666 )
158
157
159
158
# Blackhole has been configured to silently drop any incoming packets.
160
159
# No RSTs (for TCP) or ICMP UNREACH (for UDP/ICMP) will be sent back
@@ -166,7 +165,7 @@ def testConnectTimeout(self):
166
165
# to firewalling or general network configuration. In order to improve
167
166
# our confidence in testing the blackhole, a corresponding 'whitehole'
168
167
# has also been set up using one port higher:
169
- whitehole = resolve_address ('whitehole.snakebite .net' , 56667 )
168
+ whitehole = resolve_address ('pythontest .net' , 56667 )
170
169
171
170
# This address has been configured to immediately drop any incoming
172
171
# packets as well, but it does it respectfully with regards to the
@@ -180,20 +179,15 @@ def testConnectTimeout(self):
180
179
# timeframe).
181
180
182
181
# For the records, the whitehole/blackhole configuration has been set
183
- # up using the 'pf ' firewall (available on BSDs) , using the following:
182
+ # up using the 'iptables ' firewall, using the following rules :
184
183
#
185
- # ext_if="bge0"
186
- #
187
- # blackhole_ip="35.8.247.6"
188
- # whitehole_ip="35.8.247.6"
189
- # blackhole_port="56666"
190
- # whitehole_port="56667"
191
- #
192
- # block return in log quick on $ext_if proto { tcp udp } \
193
- # from any to $whitehole_ip port $whitehole_port
194
- # block drop in log quick on $ext_if proto { tcp udp } \
195
- # from any to $blackhole_ip port $blackhole_port
184
+ # -A INPUT -p tcp --destination-port 56666 -j DROP
185
+ # -A INPUT -p udp --destination-port 56666 -j DROP
186
+ # -A INPUT -p tcp --destination-port 56667 -j REJECT
187
+ # -A INPUT -p udp --destination-port 56667 -j REJECT
196
188
#
189
+ # See https://github.com/python/psf-salt/blob/main/pillar/base/firewall/snakebite.sls
190
+ # for the current configuration.
197
191
198
192
skip = True
199
193
sock = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
0 commit comments