Fix proxy minion startup issue on the test suite

This commit is contained in:
Pedro Algarvio 2019-04-19 14:44:15 +01:00
parent 7838acef5d
commit 666ca9f7cd
No known key found for this signature in database
GPG Key ID: BB36BF6584A298FF

View File

@ -205,6 +205,8 @@ class TestDaemon(object):
# Set up PATH to mockbin
self._enter_mockbin()
self.minion_targets = set(['minion', 'sub_minion'])
if self.parser.options.transport == 'zeromq':
self.start_zeromq_daemons()
elif self.parser.options.transport == 'raet':
@ -212,7 +214,6 @@ class TestDaemon(object):
elif self.parser.options.transport == 'tcp':
self.start_tcp_daemons()
self.minion_targets = set(['minion', 'sub_minion'])
self.pre_setup_minions()
self.setup_minions()
@ -459,6 +460,7 @@ class TestDaemon(object):
sys.stdout.flush()
if self.parser.options.proxy:
self.minion_targets.add(self.proxy_opts['id'])
try:
sys.stdout.write(
' * {LIGHT_YELLOW}Starting salt-proxy ... {ENDC}'.format(**self.colors)
@ -466,7 +468,7 @@ class TestDaemon(object):
sys.stdout.flush()
self.proxy_process = start_daemon(
daemon_name='salt-proxy',
daemon_id=self.master_opts['id'],
daemon_id=self.proxy_opts['id'],
daemon_log_prefix='salt-proxy/{}'.format(self.proxy_opts['id']),
daemon_cli_script_name='proxy',
daemon_config=self.proxy_opts,
@ -1313,7 +1315,7 @@ class TestDaemon(object):
ret = None
if ret and 'minions' not in ret:
continue
if ret and sorted(ret['minions']) == ['minion', 'sub_minion']:
if ret and sorted(ret['minions']) == sorted(self.minion_targets):
break
if time.time() - start >= timeout:
raise RuntimeError("Ping Minions Failed")