Commit Graph

199 Commits

Author SHA1 Message Date
Petr Viktorin
eb14f99ece Make it possible to call custom functions in Declarative tests
Sometimes, we will want to do more than just call IPA commands and
check the output. This patch makes it possible to add arbitrary
functions to Declarative tests. They will be called as part of
the sequence of tests.

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-02-12 17:11:17 +01:00
Martin Basti
39ebeae10b Fix test_host_plugin for DNS Classless Reverse zones
Ticket: https://fedorahosted.org/freeipa/ticket/4143

Reviewed-by: Martin Kosek <mkosek@redhat.com>
2014-02-12 14:01:09 +01:00
Martin Basti
5d65856588 DNS tests for classless reverse domains
Ticket: https://fedorahosted.org/freeipa/ticket/4143
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2014-02-11 17:21:11 +01:00
Tomas Babej
11505d9bce ipatests: Do not require group name resolution for the non-posix tests
In the non-posix tests on the legacy clients, the testuser does not
belong to the testgroup (since this is represented by the NIS
group membership).

Relax the regular expression check for the output of the id testuser.

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2014-02-11 16:37:44 +01:00
Tomas Babej
2e45002a2a ipatests: Change expected home directories returned by getent
The hardcoded values for the home directories for the AD users did
not properly scale up from the POSIX attrs only test scanario.

When using POSIX attrs, the home dir is returned as whatever is set
in the AD (/home/username by default). Without using POSIX attributes,
the /home/domain/username form is taken by default.

Refactor the tests to take this behaviour into account.

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2014-02-11 16:37:44 +01:00
Tomas Babej
ba7d404912 ipatests: Add test cases for subdomain users on legacy clients
Adds test cases for:
* getent subdomain user on legacy client
* getent subdomain group on legacy client
* getent id subdomain user on legacy client
* ssh into legacy client with subdomain user
* ssh into legacy client with disabled subdomain user

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2014-02-11 16:37:44 +01:00
Tomas Babej
daf2d64f83 ipatests: Stop sssd service before deleting the cache
In the integration tests, we do not stop the sssd service
before deleting the cache, but rather start it. We need
to stop sssd before deleting the cache.

Reviewed-By: Nathaniel McCallum <npmccallum@redhat.com>
2014-02-10 10:37:31 +01:00
Tomas Babej
99facb753a ipatests: Make sure we re-kinit as admin before adding the disabledipauser
When we add the disabledipauser during the setup class part of the
BaseTestLegacyClient, we need to make sure that we re-kinit admin
since we do ntpsync with the AD just before that, which can render
the previous ticket invalid.

Reviewed-By: Nathaniel McCallum <npmccallum@redhat.com>
2014-02-10 10:37:29 +01:00
Tomas Babej
01a0249a40 ipatests: Perform a connection test before preparing the client
When the host is down, the preparation of the host fails. This
produces misleading errors, since the test framework reports that
the actual command being executed failed, when in fact (in case
of SSHTransport), the cause of failure was unability to establish
a SSH session.

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

Reviewed-By: Nathaniel McCallum <npmccallum@redhat.com>
2014-02-10 10:37:26 +01:00
Tomas Babej
033c354709 ipatests: legacy_clients: Test legacy clients with non-posix trust
Adds test cases for legacy client support with IPA that has estabilish
trust with AD that does not leverage POSIX attributes defined on AD.

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

Reviewed-By: Nathaniel McCallum <npmccallum@redhat.com>
2014-02-10 10:37:23 +01:00
Tomas Babej
1601860023 ipatests: Run restoring backup files and restoring their context in one session
Restoring backup files and restoring their context were two separate commands,
what means that in case we use SSHTrasport, which creates a separate SSH
session for each command, we try to restore the SELinux context of the
changed files in a new session.

This causes problems, if the access to files themselves are necessary
for the creation of the new SSH session.

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

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-02-05 15:38:53 +01:00
Tomas Babej
baf9b4c02a ipatests: Add records for all hosts in master's domain
All the hosts in the domain have IPA master set as their only
nameserver. However, the IPA master does not create records for
these machines by default. This is not an big issue for clients
or replicas, since those records do get created in other ways,
but external hosts using their internal hostnames will not resolve.

Adds an A record for each host in master's domain.

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

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-02-05 15:38:53 +01:00
Tomas Babej
03d093d793 ipatests: test_legacy_clients: Change "test group" to "testgroup"
The integration test for legacy clients used incorrectly "test group"
instead of "testgroup" as group used on AD for test purposes. This
is inconsistent with the usage of "testuser".

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

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-02-05 15:38:53 +01:00
Petr Viktorin
7b5124416b integration tests OpenSSHTransport: Expand tilde to home in root_ssh_key_filename
Expand paths beginning with a tilde, such as the default ~/.ssh/id_rsa,
to the home directory.

https://fedorahosted.org/freeipa/ticket/4115
2014-02-05 08:35:07 +01:00
Petr Spacek
df3fa943ab Use reserved domain names for tests
https://fedorahosted.org/freeipa/ticket/4139
2014-01-30 13:46:11 +01:00
Petr Spacek
558be8e102 Rename variables in test xmlrpc/dns_plugin
https://fedorahosted.org/freeipa/ticket/4139
2014-01-30 13:37:38 +01:00
Petr Spacek
3aa9a8b9be Use private IPv4 addresses for tests
https://fedorahosted.org/freeipa/ticket/4139
2014-01-30 13:32:58 +01:00
Jan Cholasta
9d863e9a96 Convert remaining test code to LDAPEntry API. 2014-01-24 20:29:31 +01:00
Petr Viktorin
6bdc75ea24 Implement XML introspection
https://fedorahosted.org/freeipa/ticket/2937
2014-01-14 13:41:19 +01:00
Petr Vobornik
6b71d1a167 Web UI integration tests: maximize browser window by default 2014-01-21 12:04:04 +01:00
Petr Vobornik
c4abe3a2d9 Replace icons with the ones from Font Awesome
https://fedorahosted.org/freeipa/ticket/3904
2014-01-21 12:04:03 +01:00
Petr Vobornik
23c042775c RCUE dialog implementation
https://fedorahosted.org/freeipa/ticket/3904
2014-01-21 12:04:02 +01:00
Petr Vobornik
9a7e65100c New checkboxes and radio styles
https://fedorahosted.org/freeipa/ticket/3904
2014-01-21 12:04:02 +01:00
Petr Vobornik
2d9bb22772 Change undo to regular button
https://fedorahosted.org/freeipa/ticket/3904
2014-01-21 12:04:02 +01:00
Petr Vobornik
7adb034e02 Remove jquery button usage and unify button code
https://fedorahosted.org/freeipa/ticket/3904
2014-01-21 12:04:02 +01:00
Petr Vobornik
77a56b7f87 Adapt password expiration notification to new navigation
https://fedorahosted.org/freeipa/ticket/3902
2014-01-21 12:04:02 +01:00
Petr Vobornik
3b9280c974 RCUE Header
https://fedorahosted.org/freeipa/ticket/3902
2014-01-21 12:04:02 +01:00
Petr Vobornik
b69d30072a RCUE Navigation
https://fedorahosted.org/freeipa/ticket/3902
2014-01-21 12:04:02 +01:00
Tomas Babej
2adfaa3a9b 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:28 +01:00
Tomas Babej
5403648afd 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:01 +01:00
Simo Sorce
088fbad353 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
2014-01-16 09:00:35 +01:00
Rob Crittenden
0070c0feda 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:49 +01:00
Petr Viktorin
4a64a1f18b Allow anonymous and all permissions
Disallow adding permissions with non-default bindtype to privileges

Ticket: https://fedorahosted.org/freeipa/ticket/4032
Design: http://www.freeipa.org/page/V3/Anonymous_and_All_permissions
2014-01-07 09:56:41 +01:00
Xiao-Long Chen
5e96fbc22a Use /usr/bin/python2
Part of the effort to port FreeIPA to Arch Linux,
where Python 3 is the default.

FreeIPA hasn't been ported to Python 3, so the code must be modified to
run /usr/bin/python2

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

Updated by pviktori@redhat.com
2014-01-03 09:46:05 +01:00
Petr Viktorin
423bb38965 Test adding noaci/system permissions to privileges
Part of the work for: https://fedorahosted.org/freeipa/ticket/4034
2013-12-13 15:08:52 +01:00
Petr Viktorin
d38748d64f Make sure SYSTEM permissions can be retreived with --all --raw
Part of the work for: https://fedorahosted.org/freeipa/ticket/4034
2013-12-13 15:08:52 +01:00
Petr Viktorin
7fc35ced1d permission plugin: Ensure ipapermlocation (subtree) always exists 2013-12-13 15:08:52 +01:00
Petr Viktorin
53caa7aca2 Roll back ACI changes on failed permission updates 2013-12-13 15:08:52 +01:00
Petr Viktorin
f47669a5b9 Verify ACIs are added correctly in tests
To double-check the ACIs are correct, this uses different code
than the new permission plugin: the aci_show command.
A new option, location, is added to the command to support
these checks.
2013-12-13 15:08:52 +01:00
Petr Viktorin
d7ee87cfa1 Rewrite the Permission plugin
Ticket: https://fedorahosted.org/freeipa/ticket/3566
Design: http://www.freeipa.org/page/V3/Permissions_V2
2013-12-13 15:08:52 +01:00
Petr Viktorin
8ddb5da1ea Add tests for permission plugin with older clients
These tests use an old API version, which triggers
backwards-compatible behavior in the plugin.
2013-12-13 15:08:51 +01:00
Petr Viktorin
a1236b6542 Allow Declarative test classes to specify the API version
This makes it possible to test behavior with older clients.
2013-12-13 15:08:51 +01:00
Petr Viktorin
f2ee8a7403 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:33 +01:00
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