Commit Graph

88 Commits

Author SHA1 Message Date
Tomas Babej
cfaaeb9dad ipatests: Check for legacy_client attribute presence if unapplying fixes
When legacy client tests fail during IPA installation, the legacy
client test produces an additional misleading error
(the real cause is reported as well). This happens due the fact
that we try to cleanup host that was not yet defined. We need to
check for this attribute being defined before unapplying fixes there.

https://fedorahosted.org/freeipa/ticket/4124
2014-01-20 15:35:43 +01:00
Tomas Babej
dc1a1189e1 ipatests: Remove sudo calls from tasks
Sudo calls are not necessary since we log in as a root. Additionally,
sudo requires tty in default configuration, which is not acquired
when using OpenSSH transport.

https://fedorahosted.org/freeipa/ticket/4125
2014-01-20 15:32:46 +01:00
Simo Sorce
50a6430dbd Stop adding a default password policy reference
Both the password plugin and the kdb driver code automatically fall
back to the default password policy.
so stop adding an explicit reference to user objects and instead rely on the
fallback.
This way users created via the framework and users created via winsync plugin
behave the same way wrt password policies and no surprises will happen.

Also in case we need to change the default password policy DN this will allow
just code changes instead of having to change each user entry created, and
distinguish between the default policy and explicit admin changes.

Related: https://fedorahosted.org/freeipa/ticket/4085

Patch backported/updated by Martin Kosek to accomodate different ipatests
structure in ipa-3-3 branch.
2014-01-16 09:10:16 +01:00
Rob Crittenden
0fe745ef0a Change the way we determine if the host has a password set.
When creating a host with a password we don't set a Kerberos
principal or add the Kerberos objectclasses. Those get added when the
host is enrolled. If one passed in --password= (so no password) then
we incorrectly thought the user was in fact setting a password, so the
principal and objectclasses weren't updated.

https://fedorahosted.org/freeipa/ticket/4102
2014-01-15 10:02:57 +01:00
Petr Viktorin
5640049f7a test_webui: Allow False values in configuration for no_ca, no_dns, has_trusts
The driver only checked if the corresponding value was in the config, so
    no_dns: False
had the same effect as
    no_dns: True

Change the check to take the value into consideration.

This makes false-y values like False (from YAML) and empty string
(from environment) work as if the value was not specified.
2013-12-10 15:42:52 +01:00
Petr Viktorin
0d8cf9f848 test_integration: Log external hostname in Host.ldap_connect
This may make debugging easier if the address is set incorrectly.
2013-12-06 12:59:11 +01:00
Petr Viktorin
b20cdf0b9c test_integration: Support external names for hosts
The framework had a concept of external hostnames,
which the controller uses to contact the test machines,
but they were not loaded from configuration.

Load external names from configuration.

This makes tests pass in setups where internal and external
hostnames are different, and the internal hostnames are not
initially resolvable from the controller.
2013-12-06 12:59:11 +01:00
Tomas Babej
ddfc34f4bf ipatests: test_trust: use domain name instead of realm for user lookups 2013-11-01 16:25:54 +01:00
Tomas Babej
13a0f8694c ipatests: Add integration tests for legacy clients
Part of: https://fedorahosted.org/freeipa/ticket/3833
2013-11-01 16:25:54 +01:00
Tomas Babej
960c6bf301 ipatests: Add support for extra roles referenced by a keyword
Adds support for host definition by a environment variables of the
following form:

ROLE_<keyword>_envX, where X is the number of the environment
for which host referenced by a role <keyword> should be defined.

Adds a required_extra_roles attribute to the IntegrationTest class,
which can test developer use to specify the extra roles that this
particular test requires. If not all required extra roles are
available, the test will be skipped.

All extra (and static) roles are accessible to the IntegrationTests
via the host_by_role method, which returns a host of given role.

Part of: https://fedorahosted.org/freeipa/ticket/3833
2013-10-31 16:52:25 +01:00
Tomas Babej
d90862aaab ipatests: Do not use /usr/bin hardcoded paths
Part of: https://fedorahosted.org/freeipa/ticket/3833
2013-10-31 14:11:13 +01:00
Tomas Babej
63451c0b16 ipatests: Restore SELinux context after restoring files from backup
Part of: https://fedorahosted.org/freeipa/ticket/3833
2013-10-31 13:18:09 +01:00
Tomas Babej
a4ea378e51 ipatests: Extend clear_sssd_cache to support non-systemd platforms
Part of: https://fedorahosted.org/freeipa/ticket/3833
2013-10-31 13:16:16 +01:00
Petr Vobornik
cf495ede7b Fix password expiration notification
- was broken by navigation and application controller refactoring

https://fedorahosted.org/freeipa/ticket/4003
2013-10-30 13:30:31 +01:00
Petr Viktorin
227b3c7aaa beakerlib plugin: Don't try to submit logs if they are missing 2013-10-30 12:14:42 +01:00
Petr Viktorin
b5fa402f0b Tests: mkdir_recursive: Don't fail when top-level directory doesn't exist
When the directory directly under root (e.g. /etc) did not exist,
mkdir_recursive failed.
Fix the issue.
2013-10-30 12:14:40 +01:00
Ana Krivokapic
c859fd83dc Add test for external CA installation
https://fedorahosted.org/freeipa/ticket/3819
2013-10-29 08:26:23 +01:00
Tomas Babej
ddcbfd6f5f ipatests: Add AD integration test case
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-25 13:52:10 +02:00
Tomas Babej
0e3a39e76c ipatests: Add AD-integration related tasks
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:35 +02:00
Tomas Babej
70bf2f739b ipatests: Add WinHost class
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:35 +02:00
Tomas Babej
1243730aea ipatests: Create util module for ipatests
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:35 +02:00
Tomas Babej
87267dd297 ipatests: Extend IntegrationTest with multiple AD domain support
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:35 +02:00
Tomas Babej
8a2c2b7787 ipatests: Extend domain object with 'ad' role support and WinHosts
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:34 +02:00
Tomas Babej
d7c1f90916 ipatests: Add Active Directory support to configuration
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:34 +02:00
Petr Viktorin
e6738ea68f test_simple_replication: Fix waiting for replication
The integration tests must wait for replication to happen before checking
results. In some cases, the tests have failed because the checks that
detect completed replication were insufficient.

This fixes the code to:
- Wait for replication to be completed on both servers
- In the case of an error, continue waiting -- it might be the case that
  the DS is temporarily unreachable
2013-10-18 18:01:38 +02:00
Petr Viktorin
bdf9668ed1 Use new CLI options in certinstall tests
The --pin and --dirman-password options simplified ipa-certinstall
usage. Use them in tests.

Also add tests for the old way of calling the command.

https://fedorahosted.org/freeipa/ticket/3869
http://www.freeipa.org/page/V3/ipa-server-certinstall_CLI_cleanup
2013-10-18 12:46:52 +02:00
Petr Viktorin
e6d50cb906 test_caless.TestCertInstall: Fix 'test_no_ds_password' test case
The test installed the HTTP cert instead of the DS one.
2013-10-18 12:46:52 +02:00
Tomas Babej
76694f1610 ipatests: Extend the order plugin to properly handle inheritance
When trying to create a new ordered test case by inheriting
from already defined test case, by overriding few of its methods,
the execution order of the tests is as follows:
    - first all non-overriden test methods from the parent test class
    - then all overriden tests methods

This patch makes sure that methods are executed in the logical order,
that is, the order defined in the parent class.
2013-10-17 10:48:17 +02:00
Petr Viktorin
c6113ab89b Add tests for installing with empty PKCS#12 password 2013-10-04 10:27:37 +02:00
Alexander Bokovoy
5fe7f7d858 frontend: report arguments errors with better detail
When reporting argument errors, show also a context -- what is processed,
what is the name of the command.
2013-10-04 10:26:35 +02:00
Petr Viktorin
f4c022a9ca ipatests.test_cmdline.test_help: Re-raise unexpected exceptions on failure
If an exception is expected, but another one is raised, the CLITestContext
raised a generic AssertionError.
Pass through the original exception instead
2013-10-03 19:50:30 +02:00
Petr Vobornik
b792520b8a ipatests.test_integration.host: Add logging to ldap_connect() 2013-10-03 19:50:30 +02:00
Petr Viktorin
8acd7be55b ipatests.beakerlib_plugin: Add argument of generated tests to test captions
To differentiate between individual tests in BeakerLib output,
the argument needs to be added to the test name. Since Nose
doesn't provide a way to get the argument in a plugin,
a `test_argument` attribute must be added to the test function
to support this, simlarly to how `description` is used to set
individual "docstrings".

Add test_argument to the generated tests in the CA-less suite.
2013-10-03 19:50:30 +02:00
Petr Viktorin
afefb688b7 ipatests.order_plugin: Exclude test generators from the order
Ordered test generators were not announced in plugin hooks, so
e.g. the Beakerlib or collect plugin did not announce them.

Exclude test generators from ordering.
2013-10-03 19:50:29 +02:00
Petr Viktorin
0c37f95e04 ipatests.beakerlib_plugin: Warn instead of failing when some logs are missing 2013-10-03 19:50:29 +02:00
Petr Viktorin
6c9fc81214 ipatests.test_integration.test_caless: Fix mkdir_recursive call 2013-10-03 19:50:29 +02:00
Petr Viktorin
47f1addfa6 test_integration: Add OpenSSHTransport, used if paramiko is not available
This adds a transport that uses /usr/bin/ssh calls to communicate
with remote hosts.
This transport is a bit slower and buffers output more than paramiko,
so it is only used if paramiko is not available, or forced with an
environment variable.

https://fedorahosted.org/freeipa/ticket/3890
2013-10-03 18:57:55 +02:00
Petr Viktorin
45d45eabcd test_integration.host: Move transport-related functionality to a new module
This will make it possible to use a different mechanism for cases like
- Paramiko is not available
- Hosts without SSH servers (e.g. Windows)

Add BaseHost, Transport & Command base classes that define the interface
and common functionality, and Host, ParamikoTransport & SSHCommand with
specific details.

The {get,put}_file_contents methods are left on Host for convenience;
all other Transport methods must be now accessed through the transport.

Part of the work for https://fedorahosted.org/freeipa/ticket/3890
2013-10-03 18:57:55 +02:00
Petr Vobornik
0ca99a15b0 Fix enablement of automount map type selector
Map type radio used old way of defining that its value should not be used in add command.  Recent patch related to 'enable' attribute hardened/fixed the behavior of radio widgets so they are disabled in UI as well when enabled==false. Automount did not reflect this change.

https://fedorahosted.org/freeipa/ticket/3954
2013-10-03 09:13:52 +02:00
Petr Vobornik
745cbd2b6d Allow edit of ipakrbokasdelegate in Web UI when attrlevelrights are unknown
Old host entries are missing object class with krbticketflags attribute. Therefore UI does not receive attrlevelrights for it. This OC is added when ipakrbokasdelegate is set.

This patch adds the usual hack for such cases.

https://fedorahosted.org/freeipa/ticket/3940
2013-09-26 10:25:59 +02:00
Petr Vobornik
ac5447f579 Fix redirection on deletion of last dns record entry
https://fedorahosted.org/freeipa/ticket/3907
2013-09-16 13:56:51 +02:00
Petr Vobornik
93b314da42 Fix RUV search scope in ipa-replica-manage
The search had an incorrect scope and therefore it didn't find any RUV.

This issue prevented removing of replica.

https://fedorahosted.org/freeipa/ticket/3876
2013-09-04 12:46:44 +02:00
Ana Krivokapic
adac5549a0 Add integration tests for forced client re-enrollment
Add integration tests for the forced client re-enrollment feature:
http://www.freeipa.org/page/V3/Forced_client_re-enrollment#Test_Plan

https://fedorahosted.org/freeipa/ticket/3832
2013-09-02 12:29:47 +02:00
Petr Viktorin
5945988d73 Add man pages for testing tools
Add man pages for ipa-run-tests, ipa-test-task, and ipa-test-config.

https://fedorahosted.org/freeipa/ticket/3855 (part 5)
2013-08-29 15:22:22 +02:00
Petr Viktorin
c706859df2 Add CA-less install tests
Differences from the test plan at
http://www.freeipa.org/index.php?title=V3/CA-less_install&oldid=6669 are:
- The following tests are included in all applicable positive
  install tests, rather than being standalone test cases:
  - Verify CA certificate stored in LDAP
  - Verify CA PEM file created by IPA server install
  - Verify that IPA server install does not configure certmonger
  - Verify CA PEM file created by IPA replica install
  - Verify that IPA replica install does not configure certmonger
  - Verify CA PEM file created by IPA client install
- PKI setup is done only once for each test class
- Master installation is done once for the IPA command tests, and
  once for the certinstall tests
- Certificates are compared after base64 decoding to avoid failures
  from formatting mismatches
- Minor changes necessary for automation (e.g. adding --unattended
  and --password options, correcting error messages)
- Web UI tests are not included here

https://fedorahosted.org/freeipa/ticket/3830
2013-08-28 20:15:08 +02:00
Ana Krivokapic
c392146101 Fix tests which fail after ipa-adtrust-install
Some unit tests were failing after ipa-adtrust-install has been run on the
IPA server, due to missing attributes ('ipantsecurityidentifier') and
objectclasses ('ipantuserattrs' and 'ipantgroupattrs'). This patch detects if
ipa-adtrust-install has been run, and adds missing attributes and objectclasses
where appropriate.

https://fedorahosted.org/freeipa/ticket/3852
2013-08-28 16:46:15 +02:00
Petr Viktorin
023385510a Add missing license header to ipa-test-config 2013-08-28 14:40:28 +02:00
Petr Vobornik
844404af72 Update idrange search facet after trust creation
Adding a trust creates a range -> range search facet should be marked as expired.

https://fedorahosted.org/freeipa/ticket/3874
2013-08-28 14:24:03 +02:00
Ana Krivokapic
b0b25a27cf Add integration tests for Kerberos Flags
Add integration tests for the Kerberos Flags feature:
http://www.freeipa.org/page/V3/Kerberos_Flags#Test_Plan
(except the web UI tests).

https://fedorahosted.org/freeipa/ticket/3831
2013-08-27 12:46:32 +02:00
Petr Vobornik
ec6b514318 Web UI integration tests: ID range types
https://fedorahosted.org/freeipa/ticket/3834
2013-08-22 15:21:20 +02:00