mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Combine compound matcher tests
This commit is contained in:
parent
2edd526c71
commit
3d1cf71a77
1 changed files with 11 additions and 15 deletions
|
@ -43,6 +43,17 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|||
data = '\n'.join(data)
|
||||
self.assertIn('minion', data)
|
||||
self.assertNotIn('sub_minion', data)
|
||||
match = 'P@test_grain:^cheese$ and * and G@test_grain:cheese'
|
||||
data = self.run_salt('-t 1 -C \'{0}\' test.ping'.format(match))
|
||||
data = '\n'.join(data)
|
||||
self.assertIn('minion', data)
|
||||
self.assertNotIn('sub_minion', data)
|
||||
match = 'L@sub_minion and E@.*'
|
||||
data = self.run_salt('-t 1 -C "{0}" test.ping'.format(match))
|
||||
data = '\n'.join(data)
|
||||
self.assertIn('sub_minion', data)
|
||||
self.assertNotIn('minion', data.replace('sub_minion', 'stub'))
|
||||
|
||||
|
||||
def test_glob(self):
|
||||
'''
|
||||
|
@ -156,21 +167,6 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|||
self.assertIn('minion', data)
|
||||
self.assertIn('sub_minion', data)
|
||||
|
||||
def test_compound(self):
|
||||
'''
|
||||
test compound matcher
|
||||
'''
|
||||
match = 'P@test_grain:^cheese$ and * and G@test_grain:cheese'
|
||||
data = self.run_salt('-t 1 -C \'{0}\' test.ping'.format(match))
|
||||
data = '\n'.join(data)
|
||||
self.assertIn('minion', data)
|
||||
self.assertNotIn('sub_minion', data)
|
||||
match = 'L@sub_minion and E@.*'
|
||||
data = self.run_salt('-t 1 -C "{0}" test.ping'.format(match))
|
||||
data = '\n'.join(data)
|
||||
self.assertIn('sub_minion', data)
|
||||
self.assertNotIn('minion', data.replace('sub_minion', 'stub'))
|
||||
|
||||
def test_exsel(self):
|
||||
data = self.run_salt('-X test.ping test.ping')
|
||||
data = '\n'.join(data)
|
||||
|
|
Loading…
Add table
Reference in a new issue