[Lldb-commits] [PATCH] Make OSX test run firewall friendly.

Oleksiy Vyalov ovyalov at google.com
Wed Jan 21 18:53:00 PST 2015


Hi clayborg,

When running tests on OSX I see a lot of firewall warnings about allowing lldb and some test binaries to listen for incoming connections - so, I have to turn firewall off.
With this CL in the test run should be silent with enabled firewall.
Use lldb_codesign certificate to sign lldb binary when building with XCode and codesign those test binaries which open the listen sockets.

http://reviews.llvm.org/D7115

Files:
  lldb.xcodeproj/project.pbxproj
  test/api/multiple-debuggers/TestMultipleDebuggers.py
  test/api/multithreaded/TestMultithreaded.py
  test/lldbtest.py

Index: lldb.xcodeproj/project.pbxproj
===================================================================
--- lldb.xcodeproj/project.pbxproj
+++ lldb.xcodeproj/project.pbxproj
@@ -5282,6 +5282,7 @@
 			buildPhases = (
 				26F5C26710F3D9A4009D5894 /* Sources */,
 				26F5C26810F3D9A4009D5894 /* Frameworks */,
+				25ED0ED41A70979C00E3DA2E /* ShellScript */,
 			);
 			buildRules = (
 			);
@@ -5412,6 +5413,19 @@
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
+		25ED0ED41A70979C00E3DA2E /* ShellScript */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+			);
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "if [ \"${CONFIGURATION}\" != BuildAndIntegration ]\nthen\ncodesign -f -s lldb_codesign \"${TARGET_BUILD_DIR}/${PRODUCT_NAME}\"\nfi";
+		};
 		261B5A7511C3FA6F00AABD0A /* Fixup Framework Headers */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
Index: test/api/multiple-debuggers/TestMultipleDebuggers.py
===================================================================
--- test/api/multiple-debuggers/TestMultipleDebuggers.py
+++ test/api/multiple-debuggers/TestMultipleDebuggers.py
@@ -26,6 +26,7 @@
         self.driver_exe = os.path.join(os.getcwd(), "multi-process-driver")
         self.buildDriver('multi-process-driver.cpp', self.driver_exe)
         self.addTearDownHook(lambda: os.remove(self.driver_exe))
+        self.signBinary(self.driver_exe)
 
         self.inferior_exe = os.path.join(os.getcwd(), "testprog")
         self.buildDriver('testprog.cpp', self.inferior_exe)
Index: test/api/multithreaded/TestMultithreaded.py
===================================================================
--- test/api/multithreaded/TestMultithreaded.py
+++ test/api/multithreaded/TestMultithreaded.py
@@ -66,7 +66,9 @@
         self.buildDriver(sources, test_name)
         self.addTearDownHook(lambda: os.remove(test_name))
 
-        exe = [os.path.join(os.getcwd(), test_name), self.inferior]
+        test_exe = os.path.join(os.getcwd(), test_name)
+        self.signBinary(test_exe)
+        exe = [test_exe, self.inferior]
 
         env = {self.dylibPath : self.getLLDBLibraryEnvVal()}
         if self.TraceOn():
Index: test/lldbtest.py
===================================================================
--- test/lldbtest.py
+++ test/lldbtest.py
@@ -1422,6 +1422,11 @@
         if not module.buildDwarf(self, architecture, compiler, dictionary, clean):
             raise Exception("Don't know how to build binary with dwarf")
 
+    def signBinary(self, binary_path):
+        if sys.platform.startswith("darwin"):
+            codesign_cmd = "codesign --force --sign lldb_codesign %s" % (binary_path)
+            call(codesign_cmd, shell=True)
+
     def findBuiltClang(self):
         """Tries to find and use Clang from the build directory as the compiler (instead of the system compiler)."""
         paths_to_try = [

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7115.18577.patch
Type: text/x-patch
Size: 3052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150122/072903a3/attachment.bin>


More information about the lldb-commits mailing list