Commit Graph

902 Commits

Author SHA1 Message Date
Fraser Tweedale
9522970bfa dn: support conversion from python-cryptography Name
The upcoming change to using python-cryptography for certificate
process will require a way to convert
``cryptography.x509.name.Name`` values to ``ipapython.dn.DN``.
Update the ``DN`` constructor to accept a ``Name``.

Part of: https://fedorahosted.org/freeipa/ticket/6398

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-11-10 10:21:47 +01:00
Martin Babinsky
3ecda74d14 test_ipagetkeytab: use system-wide IPA CA cert location in tests
Since /etc/ipa/ca.crt should be always present on the test runner, we should
use it in bind method tests and not rely on its presence in user conf dir.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-11-09 16:39:39 +01:00
Petr Spacek
dc5699a8a4 Build: do not compress manual pages at install time
At the time of this writting
https://fedoraproject.org/wiki/Packaging:Guidelines#Manpages
says this:
  When installing man pages, note that they should be installed uncompressed
  as the build system will compress them as needed. The compression method
  may change, so it is important to reference the pages in the %files section
  with a pattern that takes this into account:
  %{_mandir}/man1/foo.1*

Removing the compression also allows to remove several install-data-hook
targets from Makefile.am files.

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
441acf7797 Build: fix distribution of static files for web UI
Static files from Git which are not touched by the build system
have to be explicitly listed in Makefile.am so they get into tarball.

EXTRA_DIST lists whole sub-directories with static files.
This is not ideal but we do not have enough time to fix it properly.

Dojo builder patch files were renames to shorten their name.
The original names were exceeding autotools length limit.

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
2f6712893b Build: fix man page distribution
By default automake does not distribute man pages. This marks then with
dist_ prefix to force their distribution in tarball.

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
8de11b091f Build: Makefiles for Python packages
This version builds only one version of Python packages. If you want to
build for Python 2 & 3 call configure twice using different --with-python
or specify PYTHON variable when calling make.

dist-hook is using SOURCES.txt file from egg-info.
According to Petr Viktorin this should be enough for our purposes
and avoids need to create plugins for setuptools.

Currently VPATH builds do not work for various reasons.
This should be fixed later on.

Most credit goes to these guys:
 Christian Heimes <cheimes@redhat.com>
 Petr Viktorin <pviktori@redhat.com>
 Kevin Brown <kevin@kevin-brown.com>

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
Martin Babinsky
2725e440bf Extend keytab retrieval test suite to cover new options
All new retrieval methods are covered including testing for excluded option
combinations.

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

Reviewed-By: Simo Sorce <ssorce@redhat.com>
2016-11-08 17:02:44 +01:00
Martin Babinsky
8480d0e333 Modernize ipa-getkeytab test suite
The test suite is now leveraging host/service tracker objects as test case
fixture, removing much of ad-hoc setup/teardown.

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

Reviewed-By: Simo Sorce <ssorce@redhat.com>
2016-11-08 17:02:44 +01:00
Lenka Doudova
e3b7d235d5 Tests: Fix integration sudo test
Tests with sudorules using only RunAsGroups attributes with empty RunAsUsers
attribute fail due to different expected value than is really returned. This is
caused by improper behaviour of sudo in versions before 1.8.18 (see [1]), to
which the tests were originally fitted. Changing the expected value to proper
one.

[1] - https://www.sudo.ws/pipermail/sudo-workers/2016-November/001025.html

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

Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
2016-11-07 12:39:06 +01:00
Tomas Krizek
5b81dbfda1 ipaldap: merge IPAdmin to LDAPClient
* move IPAdmin methods to LDAPClient
* add extra arguments (cacert, sasl_nocanon) to LDAPClient.__init__()
* add host, port, _protocol to LDAPClient (parsed from ldap_uri)
* create get_ldap_uri() method to create ldap_uri from former
    IPAdmin.__init__() arguments
* replace IPAdmin with LDAPClient + get_ldap_uri()
* remove ununsed function argument hostname from
    enable_replication_version_checking()

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-11-07 11:34:03 +01:00
Tomas Krizek
de58a5c605 ipaldap: merge simple_bind into LDAPClient
* Use LDAPClient.simple_bind instead of extra call to IPAdmin.do_simple_bind
* Rename binddn to bind_dn
* Rename bindpw to bind_password
* Explicitly specify bind_dn in all calls

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-11-07 11:34:03 +01:00
Lenka Doudova
42d1a06bd1 Tests: Verify that cert commands show CA without --all
Verify that command cert-find, cert-show and cert-request show CA even without
--all.

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

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2016-10-26 16:53:27 +02:00
Martin Basti
9408085c58 CI: Disable KRA install tests on DL0
When master is without KRA installed, on domain level0 we cannot install
KRA replicas, thus this tests must be skipped on DL0

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

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-10-26 15:06:36 +02:00
Martin Basti
11d7b774c4 CI: use --setup-kra with replica installation
Currently tests were not testing one-step installation of KRA together
with replica. Adding --setup-kra to replica installation instead of
calling ipa-kra-install after.

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

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-10-26 15:06:36 +02:00
Martin Basti
84ca1fc220 CI: extend replication layouts tests with KRA
KRA should be tested with warious replication topologies as well, mainly
in domain level 0

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

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-10-26 15:06:36 +02:00
Christian Heimes
91920e7cb4 Add __name__ == __main__ guards to setup.pys
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-10-25 18:11:31 +02:00
Ganna Kaihorodova
9b0b970733 Unaccessible variable self.attrs in Tracker
In tracker, 'self.attrs' variable is created and filled in track_create method.
Some objects are not created but still require access to this variable.
Created 'self.attrs' variable in init

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

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-10-25 14:09:14 +02:00
Jan Cholasta
0d370a959b pylint: enable the import-error check
Check for import errors with pylint to make sure new python package
dependencies are not overlooked.

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
Petr Spacek
0d37619db4 Build: move translations from install/po/ to top-level po/
Translations are need for client as well. This move is done to remove
dependency between client and install subdirectories.

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

Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2016-10-24 13:30:12 +02:00
Petr Spacek
5e028b59bc Build: merge ipatests/man/configure.ac to top-level configure.ac
At the same time, I removed unnecessary checks for mkdir etc. and added
missing check for gzip.

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

Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2016-10-24 13:30:12 +02:00
Christian Heimes
4cd83fb51c Port all setup.py to setuptools
All setup.py files are now using setuptools through a common file
ipasetup.py. The file is auto-generated and contain all common
settings.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-20 18:43:37 +02:00
Oleg Fayans
5710ecddca Reverted the essertion for replica uninstall returncode
As the issue with ipa installer always returning 0 returncode was addressed,
the test needs to be made aware of this change.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-10-18 17:30:37 +02:00
Martin Basti
91b51e702f CI: workaround: wait for dogtag before replica-prepare
In domain level 0 ipa-replica-prepare fails because dogtag is not ready
so soon after final restart during installation (tests are too fast).
Wait 30 seconds before ipa-replica-prepare is executed, to make sure
that dogtag is ready. Remove this workaround when ticket is fixed.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-10-13 17:40:11 +02:00
Oleg Fayans
8b0faa25d1 Test: disabled wrong client domain tests for domlevel 0
These tests are only relevant for domain level 1

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-12 10:53:41 +02:00
Lenka Doudova
8f04d1a793 Tests: Certificate revocation
Providing tests for certificate revocation to replace deleted tests from
test_cert_find.

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

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-10-12 10:45:16 +02:00
Lenka Doudova
c9c92e3a7f Tests: Remove invalid certplugin tests
A bunch of certplugin tests were testing number of revoked certificates with
various revocation reasons. Since existence of revoked certificates often
depends on other parts of IdM than IPA, it is not really valid to check their
presence unless creation of revoked certificate is intentionally tested.

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

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-10-12 10:45:16 +02:00
Martin Babinsky
29829cc55a remove trailing newlines form python modules
pylint-1.6.4-1.fc26.noarch reports these, hence they should be fixed in order
to build FreeIPA with this version

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-12 10:38:52 +02:00
Petr Spacek
8683cbf124 Tests: print what was expected from callables in xmlrpc_tests
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-11 16:52:37 +02:00
Martin Basti
49b29591aa Pylint: remove unused variables in tests
Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-10-11 16:50:32 +02:00
Petr Spacek
f363dfbeed DNS: Support URI resource record type
https://fedorahosted.org/freeipa/ticket/6344

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-11 16:48:47 +02:00
Lenka Doudova
74e52e8686 Tests: Remove silent deleting and creating entries by tracker
https://fedorahosted.org/freeipa/ticket/6123

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-10-06 19:16:37 +02:00
Milan Kubík
10b4b155b6 ipatests: Implement tests with CSRs requesting SAN
The patch implements several test cases testing the enforcement
of CA ACLs on certificate requests with subject alternative names.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-10-04 18:03:03 +02:00
Milan Kubík
7eb78aa8db ipatests: Fix name property on a service tracker
https://fedorahosted.org/freeipa/ticket/6366

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-10-04 18:03:03 +02:00
Milan Kubík
4f8e212c42 ipatests: provide context manager for keytab usage in RPC tests
https://fedorahosted.org/freeipa/ticket/6366

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-10-04 18:03:03 +02:00
Stanislav Laznicka
d70d71846d Fix test_util.test_assert_deepequal test
The test would be failing because recent pretty-print changes
that caused the inner members of a dictionary to be printed
in a different order.

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

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-10-04 14:11:00 +02:00
Martin Basti
95aa9369cb Fix: find OSCP certificate test
Test should check if any OSCP certificate has been returned

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

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2016-09-30 13:13:57 +02:00
Stanislav Laznicka
ecd6cb4e45 Pretty-print structures in assert_deepequal
By default, ipa-run-tests will now pretty-print structures
compared in the assert_deepequal function. This behaviour
can be turned off by the --no-pretty-print option.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-09-30 09:55:58 +02:00
Martin Basti
45e3aee352 Pylint: enable check for unused-variables
Unused variables may:
* make code less readable
* create dead code
* potentialy hide issues/errors

Enabled check should prevent to leave unused variable in code

Check is locally disabled for modules that fix is not clear or easy or have too many occurences of
unused variables

Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2016-09-27 13:35:58 +02:00
Martin Basti
9d83be3647 Remove unused variables in tests
This commit removes or marks unused variables as "expected to be unused"
by using '_' prefix.

Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2016-09-27 13:35:58 +02:00
Martin Basti
452b08754d test_text: add test ipa.pot file for tests
Input data should be packaged into freeipa-test module to be able run
test from RPM (outoftree)

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

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-09-26 18:48:07 +02:00
Martin Basti
9b68d2a1f8 Pylint: enable global-variable-not-assigned check
the global keyword should be used only when variable from outside is
assigned inside, otherwise it has no effect and just confuses developers

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2016-09-23 09:23:41 +02:00
Jan Barta
f252f50987 pylint: fix bad-classmethod-argument
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Jan Barta
cdecbcd0a1 pylint: fix pointless-statement
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Jan Barta
275e85d076 pylint: fix unneeded-not
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Jan Barta
36484e8672 pylint: fix simplifiable-if-statement warnings
fix inefficient if statements, enable pylint check

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Martin Basti
929086e099 Test: dont use global variable for iteration in test_cert_plugin
Iteration over global variable causes unwanted value changes outside
method

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-09-22 15:22:56 +02:00
Oleg Fayans
47c808afa3 tests: Fixed code styling in caless tests to make pep8 happy
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
9870c5804a tests: Reverted erroneous asserts in 4 tests
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
7412f0cb20 tests: fixed certinstall method
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
f1f94a7b9f tests: fixed super method invocation
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
8be0906b04 tests: added verbose assert to test_service_disable_doesnt_revoke
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
106f37c26f tests: Standardized replica_preparation in test_no_certs
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
b8968d923c tests: Implemented check for domainlevel before installation verification
We only need to verify installation of replica under domain level 1, otherwise
replica is not installed but only a gpg file is prepared

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
43994e6697 tests: Fixed Usage of improper certs in ca-less tests
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
804aae8196 tests: fixed expects of incorrect error messages
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
b8cf212e8b tests: Replaced unused setUp method with install
setUp method does not get executed in recent versions of pytest
Replaced with the install method derived from the parent IntegrationTest class

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
dbf0d141c5 tests: Replaced hardcoded certutil with imported from paths
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
bb4205b582 tests: Enabled negative testing for cleaning replication agreements
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
9217bcc871 tests: Made unapply_fixes call optional at master uninstallation
Unapply fixes removes the temporary testing folder at ~/ipatests, which
contains some artifacts like root.pem that need to be persistent between tests
in the test_caless testsuite. There has to be the way to skip the deletion of
this testfolder

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
e0b67dfa7e tests: Updated master and replica installation methods to enable negative testing
Negative testing was enabled by introducing an optional raiseonerr parameter
with True by default to both master and replica installation methods
Also the methods were updated to support intractive installation

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
24f218f4eb tests: Added necessary xfails
A number of tests fail due to known issues. Added xfails to acknowledge them

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
d17d13d77a tests: Added necessary getkeytabs calls to fixtures
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
759bbcdfcb tests: Removed outdated command options test
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
a81d847204 tests: Applied correct teardown methods
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
84db13f676 tests: Fixed incorrect assert in verify_installation
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
fad6ec8256 tests: Adapted installation methods to utilize methods from tasks
Master and replica installation methods were made to utilize corresponding
methods from tasks.py for the sake of DRY

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
725d8d0cac tests: Removed call for install method from parent class
The IntegrationTest.install method installs the full topology while in ca-less
tests we need to check server installation, thus the nodes should not have
server or replica installed

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
48ca465a12 tests: Added teardown methods for server and replica installation
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
c0e16aa3b9 tests: Create a method that cleans all ipa certs
Upon uninstallation IPA does not remove certs from the system, see
https://fedorahosted.org/freeipa/ticket/4639 for details. This causes
installation failures in several tests. The workaround is to manually remove
certs from all certificate databases used by IPA after each server
uninstallation

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
38ad864342 tests: Updated ipa server installation stdin text
The installator has changed the question sequence so the stdin used for
interactive server installation has to be changed accordingly

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
0c635686dd tests: Added generation of missing certs
test_ca_server_cert and test_unknown_ca required 2 more certs that were not
pre-generated

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
2f6ffa326a tests: Added basic constraints extension to the CA certs
The IPA installer refuses to accept certs signed with a CA-signature that does
not have basic constraints enabled (Described in RFC 5280)

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
bbac233b5e tests: Fixed method failures during second call for the method
When the same host is used for numerous server/replica
installations/uninstallations at some point the /etc/openldap/ldap.conf file
gets corruped which results in ldapsearch unaware of the default ldap_uri to
connect. The workaround would be to provide ldap hostname for each ldapsearch.

Attention: please unapply this fix once the original issue is resolved.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Stanislav Laznicka
330a3ca931 Remove update_from_dict() method
update_from_dict() method is not used anywhere in the project,
it only makes the tests fail. Removed it and its tests.

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

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2016-09-22 13:02:57 +02:00
Lenka Doudova
a7c49e455e Tests: Remove usage of krb5 ccache from test_ipaserver/test_ldap
In test_ipaserver/test_ldap::test_ldap::test_GSSAPI a krb5 ccache is used to
connect to ldap. The test tries to locate this cache in /tmp/krb5cc_$UID file,
which is not there due to default settings in krb5.conf, and hence the whole
test is skipped. Fix the test to use keyring to connect instead of ccache in
/tmp.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-21 18:48:22 +02:00
Lenka Doudova
8a947e2fd0 Tests: Fix host attributes in ipa-join host test
Fixing discrepancies between returned and checked attributes in ipa-join host
test, that arose after recent changes in behavior.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-21 18:46:37 +02:00
Lenka Doudova
c0fcfb31ec Tests: Update host test with ipa-join
Updating path to ipa-join command to allow execution of
test_xmlrpc/test_host::TestHostFalsePwdChange::test_join_host.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-21 18:46:37 +02:00
Lenka Doudova
936a6a38b8 Tests: Add krb5kdc.service restart to integration trust tests
krb5kdc.service restart is necessary for proper running of integration trust
related tests.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-21 18:44:42 +02:00
Jan Cholasta
09a8f62d12 test_plugable: update the rest of test_init
In commit ed4c2d9252, changes to the Plugin
class were made, but the test was updated only partially.

Update the rest to fix the failing test.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-21 18:43:01 +02:00
Lenka Doudova
522766a565 Tests: Remove unnecessary attributes from base tracker
https://fedorahosted.org/freeipa/ticket/6128

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-21 18:41:04 +02:00
Lenka Doudova
a07c4bdd4f Tests: Remove --force options from tracker base class
Removing --force option from tracker base class so it would not be required to
be implemented in every specific tracker, even though it's not necessary.
Modifying existing trackers to reflect this change.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-21 18:39:56 +02:00
Lenka Doudova
361105a3d5 Tests: Remove SSSD restart from integration tests
SSSD restart has been mistakenly added to integration tests
(test_integration/tasks.py::uninstall_master). When system setup is correct,
this restart has no significance, moreover it makes tests fail, hence its
removal is necessary.

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

Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2016-09-21 14:41:09 +02:00
Oleg Fayans
3e4740f788 Xfailed a test that fails due to 6250
Also created a decorator that removes the segment that the next test does not
expect.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-15 10:21:56 +02:00
Oleg Fayans
49fbbb0641 Fixed segment naming in topology tests
As the segment name is a stochastic valu, which can have either of the two
nodes as the left node, we need to adapt the tests to not expect some
particular segment name but rather to calculate it dynamically based on node
names and the output of topologysegment-find ipa call

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-15 10:21:56 +02:00
Lenka Doudova
7cac839203 Tests: Fix integration sudo tests setup and checks
Adding 'defaults' sudorule to prevent requesting further user authentication.
Adding checks that if a user should be rejected access, a proper error message
is displayed.

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

Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
2016-09-14 12:49:02 +02:00
Oleg Fayans
1e484d010b Xfailed the tests due to a known bug with replica preparation
https://fedorahosted.org/freeipa/ticket/6274

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-14 09:53:35 +02:00
Oleg Fayans
ac78d191de Changed addressing to the client hosts to be replicas
https://fedorahosted.org/freeipa/ticket/6287

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-14 09:51:51 +02:00
Oleg Fayans
39c15ecdcd Several fixes in replica_promotion tests
In test_one_command_installation the ipa-replica-install was missing '--server'
and '-U' options which resulted in false negative result. In
test_client_enrollment_by_unprivileged_user '--server' option was messing.
test_replica_promotion_after_adding_to_admin_group lacked '-U' option. It
leaded to 3 failed cases.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-14 09:48:15 +02:00
Oleg Fayans
22b0e8a9eb Removed incorrect check for returncode
The server installation in most cases returns response code 0 no matter what
happens except for really severe errors. In this case when we try to uninstall
the middle replica of a line topology, it fails, notifies us that we should use
'--ignore-topology-disconnect', but returns 0

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-14 09:46:22 +02:00
Lenka Doudova
8c6f677a16 Tests: Fix failing ldap.backend test
Test ipatests/test_ipaserver/test_ldap::test_Backend fails claiming service
cannot be found. Fixing this by not using api with in_tree parameter.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-09-13 15:37:52 +02:00
Lenka Doudova
b824013386 Tests: Add cleanup to integration trust tests
Trust tests fail if they are executed after external trust tests. This is
caused my missing cleanup. Providing cleanup that would enable correct
execution of the tests regardless of their order.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-09-13 15:35:43 +02:00
Lenka Doudova
fc5a99274c Tests: Fix regex errors in integration trust tests
In integration trust tests some values are checked using regular expressions.
Some of these expressions from recently added coverage have minor mistakes
which causes the comparisons to fail. Providing fix for these regular
expressions.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-09-09 16:54:05 +02:00
Martin Basti
866e59bdce Tests: extend DNS cmdline tests with lowercased record type
https://fedorahosted.org/freeipa/ticket/6203

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-09-08 17:30:29 +02:00
Martin Basti
71ad8d4fc9 Allow broadcast ip addresses
Currently environments may use prefix /31 on point-to-point connections what
makes IPA validators to fail. IPA should not care if IP address is broadcast
or not. In some cases (when prefix is not specified) IPA cannot decide
properly if broadcast address is really broadcast.

This commit allows usage of broadcast addresses in:
* host plugin
* dns plugin
* server-installer
* client-installer

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-07 16:22:03 +02:00
Martin Basti
81d64d530c Allow network ip addresses
Currently cloud environments uses heavily prefix /32 (/128) what makes
IPA validators to fail. IPA should not care if IP address is network or not.
This commit allows usage of network addresses in:
* host plugin
* dns plugin
* server-installer
* client-installer

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-07 16:22:03 +02:00
Lenka Doudova
72d7193ce2 Tests: Avoid skipping tests due to missing files
When running test_install/test_updates and test_pkcs10/test_pkcs10 as
outoftree, these are skipped with reason 'Unable to find test update files'.
For outoftree tests wrong paths are checked for these files.
Changing file localization to provide proper test setup.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-01 14:00:49 +02:00
Lenka Doudova
60e88038c4 Tests: Add missing attributes to test_xmlrpc/test_trust tests
Several tests in test_xmlrpc/test_trust_plugin.py fail because some attributes
are not expected. Fixing the tests so that the extra attributes are recognized.

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

Reviewed-By: Ganna Kaihorodova <gkaihoro@redhat.com>
2016-08-31 15:05:41 +02:00
Lenka Doudova
36979ad0b6 Tests: Random issuer certificate can be added to a service
Changing negative test case that verified that a certificate with different
than expected issuer cannot be added to a service to a positive one that
verifies that this operation now proceeds successfully. Corresponds to changes
made in scope of https://fedorahosted.org/freeipa/ticket/4559 implementation.

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

Reviewed-By: Ganna Kaihorodova <gkaihoro@redhat.com>
2016-08-31 14:29:00 +02:00
Oleg Fayans
5812af84a4 Disabled raiseonerr in kinit call during topology level check
domainlevel method is called upon each master uninstallation. Sometimes the
master uninstallation is called from within teardown method of some tests when
the master was not in fact installed, in which case the kinit_admin would
always raise an error.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-08-30 13:11:46 +02:00
Petr Spacek
eabe248957 Tests: fix test_forward_zones in test_xmlrpc/test_dns_plugin
Class test_forward_zones in ipatests/test_xmlrpc/test_dns_plugin
was using DNS zone 'fwzone2.test.' and expected to get warning
'Forwarding policy conflicts with some automatic empty zones.'
(aka 'DNSForwardPolicyConflictWithEmptyZone').

This does not make sense because 'test.' zone is not listed in IANA registry
'Locally-Served DNS Zones':
http://www.iana.org/assignments/locally-served-dns-zones/locally-served-dns-zones.xhtml

To fix this I simply removed the warning from set of expected results.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2016-08-30 10:45:12 +02:00