Making tests runnable on OSX

This commit is contained in:
Zoran Simic 2013-03-20 16:13:22 -07:00
parent 7d5441e294
commit 6d52cab067
2 changed files with 15 additions and 0 deletions

View File

@ -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 Writing Tests
============= =============

View File

@ -228,6 +228,10 @@ class Master(SMaster):
def __set_max_open_files(self): def __set_max_open_files(self):
# Let's check to see how our max open files(ulimit -n) setting is # Let's check to see how our max open files(ulimit -n) setting is
mof_s, mof_h = resource.getrlimit(resource.RLIMIT_NOFILE) 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( log.info(
'Current values for max open files soft/hard setting: ' 'Current values for max open files soft/hard setting: '
'{0}/{1}'.format( '{0}/{1}'.format(