From 2484d8923d541cb9446904fbc98d09218559502a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Vavru=C5=A1a?= <marek.vavrusa@nic.cz>
Date: Fri, 18 Sep 2015 22:10:56 +0200
Subject: [PATCH] tests: need brewed Python on 10.11, cleanup

the SIP on OSX 10.11 disables library injection
on system binaries (python is considered as it)
make needs to call python binary directly to allow
brewed python to be used
---
 help.mk                   | 9 ++++++---
 tests/integration.mk      | 2 +-
 tests/pydnstest/test.py   | 4 ++++
 tests/test_integration.py | 1 +
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/help.mk b/help.mk
index 1ceef2f30..fc43b9114 100644
--- a/help.mk
+++ b/help.mk
@@ -11,14 +11,17 @@ info:
 	$(info )
 	$(info Dependencies)
 	$(info ------------)
-	$(info [$(HAS_doxygen)] doxygen (doc))
 	$(info [$(HAS_libknot)] libknot (lib))
 	$(info [$(HAS_lua)] lua (daemon))
 	$(info [$(HAS_libuv)] libuv (daemon))
-	$(info [$(HAS_cmocka)] cmocka (tests/unit))
-	$(info [$(HAS_python)] Python (tests/integration))
+	$(info )
+	$(info Optional)
+	$(info --------)
+	$(info [$(HAS_doxygen)] doxygen (doc))
 	$(info [$(HAS_gccgo)] GCCGO (modules/go))
 	$(info [$(HAS_libmemcached)] libmemcached (modules/memcached))
 	$(info [$(HAS_hiredis)] hiredis (modules/redis))
+	$(info [$(HAS_cmocka)] cmocka (tests/unit))
+	$(info [$(HAS_python)] Python (tests/integration))
 	$(info [$(HAS_socket_wrapper)] socket_wrapper (lib))
 	$(info )
diff --git a/tests/integration.mk b/tests/integration.mk
index 685951244..8f8795859 100644
--- a/tests/integration.mk
+++ b/tests/integration.mk
@@ -27,6 +27,6 @@ $(libfaketime): $(libfaketime_DIR)/Makefile
 	@CFLAGS="" $(MAKE) -C $(libfaketime_DIR)
 
 check-integration: $(libfaketime)
-	@$(preload_LIBS) $(preload_syms) tests/test_integration.py $(TESTS) $(abspath daemon/kresd) ./kresd.j2 config
+	@$(preload_LIBS) $(preload_syms) python tests/test_integration.py $(TESTS) $(abspath daemon/kresd) ./kresd.j2 config
 
 .PHONY: check-integration
diff --git a/tests/pydnstest/test.py b/tests/pydnstest/test.py
index 9d4730692..54b94bec7 100644
--- a/tests/pydnstest/test.py
+++ b/tests/pydnstest/test.py
@@ -1,4 +1,6 @@
 #!/usr/bin/env python
+import os
+import traceback
 
 class Test:
     """ Small library to imitate CMocka output. """
@@ -26,6 +28,8 @@ class Test:
                 print('[       OK ] %s' % name)
             except Exception as e:
                 print('[     FAIL ] %s (%s)' % (name, str(e)))
+                if 'VERBOSE' in os.environ:
+                    print(traceback.format_exc())
 
         # Clear test set
         self.tests = []
diff --git a/tests/test_integration.py b/tests/test_integration.py
index 8e6f357e0..f641ba3f7 100755
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -252,6 +252,7 @@ def play_object(path, binary_name, config_name, j2template, binary_additional_pa
     # Wait until the server accepts TCP clients
     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     while True:
+    	time.sleep(0.1)
         if daemon_proc.poll() != None:
             print(open('%s/server.log' % TMPDIR).read())
             raise Exception('process died "%s", logs in "%s"' % (os.path.basename(binary_name), TMPDIR))
-- 
GitLab