summaryrefslogtreecommitdiff
path: root/lib/ldb/tests/python
AgeCommit message (Collapse)AuthorFilesLines
2017-09-22ldb: Add an unused objectGUID to each record in SearchTestsAndrew Bartlett1-25/+56
This will then be used by the GUID index tests. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-08-30ldb: Add tests for indexed and unindexed search expressionsAndrew Bartlett1-0/+299
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Aug 30 14:58:32 CEST 2017 on sn-devel-144
2017-08-30ldb: Fix tests to call the parent tearDown(), not setUp in tearDownAndrew Bartlett1-2/+2
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2017-07-02ldb:tests: Extend api.py testsuite to show transaction_commit() blocks ↵Andrew Bartlett1-10/+8
against the whole-db read lock The new ldb whole-db lock behaviour now allows this test Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-07-02ldb:tests: Extend api.py testsuite to show transaction contents can not be ↵Andrew Bartlett1-0/+66
seen outside the transaction Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-05-06ldb: Do not use mktemp() nor leak files into /tmp during api.py testAndrew Bartlett1-69/+96
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-05-06ldb: Add some tests to clarify the current iterator behaviourAndrew Bartlett1-6/+109
search_iterator() is no more memory efficient than search() because all the results come back at the first res.next() call Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-02-17pyldb: eliminate warnings from python api testMichael Adam1-4/+4
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-02-17pyldb: add api tests for search_iterator()Stefan Metzmacher1-0/+100
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-12-04ldb: Fix bug triggered by having an empty message in database during search.Adrian Cochrane1-4/+25
Previously if the message had 0 elements, Talloc would reallocate the projected array to NULL, fooling LDB into thinking that it failed to reallocate. This fix corrects LDB to be able to handle the case where the message has no attributes in common with the filter. Also the realloc call resized the array to the number of elements in the message, not the number of elements in common with the filter -- it essentially did nothing. Unlike talloc_realloc, talloc_array always returns a non-null pointer. This would help protect against possible errors. Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-11-05pyldb: Improve test coveragePetr Viktorin1-0/+82
Add tests for: - ldb.Dn.{get,set}_{extended_,}component_{name,value} - ldb.Dn.{get,set}_rdn_{name,value} - ldb.Dn.get_casefold - ldb.Dn.get_linearized - ldb.Dn.canonical_str Add negative test for Dn.__contains__ Add a helper function to register a dummy DN extension for testing. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05pyldb: Prevent segfault when first module is NULLPetr Viktorin1-0/+9
Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05pyldb: Adapt tests to Python 3Petr Viktorin1-75/+330
Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05pyldb: Modernize test suitePetr Viktorin1-116/+116
This gets rid of deprecation warnings for the old method names. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05pyldb: Add Python 3 compatibility (except strings)Petr Viktorin1-7/+10
- Use a macro for adding constants to module (This also ensures that the Python constants have the same name as the C ones. One existing misspelling is retained.) - Use new module initialization for Python 3 - Use rich comparison for ldb objects - Prepare tests for Python 3 Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-10-26ldb: Fix python bindings to accept a string as a DNldb-1.1.22Andrew Bartlett1-0/+29
This fixes add_base(), add_child() and is_child_of(). This removes a toally incorrect cast of struct ldb_dn to struct ldb_context. A helper routine is used instead Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-03-04pyldb: Add tests for type errorsPetr Viktorin1-0/+42
Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Mar 4 01:49:02 CET 2015 on sn-devel-104
2014-11-25lib-ldb-test: Test copying message element from a message to a new messageKamen Mazdrashki1-0/+14
Change-Id: Iefcafb418a170ee410aec900bb36eb8e01e946b1 Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-07-06pyldb: Add bindings for ldb_dn_remove_base_componentsAndrew Bartlett1-0/+5
2012-07-06pyldb: Fix dn concat operation to be the other way aroundAndrew Bartlett1-1/+1
This now concatonates Dn(ldb, "cn=config") + Dn(ldb, "dc=samba,dc=org") as "cn=config,dc=samba,dc=org" Andrew Bartlett
2012-06-12ldb:tests: fix use of a non-existent word (existant)Michael Adam1-1/+1
2011-11-10ldb: Re-apply pyldb fixes from Tridge and Amity, using unittest ratherJelmer Vernooij1-33/+37
than samba.tests.
2011-11-10Revert "pyldb: fixed ldb API test"Jelmer Vernooij1-36/+39
This reverts commit 333248f08c83cc5b18f8e7e84cb19d79a8309d6e. This commit made the pyldb tests depend on the Samba testsuite.
2011-11-10pyldb: fixed ldb API testAndrew Tridgell1-39/+36
it was failing previously, but the failure wasn't being noticed
2011-07-29pyldb: added binary_encode() and binary_decode() methodsAndrew Tridgell1-0/+4
this gives access to RFC2254 encoding from python Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-07-21pyldb: use dn.is_child_of() instead of dn.compare_base()Andrew Tridgell1-5/+6
the compare_base() C API doesn't really fit well in python, as it returns 0 for true. Better to have a boolean function for the python interface. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-21pyldb: add unit test for ldbDn.compare_baseMatthieu Patou1-0/+11
2011-07-05ldb: make ldb a top level library for Samba 4.0Andrew Bartlett1-0/+748
Signed-off-by: Andrew Tridgell <tridge@samba.org>