mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
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:
commit
9f53d8db29
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user