From 6d52cab0675c01b8dae4cca2776b9ce6450045f2 Mon Sep 17 00:00:00 2001 From: Zoran Simic Date: Wed, 20 Mar 2013 16:13:22 -0700 Subject: [PATCH] Making tests runnable on OSX --- doc/topics/tests/index.rst | 11 +++++++++++ salt/master.py | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/doc/topics/tests/index.rst b/doc/topics/tests/index.rst index 7c9dabab32..5d2b76a34c 100644 --- a/doc/topics/tests/index.rst +++ b/doc/topics/tests/index.rst @@ -1,3 +1,14 @@ +Running The Tests +================= + +To run the tests, use ``tests/runtests.py``, see ``--help`` for more info. + +Examples: +To run all tests: ``sudo ./tests/runtests.py`` +Run unit tests only: ``sudo ./tests/runtests.py --unit-tests`` + +You will need 'mock' (https://pypi.python.org/pypi/mock) in addition to salt requirements in order to run the tests. + ============= Writing Tests ============= diff --git a/salt/master.py b/salt/master.py index 4aa74ca9cc..55d256250f 100644 --- a/salt/master.py +++ b/salt/master.py @@ -228,6 +228,10 @@ class Master(SMaster): def __set_max_open_files(self): # Let's check to see how our max open files(ulimit -n) setting is mof_s, mof_h = resource.getrlimit(resource.RLIMIT_NOFILE) + if mof_h == resource.RLIM_INFINITY: + # Unclear what to do with infinity... OSX reports RLIM_INFINITY as hard limit, + # but raising to anything above soft limit fails... + mof_h = mof_s log.info( 'Current values for max open files soft/hard setting: ' '{0}/{1}'.format(