salt/tests/integration/client/syndic.py

39 lines
937 B
Python
Raw Normal View History

2012-03-29 07:02:40 +00:00
# Import python libs
import sys
2012-03-29 07:02:40 +00:00
# Import salt libs
from saltunittest import TestLoader, TextTestRunner
2012-03-29 07:02:40 +00:00
import integration
from integration import TestDaemon
2012-03-29 07:02:40 +00:00
class TestSyndic(integration.SyndicCase):
2012-03-29 07:02:40 +00:00
'''
Validate the syndic interface by testing the test module
'''
def test_ping(self):
'''
test.ping
'''
self.assertTrue(self.run_function('test.ping'))
def test_fib(self):
'''
test.fib
'''
self.assertEqual(
self.run_function(
'test.fib',
['40'],
)[0][-1],
34
)
if __name__ == "__main__":
loader = TestLoader()
tests = loader.loadTestsFromTestCase(TestSyndic)
print('Setting up Salt daemons to execute tests')
with TestDaemon():
runner = TextTestRunner(verbosity=1).run(tests)
sys.exit(runner.wasSuccessful())