Merge pull request #9399 from cachedout/ipc-test-skip

Don't run event tests on systems that can't support them.
This commit is contained in:
Pedro Algarvio 2013-12-22 15:53:57 -08:00
commit 9f53d8db29

View File

@ -13,11 +13,12 @@
import os
import hashlib
import time
import zmq
from contextlib import contextmanager
from multiprocessing import Process
# Import Salt Testing libs
from salttesting import expectedFailure
from salttesting import (expectedFailure, skipIf)
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
@ -28,6 +29,9 @@ from salt.utils import event
SOCK_DIR = os.path.join(integration.TMP, 'test-socks')
NO_LONG_IPC = False
if getattr(zmq, 'IPC_PATH_MAX_LEN', 103) <= 103:
NO_LONG_IPC = True
@contextmanager
def eventpublisher_process():
@ -44,7 +48,6 @@ def eventpublisher_process():
proc.terminate()
proc.join()
class EventSender(Process):
def __init__(self, data, tag, wait):
super(EventSender, self).__init__()
@ -74,7 +77,7 @@ def eventsender_process(data, tag, wait=0):
proc.terminate()
proc.join()
@skipIf(NO_LONG_IPC, "This system does not support long IPC paths. Skipping event tests!")
class TestSaltEvent(TestCase):
def setUp(self):
if not os.path.exists(SOCK_DIR):