mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
d5a3e309bf
* Initial POC * Allow the queue to fill by waiting for the lag in IPC * Add docs * Add run_tests * Add reactor to tests
44 lines
973 B
Python
44 lines
973 B
Python
# -*- coding: utf-8 -*-
|
|
'''
|
|
|
|
integration.reactor.reactor
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Test Salt's reactor system
|
|
'''
|
|
|
|
# Import Python libs
|
|
from __future__ import absolute_import
|
|
|
|
# Import Salt testing libs
|
|
from salttesting.helpers import ensure_in_syspath
|
|
|
|
ensure_in_syspath('../')
|
|
|
|
import integration
|
|
|
|
# Import Salt libs
|
|
import salt.utils.event
|
|
|
|
|
|
class ReactorTest(integration.ModuleCase, integration.SaltMinionEventAssertsMixIn):
|
|
'''
|
|
Test Salt's reactor system
|
|
'''
|
|
|
|
def test_ping_reaction(self):
|
|
'''
|
|
Fire an event on the master and ensure
|
|
that it pings the minion
|
|
'''
|
|
# Create event bus connection
|
|
e = salt.utils.event.get_event('minion', sock_dir=self.minion_opts['sock_dir'], opts=self.minion_opts)
|
|
|
|
e.fire_event({'a': 'b'}, '/test_event')
|
|
|
|
self.assertMinionEventReceived({'a': 'b'})
|
|
|
|
if __name__ == '__main__':
|
|
from integration import run_tests
|
|
run_tests(ReactorTest)
|