forked from saltstack/salt
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add initial files for syndic tests
- Loading branch information
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# basic config | ||
master: localhost | ||
master_port: 54506 | ||
root_dir: /tmp/salttest | ||
pki_dir: pki | ||
id: minion | ||
cachedir: cache | ||
acceptance_wait_time: 1 | ||
open_mode: True | ||
log_file: minion | ||
order_masters: True | ||
interface: 0.0.0.0 | ||
ret_port: 64506 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Import python libs | ||
import os | ||
|
||
# Import salt libs | ||
import integration | ||
|
||
class TestSyndicTest(integration.SyndicCase): | ||
''' | ||
Validate the syndic interface by testing the test module | ||
''' | ||
def test_ping(self): | ||
''' | ||
test.ping | ||
''' | ||
print 'foobar' | ||
self.assertTrue(self.run_function('test.ping')) | ||
|
||
def test_echo(self): | ||
''' | ||
test.echo | ||
''' | ||
self.assertEqual(self.run_function('test.echo', ['text']), 'text') | ||
|
||
def test_version(self): | ||
''' | ||
test.version | ||
''' | ||
import salt | ||
self.assertEqual(self.run_function('test.version'), salt.__version__) | ||
|
||
def test_conf_test(self): | ||
''' | ||
test.conf_test | ||
''' | ||
self.assertEqual(self.run_function('test.conf_test'), 'baz') | ||
|
||
def test_get_opts(self): | ||
''' | ||
test.get_opts | ||
''' | ||
import salt.config | ||
opts = salt.config.minion_config( | ||
os.path.join( | ||
integration.INTEGRATION_TEST_DIR, | ||
'files/conf/minion' | ||
) | ||
) | ||
self.assertEqual( | ||
self.run_function('test.get_opts')['cachedir'], | ||
opts['cachedir'] | ||
) | ||
|
||
def test_cross_test(self): | ||
''' | ||
test.cross_test | ||
''' | ||
self.assertTrue( | ||
self.run_function( | ||
'test.cross_test', | ||
['test.ping'] | ||
) | ||
) | ||
|
||
def test_fib(self): | ||
''' | ||
test.fib | ||
''' | ||
self.assertEqual( | ||
self.run_function( | ||
'test.fib', | ||
['40'], | ||
)[0][-1], | ||
34 | ||
) | ||
|
||
def test_collatz(self): | ||
''' | ||
test.collatz | ||
''' | ||
self.assertEqual( | ||
self.run_function( | ||
'test.collatz', | ||
['40'], | ||
)[0][-1], | ||
2 | ||
) | ||
|
||
def test_outputter(self): | ||
''' | ||
test.outputter | ||
''' | ||
self.assertEqual(self.run_function('test.outputter', ['text']), 'text') |