summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2017-08-24 15:02:43 +1200
committerDouglas Bagnall <dbagnall@samba.org>2018-05-05 04:32:42 +0200
commit6b7494f5e7f72a29350d5fbbf2dbae866ded9b63 (patch)
treef437383213a65632c6dd3a6a02a7d6286988f4d8
parent4eeb43d06c7bfe1e3661c954586eed0b88315ee8 (diff)
downloadsamba-6b7494f5e7f72a29350d5fbbf2dbae866ded9b63.tar.gz
perftest: ad_dc_medley failing base search failed to catch exception
This meant it only happened once. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
-rw-r--r--source4/dsdb/tests/python/ad_dc_medley_performance.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/source4/dsdb/tests/python/ad_dc_medley_performance.py b/source4/dsdb/tests/python/ad_dc_medley_performance.py
index f49563c7f6c..05be482cf61 100644
--- a/source4/dsdb/tests/python/ad_dc_medley_performance.py
+++ b/source4/dsdb/tests/python/ad_dc_medley_performance.py
@@ -38,6 +38,7 @@ from samba.auth import system_session
from ldb import Message, MessageElement, Dn, LdbError
from ldb import FLAG_MOD_ADD, FLAG_MOD_REPLACE, FLAG_MOD_DELETE
from ldb import SCOPE_BASE, SCOPE_SUBTREE, SCOPE_ONELEVEL
+from ldb import ERR_NO_SUCH_OBJECT
parser = optparse.OptionParser("ad_dc_performance.py [options] <host>")
sambaopts = options.SambaOptions(parser)
@@ -222,15 +223,19 @@ class UserTests(samba.tests.TestCase):
attrs=['cn'])
except LdbError as e:
(num, msg) = e.args
- if num != 32:
+ if num != ERR_NO_SUCH_OBJECT:
raise
def _test_base_search_failing(self):
pattern = 'missing%d' + self.ou
for i in range(4000):
- self.ldb.search(pattern % i,
- scope=SCOPE_BASE,
- attrs=['cn'])
+ try:
+ self.ldb.search(pattern % i,
+ scope=SCOPE_BASE,
+ attrs=['cn'])
+ except LdbError as (num, msg):
+ if num != ERR_NO_SUCH_OBJECT:
+ raise
def search_expression_list(self, expressions, rounds,
attrs=['cn'],