Skip salt-ssh related tests on Fedora 39

The problem is that the tornado we ship is not prepared for Python 3.12,
and it imports `ssl` and checks if the `match_hostname` function is defined, which
has been deprecated since Python 3.7, so, the logic goes into trying to import
backports.ssl-match-hostname which is not installed on the system.
This commit is contained in:
Pedro Algarvio 2024-02-26 16:05:15 +00:00
parent 3978817195
commit e9122b1d7c
4 changed files with 43 additions and 0 deletions

View file

@ -33,6 +33,17 @@ import pytest
from tests.support.case import SSHCase
pytestmark = [
pytest.mark.skipif(
"grains['osfinger'] == 'Fedora Linux-39'",
reason="Fedora 39 ships with Python 3.12. Test can't run with system Python on 3.12"
# Actually, the problem is that the tornado we ship is not prepared for Python 3.12,
# and it imports `ssl` and checks if the `match_hostname` function is defined, which
# has been deprecated since Python 3.7, so, the logic goes into trying to import
# backports.ssl-match-hostname which is not installed on the system.
)
]
@pytest.mark.skip_on_windows
class SSHCustomModuleTest(SSHCase):

View file

@ -11,6 +11,17 @@ from saltfactories.utils.tempfiles import temp_file
from tests.support.case import SSHCase
from tests.support.runtests import RUNTIME_VARS
pytestmark = [
pytest.mark.skipif(
"grains['osfinger'] == 'Fedora Linux-39'",
reason="Fedora 39 ships with Python 3.12. Test can't run with system Python on 3.12"
# Actually, the problem is that the tornado we ship is not prepared for Python 3.12,
# and it imports `ssl` and checks if the `match_hostname` function is defined, which
# has been deprecated since Python 3.7, so, the logic goes into trying to import
# backports.ssl-match-hostname which is not installed on the system.
)
]
SSH_SLS = "ssh_state_tests"
SSH_SLS_FILE = "/tmp/salt_test_file"

View file

@ -8,6 +8,14 @@ from tests.support.mock import patch
pytestmark = [
pytest.mark.slow_test,
pytest.mark.requires_sshd_server,
pytest.mark.skipif(
"grains['osfinger'] == 'Fedora Linux-39'",
reason="Fedora 39 ships with Python 3.12. Test can't run with system Python on 3.12"
# Actually, the problem is that the tornado we ship is not prepared for Python 3.12,
# and it imports `ssl` and checks if the `match_hostname` function is defined, which
# has been deprecated since Python 3.7, so, the logic goes into trying to import
# backports.ssl-match-hostname which is not installed on the system.
),
]

View file

@ -0,0 +1,13 @@
import pytest
@pytest.fixture(scope="package", autouse=True)
def _auto_skip_on_fedora_39(grains):
if grains["osfinger"] == "Fedora Linux-39":
pytest.skip(
"Fedora 39 ships with Python 3.12. Test can't run with system Python on 3.12"
# Actually, the problem is that the tornado we ship is not prepared for Python 3.12,
# and it imports `ssl` and checks if the `match_hostname` function is defined, which
# has been deprecated since Python 3.7, so, the logic goes into trying to import
# backports.ssl-match-hostname which is not installed on the system.
)