<feed xmlns='http://www.w3.org/2005/Atom'>
<title>freeipa.git/tests/test_ipalib, branch adwork</title>
<subtitle>FreeIPA project</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/abbra/public_git/freeipa.git/'/>
<entry>
<title>Fail on unknown Command options</title>
<updated>2012-06-20T13:18:42+00:00</updated>
<author>
<name>Petr Viktorin</name>
<email>pviktori@redhat.com</email>
</author>
<published>2012-04-17T16:42:35+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/abbra/public_git/freeipa.git/commit/?id=1235dfa7bf4b249eb6da8eab8d8a2c7b0eef98db'/>
<id>1235dfa7bf4b249eb6da8eab8d8a2c7b0eef98db</id>
<content type='text'>
When unknown keyword arguments are passed to a Command, raise an
error instead of ignoring them.

Options used when IPA calls its commands internally are listed
in a new Command attribute called internal_options, and allowed.

Previous patches (0b01751c, c45174d6, c5689e7f) made IPA not use
unknown keyword arguments in its own commands and tests, but since
that some violations were reintroduced in permission_find and tests.
Fix those.

Tests included; both a frontend unittest and a XML-RPC test via the
ping plugin (which was untested previously).

https://fedorahosted.org/freeipa/ticket/2509
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When unknown keyword arguments are passed to a Command, raise an
error instead of ignoring them.

Options used when IPA calls its commands internally are listed
in a new Command attribute called internal_options, and allowed.

Previous patches (0b01751c, c45174d6, c5689e7f) made IPA not use
unknown keyword arguments in its own commands and tests, but since
that some violations were reintroduced in permission_find and tests.
Fix those.

Tests included; both a frontend unittest and a XML-RPC test via the
ping plugin (which was untested previously).

https://fedorahosted.org/freeipa/ticket/2509
</pre>
</div>
</content>
</entry>
<entry>
<title>Decimal parameter conversion and normalization</title>
<updated>2012-06-18T01:59:54+00:00</updated>
<author>
<name>Martin Kosek</name>
<email>mkosek@redhat.com</email>
</author>
<published>2012-06-07T07:25:19+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/abbra/public_git/freeipa.git/commit/?id=1484ccc4049dc42a5a8a71713253894ade401573'/>
<id>1484ccc4049dc42a5a8a71713253894ade401573</id>
<content type='text'>
Parameter Decimal does not have a sufficient value checks. Some values
cause Decimal parameter with a custom precision to crash with
an unhandled exception.

Improve parameter conversion and normalization operations to handle
decimal exceptions more gracefully. Decimal parameter now also has
new attributes enabling 2 new validation/normalization methods:
 * exponential: when False, decimal number is normalized to its
                non-exponential form
 * numberclass: a set of allowed decimal number classes
                (e.g. +Infinity, -Normal, ...) that are enforced
                for every Decimal parameter value

https://fedorahosted.org/freeipa/ticket/2705
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Parameter Decimal does not have a sufficient value checks. Some values
cause Decimal parameter with a custom precision to crash with
an unhandled exception.

Improve parameter conversion and normalization operations to handle
decimal exceptions more gracefully. Decimal parameter now also has
new attributes enabling 2 new validation/normalization methods:
 * exponential: when False, decimal number is normalized to its
                non-exponential form
 * numberclass: a set of allowed decimal number classes
                (e.g. +Infinity, -Normal, ...) that are enforced
                for every Decimal parameter value

https://fedorahosted.org/freeipa/ticket/2705
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove duplicate and unused utility code</title>
<updated>2012-05-09T09:54:20+00:00</updated>
<author>
<name>Petr Viktorin</name>
<email>pviktori@redhat.com</email>
</author>
<published>2012-04-18T15:22:35+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/abbra/public_git/freeipa.git/commit/?id=f19218f7d87f5847d51f79b5d2850f90b0ae8407'/>
<id>f19218f7d87f5847d51f79b5d2850f90b0ae8407</id>
<content type='text'>
IPA has some unused code from abandoned features (Radius, ipa 1.x user
input, commant-line tab completion), as well as some duplicate utilities.
This patch cleans up the utility modules.

Duplicate code consolidated into ipapython.ipautil:
    {ipalib.util,ipaserver.ipautil,ipapython.ipautil}.realm_to_suffix
    {ipaserver,ipapython}.ipautil.CIDict
            (with style improvements from the ipaserver version)
    {ipapython.entity,ipaserver.ipautil}.utf8_encode_value
    {ipapython.entity,ipaserver.ipautil}.utf8_encode_values

ipalib.util.get_fqdn was removed in favor of the same function in
ipaserver.install.installutils

Removed unused code:
    ipalib.util:
        load_plugins_in_dir
        import_plugins_subpackage
        make_repr (was imported but unused; also removed from tests)

    ipapython.ipautil:
        format_list
        parse_key_value_pairs
        read_pairs_file
        read_items_file
        user_input_plain
        AttributeValueCompleter
        ItemCompleter

    ipaserver.ipautil:
        get_gsserror (a different version exists in ipapython.ipautil)

ipaserver.ipautil ended up empty and is removed entirely.

https://fedorahosted.org/freeipa/ticket/2650
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
IPA has some unused code from abandoned features (Radius, ipa 1.x user
input, commant-line tab completion), as well as some duplicate utilities.
This patch cleans up the utility modules.

Duplicate code consolidated into ipapython.ipautil:
    {ipalib.util,ipaserver.ipautil,ipapython.ipautil}.realm_to_suffix
    {ipaserver,ipapython}.ipautil.CIDict
            (with style improvements from the ipaserver version)
    {ipapython.entity,ipaserver.ipautil}.utf8_encode_value
    {ipapython.entity,ipaserver.ipautil}.utf8_encode_values

ipalib.util.get_fqdn was removed in favor of the same function in
ipaserver.install.installutils

Removed unused code:
    ipalib.util:
        load_plugins_in_dir
        import_plugins_subpackage
        make_repr (was imported but unused; also removed from tests)

    ipapython.ipautil:
        format_list
        parse_key_value_pairs
        read_pairs_file
        read_items_file
        user_input_plain
        AttributeValueCompleter
        ItemCompleter

    ipaserver.ipautil:
        get_gsserror (a different version exists in ipapython.ipautil)

ipaserver.ipautil ended up empty and is removed entirely.

https://fedorahosted.org/freeipa/ticket/2650
</pre>
</div>
</content>
</entry>
<entry>
<title>Redo boolean value encoding.</title>
<updated>2012-05-09T07:43:35+00:00</updated>
<author>
<name>Jan Cholasta</name>
<email>jcholast@redhat.com</email>
</author>
<published>2012-05-04T14:34:00+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/abbra/public_git/freeipa.git/commit/?id=d9d196798945bef7a955acb8b71820800455be17'/>
<id>d9d196798945bef7a955acb8b71820800455be17</id>
<content type='text'>
Move the code for encoding boolean values to LDAP boolean syntax from the
Parameter class to the Encoder class, where the rest of LDAP encoding takes
place. Remove encoding code from the Parameter class altogether, as all LDAP
encoding should be done in the Encoder class.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the code for encoding boolean values to LDAP boolean syntax from the
Parameter class to the Encoder class, where the rest of LDAP encoding takes
place. Remove encoding code from the Parameter class altogether, as all LDAP
encoding should be done in the Encoder class.
</pre>
</div>
</content>
</entry>
<entry>
<title>text unit test should validate using installed mo file</title>
<updated>2012-04-10T22:11:48+00:00</updated>
<author>
<name>John Dennis</name>
<email>jdennis@redhat.com</email>
</author>
<published>2012-03-27T02:26:35+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/abbra/public_git/freeipa.git/commit/?id=689bea65757bae66b387acde3ffc7897e6b0ec3b'/>
<id>689bea65757bae66b387acde3ffc7897e6b0ec3b</id>
<content type='text'>
We use custom gettext classes (e.g. GettextFactory &amp;
NGettextFactory). We should exercise those classes with an installed
binary mo file to demonstrate we are actually returning the expected
translated strings for all strings defined as being translatable.

The test logic in install/po/test_i18n.py was recently enhanced to
make this type of testing easier and more complete.
tests/test_ipalib/test_text.py should import the new i18n test support
and run it.

Previously tests/test_ipalib/test_text.py made a feeble but incomplete
attempt to do the above but even that was often not run because the
test would skip because the necessary test files were not available
unless they had been manually created in the install/po subdir. It is
now possible to correct those deficiencies in the test.

This patch does the following:

* Moves the location of i18n test code and adjust references to it.
  install/po/test_i18n.py was moved to tests/i18n.py. This permits
  tests/test_ipalib/test_text.py to import the i18n test utilities
  in a clean fashion. The Makefile in install/po now calls this
  same file.

* Modfies test function in test_i18n.py to accept function pointers
  for retreiving a translation.

* Imports test_i18n.py from the install/po directory in the tree

* Creates a tmp directory for the test localedir

* Parses the current ipa.pot file in install/po and generates
  a test po and mo file with special unicode markers. It installs
  the test mo file in the tmp localedir. This is accomplished by
  calling create_po() from the test_i18n.py file.

* If any of the above does not work it raises nose.SkipTest with
  the reason, and skips the test.

* It sets up functions to get a translation and a plural translation
  via our text.GettextFactory class and text.NGettextFactory class
  respectively. This are the functions we use intenally to get
  translations. It set the localdir and lang which are used by those
  classes to match our test configuration. It then runs a validation
  test on every translation and it's plural found in the test.po file
  by calling po_file_iterate and passed it the function pointers to
  our internal routines.

* At the conclusion of the test it cleans up after itself.

Note: extraneous files are not created in the tree, only a tmp
directory is utilized.

Validating msgid's in C code was insufficient.

* Make the discovery of format conversions much more robust by authoring
  a new function parse_printf_fmt() that is able to discover each
  format conversion in a string and break it into it's individual
  subparts. One of those subparts is the argument selector index. In c
  code we need to know if the argumenet selector index is present to
  know if translator can reorder the substitution strings.

  This replaces the simplistic python_anonymous_substitutions_regexp
  which was insufficient to deal with other programming languages
  (e.g. c).

* Add get_prog_langs() function to return the set of programming
  languages a msgid appears in. This is necessar because the msdid
  validation is programming language specific.

https://fedorahosted.org/freeipa/ticket/2582
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We use custom gettext classes (e.g. GettextFactory &amp;
NGettextFactory). We should exercise those classes with an installed
binary mo file to demonstrate we are actually returning the expected
translated strings for all strings defined as being translatable.

The test logic in install/po/test_i18n.py was recently enhanced to
make this type of testing easier and more complete.
tests/test_ipalib/test_text.py should import the new i18n test support
and run it.

Previously tests/test_ipalib/test_text.py made a feeble but incomplete
attempt to do the above but even that was often not run because the
test would skip because the necessary test files were not available
unless they had been manually created in the install/po subdir. It is
now possible to correct those deficiencies in the test.

This patch does the following:

* Moves the location of i18n test code and adjust references to it.
  install/po/test_i18n.py was moved to tests/i18n.py. This permits
  tests/test_ipalib/test_text.py to import the i18n test utilities
  in a clean fashion. The Makefile in install/po now calls this
  same file.

* Modfies test function in test_i18n.py to accept function pointers
  for retreiving a translation.

* Imports test_i18n.py from the install/po directory in the tree

* Creates a tmp directory for the test localedir

* Parses the current ipa.pot file in install/po and generates
  a test po and mo file with special unicode markers. It installs
  the test mo file in the tmp localedir. This is accomplished by
  calling create_po() from the test_i18n.py file.

* If any of the above does not work it raises nose.SkipTest with
  the reason, and skips the test.

* It sets up functions to get a translation and a plural translation
  via our text.GettextFactory class and text.NGettextFactory class
  respectively. This are the functions we use intenally to get
  translations. It set the localdir and lang which are used by those
  classes to match our test configuration. It then runs a validation
  test on every translation and it's plural found in the test.po file
  by calling po_file_iterate and passed it the function pointers to
  our internal routines.

* At the conclusion of the test it cleans up after itself.

Note: extraneous files are not created in the tree, only a tmp
directory is utilized.

Validating msgid's in C code was insufficient.

* Make the discovery of format conversions much more robust by authoring
  a new function parse_printf_fmt() that is able to discover each
  format conversion in a string and break it into it's individual
  subparts. One of those subparts is the argument selector index. In c
  code we need to know if the argumenet selector index is present to
  know if translator can reorder the substitution strings.

  This replaces the simplistic python_anonymous_substitutions_regexp
  which was insufficient to deal with other programming languages
  (e.g. c).

* Add get_prog_langs() function to return the set of programming
  languages a msgid appears in. This is necessar because the msdid
  validation is programming language specific.

https://fedorahosted.org/freeipa/ticket/2582
</pre>
</div>
</content>
</entry>
<entry>
<title>Change parameters to use only default_from for dynamic default values.</title>
<updated>2012-03-28T12:04:31+00:00</updated>
<author>
<name>Jan Cholasta</name>
<email>jcholast@redhat.com</email>
</author>
<published>2012-03-15T08:32:37+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/abbra/public_git/freeipa.git/commit/?id=a2299070c86ae049fb5702a72567a820fe6eaa28'/>
<id>a2299070c86ae049fb5702a72567a820fe6eaa28</id>
<content type='text'>
Replace all occurences of create_default with equivalent default_from
and remove create_default from the framework. This is needed for
proper parameter validation, as there is no way to tell which
parameters to validate prior to calling create_default, because
create_default does not provide information about which parameters are
used for generating the default value.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace all occurences of create_default with equivalent default_from
and remove create_default from the framework. This is needed for
proper parameter validation, as there is no way to tell which
parameters to validate prior to calling create_default, because
create_default does not provide information about which parameters are
used for generating the default value.
</pre>
</div>
</content>
</entry>
<entry>
<title>Only split CSV in the client, quote instead of escaping</title>
<updated>2012-03-21T00:03:54+00:00</updated>
<author>
<name>Petr Viktorin</name>
<email>pviktori@redhat.com</email>
</author>
<published>2012-02-23T12:29:47+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/abbra/public_git/freeipa.git/commit/?id=dddebe23507749486fb09d219f0da4f483ba4e79'/>
<id>dddebe23507749486fb09d219f0da4f483ba4e79</id>
<content type='text'>
Splitting on commas is not an idempotent operation:
'a,b\,c' -&gt; ('a', 'b,c') -&gt; ('a', 'b', 'c')

That means we can't do it when the call is forwarded, so this is only
done on the CLI. The UI already sends values as a tuple.

Replace escaping in the csv parser with quoting. Quoted strings can have
embedded commas instead of having to escape them. This prevents the csv
parser from eating all escape characters.

Also, document Param's csv arguments, and update tests.

https://fedorahosted.org/freeipa/ticket/2417
https://fedorahosted.org/freeipa/ticket/2227
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Splitting on commas is not an idempotent operation:
'a,b\,c' -&gt; ('a', 'b,c') -&gt; ('a', 'b', 'c')

That means we can't do it when the call is forwarded, so this is only
done on the CLI. The UI already sends values as a tuple.

Replace escaping in the csv parser with quoting. Quoted strings can have
embedded commas instead of having to escape them. This prevents the csv
parser from eating all escape characters.

Also, document Param's csv arguments, and update tests.

https://fedorahosted.org/freeipa/ticket/2417
https://fedorahosted.org/freeipa/ticket/2227
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace float with Decimal</title>
<updated>2012-01-20T07:13:44+00:00</updated>
<author>
<name>Martin Kosek</name>
<email>mkosek@redhat.com</email>
</author>
<published>2012-01-17T10:19:00+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/abbra/public_git/freeipa.git/commit/?id=092dd8db1293599a4b7f0ab33ea43e8082ec554f'/>
<id>092dd8db1293599a4b7f0ab33ea43e8082ec554f</id>
<content type='text'>
Having float type as a base type for floating point parameters in
ipalib introduces several issues, e.g. problem with representation
or value comparison. Python language provides a Decimal type which
help overcome these issues.

This patch replaces a float type and Float parameter with a
decimal.Decimal type in Decimal parameter. A precision attribute
was added to Decimal parameter that can be used to limit a number
of decimal places in parameter representation. This approach fixes
a problem with API.txt validation where comparison of float values
may fail on different architectures due to float representation error.

In order to safely transfer the parameter value over RPC it is
being converted to string which is then converted back to
decimal.Decimal number on a server side.

https://fedorahosted.org/freeipa/ticket/2260
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Having float type as a base type for floating point parameters in
ipalib introduces several issues, e.g. problem with representation
or value comparison. Python language provides a Decimal type which
help overcome these issues.

This patch replaces a float type and Float parameter with a
decimal.Decimal type in Decimal parameter. A precision attribute
was added to Decimal parameter that can be used to limit a number
of decimal places in parameter representation. This approach fixes
a problem with API.txt validation where comparison of float values
may fail on different architectures due to float representation error.

In order to safely transfer the parameter value over RPC it is
being converted to string which is then converted back to
decimal.Decimal number on a server side.

https://fedorahosted.org/freeipa/ticket/2260
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix attempted write to attribute of read-only object.</title>
<updated>2012-01-02T08:51:26+00:00</updated>
<author>
<name>Jan Cholasta</name>
<email>jcholast@redhat.com</email>
</author>
<published>2011-11-01T12:58:05+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/abbra/public_git/freeipa.git/commit/?id=9beb467d98cb16e09fcda5ebbeb27056dfff3a2d'/>
<id>9beb467d98cb16e09fcda5ebbeb27056dfff3a2d</id>
<content type='text'>
Add new class "cachedproperty" for creating property-like attributes
that cache the return value of a method call.

Also fix few issues in the unit tests to enable them to succeed.

ticket 1959
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add new class "cachedproperty" for creating property-like attributes
that cache the return value of a method call.

Also fix few issues in the unit tests to enable them to succeed.

ticket 1959
</pre>
</div>
</content>
</entry>
<entry>
<title>Parse comma-separated lists of values in all parameter types. This can be enabled for a specific parameter by setting the "csv" option to True.</title>
<updated>2011-11-30T16:08:35+00:00</updated>
<author>
<name>Jan Cholasta</name>
<email>jcholast@redhat.com</email>
</author>
<published>2011-11-21T15:50:27+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/abbra/public_git/freeipa.git/commit/?id=135ccf89de866ea2cdda96993ed2743394e1e716'/>
<id>135ccf89de866ea2cdda96993ed2743394e1e716</id>
<content type='text'>
Remove "List" parameter type and replace all occurences of it with appropriate
multi-valued parameter ("Str" in most cases) with csv enabled.

Add new parameter type "Any", capable of holding values of any type. This is
needed by the "batch" command, as "Str" is not suitable type for the "methods"
parameter.

ticket 2007
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove "List" parameter type and replace all occurences of it with appropriate
multi-valued parameter ("Str" in most cases) with csv enabled.

Add new parameter type "Any", capable of holding values of any type. This is
needed by the "batch" command, as "Str" is not suitable type for the "methods"
parameter.

ticket 2007
</pre>
</div>
</content>
</entry>
</feed>
