summaryrefslogtreecommitdiff
path: root/python/samba/tests/dcerpc/sam.py
AgeCommit message (Collapse)AuthorFilesLines
2023-11-30python: tests: update all super calls to python 3 style in testsRob van der Linde1-1/+1
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> [abartlet@samba.org Some python2 style super() calls remain due to being an actual, even if reasonable, behaviour change]
2020-02-07pytests: heed assertEquals deprecation warning en-masseDouglas Bagnall1-54/+54
TestCase.assertEquals() is an alias for TestCase.assertEqual() and has been deprecated since Python 2.7. When we run our tests with in python developer mode (`PYTHONDEVMODE=1 make test`) we get 580 DeprecationWarnings about this. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2019-08-30rpc samr: EnumDomainUsers perf improvementAaron Haslett1-23/+1
EnumDomainUsers currently takes too long, significantly slowing down calls to winbind's getpwent which is a core unix API. The time is taken up by a GUID lookup for every record in the cached result. The advantages of this approach are: 1. It meets the specified requirement that if a record yet to be returned by a search in progress (with a resume handle) is deleted or modified, the future returned results correctly reflect the new changes. 2. Memory footprint for a search in progress is only 16 bytes per record. But, those benefits are not worth the significant performance hit of the lookups, so this patch changes the function to run the search and cache the RIDs and names of all records matching the search when the request is made. This makes the memory footprint around 200 bytes per record or up to 2MB per concurrent search for a 100k user database. The speedup achieved by this change is around 50%, and in tandem with some winbindd improvements as part of the same task has achieved around 15x speedup for getpwent. The lost specification compliance is unlikely to cause a problem for any known usage of this RPC call. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-02-14s2 decrpc samr: Add tests for QueryDomainInfoGary Lockyer1-0/+55
Add tests for the number of domain users, groups and aliases returned by QueryDomainInfo. These tests revealed that the existing code was not checking the returned elements to ensure they were part of the domain. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-20tests samr: Extra tests for samr_EnumDomainUserssGary Lockyer1-0/+144
Add extra tests to test the content returned by samr_EnumDomainUsers, and tests for the result caching added in the following commit. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-20test samr: Extra tests for samr_EnumDomainGroupsGary Lockyer1-0/+169
Add extra tests to test the content returned by samr_EnumDomainGroups, and tests for the result caching added in the following commit. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-20tests samr: remove PEP8 warningsGary Lockyer1-2/+4
Remove PEP8 warnings from the samr tests. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-20tests samr: Extra tests for samr_QueryDisplayInfoGary Lockyer1-1/+389
Add extra tests to test the content returned by samr_QueryDisplayInfo, which is not tested for the ADDC. Also adds tests for the result caching added in the following commit. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-08-24PEP8: fix W391: blank line at end of fileJoe Guo1-1/+0
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-13selftest: enable py3 for samba.tests.dcerpc.samJoe Guo1-6/+4
1. Fix invalid declaration syntax for toArray 2. Simplify toArray implementation with list comprehension. 3. Remove ending L for long integer. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2015-08-24python: Use an unsigned integer for buf_size, not -1Andrew Bartlett1-1/+1
This will fail once our python bindings correctly check value ranges BUG: https://bugzilla.samba.org/show_bug.cgi?id=11429 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-02Move python modules from source4/scripting/python/ to python/.Jelmer Vernooij1-0/+50
Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Mar 2 03:57:34 CET 2013 on sn-devel-104