mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Fix salt.modules.publish and salt.states.x509 tests
The peers.conf addition for the x509 state tests broke the salt.modules.publish tests. Move the configuration to the test master's config. Also increase the publish call timeout in the x509 module to make the x509 state tests reliable on all platforms.
This commit is contained in:
parent
4859e6c9f0
commit
c3971a5802
@ -1391,10 +1391,13 @@ def create_certificate(
|
|||||||
for ignore in list(_STATE_INTERNAL_KEYWORDS) + \
|
for ignore in list(_STATE_INTERNAL_KEYWORDS) + \
|
||||||
['listen_in', 'preqrequired', '__prerequired__']:
|
['listen_in', 'preqrequired', '__prerequired__']:
|
||||||
kwargs.pop(ignore, None)
|
kwargs.pop(ignore, None)
|
||||||
|
# TODO: Make timeout configurable in Neon
|
||||||
certs = __salt__['publish.publish'](
|
certs = __salt__['publish.publish'](
|
||||||
tgt=ca_server,
|
tgt=ca_server,
|
||||||
fun='x509.sign_remote_certificate',
|
fun='x509.sign_remote_certificate',
|
||||||
arg=salt.utils.data.decode_dict(kwargs, to_str=True))
|
arg=salt.utils.data.decode_dict(kwargs, to_str=True),
|
||||||
|
timeout=30
|
||||||
|
)
|
||||||
|
|
||||||
if not any(certs):
|
if not any(certs):
|
||||||
raise salt.exceptions.SaltInvocationError(
|
raise salt.exceptions.SaltInvocationError(
|
||||||
|
@ -28,7 +28,8 @@ tcp_master_workers: 64515
|
|||||||
|
|
||||||
peer:
|
peer:
|
||||||
'.*':
|
'.*':
|
||||||
- 'test.*'
|
- '(x509|test).*'
|
||||||
|
#- 'x509.sign_remote_certificate'
|
||||||
|
|
||||||
ext_pillar:
|
ext_pillar:
|
||||||
- ext_pillar_opts:
|
- ext_pillar_opts:
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
peer:
|
|
||||||
.*:
|
|
||||||
- x509.sign_remote_certificate
|
|
@ -60,6 +60,9 @@ class x509Test(ModuleCase, SaltReturnAssertsMixin):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
os.remove(os.path.join(TMP_PILLAR_TREE, 'signing_policies.sls'))
|
os.remove(os.path.join(TMP_PILLAR_TREE, 'signing_policies.sls'))
|
||||||
os.remove(os.path.join(TMP_PILLAR_TREE, 'top.sls'))
|
os.remove(os.path.join(TMP_PILLAR_TREE, 'top.sls'))
|
||||||
|
certs_path = os.path.join(TMP, 'pki')
|
||||||
|
if os.path.exists(certs_path):
|
||||||
|
salt.utils.files.rm_rf(certs_path)
|
||||||
self.run_function('saltutil.refresh_pillar')
|
self.run_function('saltutil.refresh_pillar')
|
||||||
|
|
||||||
def run_function(self, *args, **kwargs):
|
def run_function(self, *args, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user