mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
detect the right transport for the client in tests
This commit is contained in:
parent
cf4c0b62cc
commit
d33b01d635
@ -35,6 +35,7 @@ INTEGRATION_TEST_DIR = os.path.dirname(
|
||||
)
|
||||
CODE_DIR = os.path.dirname(os.path.dirname(INTEGRATION_TEST_DIR))
|
||||
SALT_LIBS = os.path.dirname(CODE_DIR)
|
||||
TRANSPORT = 'zeromq'
|
||||
|
||||
# Import Salt Testing libs
|
||||
from salttesting import TestCase
|
||||
@ -251,6 +252,8 @@ class TestDaemon(object):
|
||||
if self.parser.options.transport == 'zeromq':
|
||||
self.start_zeromq_daemons()
|
||||
elif self.parser.options.transport == 'raet':
|
||||
global TRANSPORT
|
||||
TRANSPORT = 'raet'
|
||||
self.start_raet_daemons()
|
||||
|
||||
if os.environ.get('DUMP_SALT_CONFIG', None) is not None:
|
||||
@ -923,6 +926,15 @@ class SaltClientTestCaseMixIn(AdaptedConfigurationTestCaseMixIn):
|
||||
|
||||
@property
|
||||
def client(self):
|
||||
if TRANSPORT == 'raet':
|
||||
mopts = salt.config.client_config(
|
||||
self.get_config_file_path(
|
||||
self._salt_client_config_file_name_
|
||||
)
|
||||
)
|
||||
mopts['transport'] = 'raet'
|
||||
mopts['raet_port'] = 64506
|
||||
return salt.client.get_local_client(mopts=mopts)
|
||||
return salt.client.get_local_client(
|
||||
self.get_config_file_path(self._salt_client_config_file_name_)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user