Merge pull request #48979 from rallytime/bp-48959

Back-port #48959 to 2017.7.8
This commit is contained in:
Nicole Thomas 2018-08-07 14:11:52 -04:00 committed by GitHub
commit 22713be9c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import salt.utils
# Import Salt Testing Libs
from tests.support.case import ShellCase, SSHCase
from tests.support.helpers import flaky
class GrainsTargetingTest(ShellCase):
@ -52,6 +53,7 @@ class GrainsTargetingTest(ShellCase):
sub_minion = self.run_salt('-G \'id:sub_minion\' test.ping')
self.assertEqual(sorted(sub_minion), sorted(['sub_minion:', ' True']))
@flaky
def test_grains_targeting_disconnected(self):
'''
Tests return of minion using grains targeting on a disconnected minion.
@ -70,7 +72,7 @@ class GrainsTargetingTest(ShellCase):
for item in self.run_salt('-t 1 -G \'id:disconnected\' test.ping', timeout=40):
if item != 'disconnected:':
ret = item.strip()
self.assertEqual(ret, test_ret)
assert ret == test_ret
finally:
os.unlink(key_file)

View File

@ -94,11 +94,13 @@ class MatchTest(ShellCase, ShellCaseCommonTestsMixin):
assert minion_in_returns('minion', data) is True
assert minion_in_returns('sub_minion', data) is True
@flaky
def test_compound_pillar(self):
data = self.run_salt("-C 'I%@companions%three%sarah*' test.ping")
assert minion_in_returns('minion', data) is True
assert minion_in_returns('sub_minion', data) is True
@flaky
def test_coumpound_pillar_pcre(self):
data = self.run_salt("-C 'J%@knights%^(Lancelot|Galahad)$' test.ping")
assert minion_in_returns('minion', data) is True