mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Add regex grain match tests
This commit is contained in:
parent
6eb742727d
commit
b25e82c59f
@ -63,6 +63,18 @@ class MatchTest(integration.ShellCase):
|
||||
self.assertIn('sub_minion', data)
|
||||
self.assertNotIn('minion', data.replace('sub_minion', 'stub'))
|
||||
|
||||
def test_regrain(self):
|
||||
'''
|
||||
test salt grain matcher
|
||||
'''
|
||||
data = self.run_salt('-t 1 --grain-pcre "test_grain:^cheese$" test.ping')
|
||||
data = '\n'.join(data)
|
||||
self.assertIn('minion', data)
|
||||
self.assertNotIn('sub_minion', data)
|
||||
data = self.run_salt('--grain-pcre "test_grain:.*am$" test.ping')
|
||||
data = '\n'.join(data)
|
||||
self.assertIn('sub_minion', data)
|
||||
self.assertNotIn('minion', data.replace('sub_minion', 'stub'))
|
||||
|
||||
if __name__ == "__main__":
|
||||
loader = TestLoader()
|
||||
|
Loading…
Reference in New Issue
Block a user