summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2018-05-23 17:31:03 +1200
committerAndrew Bartlett <abartlet@samba.org>2018-05-30 04:23:28 +0200
commit439072d1997cc94b63d269e2760d70c7b1855f2f (patch)
tree0ec63e178ee2f5790326d1125120504e81a47ae7 /python
parente99c199d811e607e7867e7b40d82a1642226c647 (diff)
downloadsamba-439072d1997cc94b63d269e2760d70c7b1855f2f.tar.gz
samba-439072d1997cc94b63d269e2760d70c7b1855f2f.tar.bz2
samba-439072d1997cc94b63d269e2760d70c7b1855f2f.zip
selftest: Add test to show that sam.ldb does not do a full scan in startup
We should add some other more complex operations here. 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>
Diffstat (limited to 'python')
-rw-r--r--python/samba/tests/dsdb.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/python/samba/tests/dsdb.py b/python/samba/tests/dsdb.py
index b3cf69772c0..1cf4eef56c3 100644
--- a/python/samba/tests/dsdb.py
+++ b/python/samba/tests/dsdb.py
@@ -726,3 +726,22 @@ class DsdbTests(TestCase):
str(part_dn) + "," + str(domain_dn)),
self.samdb.normalize_dn_in_domain(part_dn))
+class DsdbFullScanTests(TestCase):
+
+ def setUp(self):
+ super(DsdbFullScanTests, self).setUp()
+ self.lp = samba.tests.env_loadparm()
+ self.creds = Credentials()
+ self.creds.guess(self.lp)
+ self.session = system_session()
+
+
+ def test_sam_ldb_open_no_full_scan(self):
+ try:
+ self.samdb = SamDB(session_info=self.session,
+ credentials=self.creds,
+ lp=self.lp,
+ options=["disable_full_db_scan_for_self_test:1"])
+ except LdbError as err:
+ estr = err.args[1]
+ self.fail("sam.ldb required a full scan to start up")