mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
commit
50e31ecf0b
1 changed files with 12 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue