Cannot currently create virtual environments on a FIPS enabled platforms

See https://github.com/saltstack/salt/issues/65444

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-10-21 09:00:32 +01:00 committed by Pedro Algarvio
parent 3ed6e05262
commit 265ec5becf
3 changed files with 10 additions and 0 deletions

View file

@ -25,6 +25,10 @@ except ImportError:
log = logging.getLogger(__name__)
pytestmark = [
pytest.mark.skip_on_fips_enabled_platform,
]
def _win_user_where(username, password, program):
cmd = "cmd.exe /c where {}".format(program)

View file

@ -9,6 +9,7 @@ log = logging.getLogger(__name__)
pytestmark = [
pytest.mark.slow_test,
pytest.mark.skip_on_fips_enabled_platform,
pytest.mark.skip_if_binaries_missing(*KNOWN_BINARY_NAMES, check_all=False),
]

View file

@ -33,6 +33,7 @@ import types
import attr
import pytest
import pytestskipmarkers.utils.platform
from pytestshellutils.exceptions import ProcessFailed
from pytestshellutils.utils import ports
from pytestshellutils.utils.processes import ProcessResult
@ -1644,6 +1645,10 @@ class VirtualEnv:
return pathlib.Path(self.venv_python).parent
def __enter__(self):
if pytestskipmarkers.utils.platform.is_fips_enabled():
pytest.skip(
"Test cannot currently create virtual environments on a FIPS enabled platform"
)
try:
self._create_virtualenv()
except subprocess.CalledProcessError: