Add compound matcher tests

This commit is contained in:
Thomas S Hatch 2013-01-29 10:20:02 -07:00
parent 193a64e33e
commit a58202c2f7

View file

@ -27,6 +27,23 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
self.assertIn('minion', data)
self.assertIn('sub_minion', data)
def test_compound(self):
'''
test salt compound matcher
'''
data = self.run_salt('-C "min* and G@test_grain:cheese" test.ping')
data = '\n'.join(data)
self.assertIn('minion', data)
self.assertNotIn('sub_minion', data)
data = self.run_salt('-C "min* and not G@test_grain:foo" test.ping')
data = '\n'.join(data)
self.assertIn('minion', data)
self.assertNotIn('sub_minion', data)
data = self.run_salt('-C "min* not G@test_grain:foo" test.ping')
data = '\n'.join(data)
self.assertIn('minion', data)
self.assertNotIn('sub_minion', data)
def test_glob(self):
'''
test salt glob matcher