Commit Graph

683 Commits

Author SHA1 Message Date
David Kupka
95191e1612 test: automember: Fix expected exception message
https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-29 10:49:37 +02:00
Stanislav Laznicka
427bbf6c0d The LDAP*ReverseMember shouldn't imply --all is always specified
The LDAP*ReverseMember methods would always return the whole LDAP
object even though --all is not specified.
Also had to fix some tests as objectClass will not be returned by
default now.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-29 10:44:30 +02:00
Petr Spacek
bf91c0f938 DNS: Fix tests for realm domains integration with DNS zone add
We forgot to update tests after change in
22f4045f72.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-28 14:19:56 +02:00
Lenka Doudova
22f26cfa8e Tests: Make ID views tests reflect new krbcanonicalname attribute
https://fedorahosted.org/freeipa/ticket/3864

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-06-28 10:50:25 +02:00
Martin Babinsky
d0c38d86a1 test-{service,host}-plugin: only expect krbcanonicalname when all=True
fixes incorrect assertions in tests that create, retrieve, and search for
services

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

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-06-28 09:17:30 +02:00
Martin Babinsky
a79d45ad79 test_serverroles: ensure that test API is initialized with correct ldap_uri
This ensures that the serverroles test works also when run together with other
iaserver test suites.

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

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-06-28 09:14:28 +02:00
Martin Babinsky
7b8247a485 keep setting ipakrbprincipal objectclass on new service entries
this is required for replica promotion to work, since the ACI allowing hosts
to add their own services uses this objectclass as target filter.

This partially reverts changes from commit
705f66f749

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-27 13:38:07 +02:00
Lenka Doudova
d64513f1ff Tests: Fix ipatests/test_ipaserver/test_rpcserver.py
Removed no longer valid assert.

Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2016-06-24 14:22:40 +02:00
Lenka Doudova
eec440b2d5 Tests: Fix for failing location tests
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-23 15:29:06 +02:00
Martin Babinsky
06d945a046 account for added krbcanonicalname attribute during xmlrpc tests
https://fedorahosted.org/freeipa/ticket/3864

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2016-06-23 09:48:06 +02:00
Jan Cholasta
f554078291 frontend: don't copy command arguments to output params
Use only object params and params defined in has_output_params as output
params. This removes unnecessary duplication of params defined both in
object plugins and as command arguments.

This requires all command output params to be properly defined in either
the object plugins or the command's has_output_params. Fix the plugins
where this wasn't true.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-20 16:39:12 +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
Martin Basti
4155eb7b13 DNS Locations: Rename ipalocationweight to ipaserviceweight
Service weight explains better meaning of attribute than location
weight, because location itself have no weight only services have.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-06-17 18:05:03 +02:00
Yuri Chornoivan
dd6645afa9 Fix minor typos
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-06-16 08:47:20 +02:00
Jan Cholasta
4128c565ea plugable: initialize plugins on demand
Use a new API namespace class which does not initialize plugins until they
are accessed.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-15 14:03:51 +02:00
Martin Babinsky
40d8dded7f Test suite for serverroles backend
Tests retrieving roles/attributes and setting server attributes in various
scenarios.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-06-13 17:50:54 +02:00
David Kupka
05878f1153 test: test_cli: Do not expect defaults in kwargs.
Client is no longer forwarding in arguments with default values to the server.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-06 19:53:59 +02:00
Fraser Tweedale
fa149cff86 Remove service and host cert issuer validation
When adding certifiates to a host or service entry, we currently
check that the issuer matches the issuer DN of the IPA CA.  Now that
sub-CAs have been implemented, this check is no longer valid and
will cause false negatives.  Remove it and update call sites.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-06 08:58:01 +02:00
Martin Basti
42719acdce DNS Locations: extend tests with server-* commands
https://fedorahosted.org/freeipa/ticket/2008

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-03 15:58:21 +02:00
Martin Basti
7c3bcafef0 DNS Locations: API tests
Tests for location-* commands

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-03 15:58:21 +02:00
Jan Cholasta
6e44557b60 ipalib: move server-side plugins to ipaserver
Move the remaining plugin code from ipalib.plugins to ipaserver.plugins.

Remove the now unused ipalib.plugins package.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-03 09:00:34 +02:00
Jan Cholasta
56c66f44a0 rpc: specify connection options in API config
Specify RPC connection options once in API.bootstrap rather than in each
invocation of rpcclient.connect.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-03 09:00:34 +02:00
Jan Cholasta
ed4c2d9252 plugable: turn Plugin attributes into properties
Implement the `name`, `doc` and `summary` Plugin attributes as properties
to allow them to be overriden in sub-classes.

Always use .doc rather than .__doc__ to access plugin documentation.

Remove the mostly unused `module`, `fullname`, `bases` and `label`
attributes.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-03 09:00:34 +02:00
Martin Basti
05c8808c76 Test: fix failing host_test
Regression caused by patches related to empty zones

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-01 08:27:26 +02:00
Martin Basti
5f42b42bd4 Performance: Find commands: do not process members by default
In all *-find commands, member attributes shouldn't be processed due
high amount fo ldpaserches cause serious performance issues. For this
reason --no-members option is set by default in CLI and API.

To get members in *-find command option --all in CLI is rquired or
'no_members=False' or 'all=True' must be set in API call.

For other commands processing of members stays unchanged. WebUI is not
affected by this change.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-05-31 14:08:54 +02:00
Petr Spacek
70794c7b1d Turn verify_host_resolvable() into a wrapper around ipapython.dnsutil
The code was duplicate and less generic anyway.
As a side-effect I had to re-wrap dns.exception.DNSException into a
PublicError so it can be displayed to the user.

DNSError is now a super class for other DNS-related errors. Errors from
DNS resolver are re-raised as DNSResolverError.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-30 20:14:32 +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
Petr Spacek
da71e7e9de DNS: Warn if forwarding policy conflicts with automatic empty zones
Forwarding policy "first" or "none" may conflicts with some automatic empty
zones. Queries for zones specified by RFC 6303 will ignore
forwarding and recursion and always result in NXDOMAIN answers.

This is not detected and warned about. Global forwarding is equivalent
to forward zone ".".

Example:
Forward zone 1.10.in-addr.arpa with policy "first"
will not forward anything because BIND will automatically prefer
automatic empty zone "10.in-addr.arpa." which is authoritative.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-30 20:14:32 +02:00
Petr Viktorin
037eae26d0 test_ipaserver.test_ldap: Adjust tests to Python 3's KeyView
In Python 3, the keys() method of mappings returns a KeyView object
that reflects the mapping's state. In LDAPEntry, this means that
the collection returned by keys() is case-insensitive and supports
aliases.

Part of the fix for: https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-30 16:44:08 +02:00
Petr Viktorin
25560f0e1d test_ipaserver.test_ldap: Use bytestrings for raw LDAP values
Part of the work for: https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-30 16:44:08 +02:00
Petr Viktorin
9ca450ac43 test_rpcserver: Expect updated error message under Python 3
Python 3's JSON module provides line number information in
its parsing error. Update the test to expect this.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-30 16:44:08 +02:00
Petr Viktorin
9477cddfeb test_topology_plugin: Don't rely on order of an attribute's values
Order of Python dicts/sets was always unreliable, but in Python 3
it's usually different every time. This affects the order in which
values of a LDAP attribute appear.
LDAP values are also specified to be unordered.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-30 16:44:08 +02:00
Jan Cholasta
60fa6ed444 frontend: merge baseldap.CallbackRegistry into Command
Also make it possible for subclasses to introduce new callback types.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-05-25 16:06:26 +02:00
Jan Cholasta
a30bc8a351 plugable: switch API to Registry-based plugin discovery
Merge Registrar into Registry. Use the Registry instance of each plugin
module to discover plugins in the module instead of the global Registrar
instance.

This removes the side-effect of all plugins in a module being re-registered
every time the module is imported.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-05-25 16:06:26 +02:00
Jan Cholasta
b08f771518 ipalib: remove the unused csv argument of Param
https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-05-25 16:06:26 +02:00
Jan Cholasta
13b010685b frontend: remove the unused Command.soft_validate method
https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-05-25 16:06:26 +02:00
Jan Cholasta
2f6b333187 frontend: re-raise remote RequirementError using CLI name in CLI
https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-05-25 16:06:26 +02:00
Jan Cholasta
e0275abe6f rpc: include structured error information in responses
Include keyword arguments of exceptions in RPC responses. This is limited
to JSON-RPC, as XML-RPC does not support additional data in error
responses.

Include keyword arguments of messages in RPC responses.

Include keyword arguments of exceptions in batch command result.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-05-25 16:06:26 +02:00
Jan Cholasta
861294c0d6 parameters: remove unused ConversionError and ValidationError arguments
Do not set the `value`, `index` and `rule` arguments when raising
ConversionError and ValidationError. The arguments are unused and are not
specified consistently accross the framework and plugins.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-05-25 16:06:26 +02:00
Lenka Doudova
d71de186cc Test: Maximum username length higher than 255 cannot be set
https://fedorahosted.org/freeipa/ticket/5774

Reviewed-By: Ganna Kaihorodova <gkaihoro@redhat.com>
2016-05-24 10:39:14 +02:00
Peter Lacko
144a367d35 Ping module tests.
Test for ping module rewritten using non-declarative way.
No new functionality has been added.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-18 17:19:05 +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
Petr Viktorin
7d4d819b90 test_cert_plugin: Encode 'certificate' for comparison with 'usercertificate'
The 'certificate' option is Str, but 'usercertificate' is Bytes.
Decode before comparing one with the other.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-10 12:41:15 +02:00
Petr Viktorin
20a6a42567 test_add_remove_cert_cmd: Use bytes for base64.b64encode()
Part of the work for: https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-05-05 16:42:46 +02:00
Petr Viktorin
bdee890014 radiusproxy plugin tests: Expect bytes, not text, for ipatokenradiussecret
Part of the work for: https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-05-05 16:42:46 +02:00
Petr Viktorin
14aba1c7c1 range plugin tests: Use bytes with MockLDAP under Python 3
Part of the work for: https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-05-05 16:42:46 +02:00
Petr Viktorin
095d0cb7af xmlrpc_test: Expect bytes rather than strings for binary attributes
The attributes krbextradata, krbprincipalkey, and userpassword contain
binary data.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-05-05 16:42:46 +02:00
Petr Viktorin
6406c7a593 xmlrpc_test: Rename exception instance before working with it
Python 3 unsets the exception variable at the end of an "except"
block to prevent reference cycles and speed up garbage collection.

Store the exception under a different name in order to use it later.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-05-05 16:42:46 +02:00
Petr Viktorin
f753ad322d test_xmlrpc: Use absolute imports
In Python 3, a module from the current package can be imported
either with the absolute name or by using an explicit relative import.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-05-05 16:42:46 +02:00