From 7f1b6455fdc1d7767bdfd3dc81851abb682cc087 Mon Sep 17 00:00:00 2001 From: Aaron Haslett Date: Thu, 28 Mar 2019 15:03:17 +1300 Subject: [PATCH] paged_search: perf testing paged search Adding medley performance run with paged search module. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13836 Signed-off-by: Aaron Haslett Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett --- selftest/perf_tests.py | 17 +++++++++++++++++ .../tests/python/ad_dc_medley_performance.py | 11 +++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/selftest/perf_tests.py b/selftest/perf_tests.py index bc08075c6d1..a3fdbf4b1b3 100644 --- a/selftest/perf_tests.py +++ b/selftest/perf_tests.py @@ -74,6 +74,11 @@ plantestsuite_loadlist("samba4.ldb.multi_connect.python(ad_dc_ntvfs)", 'tdb://$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb' '$LOADLIST', '$LISTOPT']) +plantestsuite_loadlist("samba4.ldap.vlv.python(ad_dc_ntvfs)", "ad_dc_ntvfs", + [python, + os.path.join(samba4srcdir, "dsdb/tests/python/vlv.py"), + '$SERVER', '-U"$USERNAME%$PASSWORD"', + '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT']) # this one doesn't tidy itself up fully, so leave it as last unless # you want a messy database. @@ -85,3 +90,15 @@ plantestsuite_loadlist("samba4.ldap.ad_dc_medley_performance.python(ad_dc_ntvfs) '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT']) + +# again with paged search module +plantestsuite_loadlist("samba4.ldap.ad_dc_medley_performance.paged_search."+\ + "python(ad_dc_ntvfs)", + "ad_dc_ntvfs", + [python, + os.path.join(samba4srcdir, + "dsdb/tests/python/ad_dc_medley_performance.py"), + '$SERVER', '-U"$USERNAME%$PASSWORD"', + '--workgroup=$DOMAIN', + '--use-paged-search', + '$LOADLIST', '$LISTOPT']) diff --git a/source4/dsdb/tests/python/ad_dc_medley_performance.py b/source4/dsdb/tests/python/ad_dc_medley_performance.py index 1be8ef6ce39..e0f0e19651a 100644 --- a/source4/dsdb/tests/python/ad_dc_medley_performance.py +++ b/source4/dsdb/tests/python/ad_dc_medley_performance.py @@ -42,6 +42,9 @@ from ldb import ERR_NO_SUCH_OBJECT parser = optparse.OptionParser("ad_dc_performance.py [options] ") sambaopts = options.SambaOptions(parser) +sambaopts.add_option("-p", "--use-paged-search", action="store_true", + help="Use paged search module") + parser.add_option_group(sambaopts) parser.add_option_group(options.VersionOptions(parser)) @@ -54,7 +57,6 @@ credopts = options.CredentialsOptions(parser) parser.add_option_group(credopts) opts, args = parser.parse_args() - if len(args) < 1: parser.print_usage() sys.exit(1) @@ -103,8 +105,13 @@ class UserTests(samba.tests.TestCase): super(UserTests, self).setUp() self.state = GlobalState # the class itself, not an instance self.lp = lp + + kwargs = {} + if opts.use_paged_search: + kwargs["options"] = ["modules:paged_searches"] + self.ldb = SamDB(host, credentials=creds, - session_info=system_session(lp), lp=lp) + session_info=system_session(lp), lp=lp, **kwargs) self.base_dn = self.ldb.domain_dn() self.ou = "OU=pid%s,%s" % (os.getpid(), self.base_dn) self.ou_users = "OU=users,%s" % self.ou