freeipa/ipatests
Alexander Bokovoy 6c5f2bcb30 ipaldap: fix conversion from boolean OID to Python
In IPA framework we don't properly convert to Python bool type and just
return a string (TRUE or FALSE). This can be seen with many boolean
attributes, like

        Bool('idnsallowdynupdate?',
            cli_name='dynamic_update',
            label=_('Dynamic update'),
            doc=_('Allow dynamic updates.'),
            attribute=True,
            default=False,
            autofill=True
        ),

in 'ipa dnszone-show':

> > > api.Command.dnszone_show('ipa.test')['result']['idnsallowdynupdate']
['TRUE']

This is because we don't have the reverse (from LDAP to Python) mapping
for the LDAP boolean OID 1.3.6.1.4.1.1466.115.121.1.7.

When Web UI asks for the entry, it gets back JSON output that contains
this 'TRUE' value:

            "idnsallowdynupdate": [
                "TRUE"
            ],

Add proper mapping from LDAP to Python bool type. With this, a simple
'checkbox' type can be used in Web UI instead of a complex radio-box
setup.

Note that when IPA API is asked to return raw values, 'TRUE' and 'FALSE'
still returned. These are the actual LDAP boolean attribute values. Care
needs to be done in tests:

 - if output is from a command with --raw option, 'TRUE' or 'FALSE'
   should be expected

 - if output if from a normal (non-raw) command, True or False would be
   returned

Fixes: https://pagure.io/freeipa/issue/9171

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2022-06-10 09:25:27 +02:00
..
azure js tests: use latest grunt 2022-05-05 15:04:28 +03:00
man Simplify ipa-run-tests script 2019-07-16 13:23:21 +03:00
prci_definitions Add tests for Random Serial Number v3 support 2022-06-09 08:35:15 +02:00
pytest_ipa Add tests for Random Serial Number v3 support 2022-06-09 08:35:15 +02:00
test_cmdline Make the schema cache TTL user-configurable 2021-11-03 10:59:10 +01:00
test_custodia pylint: Fix useless-suppression 2022-03-11 13:37:08 -05:00
test_install Unify access to FQDN 2020-10-26 17:11:19 +11:00
test_integration ipaldap: fix conversion from boolean OID to Python 2022-06-10 09:25:27 +02:00
test_ipaclient Remove support for csrgen 2021-01-21 13:51:45 +01:00
test_ipalib Add a new parameter type, SerialNumber, as a subclass of Str 2022-06-09 08:35:15 +02:00
test_ipaplatform ipatests/test_ipaplatform: Skip test_ipa_version on Debian 2021-11-25 21:02:56 -05:00
test_ipapython pylint: Fix useless-suppression 2022-03-11 13:37:08 -05:00
test_ipaserver pylint: Fix useless-suppression 2022-03-11 13:37:08 -05:00
test_ipatests_plugins ipatests: Don't turn Pytest IPA deprecation warnings into errors 2020-07-29 15:10:00 -04:00
test_webui external-idp: add XMLRPC tests for External IdP objects and idp indicator 2022-05-10 15:52:41 +03:00
test_xmlrpc ipaldap: fix conversion from boolean OID to Python 2022-06-10 09:25:27 +02:00
__init__.py Make an ipa-tests package 2013-06-17 19:22:50 +02:00
conftest.py pylint: Fix useless-suppression 2022-03-11 13:37:08 -05:00
create_external_ca.py Test external CA with DNS name constraints 2019-08-06 12:39:46 +02:00
data.py Fix more bytes/unicode issues 2015-10-22 18:34:46 +02:00
i18n.py pylint: Fix useless-suppression 2022-03-11 13:37:08 -05:00
ipa-run-tests ipatests: Specify shell implementation 2020-04-21 13:24:50 +02:00
ipa-test-config Rename pytest_plugins to ipatests.pytest_ipa 2018-08-02 17:07:43 +02:00
ipa-test-task ipatests: Fetch sudo rules without time offset 2021-06-03 09:21:45 +03:00
Makefile.am Build: fix distribution of static files for web UI 2016-11-09 13:08:32 +01:00
setup.cfg Port all setup.py to setuptools 2016-10-20 18:43:37 +02:00
setup.py Add Custodia tests 2021-06-16 10:28:17 -04:00
test_util.py pylint: Skip unused-private-member for property case 2022-03-11 13:37:08 -05:00
util.py pylint: Drop no longer used __home 2022-03-11 13:37:08 -05:00