summaryrefslogtreecommitdiff
path: root/source4/dsdb/tests/python/deletetest.py
AgeCommit message (Collapse)AuthorFilesLines
2023-08-30s4:dsdb:tests: Remove unused importsJoseph Sutton1-3/+3
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-04-28python: remove all 'from __future__ import print_function'Douglas Bagnall1-1/+0
This made Python 2's print behave like Python 3's print(). In some cases, where we had: from __future__ import print_function """Intended module documentation...""" this will have the side effect of making the intended module documentation work as the actual module documentation (i.e. becoming __doc__), because it is once again the first statement in the module. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-10-02python2 reduction: Merge remaining compat code into commonDavid Mulder1-1/+1
The remaining compat code (get_string, get_bytes, cmp) are useful helper routines which we should simply merge into common (especially since there is some duplication here). Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): David Mulder <dmulder@samba.org> Autobuild-Date(master): Fri Oct 2 14:49:36 UTC 2020 on sn-devel-184
2020-02-07pytests: heed assertEquals deprecation warning en-masseDouglas Bagnall1-25/+25
TestCase.assertEquals() is an alias for TestCase.assertEqual() and has been deprecated since Python 2.7. When we run our tests with in python developer mode (`PYTHONDEVMODE=1 make test`) we get 580 DeprecationWarnings about this. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2018-12-14PY3: change shebang to python3 in source4/dsdb dirJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2018-12-10s4/dsdb/tests/python: PY3 port samba4.deletetestNoel Power1-6/+7
Fix misc ldb.bytes needing to be stringified for tests to succeeed Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-08-24PEP8: fix E713: test for membership should be 'not in'Joe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E502: the backslash is redundant between bracketsJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E303: too many blank lines (2)Joe Guo1-2/+0
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E302: expected 2 blank lines, found 1Joe Guo1-0/+2
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E231: missing whitespace after ','Joe Guo1-2/+2
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E226: missing whitespace around arithmetic operatorJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E225: missing whitespace around operatorJoe Guo1-12/+12
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E202: whitespace before ')'Joe Guo1-6/+6
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E201: whitespace after '('Joe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E128: continuation line under-indented for visual indentJoe Guo1-12/+12
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E127: continuation line over-indented for visual indentJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-05-30selftest: Lock down the expected parents in BasicTreeDeleteTestsAndrew Bartlett1-4/+150
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13448 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-30selftest: Rework BasicDeleteTests.test_all() into setUp() and a testAndrew Bartlett1-75/+78
This will allow running multiple tests against the same tree. This tree is very similar to the tree produced by the KCC test that simply does a tree_delete, and I want to lock down the tree_delete behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13448 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-03-23s3/dsdb: convert print func to be py2/py3 compatibleNoel Power1-8/+9
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-02-28dsdb python tests: convert 'except X, (tuple)' to 'except X as e'Noel Power1-16/+32
In addition to converting the except line another line is also added for each except to extract the tuple contents. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-06-06selftest: Assert that name, the RDN attribute and actual RDN are in syncAndrew Bartlett1-1/+3
This allows us to catch such errors here, rather than just on dbcheck later Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz
2015-02-03s4-dsdb-tests: Move base tests for Tombstone reanimation in ↵Kamen Mazdrashki1-173/+0
tombstone_reanimation module So we have them all in one place. While moving, I have: * inherited from the base class for Tombstone reanimations * replace self.ldb with self.samdb Change-Id: Id3e4f02cc2e0877d736da812c14c91e2311203d2 Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-02-03s4-dsdb-test: Fix Undelete tests after subunit upgrade workKamen Mazdrashki1-31/+31
Change-Id: I4712a2a2163a57fde037511afcc1cb7bee05f12e Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-02-03s4-dsdb-test: Use case insensitive comparison for DNs in undelete testKamen Mazdrashki1-1/+1
Change-Id: I4a009bb7ed58ab857ac74a235bb5f580911f0d92 Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-02-03s4-dsdb-tests: Fix whitespace in deletetest.pyKamen Mazdrashki1-1/+1
Change-Id: Ic2924b0aa9cffd29fe0c857317ccb65ba53a1c21 Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-02-03s4-dsdb-tests: Make unique object names to test with in deletetestKamen Mazdrashki1-10/+18
This way we can re-run the test again and again Change-Id: I29bd878b77073d94a279c38bd0afc2f0befa6f9d Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-02-03s4-dsdb-tests: Remove unused method get_ldap_connection()Kamen Mazdrashki1-13/+0
Change-Id: Ie50f77dbba724dbd3c2822de5c2cfff41016fac6 Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-02-03s4-dsdb-tests: Remove trailing ';' in deletetest.pyKamen Mazdrashki1-2/+2
Change-Id: Ic1ad6bbda55be56cbf7ae78a8ad988b8e479a40c Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-02-03s4-dsdb-tests: Some tests for deleted objects undelete operationNadezhda Ivanova1-5/+198
Based on MS-ADTS 3.1.1.5.3.7.2 Signed-off-by: Nadezhda Ivanova <nivanova@symas.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Change-Id: I650b315601fce574f9302435f812d1dd4b177e68
2014-11-22deletetest: use samba.tests.subunitrun.Jelmer Vernooij1-60/+52
Change-Id: I13565c7c14ea186709ce1de9038ef840c5b766b8 Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2011-11-10test: fixed several tests to use samba.testsAndrew Tridgell1-1/+2
this fixes error checking. Test failures were not being detected otherwise Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-02-02s4-python Ensure we add the Samba python path first.Andrew Bartlett1-1/+1
This exact form of the construction is important, and we match on it in the installation scripts. Andrew Bartlett
2010-12-15s4-dsdb/tests/python: Explicitly pass comamnd line LoadParm() instance to ↵Kamen Mazdrashki1-1/+1
system_session() Otherwise system_session() creates a LoadParm() instance which resets certain global parameters to their defaults from smb.conf ("log level" for instance) Autobuild-User: Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date: Wed Dec 15 15:10:47 CET 2010 on sn-devel-104
2010-11-25s4-tests: Modified deletetest.py to use samba.tests.delete_forceNadezhda Ivanova1-18/+14
2010-11-19s4:dsdb tests - use even more already defined pyldb functions to retrieve NCsMatthias Dieter Wallnöfer1-7/+1
2010-11-18s4:dsdb python tests - use "ldb.domain_dn"Matthias Dieter Wallnöfer1-9/+3
By inspiration of Nadya's patches
2010-11-03pydsdb: Import testtools before subunit for those that don't haveJelmer Vernooij1-1/+1
testtools installed. Also, cleanup some imports. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Wed Nov 3 17:47:55 UTC 2010 on sn-devel-104
2010-10-16s4:objectclass LDB module - implement the "isCriticalSystemObject" subtree ↵Matthias Dieter Wallnöfer1-2/+11
delete protection MS-ADTS 3.1.1.5.5.7.2 Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Sat Oct 16 11:24:09 UTC 2010 on sn-devel-104
2010-10-03s4:deletetest.py - enhance the testsMatthias Dieter Wallnöfer1-21/+216
- Integrate the ldap.py delete protection testing code and enhance it - Demonstrate the DISALLOW_MOVE_ON_DELETE system flag Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-30s4:dsdb: move dsdb python tests from lib/ldb/ to dsdb/Stefan Metzmacher1-0/+201
metze