add more tests

This commit is contained in:
Daniel Wallace 2018-06-28 12:53:00 -05:00
parent 9a3d3f3741
commit a21aacba74
No known key found for this signature in database
GPG Key ID: 5FA5E5544F010D48
2 changed files with 19 additions and 0 deletions

View File

@ -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

View File

@ -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')