This fixes the following when running `python tests/runtests.py --ext-pillar`:
-------- Tests with Errors ------------------------------------------------------------------------------------------------------------------------
-> tearDownClass (integration.pillar.test_git_pillar.TestGitPythonSSH) ...........................................................................
Traceback (most recent call last):
File ".../salt/tests/support/gitfs.py", line 481, in tearDownClass
if cls.case.sshd_proc is not None:
AttributeError: 'NoneType' object has no attribute 'sshd_proc'
...................................................................................................................................................
-> tearDownClass (integration.pillar.test_git_pillar.TestPygit2SSH) ..............................................................................
Traceback (most recent call last):
File ".../salt/tests/support/gitfs.py", line 481, in tearDownClass
if cls.case.sshd_proc is not None:
AttributeError: 'NoneType' object has no attribute 'sshd_proc'
...................................................................................................................................................
-----------------------------------------------------------------------------------------------------------------------------------------------------
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
(cherry picked from commit 84e9fce9bb)
The proxy and ssh tests won't run when the `--proxy` and `--ssh` CLI
flags, respectively, aren't passed to runtests.py. This ensures that we
start the daemons when the file mapping logic triggers them to be run.
We can expect the subprocess has already ended by the time we're
checking for child processes. Handle this case gracefully so that tests
do not fail with an exception.
This commit adds the following features:
- Changes to test modules are identified, and those tests are added to
the list of tests to be run
- expr_match is used to allow the filename map to use either globbing or
regular expressions
- Corresponding state tests are added when doing filename matches,
meaning that for example the git state tests will be run when the git
execution module is in the --from-filenames list