Commit Graph

256 Commits

Author SHA1 Message Date
Petr Viktorin
b656398415 Regression test for user_status crash
https://fedorahosted.org/freeipa/ticket/4066
2013-12-10 15:34:45 +01:00
Petr Viktorin
a9a7976ca8 test_integration: Log external hostname in Host.ldap_connect
This may make debugging easier if the address is set incorrectly.
2013-12-06 12:58:50 +01:00
Petr Viktorin
98f4c22267 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:58:50 +01:00
Petr Viktorin
a1f32fa936 Add tests for the radiusproxy plugin 2013-12-03 14:49:10 +01:00
Petr Viktorin
1e836d2d0c Switch client to JSON-RPC
Modify ipalib.rpc to support JSON-RPC in addition to XML-RPC.
This is done by subclassing and extending xmlrpclib, because
our existing code relies on xmlrpclib internals.

The URI to use is given in the new jsonrpc_uri env variable. When
it is not given, it is generated from xmlrpc_uri by replacing
/xml with /json.

The rpc_json_uri env variable existed before, but was unused,
undocumented and not set the install scripts.
This patch removes it in favor of jsonrpc_uri (for consistency
with xmlrpc_uri).

Add the rpc_protocol env variable to control the protocol
IPA uses. rpc_protocol defaults to 'jsonrpc', but may be changed
to 'xmlrpc'.
Make backend.Executioner and tests use the backend specified by
rpc_protocol.

For compatibility with unwrap_xml, decoding JSON now gives tuples
instead of lists.

Design: http://freeipa.org/page/V3/JSON-RPC
Ticket: https://fedorahosted.org/freeipa/ticket/3299
2013-11-26 16:59:59 +01:00
Petr Viktorin
8f57f25e82 Add ConcatenatedLazyText object
This object will allow splitting large translatable strings into more
pieces, so translators don't have to re-translate the entire text
when a small part changes.

https://fedorahosted.org/freeipa/ticket/3587
2013-11-21 10:34:25 +01:00
Ana Krivokapic
b216a7b610 Add userClass attribute for users
This new freeform user attribute will allow provisioning systems
to add custom tags for user objects which can be later used for
automember rules or for additional local interpretation.

Design page: http://www.freeipa.org/page/V3/Integration_with_a_provisioning_systems
https://fedorahosted.org/freeipa/ticket/3588
2013-11-19 14:27:50 +01:00
Ana Krivokapic
487865131c Add web UI integration tests for automember rebuild
Design: http://www.freeipa.org/page/V3/Automember_rebuild_membership
https://fedorahosted.org/freeipa/ticket/3928
2013-11-15 13:28:16 +01:00
Ana Krivokapic
6eff37f8a2 Web UI integration test driver enhancement
Handle selecting an option from a select box.

https://fedorahosted.org/freeipa/ticket/3928
2013-11-15 13:28:16 +01:00
Ana Krivokapic
6c9b3b02a4 Fix error message when adding duplicate automember rule
Also fix object_name and object_name_plural for automember rules.

https://fedorahosted.org/freeipa/ticket/2708
2013-11-15 12:46:07 +01:00
Ana Krivokapic
0ac6397632 Add unit tests for automember rebuild command
Design: http://www.freeipa.org/page/V3/Automember_rebuild_membership
https://fedorahosted.org/freeipa/ticket/3752
2013-11-15 12:46:07 +01:00
Petr Viktorin
6c7a59a906 Add tests for user auth type management
https://fedorahosted.org/freeipa/ticket/3368
2013-11-08 12:48:43 +01:00
Jan Cholasta
df5f4ee81d Turn LDAPEntry.single_value into a dictionary-like property.
This change makes single_value consistent with the raw property.

https://fedorahosted.org/freeipa/ticket/3521
2013-11-05 13:56:55 +01:00
Petr Viktorin
1f6880c590 Fix debug output in integration test
Recent ipaldap work has made LDAPEntry incompatible with python-ldap's
LDIFWriter.
Convert entry to dict before printing debug output.
2013-11-04 11:59:34 +01:00
Tomas Babej
9cbb94cd66 ipatests: test_trust: use domain name instead of realm for user lookups 2013-11-01 16:24:30 +01:00
Tomas Babej
428aecec49 ipatests: Add integration tests for legacy clients
Part of: https://fedorahosted.org/freeipa/ticket/3833
2013-11-01 16:24:30 +01:00
Jan Cholasta
9ecf4b7aac Decode and encode attribute values in LDAPEntry on demand.
This is achieved by storing both decoded and encoded attribute values in
LDAPEntry and synchronizing changes between them whenever an attribute is
accessed.

Added a new property "raw" to LDAPEntry. It provides a dictionary-like
object which can be used to directly access encoded attribute values.

https://fedorahosted.org/freeipa/ticket/3521
2013-10-31 18:09:51 +01:00
Tomas Babej
b1bffb5eca 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:12 +01:00
Tomas Babej
44998feace ipatests: Do not use /usr/bin hardcoded paths
Part of: https://fedorahosted.org/freeipa/ticket/3833
2013-10-31 14:10:53 +01:00
Tomas Babej
4fd88140b1 ipatests: Restore SELinux context after restoring files from backup
Part of: https://fedorahosted.org/freeipa/ticket/3833
2013-10-31 13:18:00 +01:00
Tomas Babej
775f2de4ec ipatests: Extend clear_sssd_cache to support non-systemd platforms
Part of: https://fedorahosted.org/freeipa/ticket/3833
2013-10-31 13:16:02 +01:00
Petr Vobornik
e3d56597cd Fix password expiration notification
- was broken by navigation and application controller refactoring

https://fedorahosted.org/freeipa/ticket/4003
2013-10-30 13:31:12 +01:00
Petr Viktorin
70c1e4a185 beakerlib plugin: Don't try to submit logs if they are missing 2013-10-30 11:55:15 +01:00
Petr Viktorin
e6c06b08d8 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 11:55:10 +01:00
Petr Viktorin
dbf10b83bd Improve permission plugin test cleanup
The rename tests use names that were not being cleaned up when the
tests fail. Add cleanup steps for them.

Also, use --force so system permissions are removed as well.
2013-10-30 11:50:05 +01:00
Petr Viktorin
62890ca69b Fix indentation in permission plugin tests 2013-10-30 11:50:05 +01:00
Ana Krivokapic
5854c47685 Add test for external CA installation
https://fedorahosted.org/freeipa/ticket/3819
2013-10-29 08:27:25 +01:00
Tomas Babej
81b5ac772f ipatests: Add AD integration test case
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-25 13:51:59 +02:00
Tomas Babej
b758be1f51 ipatests: Add AD-integration related tasks
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:40 +02:00
Tomas Babej
35d843b273 ipatests: Add WinHost class
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:40 +02:00
Tomas Babej
e8941ef6cb ipatests: Create util module for ipatests
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:40 +02:00
Tomas Babej
407db5b8a9 ipatests: Extend IntegrationTest with multiple AD domain support
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:40 +02:00
Tomas Babej
5a9b46c9c5 ipatests: Extend domain object with 'ad' role support and WinHosts
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:40 +02:00
Tomas Babej
69a7c1e2ba ipatests: Add Active Directory support to configuration
Part of: https://fedorahosted.org/freeipa/ticket/3834
2013-10-24 14:08:40 +02:00
Petr Viktorin
f34b8896f9 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:28 +02:00
Petr Viktorin
756b997a7d Use a user result template in tests
This makes the tests shorter, more descriptive, and easier to change
e.g. when new attributes are added.
2013-10-18 17:11:50 +02:00
Petr Viktorin
c97f4e8a66 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:27:40 +02:00
Petr Viktorin
7be79dfe34 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:27:40 +02:00
Tomas Babej
096a49766d 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:03 +02:00
Petr Viktorin
5e8aab8558 Add tests for the IntEnum class
The StrEnum and Int tests are restructured to allow sharing the tests.
Individual *Enum tests are separated into methods.
2013-10-09 18:05:37 +02:00
Nathaniel McCallum
4f6580f11d Allow multiple types in Param type validation
Int already needed to take both int and long. This makes the functionality
available for all Param classes.
2013-10-09 18:05:37 +02:00
Petr Viktorin
b54cdab33d test_ipalib.test_crud: Don't use a string in takes_options
Options should be Param subclasses.
2013-10-08 16:46:19 +02:00
Petr Viktorin
3a4a7458c7 Add tests for installing with empty PKCS#12 password 2013-10-04 10:27:23 +02:00
Alexander Bokovoy
2d6c7e3adb 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:25:31 +02:00
Petr Viktorin
ef2d61faa2 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:35 +02:00
Petr Vobornik
5c06e27ff9 ipatests.test_integration.host: Add logging to ldap_connect() 2013-10-03 19:50:35 +02:00
Petr Viktorin
f2e8624e76 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:35 +02:00
Petr Viktorin
0ad339a731 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:35 +02:00
Petr Viktorin
a942ab4f12 ipatests.beakerlib_plugin: Warn instead of failing when some logs are missing 2013-10-03 19:50:35 +02:00
Petr Viktorin
23921f40d9 ipatests.test_integration.test_caless: Fix mkdir_recursive call 2013-10-03 19:50:35 +02:00
Petr Viktorin
3864760c52 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:41 +02:00
Petr Viktorin
758c73e149 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:41 +02:00
Petr Vobornik
6a124160a5 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:45 +02:00
Petr Vobornik
edf0719409 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:24:14 +02:00
Petr Viktorin
a93fc02af6 Raise an error when updating CIDict with duplicate keys
Updating a CIDict with data like {'A': 1, 'a': 2} would lead to data
loss since only one of the items would get to the CIDict.
This can result in non-obvious bugs similar to this one in python-ldap:
https://bugzilla.redhat.com/show_bug.cgi?id=1007820

Raise an error in this case; any resolution must be done by the caller.
2013-09-25 10:13:56 +02:00
Petr Viktorin
0226064bac Add missing dict methods to CIDict
Make the CIDict interface match standard dict (except view* methods).

Add __contains__, __iter__, clear.
Add keyword and iterable support for __init__, update.
Also add values() and itervalues(). Previously the dict versions were
used; the new ones guarantee that the order matches keys().
Mark view* methods as not implemented.
CIDict.copy() now returns a CIDict.

Test the above additions, and fromkeys() which worked but wasn't tested.
2013-09-25 10:13:56 +02:00
Petr Viktorin
468e5e40cc Convert test_ipautil from unittest to nose 2013-09-25 10:13:56 +02:00
Petr Viktorin
3e505fe532 Move tests to test directories
Nose doesn't pick up directories that don't begin with 'test'.
Rename ipatests/test_ipaserver/install to test_install so that it's run.

Also, merge test_ipautil.py from ipapython/test into tests/test_ipapython,
so the whole test suite is in one place.
2013-09-25 10:13:56 +02:00
Petr Vobornik
5c4a72de59 Fix redirection on deletion of last dns record entry
https://fedorahosted.org/freeipa/ticket/3907
2013-09-16 13:56:25 +02:00
Petr Vobornik
f312d72510 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:29 +02:00
Ana Krivokapic
f40cb4c031 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:36 +02:00
Petr Viktorin
f742520760 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:18:34 +02:00
Petr Viktorin
9b200c7c72 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:14:46 +02:00
Ana Krivokapic
196c4b5f53 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:45:57 +02:00
Petr Viktorin
fed7e7b231 Add missing license header to ipa-test-config 2013-08-28 14:40:18 +02:00
Petr Vobornik
92569b712c 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:23:42 +02:00
Ana Krivokapic
1749cce3f7 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:45:12 +02:00
Petr Vobornik
278c87cc62 Web UI integration tests: ID range types
https://fedorahosted.org/freeipa/ticket/3834
2013-08-22 15:23:56 +02:00
Petr Vobornik
0584caf56a Web UI Integration tests: Kerberos Flags
Tests according to: http://www.freeipa.org/page/V3/Kerberos_Flags

https://fedorahosted.org/freeipa/ticket/3831
2013-08-22 15:23:56 +02:00
Petr Vobornik
8e8afe0519 Web UI integration tests: CA-less
Test cases according to: http://www.freeipa.org/page/V3/CA-less_install

https://fedorahosted.org/freeipa/ticket/3830
2013-08-22 15:23:56 +02:00
Petr Viktorin
a8d2ec6677 Allow freeipa-tests to work with older paramiko versions
The integration testing framework used Paramiko SFTP files as
context managers. This feature is only available in Paramiko 1.10+.
Use an explicit context manager so that we don't rely on the feature.
2013-08-13 15:42:48 +02:00
Martin Kosek
b9ec4d1a67 Prevent *.pyo and *.pyc multilib problems
Differences in the python byte code fails in a build validation
(rpmdiff) done on difference architecture of the same package.

This patch:
 1) Ensures that timestamps of generated *.pyo and *.pyc files match
 2) Python integer literals greater or equal 2^32 and lower than 2^64
    are converted to long right away to prevent different type of
    the integer on architectures with different size of int

https://fedorahosted.org/freeipa/ticket/3858
2013-08-13 15:31:46 +02:00
Tomas Babej
69394bab5a Remove support for IPA deployments with no persistent search
Drops the code from ipa-server-install, ipa-dns-install and the
BindInstance itself. Also changed ipa-upgradeconfig script so
that it does not set zone_refresh to 0 on upgrades, as the option
is deprecated.

https://fedorahosted.org/freeipa/ticket/3632
2013-08-09 12:14:42 +02:00
Petr Viktorin
381f22af25 Add the new no_member option to CLI tests
This makes the tests pass.
2013-07-29 10:03:21 +02:00
Petr Vobornik
04839a2aea Web UI integration tests: Code quality fixes
* variables with python build-in names renamed
 * unused parameters used or removed

 https://fedorahosted.org/freeipa/ticket/3744
2013-07-26 13:35:12 +02:00
Petr Vobornik
6ec5e5fec6 Web UI integration tests: PEP8 fixes
Tests modified to comply with PEP8 rules with exception of rule E501 (long lines).
Done by autopep8 tool and 2 manual modifications.

https://fedorahosted.org/freeipa/ticket/3744
2013-07-26 13:35:12 +02:00
Petr Vobornik
8a3d8aeca3 Web UI integration tests: Compute range sizes to avoid overlaps
Heavily inspired by code from xmlrpc tests.

To obtain ranges, this patch also adds method to execute FreeIPA command through Web UI.
It uses Web UI instead of ipalib so it doesn't need to care about authentication on a test-runner machine.

https://fedorahosted.org/freeipa/ticket/3744
2013-07-26 13:35:12 +02:00
Petr Vobornik
a3567cef98 Web UI integration tests: Verify data after add and mod
https://fedorahosted.org/freeipa/ticket/3744
2013-07-26 13:35:12 +02:00
Petr Vobornik
bc06e30481 Web UI integration tests: Add ui_driver method descriptions
https://fedorahosted.org/freeipa/ticket/3744
2013-07-26 13:35:12 +02:00
Petr Vobornik
ae31130098 Web UI integration tests: Add trust tests
https://fedorahosted.org/freeipa/ticket/3744
2013-07-26 13:35:12 +02:00
Petr Viktorin
2f80855e15 test_simple_replication: Wait for replication to finish before checking
Add ldap_connect() method to Host to allow executing querying LDAP from tests.

Use information in the mapping tree to poll until all replication is finished
(or failing) before checking that entries replicated successfully.
2013-07-25 12:41:26 +02:00
Petr Viktorin
00dfd9399b Add the ipa-test-task tool
This script makes common testing tasks such as IPA installation
and uninstallation available outside of Python.

https://fedorahosted.org/freeipa/ticket/3721
2013-07-25 12:32:35 +02:00
Petr Viktorin
13f4b7e9cf Add install_topo to test tasks
This allows a cluster of replicas and clients to be installed
in a named topology.
Several named topologies are available (star, line, complete, tree,
tree2) and new ones can be defined as a simple function.
2013-07-25 12:32:35 +02:00
Petr Viktorin
ac70c2cc5c Add more test tasks
- install_client
- connect_replica
- disconnect_replica
- prepare_host
- kinit_admin
2013-07-25 12:32:34 +02:00
Petr Viktorin
db8027407a test_integration: Set up CA on replicas by default
For complex topologies the CA needs to be available on most
replicas, since only servgers with a CA can prepare replica files.
2013-07-25 12:32:33 +02:00
Petr Viktorin
4b439356b7 test_integration: Add log collection to Host
This allows collecting logs when a test context is not available.
2013-07-25 12:32:33 +02:00
Petr Viktorin
65dfcb7cec Move BeakerLibProcess out of BeakerLibPlugin
This allows reusing the code elsewhere
2013-07-25 12:32:32 +02:00
Petr Vobornik
2a9be92855 Upstream Web UI tests
Documentation: http://www.freeipa.org/page/Web_UI_Integration_Tests

https://fedorahosted.org/freeipa/ticket/3744
2013-07-16 13:15:59 +02:00
Petr Viktorin
23d3fde059 Integration test config: Make it possible to specify host IP 2013-07-15 15:49:16 +02:00
Petr Viktorin
0db6fb9ec5 BeakerLib plugin: Log http links in test docstrings
The main case for this is having ticket numbers in the Beaker ouput.
2013-07-15 15:49:15 +02:00
Petr Viktorin
c47f3154be Make BeakerLib logging less verbose
Logs from Beaker jobs are normally very brief, with the standard
output/error containing detailed information. Make ipa-run-tests
with BeakerLib plugin follow this convention.

Only include INFO and higher level messages in the Beaker logs.
Downgrade several message levels to DEBUG.
Log to console using Python logging instead of showing the Beaker logs.

Since ipa-run-tests sets up its own logging, Nose's own log
handling just causes duplicate messages. Disable it with --nologcapture.
2013-07-15 15:49:14 +02:00
Petr Viktorin
19a0d51d89 Use dosctrings in BeakerLib phase descriptions
Phase names are now in the format:
test-module-TestClass-test_method: First line of docstring

https://fedorahosted.org/freeipa/ticket/3723
2013-07-15 15:49:13 +02:00
Petr Viktorin
a02890526e Host class improvements
- Use the external hostname when connecting to remote hosts
- Make it possible to specify working directory for remote commands
- Move kinit calls to installation code
  This allows tests where installation is done later
- Log at error level when a remote command fails unexpectedly
- Clean up test directory before testing
- Break infinite recursion in mkdir_recursive if dir can't be created
2013-07-15 15:49:12 +02:00
Petr Viktorin
846ae2b3f4 tests: Configure/unconfigure remote hosts
Set up the hostname, /etc/resolv.conf, and /etc/hosts on remote
hosts in the test setup.
Undo the changes in test teardown.

Part of the work for https://fedorahosted.org/freeipa/ticket/3621
2013-07-15 15:49:11 +02:00
Petr Viktorin
d84e10347e tests: Allow public keys for authentication to the remote machines
Part of the work for https://fedorahosted.org/freeipa/ticket/3621
2013-07-15 15:49:10 +02:00
Petr Viktorin
9cbd232718 Show logs in failed tests
Output from IPA's log manager is not captured by Nose's logcapture plugin.
Forward IPA logs to a regular Python logger so that they are shown
on failures.
IPA log messages are also shown on standard error.

Filter out Paramiko logs by default; these are too verbose.

Part of the work for: https://fedorahosted.org/freeipa/ticket/3621
2013-07-15 15:49:09 +02:00
Petr Viktorin
5365e1b81b Collect logs from tests
After each test, and after class setups and teardowns, the BeakerLib
integration plugin now downloads log files from the remote masters
and submits them using rlFileSubmit.

Part of the work for: https://fedorahosted.org/freeipa/ticket/3621
2013-07-15 15:49:08 +02:00
Petr Viktorin
00f133458b Introduce a class for remote commands
Introduce a class inspired by subprocess.Popen that handles
running a command on a remote machine and handling its output.

To separate stdout & stderr streams of a remote command,
they need to be read in parallel, so that one of them doesn't
stall the runner when its buffer fills up. Accomplish this
by using a thread for each stream.

Part of the work for: https://fedorahosted.org/freeipa/ticket/3621
2013-07-15 15:49:07 +02:00
Petr Viktorin
353f3c62c3 Add a framework for integration testing
Add methods to run commands and copy files to Host objects.
Adds a base class for integration tests which can currently install
and uninstall IPA in a "star" topology with per-test specified number
of hosts.
A simple test for user replication between two masters is provided.
Log files from the remote hosts can be marked for collection, but the
actual collection is left to a Nose plugin.

Part of the work for: https://fedorahosted.org/freeipa/ticket/3621
2013-07-15 15:49:06 +02:00
Petr Viktorin
c577420e40 Add a framework for integration test configuration
Integration tests are configured via environment variables.
Add a framework for parsing these variables and storing them
in easy-to-use objects.

Add an `ipa-test-config` executable that loads the configuration
and prints out variables needed in shell scripts.

Part of the work for https://fedorahosted.org/freeipa/ticket/3621
2013-07-15 15:49:05 +02:00
Petr Viktorin
226f9d681d Add a plugin for test ordering
Tests in test classes decorated by @ipatests.order_plugin.ordered
are sorted by the source line number instead of alphabetically,
if the plugin is enabled.

The ipa-run-tests helper now loads and enables the plugin.

This should make writing integration tests easier.
2013-07-15 15:49:04 +02:00
Ana Krivokapic
91a5d3349b Require rid-base and secondary-rid-base in idrange-add after ipa-adtrust-install
Add a new API command 'adtrust_is_enabled', which can be used to determine
whether ipa-adtrust-install has been run on the system. This new command is not
visible in IPA CLI.

Use this command in idrange_add to conditionally require rid-base and
secondary-rid-base options.

Add tests to cover the new functionality

https://fedorahosted.org/freeipa/ticket/3634
2013-06-24 14:30:06 +02:00
Tomas Babej
0750bab259 Remove hardcoded values from idrange plugin tests
Hardcoded values for range parameters such as base RID or range
size could be the reason the tests produced incorrect results,
as the ranges could get in conflict with already existing ranges
on the server.

Patch dynamically chooses ID and RID range space at the end of
all ranges already present on the server.

https://fedorahosted.org/freeipa/ticket/3662
2013-06-19 16:03:43 +02:00
Petr Viktorin
780961a643 Add Nose plugin for BeakerLib integration
The plugin hooks into the Nose runner and IPA's logging infrastructure
and calls the appropriate BeakerLib functions (rl*).

IPA's log_manager is extended to accept custom Handler classes.

The ipa-run-tests helper now loads the plugin.

Patr of the work for: https://fedorahosted.org/freeipa/ticket/3621
2013-06-17 19:23:04 +02:00
Petr Viktorin
e87807d379 Add ipa-run-tests command
Part of the work for: https://fedorahosted.org/freeipa/ticket/3654
2013-06-17 19:22:58 +02:00
Petr Viktorin
c60142efda Make an ipa-tests package
Rename the 'tests' directory to 'ipa-tests', and create an ipa-tests RPM
containing the test suite

Part of the work for: https://fedorahosted.org/freeipa/ticket/3654
2013-06-17 19:22:50 +02:00