Add test to prove that recursive imports are currently broken

Refs #30465

This also exposes some other issues with the Registry being in an
inconsistent state when an exception occurs when we are rendering.
This commit is contained in:
Evan Borgstrom 2016-01-20 09:57:16 -08:00
parent 5c7cc51937
commit 51bfa16173

View file

@ -82,6 +82,18 @@ import salt://map.sls
Pkg.removed("samba-imported", names=[Samba.server, Samba.client])
'''
recursive_map_template = '''#!pyobjects
from salt://map.sls import Samba
class CustomSamba(Samba):
pass
'''
recursive_import_template = '''#!pyobjects
from salt://recursive_map.sls import CustomSamba
Pkg.removed("samba-imported", names=[CustomSamba.server, CustomSamba.client])'''
from_import_template = '''#!pyobjects
# this spacing is like this on purpose to ensure it's stripped properly
from salt://map.sls import Samba
@ -316,6 +328,9 @@ class RendererTests(RendererMixin, StateTests):
render_and_assert(import_template)
render_and_assert(from_import_template)
self.write_template_file("recursive_map.sls", recursive_map_template)
render_and_assert(recursive_import_template)
def test_random_password(self):
'''Test for https://github.com/saltstack/salt/issues/21796'''
ret = self.render(random_password_template)