mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Allow non admin name based runs on windows
This commit is contained in:
parent
d5997d2301
commit
144c68e214
1 changed files with 17 additions and 11 deletions
|
@ -476,20 +476,26 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
|
|||
is_admin = True
|
||||
else:
|
||||
is_admin = salt.utils.win_functions.is_admin(current_user)
|
||||
if self.options.coverage and any((
|
||||
self.options.name,
|
||||
not is_admin,
|
||||
not self.options.run_destructive)) \
|
||||
and self._check_enabled_suites(include_unit=True):
|
||||
log.warn("Test suite not running with elevated priviledges")
|
||||
else:
|
||||
is_admin = os.geteuid() == 0
|
||||
|
||||
if self.options.coverage and any((
|
||||
self.options.name,
|
||||
not is_admin,
|
||||
not self.options.run_destructive)) \
|
||||
and self._check_enabled_suites(include_unit=True):
|
||||
self.error(
|
||||
'No sense in generating the tests coverage report when '
|
||||
'not running the full test suite, including the '
|
||||
'destructive tests, as \'root\'. It would only produce '
|
||||
'incorrect results.'
|
||||
)
|
||||
if self.options.coverage and any((
|
||||
self.options.name,
|
||||
not is_admin,
|
||||
not self.options.run_destructive)) \
|
||||
and self._check_enabled_suites(include_unit=True):
|
||||
self.error(
|
||||
'No sense in generating the tests coverage report when '
|
||||
'not running the full test suite, including the '
|
||||
'destructive tests, as \'root\'. It would only produce '
|
||||
'incorrect results.'
|
||||
)
|
||||
|
||||
# When no tests are specifically enumerated on the command line, setup
|
||||
# a default run: +unit -cloud_provider
|
||||
|
|
Loading…
Add table
Reference in a new issue