Commit 66ebc54e authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[772] Small cleanups

parent 3912ef9b
......@@ -555,16 +555,21 @@ class TestUnixSockServer(unittest.TestCase):
sock.connect(('127.0.0.1', 12345))
self.assertEqual(('127.0.0.1', 12345),
self.unix._guess_remote(sock.fileno()))
if socket.has_ipv6:
# Don't check IPv6 address on hosts not supporting them
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
sock.connect(('::1', 12345))
self.assertEqual(('::1', 12345, 0, 0),
self.unix._guess_remote(sock.fileno()))
# Try when pretending there's no IPv6 support
# (No need to pretend when there's really no IPv6)
xfrout.socket.has_ipv6 = False
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.connect(('127.0.0.1', 12345))
self.assertEqual(('127.0.0.1', 12345),
self.unix._guess_remote(sock.fileno()))
# Return it back
xfrout.socket.has_ipv6 = True
def test_receive_query_message(self):
send_msg = b"\xd6=\x00\x00\x00\x01\x00"
......
......@@ -400,6 +400,9 @@ class UnixSockServer(socketserver_mixin.NoPollMixIn, ThreadingUnixStreamServer):
def _common_init(self):
self._lock = threading.Lock()
self._transfers_counter = 0
# This default value will probably get overwritten by the (same)
# default value from the spec file. This is here just to make
# sure and to make the default value in tests consistent.
self._acl = REQUEST_LOADER.load('[{"action": "ACCEPT"}]')
def _receive_query_message(self, sock):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment