#8781 test_ipaserver/test_jsplugins.py::test_jsplugins::test_jsplugins fails in server-less environments
Closed: fixed 3 years ago by frenaud. Opened 3 years ago by slev.

+ make fasttest
...

PATH=/usr/src/RPM/BUILD/freeipa-4.9.2/ipatests:$PATH PYTHONPATH=/usr/src/RPM/BUILD/freeipa-4.9.2 \
    /usr/bin/python3 ipatests/ipa-run-tests \
    --skip-ipaapi \
    --ignore /usr/src/RPM/BUILD/freeipa-4.9.2/ipatests/test_integration \
    --ignore /usr/src/RPM/BUILD/freeipa-4.9.2/ipatests/test_xmlrpc
...

=================================== FAILURES ===================================
________________________ test_jsplugins.test_jsplugins _________________________

self = <ipatests.test_ipaserver.test_jsplugins.test_jsplugins object at 0x7f47fe177550>

    def test_jsplugins(self):
        empty_response = "define([],function(){return[];});"

        # Step 1: make sure default response has no additional plugins
>       response = self.send_request(method='GET')

test_ipaserver/test_jsplugins.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test_ipaserver/httptest.py:56: in send_request
    conn = util.create_https_connection(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

host = 'localhost.localdomain', port = 443, cafile = '/usr/src/.ipa/ca.crt'
client_certfile = None, client_keyfile = None, keyfile_passwd = None
tls_version_min = None, tls_version_max = None, kwargs = {}
tls_cutoff_map = {'ssl2': <Options.OP_NO_SSLv2: 0>, 'ssl3': <Options.OP_NO_SSLv3: 33554432>, 'tls1.0': <Options.OP_NO_TLSv1: 67108864>, 'tls1.1': <Options.OP_NO_TLSv1_1: 268435456>, ...}

    def create_https_connection(
        host, port=HTTPSConnection.default_port,
        cafile=None,
        client_certfile=None, client_keyfile=None,
        keyfile_passwd=None,
        tls_version_min=TLS_VERSION_DEFAULT_MIN,
        tls_version_max=TLS_VERSION_DEFAULT_MAX,
        **kwargs
    ):
        """
        Create a customized HTTPSConnection object.

        :param host:  The host to connect to
        :param port:  The port to connect to, defaults to
                   HTTPSConnection.default_port
        :param cafile:  A PEM-format file containning the trusted
                        CA certificates
        :param client_certfile:
                A PEM-format client certificate file that will be used to
                identificate the user to the server.
        :param client_keyfile:
                A file with the client private key. If this argument is not
                supplied, the key will be sought in client_certfile.
        :param keyfile_passwd:
                A path to the file which stores the password that is used to
                encrypt client_keyfile. Leave default value if the keyfile
                is not encrypted.
        :returns An established HTTPS connection to host:port
        """
        # pylint: disable=no-member
        tls_cutoff_map = {
            "ssl2": ssl.OP_NO_SSLv2,
            "ssl3": ssl.OP_NO_SSLv3,
            "tls1.0": ssl.OP_NO_TLSv1,
            "tls1.1": ssl.OP_NO_TLSv1_1,
            "tls1.2": ssl.OP_NO_TLSv1_2,
            "tls1.3": getattr(ssl, "OP_NO_TLSv1_3", 0),
        }
        # pylint: enable=no-member

        if cafile is None:
            raise RuntimeError("cafile argument is required to perform server "
                               "certificate verification")

        if not os.path.isfile(cafile) or not os.access(cafile, os.R_OK):
>           raise RuntimeError("cafile \'{file}\' doesn't exist or is unreadable".
                               format(file=cafile))
E           RuntimeError: cafile '/usr/src/.ipa/ca.crt' doesn't exist or is unreadable

../ipalib/util.py:339: RuntimeError

...

FAILED test_ipaserver/test_jsplugins.py::test_jsplugins::test_jsplugins - Run...
====== 1 failed, 627 passed, 252 skipped, 1 xfailed, 3 warnings in 40.76s ======

This test requires installed and configured IPA server, it should be skipped in such envs.


Metadata Update from @slev:
- Issue assigned to slev

3 years ago

master:

  • 68a5fe8 ipatests: Skip test_jsplugins in server less environments

ipa-4-8:

  • 79d83cb ipatests: Skip test_jsplugins in server less environments

ipa-4-9:

  • 3eb8b30 ipatests: Skip test_jsplugins in server less environments

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata