[CalendarServer-changes] [15255] twext/trunk/twext/python/test/test_launchd.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Oct 30 08:15:42 PDT 2015


Revision: 15255
          http://trac.calendarserver.org//changeset/15255
Author:   cdaboo at apple.com
Date:     2015-10-30 08:15:42 -0700 (Fri, 30 Oct 2015)
Log Message:
-----------
Fix for headless/buildbot test runs.

Modified Paths:
--------------
    twext/trunk/twext/python/test/test_launchd.py

Modified: twext/trunk/twext/python/test/test_launchd.py
===================================================================
--- twext/trunk/twext/python/test/test_launchd.py	2015-10-30 14:40:40 UTC (rev 15254)
+++ twext/trunk/twext/python/test/test_launchd.py	2015-10-30 15:15:42 UTC (rev 15255)
@@ -48,7 +48,7 @@
 else:
     skip = False
 
-from twisted.trial.unittest import TestCase
+from twisted.trial.unittest import TestCase, SkipTest
 from twisted.python.filepath import FilePath
 
 
@@ -94,7 +94,12 @@
         }
         self.job = fp.child("job.plist")
         self.job.setContent(plistlib.writePlistToString(plist))
-        os.spawnlp(os.P_WAIT, "launchctl", "launchctl", "load", self.job.path)
+        err = os.spawnlp(os.P_WAIT, "launchctl", "launchctl", "load", self.job.path)
+        if err == 127:
+            # This happens when running in headless mode (e.g., buildbot) and is due to
+            # permission restrictions. Just skip the test.
+            raise SkipTest("launchctl cannot run on this system")
+
         return d
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20151030/d757b00f/attachment.html>


More information about the calendarserver-changes mailing list