Merge pull request #53264 from s0undt3ch/2019.2.1

[2019.2.1] Minion blackout tests - Add the missing, and required, top pillar file
This commit is contained in:
Pedro Algarvio 2019-05-29 08:30:44 +01:00 committed by GitHub
commit 50e31ecf0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,15 +28,25 @@ class MinionBlackoutTestCase(ModuleCase):
@classmethod
def setUpClass(cls):
cls.top_pillar = os.path.join(RUNTIME_VARS.TMP_PILLAR_TREE, 'top.sls')
cls.blackout_pillar = os.path.join(RUNTIME_VARS.TMP_PILLAR_TREE, 'blackout.sls')
@classmethod
def tearDownClass(cls):
if os.path.exists(cls.top_pillar):
os.unlink(cls.top_pillar)
del cls.top_pillar
if os.path.exists(cls.blackout_pillar):
os.unlink(cls.blackout_pillar)
del cls.blackout_pillar
def setUp(self):
with salt.utils.files.fopen(self.top_pillar, 'w') as wfh:
wfh.write(textwrap.dedent('''\
base:
'*':
- blackout
'''))
with salt.utils.files.fopen(self.blackout_pillar, 'w') as wfh:
wfh.write('minion_blackout: False')
self.addCleanup(self.cleanup_blackout_pillar)
@ -49,6 +59,8 @@ class MinionBlackoutTestCase(ModuleCase):
self.wait_for_all_jobs()
def cleanup_blackout_pillar(self):
if os.path.exists(self.top_pillar):
os.unlink(self.top_pillar)
if os.path.exists(self.blackout_pillar):
os.unlink(self.blackout_pillar)