diff --git a/tests/integration/shell/matcher.py b/tests/integration/shell/matcher.py index 5b9059574e..a3fb84a358 100644 --- a/tests/integration/shell/matcher.py +++ b/tests/integration/shell/matcher.py @@ -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()