summaryrefslogtreecommitdiff
path: root/selftest/tests.py
Commit message (Collapse)AuthorAgeFilesLines
* CVE-2018-1139 libcli/auth: Add initial tests for ntlm_password_check()Andrew Bartlett2018-08-111-0/+2
| | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13360 Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* selftest/tests.py: remove always-needed, never-set with_cmocka flagDouglas Bagnall2018-08-111-10/+8
| | | | | | | | | | We have cmocka in third_party, so we are never without it. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (Backported from commit 33ef0e57a4f08eae5ea06f482374fbc0a1014de6 by Andrew Bartlett)
* python/graph: module for generating ASCII and graphviz visualisationsDouglas Bagnall2018-01-131-0/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* functionalprep.sh: New test for ensuring that the prep works correctlyGarming Sam2017-12-201-0/+5
| | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add basic test for schema upgradeTim Beale2017-12-141-0/+5
| | | | | | | | | | | This tests that we can provision using both the 2008 and 2012 schema, that we can upgrade a 2008 Samba instance to use the 2012 schema, and that when we do that the result (more or less) matches a straight 2012 provision. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba-tool: validate password early in `domain provision`Jamie McClymont2017-12-101-0/+1
| | | | | | | | | | | | | | | | | Checks password against default quality and length standards when it is entered, allowing a second chance to enter one (if interactive), rather than running through the provisioning process and bailing on an exception Includes unit tests for the newly-added python wrapper of check_password_quality plus black-box tests for the checks in samba-tool. Breaks an openldap test which uses an invalid password. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9710 BUG: https://bugzilla.samba.org/show_bug.cgi?id=12235 Signed-off-by: Jamie McClymont <jamiemcclymont@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* selftest: Add more corruption cases for runtime and dbcheckAndrew Bartlett2017-11-241-0/+5
| | | | | | | | These tests now confirm we can handle these issues at runtime as well as at dbcheck Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* python: Port ntvfs posix bindings to Python 3 compatible formLumir Balhar2017-11-081-1/+1
| | | | | | Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* python: Port tests of samba.messaging to Python 3 compatible form.Lumir Balhar2017-10-231-1/+2
| | | | | | | | | Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Oct 23 15:40:48 CEST 2017 on sn-devel-144
* python: add a failed test to show Popen deadlockJoe Guo2017-10-191-0/+1
| | | | | | | | | | | | `Popen.wait()` will deadlock when using stdout=PIPE and/or stderr=PIPE and the child process generates large output to a pipe such that it blocks waiting for the OS pipe buffer to accept more data. Use communicate() to avoid that. This patch is commited to show the issue, a fix patch will come later. 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>
* tests: Improve tests of samba.registry Python moduleLumir Balhar2017-10-181-1/+1
| | | | | | Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* python: Enable execution of samba.tests.security with Python 3.Lumir Balhar2017-09-061-1/+1
| | | | | | | | | Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Sep 6 15:29:58 CEST 2017 on sn-devel-144
* scripts: Scripts to replay and generate samba trafficGary Lockyer2017-08-171-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | Scripts to generate representative network traffic and replay this to a samba instance. For load testing, performance profiling and capacity planning. traffic_learner process a file generated by traffic_summary and generate a model that can be used by traffic_replay to generate samba network traffic. traffic_replay Replay a summary file generated by traffic_summary, or use a model created by traffic_learner to generate network traffic. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-With: Tim Beale <timbeale@catalyst.net.nz>
* python:tests: Add test for warn_pwd_expireAndreas Schneider2017-08-071-0/+4
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Aug 7 19:11:02 CEST 2017 on sn-devel-144
* python: tests: Add test for tdb_copy function from tdb_util module.Lumir Balhar2017-07-051-0/+1
| | | | | | | | | | Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Jul 5 02:00:25 CEST 2017 on sn-devel-144
* selftest: test pam_winbind with a local user on ad_memberStefan Metzmacher2017-06-131-1/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* selftest: use "$DC_USERNAME" and "$DC_PASSWORD" for the pam_winbind testStefan Metzmacher2017-06-131-1/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* python/samba/tests: don't use hardcoded names in *pam_winbind* testsStefan Metzmacher2017-06-131-1/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli:smb: Add unit test for smb_bytes_pull_str()Andreas Schneider2017-06-091-0/+3
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12824 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* unittest: Add testsuite for smb_probe_module()Andreas Schneider2017-06-061-0/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12780 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* unittest: Add testsuite for is_known_pipename()Andreas Schneider2017-06-061-0/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12780 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* waf: Only build pam_wrapper if we build with pamAndreas Schneider2017-04-121-2/+4
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* python: Add a simple pam_winbind testAndreas Schneider2017-04-071-0/+4
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Apr 7 14:19:23 CEST 2017 on sn-devel-144
* python: selftests: Enable samba.getopt tests execution with Python 3Lumir Balhar2017-03-101-1/+1
| | | | | | Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* python: samba.tests.core: Port and enable core tests in Python 3Lumir Balhar2017-03-101-1/+1
| | | | | | | | | Port samba core tests to Python 3 compatible form and enable their execution with Python 3. Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* python: samba.auth: Port samba.auth to Python 3 compatible formLumir Balhar2017-03-101-1/+1
| | | | | | | | | Port samba.auth Python module to Python 3 compatible form and enable tests execution with Python 3. Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* python: samba.tests.dcerpc.misc: Port and enable testsLumir Balhar2017-03-101-1/+1
| | | | | | | | | Port tests of samba.dcerpc.misc module to Python 3 compatible form and enable their execution with Python 3. Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* python: samba.tests: Enable Python 3 tests for ported modulesLumir Balhar2017-03-101-2/+3
| | | | | | | | Enable tests with Python 3 for Python 3 compatible modules. Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* script: Add test script for traffic_summary.plGary Lockyer2017-03-011-0/+4
| | | | | | | | | | | | Add the test script for traffic_summary.pl, test data in previous commit. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Wed Mar 1 09:01:07 CET 2017 on sn-devel-144
* testsuite: Add cmocka unit test for smb_krb5_kt_open()Andreas Schneider2016-12-161-2/+13
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Dec 16 05:43:12 CET 2016 on sn-devel-144
* selftest: Add test for link and deleted link behaviour in dbcheckAndrew Bartlett2016-11-221-0/+5
| | | | | | | | | | The other dbcheck tests were getting over-complex, so we start a new test here based on tombestone-expunge.sh, as we are looking at very similar problems Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12297
* Remove unused python selftestDouglas Bagnall2016-09-011-1/+0
| | | | | | | | | | | It doesn't work, isn't changing, and causes a little bit of extra confusion. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Sep 1 13:29:46 CEST 2016 on sn-devel-144
* selftest: Add test for 'samba-tool tombstones expunge'Andrew Bartlett2016-09-011-0/+5
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* selftest: Correct name of samba4.blackbox.dbcheck.release-4-5-0-pre1Andrew Bartlett2016-09-011-5/+5
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* selftest: allow tests.py scripts to run independentlyDouglas Bagnall2016-08-311-0/+1
| | | | | | | | | These generate lists of test commands. Usually they are run in special environments, but they should work from the command line. This restores the intended behaviour. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dbcheck linked attribute tests: save environment with bad linksDouglas Bagnall2016-07-151-0/+5
| | | | | | | | | We save a database snapshot that contains linked attributes that should have been deleted, and make sure dbcheck fixes those links without ruining anything else. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests/dcerpc: add tests for string allocation and deletionDouglas Bagnall2016-05-101-0/+1
| | | | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue May 10 05:11:42 CEST 2016 on sn-devel-144
* selftest: Enable samba.tests.dcerpc.array testDouglas Bagnall2016-05-101-0/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2016-0771: tests: rename test getopt to get_optGarming Sam2016-03-101-1/+1
| | | | | | | | | | | | This avoids any conflicts in this directory with the original toplevel getopt. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Confirm a demote of a real network worksAndrew Bartlett2015-10-261-0/+4
| | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Oct 26 08:17:47 CET 2015 on sn-devel-104
* python/tests: Add tests for integer overflow handlingAndrew Bartlett2015-08-241-0/+1
| | | | | | | | | | This also documents an issue with our python bindings and lists, as changes to integers in a list of integers are not preserved 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>
* KCC: add tests for kcc.graph repltimes functionsDouglas Bagnall2015-06-121-0/+1
| | | | | | | | There used to be bugs in these. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* KCC: add a very puny stub for kcc.kcc_utils testsDouglas Bagnall2015-06-121-0/+1
| | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* KCC move and fix ldif_import_export and graph_utils testsDouglas Bagnall2015-06-121-2/+2
| | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* KCC: ldif_utils: ldif_to_samdb doesn't need creds; begin selftestDouglas Bagnall2015-05-301-0/+1
| | | | | | | | | | The tests are based on the testdata/ldif-utils-test-multisite.ldif which describes a multisite windows network. It was constructed by Garming Sam. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* KCC: test suite for the graph_utilsDouglas Bagnall2015-05-291-0/+1
| | | | | | | | | | | This found a few bugs in the tests which were fixed. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri May 29 13:55:54 CEST 2015 on sn-devel-104
* Move waf into third_party/.Jelmer Vernooij2015-03-261-1/+1
| | | | | Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: rename env dc to ad_dc_ntvfsMichael Adam2015-03-161-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest/tests.py: Remove testsuite samba.tests.samdb which does not have ↵Jelmer Vernooij2014-11-301-1/+0
| | | | | | | | any tests. Change-Id: I8edcf73aa4a9b61c6e5c7cfb592a4692d4030a29 Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix subunit test suite name.Jelmer Vernooij2014-11-191-1/+6
| | | | | | | | Only run it when testscenarios is installed, as it depends on that. Change-Id: I1e1284024cf94f909e585a55b8a15e33273f167b Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>