summaryrefslogtreecommitdiff
path: root/selftest/tests.py
Commit message (Collapse)AuthorAgeFilesLines
* lib:util: Add test to verify old and new macros are the sameAndreas Schneider2020-02-211-0/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib:util: Add bytearray.hAndreas Schneider2020-02-211-0/+2
| | | | | | | | | | This is an implementation which doesn't have undefined behavior problems. It casts correctly that calculations are don in the correct integer space. Also the naming is less confusing than what we have in byteorder.h. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/auth: test des_crypt56() and add test_gnutls to selftestIsaac Boukris2019-12-101-0/+2
| | | | | Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python: tests. Add test for fuzzing smbd crash bug.Jeremy Allison2019-12-041-0/+1
| | | | | | | | | Mark knownfail for now. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14205 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:mdssvc: add unit tests for the Spotlight to Elasticsearch parserRalph Boehme2019-10-091-0/+2
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* libcli/auth: add test for gensec_schannel codeGünther Deschner2019-10-071-0/+2
| | | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* selftest/tests.py: test pam_winbind for trusts domainsStefan Metzmacher2019-09-241-0/+84
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14124 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* selftest/tests.py: test pam_winbind with a lot of username variationsStefan Metzmacher2019-09-241-1/+26
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14124 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* selftest/tests.py: test pam_winbind with krb5_authStefan Metzmacher2019-09-241-0/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14124 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* selftest/tests.py: prepare looping over pam_winbindd testsStefan Metzmacher2019-09-241-21/+37
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14124 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* test_pam_winbind.sh: allow different pam_winbindd config options to be specifiedStefan Metzmacher2019-09-241-3/+3
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14124 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* libcli:auth: Add test for decoding an RC4 password bufferAndreas Schneider2019-07-261-0/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib:util: Add a test for byteorder.hAndreas Schneider2019-05-171-0/+2
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri May 17 20:44:36 UTC 2019 on sn-devel-184
* lib:util: Add test for talloc_keep_secret()Andreas Schneider2019-04-031-0/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* oLschema2ldif: Resolve multiple parsing bugsMichael Hanselmann2019-04-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The "oLschema2ldif" program contained multiple bugs triggered by malformed inputs: * Iteration beyond list of recognized dsdb syntax OIDs when value wasn't found (bug 9567) * NULL pointer dereference when input didn't define a name * Heap buffer overflows for unterminated token values Tests are added to reproduce all identified bugs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9567 Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Then adapted to use ARRAY_SIZE() consistently as suggested by metze. Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Apr 3 02:43:07 UTC 2019 on sn-devel-144
* selftest: Remove obsolete py3_compatible=True markersAndrew Bartlett2019-03-211-38/+37
| | | | | | | All our tests now run in python3. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* regfio: Add trivial unit testMichael Hanselmann2019-03-201-0/+2
| | | | | | | | | | | An upcoming commit will resolve two cases of insufficient handling of mangled registry hive files and will include unit tests. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13840 Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest/tests: add smoketests for dbcheck --quick-membership-checksJoe Guo2019-02-211-0/+30
| | | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest/tests: add helper method to simplify plantestsuiteJoe Guo2019-02-211-34/+53
| | | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Enable ldb.python for PY3Noel Power2019-01-131-1/+1
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* py:dcerpc/tests: rename dcerpc/string.py -> string_tests.pyStefan Metzmacher2018-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise it's not possible to run the raw_protocol tests anymore: python/samba/tests/dcerpc/raw_protocol.py Traceback (most recent call last): File "python/samba/tests/dcerpc/raw_protocol.py", line 26, in <module> import samba.dcerpc.dcerpc as dcerpc File "bin/python/samba/__init__.py", line 32, in <module> from samba.compat import string_types File "bin/python/samba/compat.py", line 151, in <module> from urllib import quote as urllib_quote File "/usr/lib/python2.7/urllib.py", line 25, in <module> import string File "/abs/path/samba/python/samba/tests/dcerpc/string.py", line 22, in <module> # Some strings for ctype-style character classification File "bin/python/samba/tests/__init__.py", line 36, in <module> from samba.compat import text_type ImportError: cannot import name text_type This allows the following again: SMB_CONF_PATH=/dev/null \ SERVER=172.31.9.188 \ TARGET_HOSTNAME=w2012r2-188.w2012r2-l6.base \ USERNAME=administrator \ PASSWORD=A1b2C3d4 \ DOMAIN=W2012R2-L6 \ REALM=W2012R2-L6.BASE \ python/samba/tests/dcerpc/raw_protocol.py -v -f TestDCERPC_BIND BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* PY3: wrap filter calls with list where list is expectedNoel Power2018-12-101-1/+1
| | | | | | | filter in PY2 returns list in PY3 it returns an iterator Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest/tests.py: avoid import *Douglas Bagnall2018-10-251-1/+6
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
* tests: Check pam_winbind pw change with different optionsMathieu Parent2018-10-021-0/+10
| | | | | | | | | | | Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Mathieu Parent <math.parent@gmail.com> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Oct 2 17:30:29 CEST 2018 on sn-devel-144
* selftest/tests.py: update to support waf 2.0Alexander Bokovoy2018-09-051-1/+1
| | | | | Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest/tests.py: Update path to waflibThomas Nagy2018-09-051-1/+1
| | | | | | Signed-off-by: Thomas Nagy <tnagy@waf.io> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PEP8: fix E225: missing whitespace around operatorJoe Guo2018-08-241-1/+1
| | | | | | 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>
* PEP8: fix E128: continuation line under-indented for visual indentJoe Guo2018-08-241-2/+2
| | | | | | 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>
* CVE-2018-1139 libcli/auth: Add initial tests for ntlm_password_check()Andrew Bartlett2018-08-141-0/+2
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13360 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* selftest: Add tests for samba.auth.admin_session()Andrew Bartlett2018-07-121-1/+1
| | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Pair-programmed-with: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* auth: keytab invalidation testAaron Haslett2018-05-151-0/+2
| | | | | | | | | | | | | | chgtdcpass should add a new DC password and delete the old ones but the bug exposed by this test causes the tool to remove only a single record from the old entries, leaving the old passwords functional. Since the tool is used by administrators who may have disclosed their domain join password and want to invalidate it, this is a security concern. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13415 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* selftest/graph: enable py3 for samba.tests.graphJoe Guo2018-04-131-1/+1
| | | | | | | | | Changes are made separatedly in previous commits. No change needed here. 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>
* selftest: enable py3 for samba.tests.docsJoe Guo2018-04-131-1/+1
| | | | | | | | | Popen methods will return bytes. Decode output to string before using. 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>
* selftest: enable py3 for samba.tests.sourceJoe Guo2018-04-131-1/+1
| | | | | | | | | | | | | | In py2, `open` has no `encoding` arg, python guesses file encoding from locale. This could be wrong. Use `io.open` to open a file, so we can specify encoding in both py2 and py3. Also, open file with `r` instead of `rb` for py3. 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>
* selftest: enable py3 for samba.tests.blackbox.ndrdumpJoe Guo2018-04-051-1/+1
| | | | | | | | | | | No change needed. 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> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Apr 5 12:16:41 CEST 2018 on sn-devel-144
* selftest: enable py3 for samba.tests.samdb_apiJoe Guo2018-04-051-1/+1
| | | | | | | | Fix bytes and string. 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>
* selftest: enable py3 for samba.tests.kcc.graph_utilsJoe Guo2018-04-051-1/+1
| | | | | | | | | zip will not return a list in Python 3. Convert to list. 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>
* selftest: enable py3 for samba.tests.kcc.graphJoe Guo2018-04-051-2/+2
| | | | | | | | | | In Python 3, range() will not return a list any more. So `range(7) * 4` will not work. Convert range to list to fix. 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>
* selftest: enable py3 for samba.tests.upgradeprovisionJoe Guo2018-04-051-1/+1
| | | | | | | | | 1. `has_key` was removed from dict in Python 3, use `in` instead. 2. `cmp` was removed in Python 3, define it ourselves. 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>
* selftest: enable py3 for samba.tests.hostconfigJoe Guo2018-04-051-1/+1
| | | | | | | | Fix relative import. 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>
* selftest: enable py3 for samba.tests.commonJoe Guo2018-04-051-1/+1
| | | | | | | | | | | | | | | fix dsdb_Dn comparison for Python 3 In Python 3, the builtin `cmp` funtion was dropped. And the `__cmp__` magic method in object is no longer honored, which is replaced by 6 new methods: __eq__, __ne__, __lt__, __le__, __gt__, __ge__. This caused `tests.CommonTests` failed with `py3_compatiable=True`. Fixed by adding the above methods. 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>
* selftest: enable py3 for samba.tests.dcerpc.stringJoe Guo2018-04-051-1/+1
| | | | | | | | No change needed. 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>
* selftest: enable py3 for samba.tests.dcerpc.arrayJoe Guo2018-04-051-1/+1
| | | | | | | | No change needed. 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>
* selftest: enable py3 for samba.tests.dcerpc.rpc_tallocJoe Guo2018-04-051-1/+1
| | | | | | | | No changes needed. 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>
* selftest: enable py3 for samba.tests.password_qualityJoe Guo2018-04-051-1/+1
| | | | | | | | No change needed. 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>
* selftest: enable py3 for samba.tests.upgradeJoe Guo2018-04-051-1/+1
| | | | | | | | | `os.tempname` is removed in Python 3. Use `tempfile` instead. 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>
* selftest: enable py3 for samba.tests.blackbox.check_outputJoe Guo2018-04-051-1/+1
| | | | | | | | | | | | convert bytes to str for Python 3 `BlackboxTestCase.check_output` will return bytes since it uses `subprocess.communicate` underneath. Convert expected string result to bytes for comparing. 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>
* get make test TESTS=samba.tests.provision to workNoel Power2018-04-051-1/+1
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* samba python tests: enable samba.tests.ntacls for python3Noel Power2018-04-051-1/+1
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* selftest python: get samba.tests.s3idmapdb to run with py3Noel Power2018-04-051-1/+1
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>