summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Goirand <zigo@debian.org>2016-10-10 12:06:49 +0200
committerThomas Goirand <zigo@debian.org>2016-10-10 12:06:49 +0200
commit325e4efe004af9bfe832a269caae4cb637f753bf (patch)
treecc4fb013af9163613c62bf633cea373811255b5f /tests
parent72ce5c1ae8abbcd3f8bb5f4e93915f61a1047704 (diff)
downloadwebsockify-325e4efe004af9bfe832a269caae4cb637f753bf.tar.gz
TCP_KEEPCNT doesn't exist in non-linux
The TCP_KEEPCNT option for sockets only work with the Linux kernel, this isn't available for example in FreeBSD and Hurd, which makes the package fail to build on these platforms. See Debian bug here: https://bugs.debian.org/840035
Diffstat (limited to 'tests')
-rw-r--r--tests/test_websocket.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test_websocket.py b/tests/test_websocket.py
index d8acb4f..545fa1c 100644
--- a/tests/test_websocket.py
+++ b/tests/test_websocket.py
@@ -324,8 +324,9 @@ class WebSocketServerTestCase(unittest.TestCase):
tcp_keepidle=keepidle,
tcp_keepintvl=keepintvl)
- self.assertEqual(sock.getsockopt(socket.SOL_TCP,
- socket.TCP_KEEPCNT), keepcnt)
+ if hasattr(socket, 'TCP_KEEPCNT'):
+ self.assertEqual(sock.getsockopt(socket.SOL_TCP,
+ socket.TCP_KEEPCNT), keepcnt)
self.assertEqual(sock.getsockopt(socket.SOL_TCP,
socket.TCP_KEEPIDLE), keepidle)
self.assertEqual(sock.getsockopt(socket.SOL_TCP,
@@ -337,8 +338,9 @@ class WebSocketServerTestCase(unittest.TestCase):
tcp_keepidle=keepidle,
tcp_keepintvl=keepintvl)
- self.assertNotEqual(sock.getsockopt(socket.SOL_TCP,
- socket.TCP_KEEPCNT), keepcnt)
+ if hasattr(socket, 'TCP_KEEPCNT'):
+ self.assertNotEqual(sock.getsockopt(socket.SOL_TCP,
+ socket.TCP_KEEPCNT), keepcnt)
self.assertNotEqual(sock.getsockopt(socket.SOL_TCP,
socket.TCP_KEEPIDLE), keepidle)
self.assertNotEqual(sock.getsockopt(socket.SOL_TCP,