Commit Graph

39 Commits

Author SHA1 Message Date
Christian Heimes
21f14e9893 Remove Python 2 support and packages
Remove Python 2 related code and configuration from spec file, autoconf
and CI infrastructure. From now on, FreeIPA 4.8 requires at least Python
3.6. Python 2 packages like python2-ipaserver or python2-ipaclient are
no longer available. PR-CI, lint, and tox aren't testing Python 2
compatibility either.

See: https://fedoraproject.org/wiki/Changes/FreeIPA_Python_2_Removal
Fixes: https://pagure.io/freeipa/issue/7568
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Tibor Dudlak <tdudlak@redhat.com>
2018-09-06 17:39:00 +02:00
Pavel Vomacka
e89163d491 Edit TravisCI conf files to run WebUI unit tests
Related: https://pagure.io/freeipa/issue/7278
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2017-12-14 18:57:37 +01:00
Christian Heimes
929c77c784 Travis: Add workaround for missing IPv6 support
Latest Travis CI image lacks IPv6 address on localhost. Add some
diagnostics and skip IPv6 tests in ipa-server-install when TRAVIS is
detected.

The hack will be removed as soon as it is no longer required to pass
automated testing.

https://pagure.io/freeipa/issue/7323

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Felipe Volpone <fbarreto@redhat.com>
2017-12-14 14:04:19 +01:00
Christian Heimes
c468e32012 Use Python 3 on Travis
Removes Travis workaround "group: deprecated-2017Q3"

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-11-23 18:31:30 +01:00
Christian Heimes
9e640190ee
Run tox tests for PyPI packages on Travis
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2017-11-20 17:01:59 +01:00
Christian Heimes
64a88d597c Py3: Fix vault tests
* Bump PKI to 10.5.1-2, which fixes an issue with KRA under Python 3
* Correct encoding of secret

https://pagure.io/freeipa/issue/7033

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2017-11-16 08:50:58 +01:00
Christian Heimes
a48f6511f6 Use namespace-aware meta importer for ipaplatform
Instead of symlinks and build-time configuration the ipaplatform module
is now able to auto-detect platforms on import time. The meta importer
uses the platform 'ID' from /etc/os-releases. It falls back to 'ID_LIKE'
on platforms like CentOS, which has ID=centos and ID_LIKE="rhel fedora".

The meta importer is able to handle namespace packages and the
ipaplatform package has been turned into a namespace package in order to
support external platform specifications.

https://fedorahosted.org/freeipa/ticket/6474

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2017-11-15 14:17:24 +01:00
Stanislav Laznicka
6c88eb8097 travis: pep8 changes to pycodestyle
Travis CI environment changes pep8 into pycodestyle, do the
transition on our side as well

Reviewed-By: Tibor Dudlak <tdudlak@redhat.com>
2017-10-25 09:59:28 +02:00
Stanislav Laznicka
0d7daf0495 Remove pkcs10 module contents
This removes pkcs10 module contents and adds a warning message
about its future removal.

https://pagure.io/freeipa/issue/7131
2017-10-25 09:46:41 +02:00
Felipe Barreto
be66eadb62
Fixing tox and pylint errors
Fixing import errors introduced by commits
icac3475a0454b730d6e5b2093c2e63d395acd387 and
0b7d9c5.

https://pagure.io/freeipa/issue/7132

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2017-10-23 18:11:30 +02:00
Stanislav Laznicka
209bb27712 travis: make tests fail if pep8 does not pass
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2017-10-10 10:05:37 +02:00
Stanislav Laznicka
537690ae44 travis: run the same tests in python2/3
We missed running some tests in python3

https://pagure.io/freeipa/issue/7131

Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2017-09-14 14:06:09 +02:00
Stanislav Laznicka
76c6ffe125 Change Travis CI container to FreeIPA-owned
https://pagure.io/freeipa/issue/6874

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2017-09-08 15:42:07 +02:00
Stanislav Laznicka
75e9f3ac6f travis: temporary workaround for Travis CI
Travis upgraded their environment but broke some deployments. Wait
for them to fix the issue with python3.
2017-09-08 09:30:40 +02:00
Martin Basti
902f736a2b py3: test_otptoken_import: fix bytes usage
https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-28 16:26:50 +02:00
Martin Basti
8416d5772d py3: Remove comparison >=2 of debnug log level
We have only one debug log level and it causes issues with py3.
...
  File "/usr/lib/python3.5/site-packages/ipaserver/rpcserver.py", line 490, in marshal
    response, version, pretty_print=self.api.env.debug >= 2
TypeError: unorderable types: str() >= int()

https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-28 16:26:50 +02:00
Stanislav Laznicka
db4d0998fd wsgi plugins: mod_wsgi expects bytes as an output
python3-mod_wsgi expects that the application() method returns
bytes otherwise it breaks.

https://pagure.io/freeipa/issue/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
2017-06-27 16:48:21 +02:00
Martin Basti
10d4fb7ea8 py3: test_location_plugin: fix iteration over changed dict
In py3 dict.items() doesn't return list so we must create a list to
avoid changing dictionary over iteration.

https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-23 14:45:05 +02:00
Martin Basti
8116a7b450 py3: test_kerberos_principal_aliases: fix code scope
In py3 the variable is valid only in the block where it is defined. We
must move test definition to global scope.

https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-23 14:45:05 +02:00
Martin Basti
c422206cc7 py3: dogtag.py: fix bytes warnings
/usr/lib/python3.5/site-packages/ipaserver/plugins/dogtag.py:1438: BytesWarning: str() on a bytes instance
   "parse_result:\\n%s" % (parse_func.__name__, xml_text, result))

https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-23 14:45:05 +02:00
Martin Basti
b35db9152c py3: travis: enable tests for plugins that are aleready working
These tests just works now

https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-23 14:45:05 +02:00
Martin Basti
172a2e7456 Travis: enable temporary Py3 testing
This testconfig is temporary until all plugins are migrated into py3.
After that this temporal config file will be removed and used only the
previous one again

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-20 12:36:29 +02:00
Martin Basti
5fdd0a3f60 Travis: build only py2 packages for py2 testing
We will testing both py2 and py3 packages, first step is use only py2
builds for testing py2 packages

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-20 12:36:29 +02:00
Martin Babinsky
afe85c3798
Travis CI: explicitly update pip before running the builds
This is to workaround around
https://github.com/travis-ci/travis-ci/issues/7733 and issues with
implicit requirement of python-requests on newer pip.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
2017-05-10 08:54:13 +02:00
Christian Heimes
08fc9d7a68 Run test_ipaclient test suite
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2017-03-14 17:14:26 +01:00
Martin Babinsky
91341f4035 Travis CI: Upload the logs from failed jobs to transfer.sh
When a non-lint job fails, all the relevant logs from the test runner
will be gzipped and uploaded to https://transfer.sh file sharing
service. The download link will then be displayed at the very end of the
Travis build log.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2017-02-09 13:26:07 +01:00
Martin Babinsky
0ef55a91ef Trim the test runner log to show only pytest failures/errors
If we get to the `run-tests` phase, we no longer care about messages
from previous steps so we can truncate the log output to only show
pytest failures/errors, reducing log size.

As a fallback, the previous behaviour to print last 5000 log lines was
kept in the case the CI tests fail during setup.

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
f48d6fc168 Travis CI: use specific Python version during build
This is a preparatory work for the future requirement of running
Python2/3 jobs simultaneously.

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
b6216756f6 introduce install step to .travis.yml and cache pip installs
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
b8423492f5 split out lint to a separate Travis job
In order to speed our Travis CI gating even further, the lint step has
been split to a separate job that can be run in parallel with the test
runs. The test runs are in turn launched in developer mode to speed them
up.

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
149d86de14 Travis: offload test execution to a separate script
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
aff4e684e1 Put the commands informing and displaying build logs on single line
This prevents Travis log collector to add separate expansion marks to
the echo output and the actuall log output.

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
758731088e travis: mark FreeIPA as python project
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
d86cae7748 Bump up ipa-docker-test-runner version
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
6d6fbc010e Use ipa-docker-test-runner to run tests in Travis CI
https://github.com/martbab/ipa-docker-test-runner is now used to run the
following tasks in Travis CI:

* pull in a FreeIPA test runner Docker image
* configure/make lint/make rpms
* install rpms
* install FreeIPA server and KRA
* run out-of-tree tests

For performance reasons (last two steps are very time-consuming) the available
tests were split roughly in half and are run as two separate jobs to speed up
the process.

AD trust is not installed as part of tests since the enabled compat plugin
causes false negative errors.

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2016-12-07 10:32:44 +01:00
Petr Spacek
14c1c8dfd0 Build: add Python lint target
https://fedorahosted.org/freeipa/ticket/6418

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2016-11-09 13:08:32 +01:00
Petr Spacek
fee9bbd85a Build: add make rpms target and convenience script makerpms.sh
make rpms and ./makerpms.sh will produce the same RPM packages. The
advantage of makerpms.sh is that it will take care of initial
autoreconf & configure phases as needed.

rpm-build-4.13.0-1.fc24.x86_64 broke parallel build of RPMs.
If you get error
  INTERNAL: Exiting with 1 jobserver tokens available; should be 8!
undefine the MAKEFLAGS variable and do not specify neither -j nor -l.

https://fedorahosted.org/freeipa/ticket/6418

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2016-11-09 13:08:32 +01:00
Jan Cholasta
1077743d90 spec file: do not include BuildRequires for lint by default
Lint is never executed from rpmbuild, so the BuildRequires for lint are
purely informational.

Include them only if %with_lint RPM macro is specified.

Update .travis.yml accordingly.

https://fedorahosted.org/freeipa/ticket/6418

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-24 14:11:08 +02:00
Martin Babinsky
37f3ad8867 Use Travis-CI for basic sanity checks
This patch adds the config file for Travis CI. The config file instructs the
CI to:
* check pep8 errors in PR
* build RPMs in pulled in Fedora builder container
    (docker.io/martbab/freeipa-fedora-builder)

These basic checks should eliminate basic errors that can break the build
itself (formatting errors, Syntax errors/undeclared variables, missing
BuildRequires, broken API.txt, etc.). It does not run any of our
integration/unit tests.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-06 17:43:38 +02:00