mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
commit
89e0f151fa
@ -136,8 +136,9 @@ def run_tests(*test_cases, **kwargs):
|
||||
self.add_option(
|
||||
'--transport',
|
||||
default='zeromq',
|
||||
choices=('zeromq', 'raet'),
|
||||
help='Set to raet to run integration tests with raet transport. Default: %default'
|
||||
choices=('zeromq', 'raet', 'tcp'),
|
||||
help=('Select which transport to run the integration tests with, '
|
||||
'zeromq, raet, or tcp. Default: %default')
|
||||
)
|
||||
|
||||
def validate_options(self):
|
||||
@ -184,6 +185,8 @@ class TestDaemon(object):
|
||||
self.start_zeromq_daemons()
|
||||
elif self.parser.options.transport == 'raet':
|
||||
self.start_raet_daemons()
|
||||
elif self.parser.options.transport == 'tcp':
|
||||
self.start_tcp_daemons()
|
||||
|
||||
self.minion_targets = set(['minion', 'sub_minion'])
|
||||
self.pre_setup_minions()
|
||||
@ -288,6 +291,8 @@ class TestDaemon(object):
|
||||
|
||||
# no raet syndic daemon yet
|
||||
|
||||
start_tcp_daemons = start_zeromq_daemons
|
||||
|
||||
def prep_ssh(self):
|
||||
'''
|
||||
Generate keys and start an ssh daemon on an alternate port
|
||||
@ -513,6 +518,12 @@ class TestDaemon(object):
|
||||
sub_minion_opts['raet_port'] = 64520
|
||||
# syndic_master_opts['transport'] = 'raet'
|
||||
|
||||
if transport == 'tcp':
|
||||
master_opts['transport'] = 'tcp'
|
||||
minion_opts['transport'] = 'tcp'
|
||||
sub_minion_opts['transport'] = 'tcp'
|
||||
# syndic_master_opts['transport'] = 'raet'
|
||||
|
||||
# Set up config options that require internal data
|
||||
master_opts['pillar_roots'] = {
|
||||
'base': [os.path.join(FILES, 'pillar', 'base')]
|
||||
|
@ -41,7 +41,7 @@ class KeyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
'''
|
||||
data = self.run_key('-L')
|
||||
expect = None
|
||||
if self.master_opts['transport'] == 'zeromq':
|
||||
if self.master_opts['transport'] in ('zeromq', 'tcp'):
|
||||
expect = [
|
||||
'Accepted Keys:',
|
||||
'minion',
|
||||
@ -67,7 +67,7 @@ class KeyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
'''
|
||||
data = self.run_key('-L --out json')
|
||||
expect = None
|
||||
if self.master_opts['transport'] == 'zeromq':
|
||||
if self.master_opts['transport'] in ('zeromq', 'tcp'):
|
||||
expect = [
|
||||
'{',
|
||||
' "minions_rejected": [], ',
|
||||
@ -99,7 +99,7 @@ class KeyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
'''
|
||||
data = self.run_key('-L --out yaml')
|
||||
expect = []
|
||||
if self.master_opts['transport'] == 'zeromq':
|
||||
if self.master_opts['transport'] in ('zeromq', 'tcp'):
|
||||
expect = [
|
||||
'minions:',
|
||||
'- minion',
|
||||
@ -125,7 +125,7 @@ class KeyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
'''
|
||||
data = self.run_key('-L --out raw')
|
||||
expect = None
|
||||
if self.master_opts['transport'] == 'zeromq':
|
||||
if self.master_opts['transport'] in ('zeromq', 'tcp'):
|
||||
expect = [
|
||||
"{'minions_rejected': [], 'minions_denied': [], 'minions_pre': [], "
|
||||
"'minions': ['minion', 'sub_minion']}"
|
||||
@ -144,7 +144,7 @@ class KeyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
test salt-key -l
|
||||
'''
|
||||
data = self.run_key('-l acc')
|
||||
if self.master_opts['transport'] == 'zeromq':
|
||||
if self.master_opts['transport'] in ('zeromq', 'tcp'):
|
||||
self.assertEqual(
|
||||
data,
|
||||
['Accepted Keys:', 'minion', 'sub_minion']
|
||||
@ -166,7 +166,7 @@ class KeyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
'''
|
||||
data = self.run_key('-l un')
|
||||
expect = None
|
||||
if self.master_opts['transport'] == 'zeromq':
|
||||
if self.master_opts['transport'] in ('zeromq', 'tcp'):
|
||||
expect = ['Unaccepted Keys:']
|
||||
elif self.master_opts['transport'] == 'raet':
|
||||
expect = ['minions_pre:']
|
||||
@ -181,7 +181,7 @@ class KeyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
self.run_key(arg_str)
|
||||
try:
|
||||
key_names = None
|
||||
if self.master_opts['transport'] == 'zeromq':
|
||||
if self.master_opts['transport'] in ('zeromq', 'tcp'):
|
||||
key_names = ('minibar.pub', 'minibar.pem')
|
||||
elif self.master_opts['transport'] == 'raet':
|
||||
key_names = ('minibar.key',)
|
||||
@ -197,7 +197,7 @@ class KeyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
self.run_script('salt-key', arg_str)
|
||||
try:
|
||||
key_names = None
|
||||
if self.master_opts['transport'] == 'zeromq':
|
||||
if self.master_opts['transport'] in ('zeromq', 'tcp'):
|
||||
key_names = ('minibar.pub', 'minibar.pem')
|
||||
elif self.master_opts['transport'] == 'raet':
|
||||
key_names = ('minibar.key',)
|
||||
|
@ -828,8 +828,10 @@ def parse():
|
||||
parser.add_option(
|
||||
'--test-transport',
|
||||
default='zeromq',
|
||||
choices=('zeromq', 'raet'),
|
||||
help='Set to raet to run integration tests with raet transport. Default: %default')
|
||||
choices=('zeromq', 'raet', 'tcp'),
|
||||
help=('Select which transport to run the integration tests with, '
|
||||
'zeromq, raet, or tcp. Default: %default')
|
||||
)
|
||||
parser.add_option(
|
||||
'--test-without-coverage',
|
||||
default=False,
|
||||
|
@ -55,8 +55,10 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
|
||||
self.add_option(
|
||||
'--transport',
|
||||
default='zeromq',
|
||||
choices=('zeromq', 'raet'),
|
||||
help='Set to raet to run integration tests with raet transport. Default: %default')
|
||||
choices=('zeromq', 'raet', 'tcp'),
|
||||
help=('Select which transport to run the integration tests with, '
|
||||
'zeromq, raet, or tcp. Default: %default')
|
||||
)
|
||||
self.add_option(
|
||||
'--interactive',
|
||||
default=False,
|
||||
|
Loading…
Reference in New Issue
Block a user