]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests/integration: address parse, platform checks
authorMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 21 Jan 2015 11:41:01 +0000 (12:41 +0100)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 21 Jan 2015 11:41:01 +0000 (12:41 +0100)
tests/pydnstest/testserver.py
tests/test_integration.c
tests/test_integration.py

index 0d72ebbdebae8d953e821d27589d65181435d44f..f804b42a9ce9faf29d8ef5cbaf2b533ed3bb95ea 100644 (file)
@@ -92,7 +92,7 @@ class TestServer:
 
     def client(self, dst_address = None):
         """ Return connected client. """
-        self.client_address = dst_address
+        self.client_address = dst_address.split('@')[0]
         sock = socket.socket(self.sock_type, socket.SOCK_STREAM)
         sock.connect(self.sock.getsockname())
         return sock
index 6202515ec3f85eacf2b9595d2899a942c05e75de..cb0e48a6d511eae230d45888b451411a496e9932 100644 (file)
@@ -217,10 +217,10 @@ int tcp_recv_msg(int fd, uint8_t *buf, size_t len, struct timeval *timeout)
        return rcvd;
 }
 
-int udp_recv_msg(int fd, uint8_t *buf, size_t len, struct sockaddr *addr)
+int udp_recv_msg(int fd, uint8_t *buf, size_t len, struct timeval *timeout)
 {
        /* Tunnel via TCP. */
-       return tcp_recv_msg(fd, buf, len, NULL);
+       return tcp_recv_msg(fd, buf, len, timeout);
 }
 
 
index 53fccc3031bb040fe1c2c6e4d5a3cac84ca0b9dc..9187ae8eed2e339ca452445d94cfaad6400134bf 100755 (executable)
@@ -148,11 +148,16 @@ def test_ipc(*args):
     finally:
         server.stop()
 
+def test_platform(*args):
+    if sys.platform == 'darwin':
+        raise Exception('ld -wrap is not supported on OS X')
+
 if __name__ == '__main__':
 
     # Self-tests first
     test = test.Test()
     test.add('integration/ipc', test_ipc)
+    test.add('integration/platform', test_platform)
     if test.run() != 0:
         sys.exit(1)
     else: