Skip to content

Commit

Permalink
Merge pull request #25596 from jfindlay/tcp_test
Browse files Browse the repository at this point in the history
Tcp test
  • Loading branch information
Mike Place committed Jul 21, 2015
2 parents 50c331c + a95353b commit 89e0f15
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
15 changes: 13 additions & 2 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ def setup_additional_options(self):
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):
Expand Down Expand Up @@ -184,6 +185,8 @@ def __enter__(self):
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()
Expand Down Expand Up @@ -288,6 +291,8 @@ def start_raet_daemons(self):

# 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
Expand Down Expand Up @@ -513,6 +518,12 @@ def transplant_configs(cls, transport='zeromq'):
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')]
Expand Down
16 changes: 8 additions & 8 deletions tests/integration/shell/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_list_all(self):
'''
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',
Expand All @@ -67,7 +67,7 @@ def test_list_json_out(self):
'''
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": [], ',
Expand Down Expand Up @@ -99,7 +99,7 @@ def test_list_yaml_out(self):
'''
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',
Expand All @@ -125,7 +125,7 @@ def test_list_raw_out(self):
'''
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']}"
Expand All @@ -144,7 +144,7 @@ def test_list_acc(self):
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']
Expand All @@ -166,7 +166,7 @@ def test_list_un(self):
'''
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:']
Expand All @@ -181,7 +181,7 @@ def test_keys_generation(self):
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',)
Expand All @@ -197,7 +197,7 @@ def test_keys_generation_no_configdir(self):
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',)
Expand Down
6 changes: 4 additions & 2 deletions tests/jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ def setup_additional_options(self):
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,
Expand Down

0 comments on commit 89e0f15

Please sign in to comment.