summaryrefslogtreecommitdiff
path: root/source4/scripting/devel
diff options
context:
space:
mode:
authorNadezhda Ivanova <nivanova@samba.org>2010-11-25 01:16:14 +0200
committerNadezhda Ivanova <nivanova@samba.org>2010-11-25 01:28:19 +0100
commitfc1da86d403c654fc96a6b1410147fe93dee0a39 (patch)
treeb9bc45361290ed52495c57ff716223b90ba31b98 /source4/scripting/devel
parent21aceb1374329b9738031d9d6143b2cb24c87f52 (diff)
downloadsamba-fc1da86d403c654fc96a6b1410147fe93dee0a39.tar.gz
samba-fc1da86d403c654fc96a6b1410147fe93dee0a39.tar.bz2
samba-fc1da86d403c654fc96a6b1410147fe93dee0a39.zip
s4-tests: Modified speedtest.py to use samba.tests.delete_force
Autobuild-User: Nadezhda Ivanova <nivanova@samba.org> Autobuild-Date: Thu Nov 25 01:28:19 CET 2010 on sn-devel-104
Diffstat (limited to 'source4/scripting/devel')
-rwxr-xr-xsource4/scripting/devel/speedtest.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/source4/scripting/devel/speedtest.py b/source4/scripting/devel/speedtest.py
index d5d87afb77..891a741b1c 100755
--- a/source4/scripting/devel/speedtest.py
+++ b/source4/scripting/devel/speedtest.py
@@ -46,6 +46,7 @@ from samba import gensec
from samba.samdb import SamDB
from samba.credentials import Credentials
import samba.tests
+from samba.tests import delete_force
from subunit.run import SubunitTestRunner
import unittest
@@ -76,12 +77,6 @@ creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
class SpeedTest(samba.tests.TestCase):
- def delete_force(self, ldb, dn):
- try:
- ldb.delete(dn)
- except LdbError, (num, _):
- self.assertEquals(num, ERR_NO_SUCH_OBJECT)
-
def find_basedn(self, ldb):
res = ldb.search(base="", expression="", scope=SCOPE_BASE,
attrs=["defaultNamingContext"])
@@ -126,13 +121,13 @@ url: www.example.com
def remove_bundle(self, count):
for i in range(count):
- self.delete_force(self.ldb_admin, "cn=speedtestuser%d,cn=Users,%s" % (i+1, self.base_dn))
+ delete_force(self.ldb_admin, "cn=speedtestuser%d,cn=Users,%s" % (i+1, self.base_dn))
def remove_test_users(self):
res = ldb.search(base="cn=Users,%s" % self.base_dn, expression="(objectClass=user)", scope=SCOPE_SUBTREE)
dn_list = [item.dn for item in res if "speedtestuser" in str(item.dn)]
for dn in dn_list:
- self.delete_force(self.ldb_admin, dn)
+ delete_force(self.ldb_admin, dn)
def run_bundle(self, num):
print "\n=== Test ADD/DEL %s user objects ===\n" % num