From 64756f8d17adf55d8c2cdf2413023a451ea9d566 Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Tue, 6 Aug 2013 12:58:59 +0200 Subject: [PATCH] Use /var/run/syslog on macosx for syslog tests. - This patch is based on zaictev review. - Fixes bug 1206560. Change-Id: I41f3d485df41fe443784f803b276712405fe72c6 --- test/unit/common/test_utils.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py index 59631496d0..3b3b04adcb 100644 --- a/test/unit/common/test_utils.py +++ b/test/unit/common/test_utils.py @@ -432,10 +432,16 @@ class TestUtils(unittest.TestCase): utils.get_logger({ 'log_facility': 'LOG_LOCAL3', }, 'server', log_route='server') - self.assertEquals([ - ((), {'address': '/dev/log', - 'facility': orig_sysloghandler.LOG_LOCAL3})], - syslog_handler_args) + expected_args = [((), {'address': '/dev/log', + 'facility': orig_sysloghandler.LOG_LOCAL3})] + if not os.path.exists('/dev/log') or \ + os.path.isfile('/dev/log') or \ + os.path.isdir('/dev/log'): + # Since socket on OSX is in /var/run/syslog, there will be + # a fallback to UDP. + expected_args.append(((), + {'facility': orig_sysloghandler.LOG_LOCAL3})) + self.assertEquals(expected_args, syslog_handler_args) syslog_handler_args = [] utils.get_logger({