mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add shell ipcadr
match test.
This commit is contained in:
parent
3d9375038c
commit
7e816c291f
1 changed files with 20 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
# Import python libs
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
# Import salt libs
|
||||
from saltunittest import TestLoader, TextTestRunner
|
||||
|
@ -114,6 +115,25 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|||
self.assertIn('minion', data)
|
||||
self.assertIn('sub_minion', data)
|
||||
|
||||
def test_ipcadr(self):
|
||||
subnets_data = self.run_salt('\'*\' network.subnets')
|
||||
subnet = None
|
||||
for line in subnets_data:
|
||||
try:
|
||||
yamline = yaml.load(line)
|
||||
subnet = yamline.values()[0][0]
|
||||
break
|
||||
except:
|
||||
continue
|
||||
|
||||
if subnet is None:
|
||||
self.skipTest('Failed to query the minion\'s subnets')
|
||||
|
||||
data = self.run_salt('-S {0} test.ping'.format(subnet))
|
||||
data = '\n'.join(data)
|
||||
self.assertIn('minion', data)
|
||||
self.assertIn('sub_minion', data)
|
||||
|
||||
def test_static(self):
|
||||
'''
|
||||
test salt static call
|
||||
|
|
Loading…
Add table
Reference in a new issue