mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Initial host state test
This commit is contained in:
parent
26bcb2a4cf
commit
5f9a7e87e4
28
tests/integration/states/host.py
Normal file
28
tests/integration/states/host.py
Normal file
@ -0,0 +1,28 @@
|
||||
'''
|
||||
tests for host state
|
||||
'''
|
||||
|
||||
# Import python libs
|
||||
import os
|
||||
#
|
||||
# Import salt libs
|
||||
from saltunittest import TestLoader, TextTestRunner
|
||||
import integration
|
||||
from integration import TestDaemon
|
||||
|
||||
HFILE = os.path.join(integration.TMP, 'hosts')
|
||||
|
||||
class HostTest(integration.ModuleCase):
|
||||
'''
|
||||
Validate the host state
|
||||
'''
|
||||
def test_present(self):
|
||||
'''
|
||||
host.present
|
||||
'''
|
||||
ret = self.run_state('host.present', name='spam.bacon', ip='10.10.10.10')
|
||||
result = self.state_result(ret)
|
||||
self.assertTrue(result)
|
||||
with open(HFILE) as fp_:
|
||||
self.assertIn('{0}\t\t{1}'.format(ip, name), fp_.read())
|
||||
|
Loading…
Reference in New Issue
Block a user