summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib
Commit message (Collapse)AuthorAgeFilesLines
* ticket 1600 - convert unittests to use DN objectsJohn Dennis2011-08-161-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a larger goal of replacing all DN creation via string formatting/concatenation with DN object operations because string operations are not a safe way to form a DN nor to compare a DN. This work needs to be broken into smaller chunks for easier review and testing. Addressing the unit tests first makes sense because we don't want to be modifying both the core code and the tests used to verify the core code simultaneously. If we modify the unittests first with existing core code and no regressions are found then we can move on to modifying parts of the core code with the belief the unittests can validate the changes in the core code. Also by doing the unittests first we also help to validate the DN objects are working correctly (although they do have an extensive unittest). The fundamental changes are: * replace string substitution & concatenation with DN object constructor * when comparing dn's the comparision is done after promotion to a DN object, then two DN objects are compared * when a list of string dn's are to be compared a new list is formed where each string dn is replaced by a DN object * because the unittest framework accepts a complex data structure of expected values where dn's are represeted as strings the unittest needs to express the expected value of a dn as a callable object (e.g. a lambda expression) which promotes the dn string to a DN object in order to do the comparision.
* ticket 1569 - Test DN object non-latin Unicode supportJohn Dennis2011-08-161-0/+94
| | | | | | | | | | | | | | | | | | | | | The DN unittest was lacking a test for i18n. The unittest was updated to store "Hello" in Arabic with both utf-8 and unicode and verify the values could be properly retrieved and converted to dn string syntax. During the testing a few problems were discovered and corrected. * passing in utf-8 caused an ASCII decode error becuase of Python's silly default encoding of ASCII. The fix was to explictly use the utf-8 codec. * there were a couple of places where encode/decode were not called correctly. * the internal attr and value members of the AVA class were renamed to explicitly show they are stored as unicode. Of course the unittest was updated as well.
* ticket 1568 - DN objects should support the insert methodJohn Dennis2011-08-161-0/+9
| | | | Add dn.insert() and update unittest
* Fix message in test case for checking minimum valuesRob Crittenden2011-07-281-1/+1
|
* Make AVA, RDN & DN comparison case insensitive. No need for lowercase ↵John Dennis2011-07-271-37/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | normalization. Replace deepcopy with constructor (i.e. type call) Can now "clone" with configuration changes by passing object of the same type to it's constructor, e.g. dn1 = DN(('cn', 'foo')) dn2 = DN(dn1) dn2 = DN(dn1, first_key_match=False) Remove pairwise grouping for RDN's. Had previously removed it for DN's, left it in for RDN's because it seemed to make sense because of the way RDN's work but consistency is a higher goal. Add keyword constructor parameters to pass configuration options. Make first_key_match a configuration keyword. Updated documentation. Updated unit test. FWIW, I noticed the unittest is now running 2x faster, not sure why, removal of deepcopy? Anyway, hard to argue with performance doubling.
* Ticket 1485 - DN pairwise groupingJohn Dennis2011-07-211-68/+116
| | | | | | | | | | | | | | | | | | | | | The pairwise grouping used to form RDN's and AVA's proved to be confusing in practice, this patch removes that functionality thus requiring programmers to explicitly pair attr,value using a tuple or list. In addition it was discovered additional functionality was needed to support some DN operations in freeipa. DN objects now support startswith(), endswith() and the "in" membership test. These functions and operators will accept either a DN or RDN. The unittest was modified to remove the pairwise tests and add new explicit tests. The unittest was augmented to test the new functionality. In addition the unittest was cleaned up a bit to use common utilty functions for improved readabilty and robustness. The documentation was updated. fix test_role_plugin use of DN to avoid pairwise grouping
* Set a default minimum value for class Int, handle long values better.Rob Crittenden2011-07-191-3/+3
| | | | | | | Allow a long to get as far as the min/max constraints where we can compare it to min/max int values and reject with a proper error message. https://fedorahosted.org/freeipa/ticket/1494
* Add ability to specify DNS reverse zone name by IP network address.Jan Cholasta2011-07-151-0/+27
| | | | | | | In order for this to work, chaining of parameters through default_from is made possible. ticket 1474
* Let the framework be able to override the hostname.Rob Crittenden2011-06-231-1/+0
| | | | | | | | | | | | | | | | | | The hostname is passed in during the server installation. We should use this hostname for the resulting server as well. It was being discarded and we always used the system hostname value. Important changes: - configure ipa_hostname in sssd on masters - set PKI_HOSTNAME so the hostname is passed to dogtag installer - set the hostname when doing ldapi binds This also reorders some things in the dogtag installer to eliminate an unnecessary restart. We were restarting the service twice in a row with very little time in between and this could result in a slew of reported errors, though the server installed ok. ticket 1052
* Module for DN objects plus unit testJohn Dennis2011-06-221-0/+919
|
* Final i18n unit test fixes.Pavel Zuna2011-03-011-6/+6
|
* Fix i18n related failures in unit tests.Pavel Zuna2011-03-015-57/+29
|
* Remove deprecated i18n code from ipalib/request and all references to it.Pavel Zuna2011-03-011-161/+0
| | | | Ticket #903
* Convert json strings to unicode when they are unmarshalled.Rob Crittenden2011-02-111-1/+1
| | | | | | | | | This patch removes some individual work-arounds of converting strings to unicode, they only masked the problem. String values are not passed to the validator or normalizers so things like adding the realm automatically to services weren't happening. ticket 941
* Fix test failures caused by the performance patch.Rob Crittenden2011-02-101-0/+2
| | | | | | It isn't safe to assume there is an environment or mode in any given object. Only skip the extra work if the object explicitly has production in it.
* Fix failed tests. API for utcoffset changed and strings are more robust.Rob Crittenden2011-01-241-3/+4
| | | | | | | In Python 2.7 the API for time.utcoffset() changed. We do more automatic conversions of strings so need to loosen the tests a bit.
* Add API version and have server reject incompatible clients.Rob Crittenden2011-01-142-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | This patch contains 2 parts. The first part is a small utility to create and validate the current API. To do this it needs to load ipalib which on a fresh system introduces a few problems, namely that it relies on a python plugin to set the default encoding to utf8. For our purposes we can skip that. It is also important that any optional plugins be loadable so the API can be examined. The second part is a version exchange between the client and server. The version has a major and a minor version. The major verion is updated whenever existing API changes. The minor version is updated when new API is added. A request will be rejected if either the major versions don't match or if the client major version is higher than then server major version (though by implication new API would return a command not found if allowed to proceed). To determine the API version of the server from a client use the ping command. ticket 584
* Change FreeIPA license to GPLv3+Jakub Hrozek2010-12-2017-85/+85
| | | | | | | | | | The changes include: * Change license blobs in source files to mention GPLv3+ not GPLv2 only * Add GPLv3+ license text * Package COPYING not LICENSE as the license blobs (even the old ones) mention COPYING specifically, it is also more common, I think https://fedorahosted.org/freeipa/ticket/239
* Allow RDN changes from CLIJakub Hrozek2010-12-201-0/+28
| | | | https://fedorahosted.org/freeipa/ticket/397
* Add new parameter type IA5Str and use this to enforce the right charset.Rob Crittenden2010-12-071-0/+23
| | | | ticket 496
* Use context to decide which name to return on RequirementsErrorsRob Crittenden2010-10-282-11/+19
| | | | | | | | | | | | | | When a Requirement fails we throw an exception including the name of the field that is missing. To make the command-line friendlier we have a cli_name defined which may or may not match the LDAP attribute. This can be confusing if you are using ipalib directly because the attribute name missing may not match what is actually required (desc vs description is a good example). If you use the context 'cli' then it will throw exceptions using cli_name. If you use any other context it will use the name of the attribute. ticket 187
* Fix _merge_from_file testRob Crittenden2010-10-181-1/+1
|
* Add support for client failover to the ipa command-line.Rob Crittenden2010-08-161-1/+1
| | | | | | | | | | | | This adds a new global option to the ipa command, -f/--no-fallback. If this is included then just the server configured in /etc/ipa/default.conf is used. Otherwise that is tried first then all servers in DNS with the ldap SRV record are tried. Create a new Local() Command class for local-only commands. The help command is one of these. It shouldn't need a remote connection to execute. ticket #15
* Fix RPC tests. The method comes back as a unicode from xmlrpclib.Rob Crittenden2010-08-061-2/+2
|
* Skip the i18n test if the test language has not been builtRob Crittenden2010-08-061-0/+6
|
* Fix this test to work from source tree rootRob Crittenden2010-08-061-2/+2
| | | | | | | | It would work if you ran the test from its location in tests/test_ipalib but this isn't the most common method. If you want to run it individually you can do: $ ./make-test tests/test_ipalib/test_text.py
* Drop our own PKCS#10 ASN.1 decoder and use the one from python-nssRob Crittenden2010-07-291-6/+6
| | | | | | | | | | | | | | | This patch: - bumps up the minimum version of python-nss - will initialize NSS with nodb if a CSR is loaded and it isn't already init'd - will shutdown NSS if initialized in the RPC subsystem so we use right db - updated and added a few more tests Relying more on NSS introduces a bit of a problem. For NSS to work you need to have initialized a database (either a real one or no_db). But once you've initialized one and want to use another you have to close down the first one. I've added some code to nsslib.py to do just that. This could potentially have some bad side-effects at some point, it works ok now.
* Add some basic tests for ipalib/x509Rob Crittenden2010-07-291-0/+139
|
* Add weekly periodic schedule to AccessTime param type.root2010-05-041-3/+2
| | | | Fix bug #588414
* Add test cases for AccessTime param and fix some problems in AccessTimeRob Crittenden2010-05-031-0/+40
|
* Add gettext translation test using test language.John Dennis2010-04-161-0/+88
|
* XML-RPC signature changeJason Gerard DeRose2010-03-301-1/+1
|
* Finish deferred translation mechanismJason Gerard DeRose2010-03-161-11/+124
|
* localize doc stringsJohn Dennis2010-03-083-5/+6
| | | | | | | | | | | | A number of doc strings were not localized, wrap them in _(). Some messages were not localized, wrap them in _() Fix a couple of failing tests: The method name in RPC should not be unicode. The doc attribute must use the .msg attribute for comparison. Also clean up imports of _() The import should come from ipalib or ipalib.text, not ugettext from request.
* Fix unicode failures in Env tests and dn failures in XML-RPC testsRob Crittenden2010-02-261-19/+19
|
* Translatable Param.label, Param.docJason Gerard DeRose2010-02-241-3/+3
|
* Fix non XML-RPC testsJason Gerard DeRose2010-02-191-8/+13
|
* Add Object.label class attribute, enable in webUIJason Gerard DeRose2010-02-121-0/+19
|
* Allow one-character Param namesRob Crittenden2010-02-121-4/+0
| | | | This is done explicitly to support the l/localityname attribute.
* Command.output_params not contains params in Command.paramsJason Gerard DeRose2010-02-111-0/+27
|
* Add support for the 'no_create', 'no_update', and 'no_search' Param flagsJason Gerard DeRose2010-02-051-3/+5
|
* Remove __public__ and __proxy__ hold-overs from Plugin classJason Gerard DeRose2010-01-283-118/+0
|
* Fix backend.Executioner unit test.Pavel Zuna2010-01-131-6/+13
| | | | | | | | | | Before the patch that allows to create unshared instances of Connectible objects, all Connection object were deleted at once in destroy_context(). It made sense at the time, because there was always at most one Connection per Connectible subclass and Connectible.disconnect() was called only internally by the Executioner class. Now that we can make arbitrary connections, it makes more sense to delete the Connection object when Connectible.disconnect() is called.
* Take 2: Extensible return values and validation; steps toward a single ↵Jason Gerard DeRose2009-12-106-64/+553
| | | | output_for_cli(); enable more webUI stuff
* Reading INT parameter class should respect radix prefixJohn Dennis2009-11-231-0/+27
| | | | | | | | | | This modifies the original patch by including a unit test, handling floats when passed as unicode, and handling large magnitude values beyond maxint. The INT parameter class was not respecting any radix prefix (e.g. 0x) the user may have supplied. This patch implements _convert_scalar method for the Int class so that we can pass the special radix base of zero to the int constructor telling it to determine the radix from the prefix (if present).
* _convert_scalar() should throw an error if passed a tuple or listRob Crittenden2009-11-171-1/+7
| | | | | A parameter needs to have multivalue set in order to work on lists/tuples and even then _convert_scalar() will be sent one value at a time.
* Change Password param so (password, confirm_password) can be passed to ↵Jason Gerard DeRose2009-10-181-0/+11
| | | | _convert_scalar()
* Removed util.add_global_options() and frontend.ApplicationJason Gerard DeRose2009-10-141-37/+0
|
* Giant webui patch take 2Jason Gerard DeRose2009-10-131-0/+21
|
* Fix unit tests for plugins using baseldap classes.Pavel Zuna2009-10-053-143/+9
|