diff options
| author | Andrew Bartlett <abartlet@samba.org> | 2017-09-21 14:15:32 +1200 |
|---|---|---|
| committer | Andrew Bartlett <abartlet@samba.org> | 2017-09-22 21:20:25 +0200 |
| commit | 644b3ffb14252f2a2dfe282b5d748b6ea86325e1 (patch) | |
| tree | f164f6c64e9666e36f5bf94d1772678a272ea194 /lib/ldb/tests/python/api.py | |
| parent | a0b46ecdd2481699ce91c2636d4eac9067f8f69e (diff) | |
| download | samba-644b3ffb14252f2a2dfe282b5d748b6ea86325e1.tar.gz samba-644b3ffb14252f2a2dfe282b5d748b6ea86325e1.tar.bz2 samba-644b3ffb14252f2a2dfe282b5d748b6ea86325e1.zip | |
ldb: Ensure we do not run out of File descriptors in autobuild
The python TestCase API will keep a reference to the test object until the end
of the tests, long after we need the actual LDB or the fd.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'lib/ldb/tests/python/api.py')
| -rwxr-xr-x | lib/ldb/tests/python/api.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/ldb/tests/python/api.py b/lib/ldb/tests/python/api.py index ba9476a0e68..14bbdcb1718 100755 --- a/lib/ldb/tests/python/api.py +++ b/lib/ldb/tests/python/api.py @@ -55,6 +55,9 @@ class SimpleLdb(TestCase): def tearDown(self): shutil.rmtree(self.testdir) super(SimpleLdb, self).tearDown() + # Ensure the LDB is closed now, so we close the FD + del(self.ldb) + def test_connect(self): ldb.Ldb(self.filename) @@ -610,6 +613,10 @@ class SearchTests(TestCase): shutil.rmtree(self.testdir) super(SearchTests, self).tearDown() + # Ensure the LDB is closed now, so we close the FD + del(self.l) + + def setUp(self): super(SearchTests, self).setUp() self.testdir = tempdir() @@ -992,6 +999,9 @@ class AddModifyTests(TestCase): shutil.rmtree(self.testdir) super(AddModifyTests, self).tearDown() + # Ensure the LDB is closed now, so we close the FD + del(self.l) + def setUp(self): super(AddModifyTests, self).setUp() self.testdir = tempdir() @@ -1243,6 +1253,10 @@ class DnTests(TestCase): super(DnTests, self).setUp() self.ldb = ldb.Ldb() + def tearDown(self): + super(DnTests, self).tearDown() + del(self.ldb) + def test_set_dn_invalid(self): x = ldb.Message() def assign(): @@ -1863,6 +1877,8 @@ class LdbResultTests(TestCase): def tearDown(self): shutil.rmtree(self.testdir) super(LdbResultTests, self).tearDown() + # Ensure the LDB is closed now, so we close the FD + del(self.l) def test_return_type(self): res = self.l.search() |
