URL:
https://github.com/freeipa/freeipa/pull/1372
Author: Rezney
Title: #1372: Test self-signed > external CA > self-signed test case.
Action: opened
PR body:
"""
Various changes are being done in this PR:
1. In order to avoid boilerplate code we add a function for signing a CA.
2. We add self-signed > external CA > self-signed test case itself + introduce two
new constants.
3. We move create_caless_pki.py and create_external_ca.py modules to pytest_plugins.
Details:
Till now both create_caless_pki.py and create_external_ca.py were
stored in test_integration folder. However when trying to import
e.g. "from create_external_ca import ExternalCA" from tasks.py
where all other integration test`s support functions lives we get
"AttributeError: module 'pytest' has no attribute 'config' as
pytest
was not completely initialized at the moment of the import.
Backtrace from the issue:
`
File "/usr/lib/python3.6/site-packages/_pytest/config.py", line 421, in
consider_module
self._import_plugin_specs(getattr(mod, 'pytest_plugins', []))
File "/usr/lib/python3.6/site-packages/_pytest/config.py", line 426, in
_import_plugin_specs
self.import_plugin(import_spec)
File "/usr/lib/python3.6/site-packages/_pytest/config.py", line 443, in
import_plugin
__import__(importspec)
File
"/usr/lib/python3.6/site-packages/ipatests/pytest_plugins/integration/__init__.py",
line 37, in <module>
from . import tasks
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
File "<frozen importlib._bootstrap>", line 616, in
_load_backward_compatible
File "/usr/lib/python3.6/site-packages/_pytest/assertion/rewrite.py", line
212, in load_module
py.builtin.exec_(co, mod.__dict__)
File
"/usr/lib/python3.6/site-packages/ipatests/pytest_plugins/integration/tasks.py",
line 47, in <module>
from ipatests.test_integration.create_external_ca import ExternalCA
File "/usr/lib/python3.6/site-packages/ipatests/test_integration/__init__.py",
line 22, in <module>
ipatests.util.check_ipaclient_unittests()
File "/usr/lib/python3.6/site-packages/ipatests/util.py", line 71, in
check_ipaclient_unittests
if pytest.config.getoption('ipaclient_unittests', False):
AttributeError: module 'pytest' has no attribute 'config'
`
"""
To pull the PR as Git branch:
git remote add ghfreeipa
https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1372/head:pr1372
git checkout pr1372