mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
add more tests
This commit is contained in:
parent
9a3d3f3741
commit
a21aacba74
@ -3829,6 +3829,11 @@ class SProxyMinion(SMinion):
|
||||
|
||||
fq_proxyname = self.opts['proxy']['proxytype']
|
||||
|
||||
# we can then sync any proxymodules down from the master
|
||||
# we do a sync_all here in case proxy code was installed by
|
||||
# SPM or was manually placed in /srv/salt/_modules etc.
|
||||
self.functions['saltutil.sync_all'](saltenv=self.opts['saltenv'])
|
||||
|
||||
self.functions.pack['__proxy__'] = self.proxy
|
||||
self.proxy.pack['__salt__'] = self.functions
|
||||
self.proxy.pack['__ret__'] = self.returners
|
||||
|
@ -41,10 +41,24 @@ class ProxyCallerSimpleTestCase(ShellCase):
|
||||
self.assertIn('apache', ret['local'])
|
||||
self.assertIn('redbull', ret['local'])
|
||||
|
||||
def test_upgrade(self):
|
||||
ret = self._load_return(self.run_call('--proxyid proxytest --out=json pkg.upgrade'))
|
||||
self.assertEqual(ret['local']['coreutils']['new'], '3.0')
|
||||
self.assertEqual(ret['local']['redbull']['new'], '1001.99')
|
||||
|
||||
def test_service_list(self):
|
||||
ret = self._load_return(self.run_call('--proxyid proxytest --out=json service.list'))
|
||||
self.assertIn('ntp', ret['local'])
|
||||
|
||||
def test_service_start(self):
|
||||
ret = self._load_return(self.run_call('--proxyid proxytest --out=json service.start samba'))
|
||||
ret = self._load_return(self.run_call('--proxyid proxytest --out=json service.status samba'))
|
||||
self.assertTrue(ret)
|
||||
|
||||
def test_service_get_all(self):
|
||||
ret = self._load_return(self.run_call('--proxyid proxytest --out=json service.get_all'))
|
||||
self.assertIn('samba', ret['local'])
|
||||
|
||||
def test_grains_items(self):
|
||||
ret = self._load_return(self.run_call('--proxyid proxytest --out=json grains.items'))
|
||||
self.assertEqual(ret['local']['kernel'], 'proxy')
|
||||
|
Loading…
Reference in New Issue
Block a user