mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #1530 from dcolish/develop
Fix test.integration.states.host. Make master_config and minion_config a...
This commit is contained in:
commit
ed84eda01f
@ -183,6 +183,7 @@ class ModuleCase(TestCase):
|
||||
'''
|
||||
return self.run_function('state.single', [function], **kwargs)
|
||||
|
||||
@property
|
||||
def minion_opts(self):
|
||||
'''
|
||||
Return the options used for the minion
|
||||
@ -194,6 +195,7 @@ class ModuleCase(TestCase):
|
||||
)
|
||||
)
|
||||
|
||||
@property
|
||||
def master_opts(self):
|
||||
'''
|
||||
Return the options used for the minion
|
||||
|
@ -18,14 +18,14 @@ class TestModulesGrains(integration.ModuleCase):
|
||||
'''
|
||||
grains.items
|
||||
'''
|
||||
opts = self.minion_opts()
|
||||
opts = self.minion_opts
|
||||
self.assertEqual(self.run_function('grains.items')['test_grain'], opts['grains']['test_grain'])
|
||||
|
||||
def test_item(self):
|
||||
'''
|
||||
grains.item
|
||||
'''
|
||||
opts = self.minion_opts()
|
||||
opts = self.minion_opts
|
||||
self.assertEqual(self.run_function('grains.item', ['test_grain']), opts['grains']['test_grain'])
|
||||
|
||||
def test_ls(self):
|
||||
|
@ -13,21 +13,19 @@ HFILE = os.path.join(integration.TMP, 'hosts')
|
||||
|
||||
|
||||
class HostTest(integration.ModuleCase):
|
||||
def setUp(self):
|
||||
shutil.copy(os.path.join(
|
||||
integration.INTEGRATION_TEST_DIR, 'files', 'hosts'),
|
||||
self.master_opts['hosts.file'])
|
||||
shutil.copy(os.path.join(
|
||||
integration.INTEGRATION_TEST_DIR, 'files', 'hosts'),
|
||||
self.minion_opts['hosts.file'])
|
||||
|
||||
def tearDown(self):
|
||||
os.remove(self.master_opts['hosts.file'])
|
||||
os.remove(self.minion_opts['hosts.file'])
|
||||
|
||||
'''
|
||||
Validate the host state
|
||||
'''
|
||||
|
||||
def setUp(self):
|
||||
shutil.copyfile(os.path.join(integration.FILES, 'hosts'), HFILE)
|
||||
super(HostTest, self).setUp()
|
||||
|
||||
def tearDown(self):
|
||||
if os.path.exists(HFILE):
|
||||
os.remove(HFILE)
|
||||
super(HostTest, self).tearDown()
|
||||
|
||||
def test_present(self):
|
||||
'''
|
||||
host.present
|
||||
|
Loading…
Reference in New Issue
Block a user