add ssh dir to test runner when --ssh-tests set

This commit is contained in:
Ch3LL 2017-11-09 15:17:25 -05:00
parent 8089a885c2
commit c731eb8ea6
No known key found for this signature in database
GPG Key ID: 132B55A7C13EFA73

View File

@ -130,6 +130,9 @@ TEST_SUITES = {
'returners':
{'display_name': 'Returners',
'path': 'integration/returners'},
'ssh':
{'display_name': 'SSH',
'path': 'integration/ssh'},
'spm':
{'display_name': 'SPM',
'path': 'integration/spm'},
@ -172,7 +175,7 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
source_code_basedir = SALT_ROOT
def _get_suites(self, include_unit=False, include_cloud_provider=False,
include_proxy=False):
include_proxy=False, include_ssh=False):
'''
Return a set of all test suites except unit and cloud provider tests
unless requested
@ -184,28 +187,33 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
suites -= set(['cloud_provider'])
if not include_proxy:
suites -= set(['proxy'])
if not include_ssh:
suites -= set(['ssh'])
return suites
def _check_enabled_suites(self, include_unit=False,
include_cloud_provider=False, include_proxy=False):
include_cloud_provider=False,
include_proxy=False, include_ssh=False):
'''
Query whether test suites have been enabled
'''
suites = self._get_suites(include_unit=include_unit,
include_cloud_provider=include_cloud_provider,
include_proxy=include_proxy)
include_proxy=include_proxy,
include_ssh=include_ssh)
return any([getattr(self.options, suite) for suite in suites])
def _enable_suites(self, include_unit=False, include_cloud_provider=False,
include_proxy=False):
include_proxy=False, include_ssh=False):
'''
Enable test suites for current test run
'''
suites = self._get_suites(include_unit=include_unit,
include_cloud_provider=include_cloud_provider,
include_proxy=include_proxy)
include_proxy=include_proxy,
include_ssh=include_ssh)
for suite in suites:
setattr(self.options, suite, True)
@ -473,7 +481,8 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
if not self.options.name and not \
self._check_enabled_suites(include_unit=True,
include_cloud_provider=True,
include_proxy=True):
include_proxy=True,
include_ssh=True):
self._enable_suites(include_unit=True)
self.start_coverage(
@ -662,7 +671,8 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
status = []
# Return an empty status if no tests have been enabled
if not self._check_enabled_suites(include_cloud_provider=True, include_proxy=True) and not self.options.name:
if not self._check_enabled_suites(include_cloud_provider=True,
include_proxy=True, include_ssh=True) and not self.options.name:
return status
with TestDaemon(self):