Commit Graph

314 Commits

Author SHA1 Message Date
Oleg Fayans
f784532d4e Test for incorrect client domain
https://fedorahosted.org/freeipa/ticket/5976

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-07-01 17:59:27 +02:00
Lenka Doudova
1d9e1521c5 Tests: Remove DNS configuration from trust tests
Since DNS configuration is no longer needed for running trust tests, this method's contents are removed. Method is left empty as reference for others, should they have issues with DNS configuration.

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2016-06-30 13:14:27 +02:00
Martin Babinsky
081941a5b9 CI test suite for server-del
these tests cover various scenarios such as:
* trying to remove master that would disconnect topology in one of the
  suffixes
* forcing master removal regardless of topology state before/after removal
* trying to remove last CA/DNS server/DNSSec key master
* forcing removal of the last DNSSec key master

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-17 18:55:19 +02:00
Petr Spacek
ec49130b94 Use root_logger for verify_host_resolvable()
After discussion with Martin Basti we decided to standardize on root_logger
with hope that one day we will use root_logger.getLogger('module')
to make logging prettier and tunable per module.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-30 20:14:32 +02:00
Oleg Fayans
84e5065b39 Added necessary A record for the replica to root zone
A master can only be delegated a zone authority, if this zone contains A
records of the master and ALL replicas

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-11 13:19:13 +02:00
Oleg Fayans
5567dff4b4 A workaround for ticket N 5348
A freshly created dnssec-enabled zone does not always display the signature
until you restart named-pkcs11. Added restarting of this service after each
dnssec-enabled zone.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-11 13:16:43 +02:00
Oleg Fayans
1c79c1ea2d Bugfixes in managed topology tests
Fixed a false negative related to replication taking some time: added
wait_for_replication call before checking for new object in replicas.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-20 17:59:11 +02:00
Oleg Fayans
1974f20aec Improve reporting of failed tests in topology test suite
https://fedorahosted.org/freeipa/ticket/5772

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-20 17:59:11 +02:00
Oleg Fayans
c061172792 Add test if replica is working after domain upgrade
Corresponds to the testcase described in
http://www.freeipa.org/page/V4/Replica_Promotion/Test_plan#Test_case:
_Replica_created_using_old_workflow_is_functional_after_domain_upgrade

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-15 15:44:09 +02:00
Oleg Fayans
280f1ed85f Fixed a failure in legacy_client tests
https://fedorahosted.org/freeipa/ticket/5800

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-13 16:05:12 +02:00
Oleg Fayans
ab3b4a92a8 Added 5 more tests to Replica Promotion testsuite
The following testcases were automated:
1. Test one command replica installation
2. Test csreplica-manage-(del, connect, disconnect) are disabled in domain
level 1
3. Client enrollment and replica promotion by an unprivileged user are
prohibited
4. Replica uninstallation is prohibited if it disconnects a part of existing
topology (is possible only with --ignore-topology-disconnect option)
https://fedorahosted.org/freeipa/ticket/5723

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-06 16:02:55 +02:00
Oleg Fayans
f836ee7b9c Added a kdestroy call to clean ccache at master/client uninstallation
https://fedorahosted.org/freeipa/ticket/5741

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2016-04-06 15:59:22 +02:00
Oleg Fayans
2fa0952603 Fixed a bug with prepare_host failing upon existing ipatests folder
https://fedorahosted.org/freeipa/ticket/5748

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-03-23 17:19:21 +01:00
Oleg Fayans
d58cd04e8a rewrite a misprocessed teardown_method method as a custom decorator
teardown_method is a standard pytest method used to put any code to be executed
after each test method is executed. While treated correctly by our integration
tests, this method is misinterpreted by in-tree tests in the following way:
in-tree tests try to execute it even if all the test methods are skipped due to
test resources being not configured. This causes the tests, that otherwise would
have been skipped, to fail

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-03-23 12:46:23 +01:00
Oleg Fayans
c204290038 Added copyright info to replica promotion tests
https://fedorahosted.org/freeipa/ticket/5723

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-03-22 13:48:45 +01:00
Christian Heimes
49be6c8d3c Move user/group constants for PKI and DS into ipaplatform
https://fedorahosted.org/freeipa/ticket/5619

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2016-03-22 10:40:44 +01:00
Martin Basti
fb3a5d5a9c Use platform path constant for SSSD log dir
The path to SSSD log directory is platform specific and should be in
ipaplatform module.

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-03-16 09:31:02 +01:00
Oleg Fayans
578cff9567 Workaround for ticket 5627
https://fedorahosted.org/freeipa/ticket/5723

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-03-11 17:27:45 +01:00
Oleg Fayans
b5807fd9b6 Made apply_common_fixes call at replica installation independent on domain_level
Besides added obligatory domain/realm-specific commandline options
 to replica installation

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-03-11 17:27:45 +01:00
Oleg Fayans
ddadbf8274 Enabled setting domain level explicitly in test class
Needed for replica promotion tests

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-03-11 17:27:45 +01:00
Oleg Fayans
0b1fe08f1d Integration tests for replica promotion feature
http://www.freeipa.org/page/V4/Replica_Promotion/Test_plan

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-03-11 17:27:45 +01:00
Martin Basti
a63ce1fe22 CI: allow customized DS install test to work with domain levels
Test will use tasks methods instead of custom commands to be able work
with domain levels.

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

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-03-03 17:26:56 +01:00
Oleg Fayans
cfbb7769a7 Removed messing around with resolv.conf
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-03-02 16:41:28 +01:00
Petr Vobornik
02d3ea1062 advise: configure TLS in redhat_nss_pam_ldapd and redhat_nss_ldap plugins
authconfig in config_redhat_nss_ldap and config_redhat_nss_pam_ldapd got
new option --enableldaptls

It should have effect primarily on el5 systems.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2016-03-01 13:05:20 +01:00
Martin Babinsky
94a836dd46 CI tests: use old schema when testing hostmask-based sudo rules
Newer versions of sssd use native IPA schema to process sudo rules.
However, this schema currently has no support for hostmask-based rules
and causes some sudo CI tests to fail. We have to temporarily set
sssd.conf to use ou=sudoers,$SUFFIX as a sudo rule search base when
executing them.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2016-02-25 13:37:16 +01:00
Martin Basti
a14d687493 Revert "test: Temporarily increase timeout in vault test."
This reverts commit 8112ac69cc.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-02-24 17:27:14 +01:00
Jan Cholasta
11592dde1b client: stop using /etc/pki/nssdb
Don't put any IPA certificates to /etc/pki/nssdb - IPA itself uses
/etc/ipa/nssdb and IPA CA certificates are provided to the system using
p11-kit. Remove leftovers on upgrade.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-02-24 10:53:28 +01:00
David Kupka
775ee77bcc CI: Make double circle topology python3 compatible
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-02-24 10:37:04 +01:00
David Kupka
a1e582b33c CI: Add test for double-circle topology generator.
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-02-23 17:32:36 +01:00
David Kupka
a1d2ce00a6 CI: Add replication test utilizing double-circle topology.
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-02-23 17:32:36 +01:00
David Kupka
cbd9c3943a CI: Add double circle topology.
Every site consist of at least two replicas and is connected to two other
sites.

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-02-23 17:32:36 +01:00
David Kupka
acdabba6ec CI: add empty topology test for 2-connected topology generator
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-02-23 17:30:16 +01:00
David Kupka
616c78b720 CI: Fix pep8 errors in 2-connected topology generator
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-02-23 17:30:16 +01:00
Petr Viktorin
200614872e tests: Use absolute imports
https://fedorahosted.org/freeipa/ticket/5638

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-02-17 10:41:29 +01:00
David Kupka
2541b5fcbf CI: Add test for 2-connected topology generator.
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-02-12 16:57:19 +01:00
David Kupka
c2bbd5dcd8 CI: Add simple replication test in 2-connected topology.
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-02-12 16:57:19 +01:00
David Kupka
8f6e9113e9 CI: Add '2-connected' topology generator.
If number of servers (master+replicas) is equal to 4 + SUM(1, n, 2^n*5) for
any n >= 0:
 * every server has replication agreement with 2 - 4 other servers.
 * at least two agreements must fail in order to disconnect the topology.
Otherwise there can be server(s) with single agreement on the edge of the
topology.

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-02-12 16:57:19 +01:00
Oleg Fayans
42d3644276 Removed --ip-address option from replica installation
Explicitly specifying ip-address of the replica messes up with the current
bind-dyndb-ldap logic, causing reverse zone not to be created.

Enabled reverse-zone creation for the clients residing in different subnet from
master

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-02-04 15:53:30 +01:00
Oleg Fayans
aa30199e0b Updated connect/disconnect replica to work with both domainlevels
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-02-01 16:05:38 +01:00
Oleg Fayans
b23fea7660 Enabled recreation of test directory in apply_common_fixes function
Without it any test comprized of more than one cycle of installing-uninstalling
of ipa would fail due to the fact that test folder on the remote machine gets
deleted during ipa uninstallation.

Also removed duplicate call of apply_common fixes and added unapply_fixes to
uninstall_replica

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-29 14:15:29 +01:00
Martin Basti
c5076452d6 DNSSEC CI: fix zone delegations
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-01-29 11:52:09 +01:00
Milan Kubík
8f6fb7b4ea ipatests: fix the install of external ca
Fixes the install invocation in the test to use domain and
realm correctly. Also makes the test aware of domain levels.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-27 13:14:51 +01:00
Martin Basti
cdf08a0a86 Fix DNSSEC test: add glue record
Missing glue record causes test failure in cases when DNS zone was not
managed by IPA DNS

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-01-25 13:27:38 +01:00
Petr Viktorin
126d899321 Use explicit truncating division
In Python 3, the truncating division operator, //, is needed to
get C-style "int division".

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-20 11:59:21 +01:00
Oleg Fayans
7a742391c1 fixed an issue with master installation not creating reverse zone
When resolv.conf is set to point to the master's ip before installation, the
ipa-server-install does not create a reverse zone for it's ip even despite
--auto-reverse option provided. The fix is not to mess around with resolv.conf
before master installation.

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-01-19 17:47:23 +01:00
Martin Basti
26899c91af CI test: fix regression in task.install_kra
ipa-kra-install needs directory manager password

Regression caused by c4b9b295d8

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-14 13:19:57 +01:00
Milan Kubík
c0133778ae ipatests: Make the A record for hosts in topology conditional
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-13 10:07:46 +01:00
Martin Basti
c611174987 DNSSEC test: fix adding zones with --skip-overlap-check
In DNSSEC tests the root zone has to be created, this requires to use
--skip-overlap-check to work properly.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-12 10:45:00 +01:00
Oleg Fayans
3b39d8b6de Fixed install_ca and install_kra under domain level 0
Also added ipa_backup, ipa_restore and replica_uninstall functions

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 18:27:57 +01:00
Martin Basti
e4075b1fe2 Remove unused imports
This patch removes unused imports, alse pylint has been configured to
check unused imports.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Oleg Fayans
b12ba14e3d CI tests: Added domain realm as a parameter to master installation in integration tests
Without realm provided explicitly, installation calculates it automatically
from the current hostname which may be inconsistent with the configured domain
name. Which, in turn, causes failures in integration tests in the lab.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-21 15:10:56 +01:00
Oleg Fayans
36e85b10db CI tests: Enabled automatic creation of reverse zone during master installation
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-21 15:01:21 +01:00
Martin Babinsky
c4b9b295d8 CI tests: remove '-p' option from ipa-dns-install calls
fix for https://fedorahosted.org/freeipa/ticket/4933 made ipa-dns-install to
use LDAPI and deprecated -p option for directory manager password. This patche
remove the option from calls to ipa-dns-install in CI tests so that
deprecation warning does not clutter the logs.

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2015-12-14 15:41:28 +01:00
David Kupka
8112ac69cc test: Temporarily increase timeout in vault test.
Remove this change when vault is fixed.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-14 11:52:20 +01:00
Gabe
5c9b9089b7 Migrate wget references and usage to curl
https://fedorahosted.org/freeipa/ticket/5458

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-11 18:46:10 +01:00
Martin Basti
1e0f1f5197 CI: fix ipa-kra-install on domain level 1
Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2015-12-11 15:11:20 +01:00
Tomas Babej
a02f83ff9c tests: Add hostmask detection for sudo rules validating on hostmask
IPA sudo tests worked under the assumption that the clients
that are executing the sudo commands have their IPs assigned
within 255.255.255.0 hostmask.

Removes this (invalid) assumption and adds a
dynamic detection of the hostmask of the IPA client.

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

Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-By: Oleg Fayans <ofayans@redhat.com>
Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2015-12-11 14:25:50 +01:00
Martin Babinsky
7c4ce9a098 fix error message assertion in negative forced client reenrollment tests
https://fedorahosted.org/freeipa/ticket/5511

Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
2015-12-11 13:11:54 +01:00
Martin Babinsky
35fae355cc CI tests: ignore disconnected domain level 1 topology on IPA master teardown
Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2015-12-09 09:39:20 +01:00
Martin Basti
e4259d5b49 CI: fix function that prepare the hosts file before CI run
Without this fix function removed 2 lines from hosts file.

Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2015-12-08 10:25:50 +01:00
Martin Basti
a11cddd75b CI: installation tests
Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2015-12-08 10:07:00 +01:00
Martin Basti
bee222372a CI: test various topologies with multiple replicas
Test tests topologies listed bellow with and without CA on replicas:
star topology: 3 replicas
line topology: 3 replicas
complete topology: 3 replicas

Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2015-12-07 16:44:36 +01:00
Tomas Babej
5cb003f0b4 tests: Fix incorrect uninstall method invocation
https://fedorahosted.org/freeipa/ticket/5516

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-07 10:58:57 +01:00
Petr Vobornik
517aa84569 rename topology suffixes to "domain" and "ca"
https://www.redhat.com/archives/freeipa-devel/2015-November/msg00485.html

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-04 12:59:21 +01:00
Martin Basti
e56a1535b0 CI test: Fix installation of KRA on a replica
With domain level 1 installation of KRA has been changed on replica.

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

Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2015-11-18 12:58:09 +01:00
Martin Basti
79f7c71e61 Fix CI tests domain_level env config
Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2015-11-18 12:57:09 +01:00
Oleg Fayans
511ace9a4f Fixed A record creation bug
When creating an A record we used to provide full hostname as a record name,
while we should have provided only the first part of the hostname

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-03 16:14:49 +01:00
Oleg Fayans
f9bbfade29 The test was made to be skipped if domainlevel is 0
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-03 16:11:57 +01:00
Oleg Fayans
f8778f6e4f Updated the tests according to the new replica installation workflow
As of 4.3 the replica installation is performed without preparing a gpg file on
master, but rather enrolling a future replica as a client with subsequent
promotion of the client. This required the corresponding change in the
integration tests

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-03 16:11:57 +01:00
Martin Basti
f2032ca2ca DNSSEC CI: wait until DS records is replicated
In some cases replication may take much more time than we expected. This
patch adds explicit cech if DS records has been replicated.

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-10-22 18:24:53 +02:00
Martin Basti
f4c8c93e70 Rename option --dirsrv-config-mods to --dirsrv-config-file
Option is renamed to be consistent with other options.

Affected tickets:
    https://fedorahosted.org/freeipa/ticket/4949
    https://fedorahosted.org/freeipa/ticket/4048
    https://fedorahosted.org/freeipa/ticket/1930

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-10-19 14:18:23 +02:00
Martin Basti
5233165ce7 CI: installation with customized DS config
Test covers:

https://fedorahosted.org/freeipa/ticket/4949
https://fedorahosted.org/freeipa/ticket/4048
https://fedorahosted.org/freeipa/ticket/1930

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-10-15 18:37:52 +02:00
Martin Basti
5f3784520b CI Test: add setup_kra options into install scripts
https://fedorahosted.org/freeipa/ticket/5302

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2015-10-12 17:50:22 +02:00
Martin Basti
573d3323af CI TEST: Vault
Simple CI test for vault feature, including testing with replica

Covers https://fedorahosted.org/freeipa/ticket/5302

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2015-10-12 15:15:23 +02:00
Oleg Fayans
2b4354f37e Fixed a timing issue with drill returning non-zero exitcode
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-09 14:07:45 +02:00
Petr Viktorin
65e3b9edc6 Use six.Stringio instead of StringIO.StringIO
The StringIO class was moved to the io module.
(In Python 2, io.StringIO is available, but is Unicode-only.)

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-07 10:27:20 +02:00
Milan Kubík
c22c60b87c ipatests: configure Network Manager not to manage resolv.conf
For the duration of the test, makes resolv.conf unmanaged.
If NetworkManager is not running, nothing is changed.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-02 14:01:50 +02:00
Martin Babinsky
7ab52384be re-kinit after ipa-restore in backup/restore CI tests
In FreeIPA CI-tests the install_master task automatically performs kinit after
successfull installation. This may break some backup/restore tests which
perform backup into previously installed IPA master. In this case it is
neccessary to re-kinit after restore.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-02 12:42:20 +02:00
Oleg Fayans
03d696f224 Added a proper workaround for dnssec test failures in Beaker environment
In beaker lab the situation when master and replica have ip addresses from
different subnets is quite frequent. When a replica has ip from different
subnet than master's, ipa-replica-prepare looks up a proper reverse zone to
add a pointer record, and if it does not find it, it asks a user for permission
to create it automatically. It breaks the tests adding the unexpected input.
The workaround is to always create a reverse zone for a new replica.

Corresponding ticket is https://fedorahosted.org/freeipa/ticket/5306

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-01 14:46:43 +02:00
Martin Basti
28c25241fe CI: backup and restore with KRA
Reviewed-By: Milan Kubík <mkubik@redhat.com>
2015-09-25 13:22:19 +02:00
Martin Basti
8772fb4c3d backup CI: test DNS/DNSSEC after backup and restore
Reviewed-By: Milan Kubík <mkubik@redhat.com>
2015-09-16 18:20:18 +02:00
Martin Basti
3c33b48655 DNSSEC CI: test master migration
Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2015-09-16 18:03:34 +02:00
Martin Basti
f2b309ff4f DNSSEC: improve CI test
Test disabling and re-enabling zone signing.

Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2015-09-16 18:03:34 +02:00
Petr Viktorin
8de13bd7dd Use the print function
In Python 3, `print` is no longer a statement. Call it as a function
everywhere, and include the future import to remove the statement
in Python 2 code as well.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
ace63f4ea5 Replace uses of map()
In Python 2, map() returns a list; in Python 3 it returns an iterator.

Replace all uses by list comprehensions, generators, or for loops,
as required.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
5a9141dc40 Replace filter() calls with list comprehensions
In Python 3, filter() returns an iterator.
Use list comprehensions instead.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
dd16cc98b0 Use six.string_types instead of "basestring"
Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Oleg Fayans
c7408f67f6 Integration tests for topology plugin
Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-28 16:12:25 +02:00
Oleg Fayans
b202afbcc0 Temporary fix for ticket 5240
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-24 16:32:23 +02:00
Oleg Fayans
b93137c196 Added a user-friendly output to an import error
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-24 16:31:28 +02:00
Martin Babinsky
1bd099a114 do not install CA on replica during integration test if setup_ca=False
The patch fixes bug in the construction of ipa-replica-install arguments in
test_integration/tasks.install_replica. Due to this bug the replica
installation during certain integration tests involved CA setup even when
setup_ca was set to False.

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2015-04-15 13:09:59 +02:00
Martin Babinsky
c8fae594df proper client host setup/teardown in forced client reenrollment integration test suite
Replace setUp()/tearDown() methods with a pytest.fixture for proper client
setup/teardown during test_forced_client_reenrollment

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2015-04-14 19:38:04 +02:00
Martin Basti
0a1a3d7312 DNSSEC CI tests
Tests:
* install master, replica, then instal DNSSEC on master
  * test if zone is signed (added on master)
  * test if zone is signed (added on replica)

* install master with DNSSEC, then install replica
  * test if root zone is signed
  * add zone, verify signatures using our root zone

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

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2015-04-14 19:29:36 +02:00
Gabe
ae4ee6b533 ipatests: Add tests for valid and invalid ipa-advise
- Add test for invalid run of the ipa-advise command
- Add tests for valid runs of the ipa-advise command

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-02-26 20:57:49 +01:00
Petr Viktorin
61c4ecccc1 Run pylint on tests
Drop support for pylint < 1.0

Enable ignoring unknown attributes on modules (both nose and pytest
use advanced techniques, support for which only made it to pylint
recently)

Fix some bugs revealed by pylint

Do minor refactoring or add pylint:disable directives where the
linter complains.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-01-14 11:40:28 +01:00
Petr Viktorin
bc5b13c3da ipatests: Use pytest-sourceorder
The plugin to run tests within a class in the order they're defined
in the source was split into a separate project.
Use this project instead of a FreeIPA-specific copy.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-12-17 15:37:56 +01:00
Tomas Babej
3507bcd3df ipatests: Invoke class install methods properly with respect to pytest-multihost
Multihost object was is not passed to the install method in the super construction.
This fixes setup errors in AD Trust, Forced client reenrollment, CALess and Sudo
tests.

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

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-12-16 12:20:44 +01:00
Petr Viktorin
a97d61df04 test_integration: Parametrize test instead of using a generator
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-12-11 07:04:58 +01:00
Petr Viktorin
d9ab11a232 test_integration: Use collect_log from the host, not the testing class
The testing class no longer has this method.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-12-11 07:04:58 +01:00
Petr Viktorin
74f7d67fd5 test_integration: Use python-pytest-multihost
The core integration testing functionality was split into a separate
project. Use this project, and configure it for FreeIPA.

The "mh" (multihost) fixture is made available for integration tests.

Configuration based on environment variables is moved into a separate
module, to ease eventual deprecation.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-12-11 07:04:58 +01:00
Petr Viktorin
d42c26c542 test_integration: Adjust tests for pytest
- Customize install() instead of setup_class()
- Use pytest parametrization instead of test generators

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-21 12:14:44 +01:00
Petr Viktorin
29c28786e3 Integration tests: Port the BeakerLib plugin and log collection to pytest
Move the IPA-specific log collection out of the Beakerlib plugin.
Add the --logfile-dir option to tests and ipa-test-task, so that logs
can be collected even if BeakerLib is not used.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-21 12:14:44 +01:00
Petr Viktorin
0ad5c57f62 Switch integration testing config to a fixture
The hack of storing the config on the class is left in;
it would be too much work for too little gain at this time.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-21 12:14:44 +01:00
Petr Viktorin
3a9a98b285 Integration tests: Port the ordering plugin to pytest
Ordered integration tests may now be run with pytest.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-21 12:14:44 +01:00
Petr Viktorin
375e9f7c4b tests: Use PEP8-compliant setup/teardown method names
The setUp/dearDown names are used in the unittest module, but there is no reason
to use them in non-`unittest` test cases.
Nose supports both styles (but mixing them can cause trouble when
calling super()'s methods).
Pytest only supports the new ones.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-21 12:14:44 +01:00
Petr Viktorin
93422a54a3 Add additional backup & restore checks
https://fedorahosted.org/freeipa/ticket/3893

Reviewed-By: Martin Basti <mbasti@redhat.com>
2014-11-20 15:47:38 +01:00
Martin Basti
e7edac30a1 Fix CI tests: install_adtrust
IPA uses both named and named-pkcs11 service.
If named is masked use named-pkcs11, instead of raising exception

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-11-04 16:23:41 +01:00
Petr Viktorin
0cdaf2c48f sudo integration test: Remove the local user test
SSSD does not support sudo rules for local users;
these should be added in a local sudoers file.

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

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-10-03 14:19:42 +02:00
Petr Viktorin
21276e8a3f test_forced_client_reenrollment: Don't check for host certificates
Since ticket 4449 we no longer generate host certificates by defailt.
Checdk that they are not present.

https://fedorahosted.org/freeipa/ticket/4601
2014-10-02 11:55:04 +02:00
Jan Cholasta
88083887c9 CA-less installer options usability fixes
The --*_pkcs12 options of ipa-server-install and ipa-replica-prepare have
been replaced by --*-cert-file options which accept multiple files.
ipa-server-certinstall now accepts multiple files as well. The files are
accepted in PEM and DER certificate, PKCS#7 certificate chain, PKCS#8 and
raw private key and PKCS#12 formats.

The --root-ca-file option of ipa-server-install has been replaced by
--ca-cert-file option which accepts multiple files. The files are
accepted in PEM and DER certificate and PKCS#7 certificate chain formats.

The --*_pin options of ipa-server-install and ipa-replica-prepare have been
renamed to --*-pin.

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

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-09-30 08:50:47 +02:00
Jan Cholasta
3aa0731fc6 External CA installer options usability fixes
The --external_cert_file and --external_ca_file options of ipa-server-install
and ipa-ca-install have been replaced by --external-cert-file option which
accepts multiple files. The files are accepted in PEM and DER certificate and
PKCS#7 certificate chain formats.

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

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-09-30 08:50:47 +02:00
Petr Viktorin
dea825fd9c ipa-restore: Set SELinux booleans when restoring
https://fedorahosted.org/freeipa/ticket/4157

Reviewed-By: Thierry Bordaz <tbordaz@redhat.com>
2014-09-26 12:12:59 +02:00
Petr Viktorin
ccb91f5970 Add test for backup/delete system users/restore
Regression test for: https://fedorahosted.org/freeipa/ticket/3866

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-09-24 13:53:07 +02:00
Petr Viktorin
f1ab2f7aa4 Add basic test for backup & restore
https://fedorahosted.org/freeipa/ticket/3893

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-09-24 13:53:07 +02:00
Petr Viktorin
8fabd6dde1 Support delegating RBAC roles to service principals
https://fedorahosted.org/freeipa/ticket/3164

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-08-21 14:07:01 +02:00
Tomas Babej
6bb4eea348 ipatests: test_trust: Add test to cover lookup of trusdomains
Adds an integration tests that checks that all trustdomains are
able to be found by trustdomain-find command right after the
trust has been established.

Also moves some code to allow easier adding common test cases for
both POSIX and non-POSIX test classes.

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

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-08-07 12:49:47 +02:00
Tomas Babej
4254423f83 ipatests: tasks: Fix dns configuration for trusts
Properly configure forwarders to the AD zone with respect to
newly created ipa dnsforwardzone commands.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2014-07-15 09:53:27 +02:00
Tomas Babej
c8511d3b3b ipaplatform: Fix misspelled path constant
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 21:07:07 +02:00
Tomas Babej
e7969f5af5 ipatests: test_sudo: Expect root listed out if no RunAsUser available
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:52 +02:00
Tomas Babej
701f1fc8ba ipatests: test_sudo: Do not expect enumeration of runasuser groups
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:52 +02:00
Tomas Babej
e0fd2695ca ipatests: test_sudo: Fix assertions not assuming runasgroupcat set to ALL
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:52 +02:00
Tomas Babej
ec2050b7df ipatests: test_sudo: Add coverage for category ALL validation
Makes sure sudorules behave correctly both when adding new entries
with corresponding category set to ALL, and when setting the
category to all when corresponding entries exist.

The only exception of deny commands with cmdcategory ALL is
covered as well.

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:52 +02:00
Tomas Babej
c50d190549 ipatests: test_sudo: Add coverage for external entries
Covers functionality of external entries for:
* users
* runAsUsers
* groups of RunAsUsers
* runAsGroups

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:52 +02:00
Tomas Babej
d537da8b8a ipatests: test_sudo: Add tests for allowing hosts via hostmasks
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:51 +02:00
Tomas Babej
4d2ef43f28 ipaplatform: Move all filesystem paths to ipaplatform.paths module
https://fedorahosted.org/freeipa/ticket/4052

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-16 19:48:20 +02:00
Tomas Babej
491f431107 ipatests: Enable SSSD debugging on legacy clients with SSSD
Reviewed-By: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2014-05-09 13:57:04 +03:00
Tomas Babej
d98e06c314 ipatests: Setup SSSD debugging mode by default
Reviewed-By: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2014-05-09 13:57:04 +03:00
Tomas Babej
086d9f46dd ipatests: legacy clients: Do not use external hostnames for testing login to legacy clients from master
Reviewed-By: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2014-05-09 13:57:04 +03:00
Tomas Babej
5ce88a1f89 ipatests: Add Sudo integration test
Reviewed-By: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2014-05-09 13:57:04 +03:00
Petr Viktorin
d28d37ebdb test_integration.host: Export the hostname to dict as string
Our tests do strict type-checking, using unicode string causes failures.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-04-22 12:55:35 +02:00
Tomas Babej
f74ab3cba2 ipatests: Fix incorrect UID/GID reference for subdomain users and groups
In legacy client integration test, the test cases that query information
from subdomain about subdomain users and group expected subdomain
users and groups to have the UIDs/GIDs as users and groups in the root
domain.

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-04-17 16:31:11 +02:00
Tomas Babej
49a59d1292 ipatests: Allow using FQDN with trailing dot as final hostname
When creating a BaseHost instance, the machine's hostname was
reconfigured to have the same shortname prepended the domain name
of the domain where it was defined.

However, it makes sense in certain use cases to define hosts
that have hostnames other than belonging directly in the domain
they were defined in.

Treat input hostnames with trailing dots as static FQDNs that
will not be changed by the name of the domain they were defined in.

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-04-17 16:31:11 +02:00
Tomas Babej
24aa0a91e5 ipatests: tasks: Accept extra arguments when installing client
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-04-17 16:31:11 +02:00
Tomas Babej
ceca0b5591 ipatests: Fix apache semaphores prior to installing IPA server
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-04-17 16:31:11 +02:00
Adam Misnyovszki
f85fe1e851 CI - test_forced_client_reenrollment stability fix
fixes FreeIPA Jenkins CI test freeipa-integration-forced_client_reenrollment-f19

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

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-04-17 16:31:11 +02:00
Petr Viktorin
85b8d8d5ae CA-less tests: Use sequential certificate serial numbers
When serial numbers were generated with $RANDOM, there
could be collisions.
Use sequential numbers instead.

Reviewed-By: Adam Misnyovszki <amisnyov@redhat.com>
2014-04-10 12:05:26 +02:00
Adam Misnyovszki
2b171d273f CA-less tests generate failure
CA-less test suite always generate failures when installing
revoked certificates. This is a known issue, described in
https://fedorahosted.org/freeipa/ticket/4270 , this fix skips
these tests, outputting a warning for the later ticket.

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

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-04-08 14:10:28 +02:00
Tomas Babej
50a6316d16 ipatests: tasks: Wait 2 seconds after restart of SSSD when clearing the cache
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-04-04 12:07:00 +02:00
Tomas Babej
6dcf2400be ipatests: legacy_clients: Relax regex checks
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-04-04 12:07:00 +02:00
Tomas Babej
517ac41524 ipatests: legacy_clients: Use hostname instead of external hostname for AD subdomain
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-04-04 12:07:00 +02:00
Tomas Babej
81b5adee80 ipatests: Make sure that remnants of PKI are removed
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-04-04 12:07:00 +02:00
Tomas Babej
f9ebd47f93 ipatests: Do not depend on the case of the attributes when testing ID ranges
In test_trust.py, several tests did case sensitive search on the output of
the ipa idrange-show command. This could cause false negatives.

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

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-03-26 12:57:29 +01:00
Tomas Babej
8c8cc8b614 ipatests: test_trust: Change expected home directories for posix users
Information from the AD about the home directories is not leveraged at
all, but is generated from the username and domain. Fix the assumptions
in the tests.

Also changes 'Subdomain Test User' to 'Subdomaintest User' to be more
consistent.

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

Reviewed-By: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2014-03-24 09:51:52 +01:00
Petr Viktorin
44b065a277 test_integration.tasks: Do not fail cleanup if backup directory does not exist
If the test backup directory was never created (for example if
there was an early failure, or install was never run),
we don't want the test to fail.
Do not restore if the backup dir is not there.

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-03-20 15:38:16 +01:00
Petr Viktorin
561e57d121 Add tests for integration test configuration
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-03-05 10:00:58 +01:00
Petr Viktorin
e6dbb2aa68 test_integration.config: Convert some text values to str
When loading from file, some strings are loaded as unicode,
which would throw off assert_deepequal.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-03-05 10:00:58 +01:00
Petr Viktorin
2150481f2a test_integration.config: Add environment variables for JSON/YAML
Part of the work for: https://fedorahosted.org/freeipa/ticket/3938

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-03-05 10:00:58 +01:00
Petr Viktorin
ef0264f75f test_integration.config: Load/store from/to dicts
Part of the work for: https://fedorahosted.org/freeipa/ticket/3938

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-03-05 10:00:58 +01:00
Petr Viktorin
310d8254ed test_integration.config: Do not store the index in Domain and Host objects
The index is a detail of the environment variable method of
configuration, it should only be used there.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-03-05 10:00:58 +01:00
Petr Viktorin
e1b73c18e3 test_integration.config: Use a more declarative approach to test-wide settings
The list of options was duplicated too many times. Consolidate.

Part of the work for: https://fedorahosted.org/freeipa/ticket/3938

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-03-05 10:00:58 +01:00