Commit Graph

350 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Martin Basti
b87a825d74 fix stageuser tests (removal of has_keytab and has_password from find)
User tests has been fixed, but stageuser tests was forgotten, this
commit fixes it.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-05-05 15:20:19 +02:00
Lenka Doudova
847c950408 Test fix: Cleanup for host certificate
This fix provides means to remove certificates from host that were added during tests, but not removed.

Ticket: https://fedorahosted.org/freeipa/ticket/5839
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-05-03 17:12:45 +02:00
Martin Basti
fe2ce02a6f Performace: don't download password attributes in host/user-find
For each entry in user/host-find was executed an extra search for password
attributes what has significant impact on performance (for 2000 users
there were 2000 additional searches)

http://www.freeipa.org/page/V4/Performance_Improvements

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-04-22 13:28:57 +02:00
Milan Kubík
0472300dff ipatests: Add test case for requesting a certificate with full principal.
https://fedorahosted.org/freeipa/ticket/5733

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-21 17:06:54 +02:00
Filip Skola
5dfaeca7ce Refactor test_automember_plugin, create AutomemberTracker
Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2016-04-19 10:35:13 +02:00
Martin Babinsky
62bb478e11 specify type of exceeded limit when warning about truncated search results
API commands inheriting from LDAPSearch should mention which limit was
exceeded in the warning message sent with truncated results.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-13 17:52:22 +02:00
Filip Skola
49c015b2ed Refactor test_hostgroup_plugin
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-03-24 14:38:22 +01:00
Filip Skola
ab3f652dc1 Refactor test_nesting, create HostGroupTracker
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-03-24 14:36:55 +01:00
Martin Basti
ae5bf8291f Fix stageuser-activate - managers test
https://fedorahosted.org/freeipa/ticket/5481

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-03-23 16:38:26 +01:00
Martin Basti
da0318d4d7 Pylint: remove unnecessary-semicolon
Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
2016-03-22 10:20:51 +01:00
Martin Babinsky
abe3abb466 test_cert_plugin: use only first part of the hostname to construct short name
The short hostname construction for the negative test case in
test_cert_plugin::test_cert_find suite could not work when domain name was
different as hostname of the test runner, leading to test failure. A more
naive approach works better in this case.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-03-08 20:22:55 +01:00
Filip Skola
de63e16922 Refactor test_group_plugin, use GroupTracker for tests
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-03-08 16:32:11 +01:00
Martin Basti
72d5499c5a pylint: supress false positive no-member errors
pylint 1.5 prints many false positive no-member errors which are
supressed by this commit.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-03-02 14:57:36 +01:00
Filip Skola
dd38602fa5 Refactor test_sudocmdgroup_plugin
Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2016-03-01 13:50:32 +01:00
Filip Skola
007c360f85 Refactor test_sudocmd_plugin
Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2016-03-01 13:50:32 +01:00
Milan Kubík
b32c9d639e ipatests: extend permission plugin test with new expected output
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-02-25 16:31:15 +01:00
Stanislav Laznicka
9757384c7c Cosmetic changes to the code
Fixes some Coverity issues

ipadiscovery.py:          added assert should universe break
plugins/dns.py:           removed dead code
dnssec/ldapkeydb.py:      attribute assert in the proper object
test_automount_plugin.py: fixed possible close() on None
xmlrpc_test.py:           Coverity does not like accessing None.__class__

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-02-24 09:21:30 +01:00
Milan Kubík
87ee451c7d ipatests: Add missing certificate profile fixture
https://fedorahosted.org/freeipa/ticket/5630

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-02-11 14:13:56 +01:00
Filip Skola
ec75b01f17 Refactor test_attr
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-01-26 19:04:38 +01:00
Filip Skola
9ba5bf03a8 Refactor test_replace
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-01-26 19:03:15 +01:00
Filip Skola
3d1adb3255 Refactor test_user_plugin, use UserTracker for tests
Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-01-25 16:04:32 +01:00
Petr Viktorin
b2436560df Alias "unicode" to "str" under Python 3
Follow-up to commit 23507e6124

The six way of doing this is to replace all occurences of "unicode"
with "six.text_type". However, "unicode" is non-ambiguous and
(arguably) easier to read. Also, using it makes the patches smaller,
which should help with backporting.

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
Milan Kubík
1995997071 ipatests: Fix configuration problems in dns tests
revzone2 changed to unresolvable reverse zone
test for root zone now supresses the overlap check

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-11 14:48:08 +01:00
Martin Basti
00fd28e026 Enable pylint unnecessary-pass check
Enables check and removes extra pass statement from code.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
78254a9fdd Enable pylint expression-not-assigned check
Enables check and fixes:
************* Module ipa-replica-conncheck
install/tools/ipa-replica-conncheck:150:
[W0106(expression-not-assigned), parse_options] Expression
"(replica_group.add_option('-w', '--password', dest='password',
sensitive=True, help='Password for the principal'), )" is assigned to
nothing)
************* Module ipatests.test_xmlrpc.test_automount_plugin
ipatests/test_xmlrpc/test_automount_plugin.py:437:
[W0106(expression-not-assigned),
test_automount_indirect.test_1a_automountmap_add_indirect] Expression
"api.Command['automountmap_add_indirect'](self.locname, self.mapname,
**self.map_kw)['result']" is assigned to nothing)
************* Module ipatests.test_ipaserver.test_otptoken_import
ipatests/test_ipaserver/test_otptoken_import.py:128:
[W0106(expression-not-assigned), test_otptoken_import.test_mini]
Expression "[(t.id, t.options) for t in doc.getKeyPackages()]" is
assigned to nothing)
************* Module ipatests.test_ipaserver.test_ldap
ipatests/test_ipaserver/test_ldap.py:221:
[W0106(expression-not-assigned), test_LDAPEntry.test_popitem] Expression
"list(e) == []" is assigned to nothing)
************* Module ipa-client-install
ipa-client/ipa-install/ipa-client-install:114:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-p', '--principal', dest='principal',
help='principal to use to join the IPA realm'), )" is assigned to
nothing)
ipa-client/ipa-install/ipa-client-install:116:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-w', '--password', dest='password',
sensitive=True, help='password to join the IPA realm (assumes bulk
password unless principal is also set)'), )" is assigned to nothing)
ipa-client/ipa-install/ipa-client-install:118:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-k', '--keytab', dest='keytab', help='path to
backed up keytab from previous enrollment'), )" is assigned to nothing)
ipa-client/ipa-install/ipa-client-install:120:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-W', dest='prompt_password',
action='store_true', default=False, help='Prompt for a password to join
the IPA realm'), )" is assigned to nothing)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
9f49246476 Enable pylint unused-format-string-key check
Enables check and fixes:
ipatests/test_xmlrpc/test_permission_plugin.py:534:
[W1301(unused-format-string-key), test_permission] Unused key 'tdn' in
format string dictionary)
ipatests/test_xmlrpc/test_permission_plugin.py:652:
[W1301(unused-format-string-key), test_permission] Unused key 'tdn' in
format string dictionary)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
89e16a8053 Enable pylint duplicated-key check
Enables check and fixes:
ipatests/test_xmlrpc/test_permission_plugin.py:65:
[W0109(duplicate-key), ] Duplicate key 'ipapermlocation' in dictionary)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +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
Milan Kubik
c8a0359362 ipatests: Roll back the forwarder config after a test case
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-12-21 14:08:29 +01:00
Martin Basti
ee51ad0f25 Fix DNS tests: dns-resolve returns warning
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-12-21 14:07:12 +01:00
Petr Viktorin
099cf98307 Refactor ipautil.run
The ipautil.run function now returns an object with returncode and
output are accessible as attributes.

The stdout and stderr of all commands are logged (unless skip_output is given).

The stdout/stderr contents must be explicitly requested with a keyword
argument, otherwise they are None.
This is because in Python 3, the output needs to be decoded, and that can
fail if it's not decodable (human-readable) text.

The raw (bytes) output is always available from the result object,
as is "leniently" decoded output suitable for logging.

All calls are changed to reflect this.

A use of Popen in cainstance is changed to ipautil.run.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-14 10:54:23 +01:00
Lenka Doudova
a66a2c5160 Adding descriptive IDs to stageuser tests
Adding descriptive IDs to parametrized stageuser test for better identification of test cases.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-12-11 12:34:17 +01:00
Milan Kubík
17f9ca154b Separated Tracker implementations into standalone package
The previous way of implementing trackers in the module with
the test caused circular imports. The separate package resolves
this issue.

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

Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2015-12-02 17:12:24 +01:00
Martin Babinsky
8909506a88 update idrange tests to reflect disabled modification of local ID ranges
Fix for https://fedorahosted.org/freeipa/ticket/4826 temporarily disallowed
modification of local ID ranges via API calls The corresponding XMLRPC tests
were updated to reflect this change.

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2015-11-23 12:45:03 +01:00
Martin Basti
b0faf30eac Tests: DNS various exceptions can be raised in test
Test 'Try to add SRV record to zone %r both via parts and a raw value'
can raise various exceptions which are all valid. Due to internal
representation IPA may raise exception for any of target, port,
priority, weight part.

This commit handles all of them.

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-11-13 14:01:46 +01:00
Martin Basti
c08d4523b2 Tests: DNS replace 192.0.2.0/24 with 198.18.0.0/15 range
192.0.2.0/24 is IANA reserved address that should not be used. netaddr
module check implemented for this address and IPA reject this address as
invalid.
198.18.0.0/15 is IANA reserved address for benchmark testing purpose, so
we can safely use this network.

http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-11-13 14:01:46 +01:00
Milan Kubik
0a64e9bd70 Applied tier0 and tier1 marks on unit tests and xmlrpc tests
Web UI tests were marked as tier1 tests.

The tier system is intended to be used together with CI system
to make sure the more complicated tests are being run only
when all of the basic functionality is working.

The system is using pytest's marker system. E.g. an invocation of
all tier1 tests with listing will look like:

    $ py.test -v -m tier1 ipatests

or in case of out of tree tests:

    $ ipa-run-tests -m tier1

Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2015-11-09 11:49:17 +01:00
Abhijeet Kasurde
c60cec4fa7 Added user friendly error message for dnszone enable and disable
Added try-except block in dns plugin in order to provide user
friendly message to end user.

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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-29 13:41:41 +01:00
Milan Kubík
5ab0fcabf3 ipatests: CA ACL and cert profile functional test
https://fedorahosted.org/freeipa/ticket/57

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-27 09:57:48 +01:00
Milan Kubík
8d64485b2e ipatests: CA ACL - added config templates
https://fedorahosted.org/freeipa/ticket/57

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-27 09:57:48 +01:00
Milan Kubík
897c9c9c43 tests: add test to check the default ACL
Also includes basic ACL manipulation and adding
and removing members to/from the acl.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-27 09:57:48 +01:00
Milan Kubík
36f7074683 ipatests: Add initial CAACLTracker implementation
The patch implements the tracker for CA ACL feature.
The basic CRUD checkers has been implemented. The methods
for adding and removing the association of the resources
with the ACL do not have the check methods. These will be provided
as a separate test suite.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-27 09:57:48 +01:00
Milan Kubík
30f0a034e1 ipatests: add fuzzy instances for CA ACL DN and RDN
https://fedorahosted.org/freeipa/ticket/57

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-27 09:57:48 +01:00
Martin Babinsky
af1f6721e1 fix class teardown in user plugin tests
https://fedorahosted.org/freeipa/ticket/5368

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-22 13:15:43 +02:00
Tomas Babej
eaeb40328c tests: Add tests for idoverride object integrity
As far as IPA objects are concerned, ID overrides are supposed
to be removed when the respective user/group is removed.

Adds a couple of tests to ensure this behaviour is covered.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-10-14 16:11:25 +02:00
Martin Basti
16261adc58 Replace tab with space in test_user_plugin.py
Mixing tabs and spaces is not allowed in python3

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-10-14 10:14:51 +02:00
Petr Viktorin
905d81f500 ipalib.aci: Port to Python 3
- Don't encode under Python 3, where shlex would choke on bytes
- Sort the attrs dictionary in export_to_string, so the tests are
  deterministic. (The iteration order of dicts was always unspecified,
  but was always the same in practice under CPython 2.)

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-10-13 14:16:32 +02:00
Tomas Babej
12840e0bfa tests: Amend result assertions in realmdomains tests
* Nonexistent domains have to be added/deleted with force
* Warning messages are emitted
* Some error messages have been altered

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-12 13:34:20 +02:00
Petr Viktorin
e3c05fcb73 Remove uses of the types module
In Python 3, the types module no longer provide alternate names for
built-in types, e.g. `types.StringType` can just be spelled `str`.

NoneType is also removed; it needs to be replaced with type(None)

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
Robert Kuska
01da4a8de3 Replace StandardError with Exception
StandardError was removed in Python3 and instead
Exception should be used.

Signed-off-by: Robert Kuska <rkuska@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-30 10:51:36 +02:00
Jan Cholasta
33aba6f35e Use byte literals where appropriate
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2015-09-17 11:08:43 +02:00
Jan Cholasta
23507e6124 Alias "unicode" to "str" under Python 3
The six way of doing this is to replace all occurences of "unicode"
with "six.text_type". However, "unicode" is non-ambiguous and
(arguably) easier to read. Also, using it makes the patches smaller,
which should help with backporting.

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2015-09-17 11:08:43 +02:00
Milan Kubík
1550b5ab50 ipatests: Add basic tests for certificate profile plugin
Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2015-09-16 18:51:56 +02:00
Milan Kubík
a4aace730c ipatests: Add Certprofile tracker class implementation
https://fedorahosted.org/freeipa/ticket/57

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2015-09-16 18:51:56 +02:00
Abhijeet Kasurde
1b70521e6b Updated number of legacy permission in ipatests
Since IPA 4.2 has an additional permission
"Request Certificate ignoring CA ACLs", the number of legacy
permission in testcase is updated from 8 to 9.

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

Signed off-by: Abhijeet Kasurde <akasurde@redhat.com>

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-09-16 12:58:03 +02:00
Martin Basti
9ffe7f4998 FIX vault tests
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-09-09 14:27:56 +02:00
Petr Viktorin
5178e9a597 Modernize use of range()
In Python 3, range() behaves like the old xrange().
The difference between range() and xrange() is usually not significant,
especially if the whole result is iterated over.

Convert xrange() usage to range() for small ranges.
Use modern idioms in a few other uses of range().

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +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
3bf91eab25 Use Python3-compatible dict method names
Python 2 has keys()/values()/items(), which return lists,
iterkeys()/itervalues()/iteritems(), which return iterators,
and viewkeys()/viewvalues()/viewitems() which return views.

Python 3 has only keys()/values()/items(), which return views.
To get iterators, one can use iter() or a for loop/comprehension;
for lists there's the list() constructor.

When iterating through the entire dict, without modifying the dict,
 the difference between Python 2's items() and iteritems() is
negligible, especially on small dicts (the main overhead is
extra memory, not CPU time). In the interest of simpler code,
this patch changes many instances of iteritems() to items(),
iterkeys() to keys() etc.

In other cases, helpers like six.itervalues are used.

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
Lenka Doudova
a78e751209 Fix user tracker to reflect new user-del message
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-27 12:24:23 +02:00
Petr Vobornik
9b0a01930b vault: fix vault tests after default type change
https://fedorahosted.org/freeipa/ticket/5251

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-26 14:01:41 +02:00
Michael Simacek
aad73fad60 Port from python-krbV to python-gssapi
python-krbV library is deprecated and doesn't work with python 3. Replacing all
it's usages with python-gssapi.

- Removed Backend.krb and KRB5_CCache classes
  They were wrappers around krbV classes that cannot really work without them
- Added few utility functions for querying GSSAPI credentials
  in krb_utils module. They provide replacements for KRB5_CCache.
- Merged two kinit_keytab functions
- Changed ldap plugin connection defaults to match ipaldap
- Unified getting default realm
  Using api.env.realm instead of krbV call

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Robbie Harwood <rharwood@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-08-26 09:41:36 +02:00
Endi S. Dewata
e46d9236d1 Added support for changing vault encryption.
The vault-mod command has been modified to support changing vault
encryption attributes (i.e. type, password, public/private keys)
in addition to normal attributes (i.e. description). Changing the
encryption requires retrieving the stored secret with the old
attributes and rearchiving it with the new attributes.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-25 19:11:53 +02:00
Lenka Doudova
a14c4b5001 Automated test for stageuser plugin
Ticket: https://fedorahosted.org/freeipa/ticket/3813
Test plan: http://www.freeipa.org/page/V4/User_Life-Cycle_Management/Test_Plan

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Thierry Bordaz <tbordaz@redhat.com>
2015-08-25 13:19:06 +02:00
Petr Viktorin
5435a8a32a Use absolute imports
In Python 3, implicit relative imports will not be supported.
Use fully-qualified imports everywhere.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-12 18:17:23 +02:00
Petr Viktorin
27dabb4528 Modernize 'except' clauses
The 'as' syntax works from Python 2 on, and Python 3 will
drop the "comma" syntax.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-12 18:17:23 +02:00
Martin Babinsky
555229e33e test suite for user/host/service certificate management API commands
These tests excercise various scenarios when using new class of API commands
to add or remove certificates to user/service/host entries.

Part of http://www.freeipa.org/page/V4/User_Certificates

Reviewed-By: Milan Kubík <mkubik@redhat.com>
2015-08-03 14:40:12 +02:00
Milan Kubík
3f90aa0c18 tests: Allow Tracker.dn be an instance of Fuzzy
Some of the IPA LDAP entries are using ipaUniqueID as
the "primary key". To match this UUID based attribute
in assert_deepequal, an instance of Fuzzy class must
be used. This change adds the possibility to assign
the Fuzzy object as the DN for the tracked entry.

The user may need to override the rdn and name
properties for the class using the Fuzzy DN.

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2015-07-31 15:50:05 +02:00
Petr Viktorin
b8c46f2a32 Modernize number literals
Use Python-3 compatible syntax, without breaking compatibility with py 2.7

- Octals literals start with 0o to prevent confusion
- The "L" at the end of large int literals is not required as they use
  long on Python 2 automatically.
- Using 'int' instead of 'long' for small numbers is OK in all cases except
  strict type checking checking, e.g. type(0).

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-07-31 15:22:19 +02:00
Tomas Babej
106e904337 tests: test_cert: Services can have multiple certificates
Old certificates of the services are no longer removed and revoked
after new ones have been issued.

Check that both old and new certificates are present.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-22 11:14:23 +02:00
Tomas Babej
8eb26e9230 tests: vault_plugin: Skip tests if KRA not available
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-22 11:13:06 +02:00
Tomas Babej
5f8fd8a8e3 tests: realmdomains_plugin: Add explanatory comment
The realmdomains_mod command will fail if the testing environment
is configured improperly and the IPA domain's NS/SOA records are
not resolvable. This can easily happen if the machine's DNS server
is not configured to the IPA server.

Leave a explanatory note in the class.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-07-22 11:10:49 +02:00
Tomas Babej
12395a94f3 tests: service_plugin: Make sure the cert is decoded from base64
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-22 11:09:59 +02:00
Tomas Babej
705603a396 tests: user_plugin: Add preserved flag when --all is used
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-07-21 18:59:40 +02:00
Martin Basti
c6c84faecf Py3: replace tab with space
python3 does not allow to mix spaces and tabs

Reviewed-By: Christian Heimes <cheimes@redhat.com>
2015-07-17 17:19:51 +02:00
Yuri Chornoivan
75fde43491 Fix minor typos
<ame> -> <name>
overriden -> overridden
ablity -> ability
enties -> entries
the the -> the

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

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2015-07-17 14:33:30 +02:00
Endi S. Dewata
bf6df3df9b Added vault access control.
New LDAP ACIs have been added to allow vault owners to manage the
vaults and to allow members to access the vaults. New CLIs have
been added to manage the owner and member list. The LDAP schema
has been updated as well.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-07-08 06:30:23 +00:00
Endi S. Dewata
475ade4bec Added ipaVaultPublicKey attribute.
A new attribute ipaVaultPublicKey has been added to replace the
existing ipaPublicKey used to store the vault public key.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-07-07 07:44:56 +00:00
Endi S. Dewata
fc5c614950 Added symmetric and asymmetric vaults.
The vault plugin has been modified to support symmetric and asymmetric
vaults to provide additional security over the standard vault by
encrypting the data before it's sent to the server. The encryption
functionality is implemented using the python-cryptography library.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-07-07 07:44:56 +00:00
Jan Cholasta
e39fe4ed31 plugable: Pass API to plugins on initialization rather than using set_api
https://fedorahosted.org/freeipa/ticket/3090

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-01 13:05:30 +00:00
Martin Babinsky
74883bbc95 generalize certificate creation during testing
With added support for multiple certificates for hosts, services, and even
users, IPA testing framework will need a more flexible way to generate
temporary testing certificates for these entities. This patch modifies the
currently used `testcert` module to support these requirements.

Related to work on http://www.freeipa.org/page/V4/User_Certificates

Reviewed-By: Milan Kubík <mkubik@redhat.com>
2015-06-23 10:29:20 +02:00
Martin Basti
f8c8c360f1 DNSSEC: validate forward zone forwarders
Show warning messages if DNSSEC validation is failing for particular FW
zone or if the specified forwarders do not work

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

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-06-11 13:12:31 +02:00
Martin Basti
9aa6124b39 DNSSEC: Improve global forwarders validation
Validation now provides more detailed information and less false
positives failures.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-06-11 13:12:31 +02:00
Jan Cholasta
81729e22d3 vault: Move vaults to cn=vaults,cn=kra
https://fedorahosted.org/freeipa/ticket/3872

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-06-10 16:17:34 +00:00
Endi S. Dewata
df1bd39a43 Added vault-archive and vault-retrieve commands.
New commands have been added to archive and retrieve
data into and from a vault, also to retrieve the
transport certificate.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-06-08 10:04:23 +00:00
Milan Kubík
d25a45a9f9 Abstract the HostTracker class from host plugin test
Implements a base class to help test LDAP based plugins.

The class has been decoupled from the original host plugin test
and moved to separate module ipatests.test_xmlrpc.ldaptracker.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-06-05 19:06:20 +02:00
Rob Crittenden
a92328452d Add plugin to manage service constraint delegations
Service Constraints are the delegation model used by
ipa-kdb to grant service A to obtain a TGT for a user
against service B.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-03 09:47:40 +00:00
Endi S. Dewata
fde21adcbd Added vault plugin.
A new plugin has been added to manage vaults. Test scripts have
also been added to verify the functionality.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-05-25 06:17:09 +00:00
Thierry Bordaz
51937cc571 User life cycle: Stage user Administrators permission/priviledge
Creation of stage user administrator

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-05-18 09:37:21 +02:00
Lenka Ryznarova
b7af182546 Test Objectclass of postdetach group
Add regression test to check whether a post detach group has a full set of objectclass.
Add regression test to check whether group-add-member is successfull for a post detach group.

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

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-05-07 16:05:54 +02:00
Jan Cholasta
db88498c95 ldap: Move schema handling from IPASimpleLDAPObject to LDAPClient
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2015-04-16 06:58:31 +00:00
Jan Cholasta
cbb112dd57 ldap: Use LDAPClient instead of IPASimpleLDAPObject in LDAPEntry
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2015-04-16 06:58:31 +00:00
Ales 'alich' Marecek
ca96ecbf40 Ipatests DNS SOA Record Maintenance
https://fedorahosted.org/freeipa/ticket/4746

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-04-02 08:56:32 +00:00
Tomas Babej
a34ff7f6c1 ipatests: Add coverage for adding and removing sshpubkeys in ID overrides
Adds xmlrpc tests for:
  - Adding a user ID override with sshpubkey
  - Modifying a user ID override to contain sshpubkey
  - Removing a sshpubkey value from a user ID override

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

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2015-02-19 17:03:06 +01:00
Petr Vobornik
25f5ee0cb6 ipatests: add missing ssh object classes to idoverrideuser
Reviewed-By: Martin Kosek <mkosek@redhat.com>
2015-02-19 17:03:06 +01:00
Tomas Babej
f83b4fe330 ipatests: Fix incorrect assumptions in idviews tests
https://fedorahosted.org/freeipa/ticket/4839

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-01-26 13:01:33 +01:00
Tomas Babej
3341d31ec7 ipatests: Fix old command references in the ID views tests
Make sure only new API command versions are referenced.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-01-26 13:01:33 +01:00
Tomas Babej
a294f10d06 ipatests: Add coverage for referential integrity plugin applied on ipaAssignedIDView
This adds a test case which makes sure that referential integrity
plugin does not leave any trailing references for ipaAssignedIDView
attribute on hosts, if the ID view being referenced has been deleted.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-01-26 13:01:33 +01:00
Martin Basti
9af8fa9dd5 DNS tests: warning if forward zone is inactive
Ticket: https://fedorahosted.org/freeipa/ticket/4721
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-01-15 13:21:47 +01:00
Petr Viktorin
07545569ec test_host_plugin: Use HostTracker fixtures
The racker object "remembers" expected state across several tests,
so only changes (rather than all expected state) need to be specified
in each test. Also, the tracker fixture will make it easy to use hosts
in other test modules.

This change makes the tests independent; any permutation of any subset
of these tests should now pass.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-01-14 11:40:28 +01:00
Petr Viktorin
8add23d401 test_host_plugin: Split tests into independent classes
Any of the classes may be run alone.

In classes not marked @ordered, individual tests are independent.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-01-14 11:40:28 +01:00
Petr Viktorin
4d9112b5c6 test_host_plugin: Convert tests to imperative style
This has several advantages:
- Tests other than run-command/check-response can be added easily
- Tracebacks are meaningful (which means we'll be able to remove a lot of
  test name/description/location tracking code)
- Individual tests can be selected/deselected using normal pytest mechanisms
  (but for isolated tests, more changes will be needed)

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-01-14 11:40:28 +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
Martin Basti
92feba2223 New test cases for Forward_zones
https://fedorahosted.org/freeipa/ticket/4750

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2015-01-13 14:34:47 +01:00
Martin Basti
6a0934f584 DNS tests: separate current forward zone tests
Ticket: https://fedorahosted.org/freeipa/ticket/4750
Reviewed-By: Martin Kosek <mkosek@redhat.com>
2015-01-13 14:34:47 +01:00
Petr Vobornik
026c9eca09 add --hosts and --hostgroup options to allow/retrieve keytab methods
`--hosts` and `--hostgroup` options added to:
* service-allow-create-keytab
* service-allow-retrieve-keytab
* service-disallow-create-keytab
* service-disallow-retrieve-keytab
* host-allow-create-keytab
* host-allow-retrieve-keytab
* host-disallow-create-keytab
* host-disallow-retrieve-keytab

in order to allow hosts to retrieve keytab of their services or related hosts as described on http://www.freeipa.org/page/V4/Keytab_Retrieval design page

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2014-12-03 11:34:10 +00:00
David Kupka
56ca47d535 Fix error message for nonexistent members and add tests.
https://fedorahosted.org/freeipa/ticket/4643

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-24 16:04:57 +01:00
Petr Viktorin
0cb12f3cde Declarative tests: Switch to pytest
Provide a local pytest plugin to generate tests.

The Declarative tests can now only 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
07def0b275 Declarative tests: Move cleanup to setup_class/teardown_class
https://fedorahosted.org/freeipa/ticket/4610

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-21 12:14:44 +01:00
Petr Viktorin
93c69b5127 Use setup_class/teardown_class in Declarative tests
Pytest will consider each Declarative test individually, running
setup/teardown for each one.
Move the setup and teardown to the class level.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-21 12:14:44 +01:00
Petr Viktorin
84bd4c1246 test_automount_plugin: Fix test ordering
Nose ran the `test_a_*` and `test_a2_*` tests in opposite order
than the source suggested. Fix this.

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
Martin Basti
310e46452c Fix warning message should not contain CLI commands
Message is now universal for both CLI and WebUI

Ticket: https://fedorahosted.org/freeipa/ticket/4647
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2014-11-19 15:20:55 +01:00
Petr Vobornik
3d11de4849 idrange: include raw range type in output
iparangetype output is a localized human-readable value which is not suitable for machine-based API consumers

Solved by new iparangetyperaw output attribute which contains iparangetype's raw value

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-11 10:56:16 +01:00
Petr Vobornik
feea9047be unittests: baserid for ipa-ad-trust-posix idranges
https://fedorahosted.org/freeipa/ticket/4221

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-11 10:56:16 +01:00
Martin Basti
5e1172f560 fix forwarder validation errors
Fix tests, validation in dnsconfig mod, wuser warning

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2014-10-21 15:55:09 +02:00
Petr Vobornik
b69a8dad2e tests: management of keytab permissions
https://fedorahosted.org/freeipa/ticket/4419

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2014-10-17 14:11:35 +02:00
Martin Basti
41015e6c9c DNS missing tests
* try to remove non-existent permission
* try to remove idnssoamname using dnszone-mod --name-server=

Reviewed-By: David Kupka <dkupka@redhat.com>
2014-10-09 10:02:22 +02:00
Petr Viktorin
3eca0ff2fe test_service_plugin: Do not lowercase memberof_role
This adjusts the test for the change in commit 792c3f9c8c

Related ticket: https://fedorahosted.org/freeipa/ticket/4192
2014-10-01 12:43:40 +02:00
Tomas Babej
8fb0e3a2b4 ipatests: Add xmlrpc tests for idviews plugin
Add coverage for the ID views and ID overrides.

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

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2014-09-30 10:42:06 +02:00
Tomas Babej
d83af7d38d baseldap: Properly handle the case of renaming object to the same name
When renaming a object to the same name, errors.EmptyModList is raised.
This is not properly handled, and can cause other modifications in the
LDAPUpdate command to be ignored.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2014-09-29 15:24:58 +02:00
David Kupka
cd9a4cca1f Do not require description in UI.
Description attribute is not required in LDAP schema so there is no reason to
require it in UI. Modified tests to reflect this change.

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

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-09-29 12:53:43 +02:00
Martin Basti
bc2eaa1456 DNS tests: tests update to due to change in options
Affected options --name-server, --ip-address

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2014-09-25 16:38:02 +02:00
Martin Basti
94743a3f26 DNS test: allow '.' as zone name
https://fedorahosted.org/freeipa/ticket/4149

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2014-09-25 16:38:02 +02:00
Petr Viktorin
f3b1471af9 test_permission_plugin: Check legacy permissions
Currently a number of v2 permissions are in $SUFFIX, which the original
test did not anticipate.

Properly check that legacy permissions are found.

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-09-25 13:21:28 +02:00
Tomas Babej
1f8f762b84 ipalib: host_del: Extend LDAPDelete's takes_options instead of overriding
The host-del command did not accept --continue option, since the
takes_options was overriden and did not take the options from LDAPDelete.

Fix the behaviour.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2014-09-17 09:36:27 +02:00
Petr Viktorin
6ce44c4f05 permission plugin: Auto-add operational atttributes to read permissions
The attributes entryusn, createtimestamp, and modifytimestamp
should be readable whenever thir entry is, i.e. when we allow reading
the objectclass.
Automatically add them to every read permission that includes objectclass.

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

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-09-12 18:22:17 +02:00
Martin Basti
028b3d1009 Tests: DNS wildcard records
Ticket: https://fedorahosted.org/freeipa/ticket/4488
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2014-09-05 12:29:29 +02:00
Martin Basti
7e76bba512 Fix DNS record rename test
bind-dyndb-ldap's bug caused test failure
https://fedorahosted.org/bind-dyndb-ldap/ticket/123

Owners with NS record works with the bug

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-09-05 12:11:39 +02:00
Martin Basti
2b3be21b25 Test: DNS NS validation
Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-09-05 12:11:39 +02:00