summaryrefslogtreecommitdiff
path: root/python/samba/tests
AgeCommit message (Collapse)AuthorFilesLines
2019-07-22tests/py-segfault: add messaging.deregister()Douglas Bagnall1-0/+6
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-22py segfault test: registry.open_hiveDouglas Bagnall1-0/+8
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-16prefork restart tests: Use echo server for back offGary Lockyer1-7/+7
Use the echo server for the restart back off tests in the samba.tests.prefork_restart tests instead of the kdc. The kdc is not enabled when the ADDC is built to run MIT Kerberos. Changing the test to use the echo server means it can be run when MIT Kerberos is enabled. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-10pyldb: remove ldb.open, which was never survivableDouglas Bagnall1-8/+0
There was no way to call ldb.open without evoking signal 11, so it is unlikely anyone was using it. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-10py segfault test: ldb.openDouglas Bagnall1-0/+8
There seems to be no way of using ldb.open without causing a segfault Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-10py segfault test: ldb.register_moduleDouglas Bagnall1-0/+4
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-05tests/usage: test for --help consistencyDouglas Bagnall1-1/+8
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-05tests/samba-tool: test --help consistencyDouglas Bagnall1-0/+8
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-05python/tests: helper function for checking --help consistencyDouglas Bagnall1-0/+118
Check that --help output doesn't contradict itself by assigning the same option string to different meanings (which *does* happen in the ldb tools). This will be used in the samba-tool help tests and the usage tests. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-05tests/usage: generalise to cover non-python scriptsDouglas Bagnall1-35/+118
It is not as simple as running everything executable, because for example .so library files are marked as executable. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-05tests/usage: python scripts --help should be helpfulDouglas Bagnall1-0/+67
We want to be sure it says *something* and returns success. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-05tests: ensure that most python scripts have usage textDouglas Bagnall1-0/+205
When a script is run with the wrong arguments, it should at least say something like this: Usage: samba-foo [OPTIONS] For many samba scripts, especially without a server environment, having no arguments is the wrong arguments. Here we look for every executable file with '#![...]python[3]' on the first line, and exclude certain files and directories that have excuses to fail the test. For example, many selftest scripts are stream-oriented and will hang forever waiting for stdin, which is not an error. Some test modules are designed so they can be optionally run from the command line, but this option is typically only used by the developer who is writing them. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-04samba-tool tests: add tests for contact managementBjörn Baumbach2-0/+483
Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-04samba-tool tests: add test for 'samba-tool group edit' commandBjörn Baumbach1-0/+208
Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-04samba-tool tests: add test for 'samba-tool computer edit' commandBjörn Baumbach1-0/+180
Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-04samba-tool tests: add test for 'samba-tool user edit', using ↵Björn Baumbach1-0/+26
LDB_FLAG_FORCE_NO_BASE64_LDIF Test to edit a user: Change attributes with LDB_FLAG_FORCE_NO_BASE64_LDIF Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-04samba-tool tests: add additional tests for "samba-tool user edit" commandBjörn Baumbach1-0/+97
Especially test handling of base64 encoded attribute values here. Add selftest/knownfail.d/samba_tool.user_edit. Tests fail, because: - can not work with ldif without a trailing new line - can not handle base64 strings BUG: https://bugzilla.samba.org/show_bug.cgi?id=14003 Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-04samba-tool user edit test: use testit instead of subunit_start_test, pass/failedBjörn Baumbach1-38/+23
Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-04samba-tool tests: remove probably outdated commentBjörn Baumbach1-1/+0
Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-04samba-tool tests: rename "user edit" test from edit.sh to user_edit.shBjörn Baumbach1-1/+1
Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-02pytests/subunitrun: not usefully executableDouglas Bagnall1-2/+0
it only defines classes and fiddles with signals. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-02samba-tool dcpromo tests: add --backend-store-size optionGary Lockyer1-0/+170
Add a new "samba-tool domain dcpromo" option "backend-store-size". This allows the lmdb map size to be set during a promotion, instead of hard-wiring it to 8Gb. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-02clone-dc-database tests: Add --backend-store-size optionGary Lockyer1-0/+119
Add a new "samba-tool drs clone-dc-database" option "backend-store-size". This allows the lmdb map size to be set during a clone, instead of hard-wiring it to 8Gb. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>' Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-02domain join tests: Add --backend-store-size option.Gary Lockyer1-0/+148
Tests for the new "samba-tool domain join" option "backend-store-size". This allows the lmdb map size to be set during a provision, instead of hard-wiring it to 8Gb. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-02provision tests: Add --backend-store-size option.Gary Lockyer2-0/+149
Tests for the new "samba-tool domain provision" option "backend-store-size". This allows the lmdb map size to be set during a provision, instead of hard-wiring it to 8Gb Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-06-19CVE-2019-12435 rpc/dns: avoid NULL deference if zone not found in ↵Douglas Bagnall1-0/+26
DnssrvOperation2 We still want to return DOES_NOT_EXIST when request_filter is not 0. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13922 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-06-19CVE-2019-12435 rpc/dns: avoid NULL deference if zone not found in ↵Douglas Bagnall1-0/+25
DnssrvOperation We still want to return DOES_NOT_EXIST when request_filter is not 0. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13922 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-06-18selftest: add tests for samba-tool ntacl changedomsidBjörn Baumbach1-0/+87
Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Björn Baumbach <bb@sernet.de> Autobuild-Date(master): Tue Jun 18 16:54:22 UTC 2019 on sn-devel-184
2019-06-07Revert TestCaseInSubDir parts of "downgradedatabase: blackbox test"Andrew Bartlett1-7/+2
This reverts part of commit 74d15c9bf76f0a2fb5fa7b7b1d80971d10c4fe45. TestCaseInSubDir should not have been modified in this way, instead the downgradedatabase test should have removed the files it created specifically (this is part of the test, it shows the right files were created). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13978 Signed-off-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): Fri Jun 7 21:08:12 UTC 2019 on sn-devel-184
2019-06-07selftest: Specifically remove files generated by provisionAndrew Bartlett1-3/+11
This allows the changes in 74d15c9bf76f0a2fb5fa7b7b1d80971d10c4fe45 to be reverted, and aligns this test with others that use TestCaseInTempDir. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13978 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-06-06tests blackbox ndrdump: Clean up pep8 warningsGary Lockyer1-7/+15
Clean up the test code and remove the pep8 warnings Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Jun 6 04:58:18 UTC 2019 on sn-devel-184
2019-06-06tests blackbox ndrdump: Add test for struct printingGary Lockyer1-2/+10
Add test for the dumping of a public structure with ndrdump. This removes the need to define decode_* functions in the idl. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-06-05tests auth log winbind: Fix flapping testGary Lockyer1-36/+53
Fix flapping auth_log_winbind tests, were seeing failures like UNEXPECTED(failure): samba.tests.auth_log_winbind.samba.tests.auth_log_winbind.AuthLogTestsWinbind. test_wbinfo(ad_member:local) REASON: Exception: Exception: Traceback (most recent call last): File "bin/python/samba/tests/auth_log_winbind.py", line 328, in test_wbinfo self.assertEquals(logon_id, msg["Authentication"]["logonId"]) AssertionError: '812b7158bff1660e' != '2cfc1fed76ff8865' - 812b7158bff1660e + 2cfc1fed76ff8865 Test had a race condition with other SamLogon events on the domain server. The tests can now handle multiple SamLogon messages and filter out the SamLogon messages for other logons. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-29tests/samba-tool: test dns serverinfo/zoneinfoDouglas Bagnall1-0/+26
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2019-05-29downgradedatabase: blackbox: MDB backendAaron Haslett1-3/+35
When Samba uses TDB as a backend store, all new database features are toggled on/off when GUID indexing is toggled. But, GUID indexing can't be disabled on MDB, so the other features are toggled separately. Consequently, the downgradedatabase script behaves differently depending on the database backend. This patch adds testing for the MDB behaviour. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2019-05-29downgradedatabase: blackbox: database repackedAaron Haslett1-4/+13
Now that the database is repacked when GUID indexing is toggled on TDB, test that downgradedatabase repacks a TDB-backed database with V2 pack format database with V1. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2019-05-29downgradedatabase: blackbox: check ordered integer removedAaron Haslett1-1/+19
Test that when we undo GUID indexing on a TDB-backed database with downgradedatabase, ORDERED_INTEGER is removed from @ATTRIBUTES Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2019-05-29downgradedatabase: blackbox testAaron Haslett2-2/+106
This test confirms that running downgradedatabase causes all GUID keys to be replaced with DN keys at the KV level Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2019-05-24ldap tests: test scheme for referralsGary Lockyer1-0/+91
Ensure that the referrals returned in a search request use the same scheme as the request, i.e. referrals recieved via ldap are prefixed with "ldap://" and those over ldaps are prefixed with "ldaps://" BUG: https://bugzilla.samba.org/show_bug.cgi?id=12478 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-06selftest: correcting empty attribute usage in requestsAaron Haslett4-6/+4
Many parts of Samba use an empty attribute list in requests expecting all attributes to be returned in the response, which is incorrect. This patch corrects the instances found by current CI tests. Static analysis and debugging will need to be done before changing ildap to the correct semantics. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Mon May 6 05:45:55 UTC 2019 on sn-devel-184
2019-05-01pytests: slightly better errors in Testcase.insta_creds()Douglas Bagnall1-3/+4
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-04-23pytest/segfault: segfault with nameless elementDouglas Bagnall1-0/+10
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2019-04-11selftest: tagging tests for new schemaupgrade_dc targetAaron Haslett1-5/+5
Tagging schema tests against schemaupgrade_dc test target and fixing some DN assertions to be more generic. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2019-04-08CVE-2019-3870 pysmbd: Include tests to show the outside umask has no impactAndrew Bartlett2-1/+14
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13834 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-04-08CVE-2019-3870 tests: Extend smbd tests to check for umask being overwrittenTim Beale3-4/+53
The smbd changes the umask - if the code fails to restore the umask to what it was, then this is very bad. Add an extra check to every smbd-related test that the umask at the end of the test is the same as what it was at the beginning (i.e. if the smbd code changed the umask then it correctly restored the value afterwards). As the selftest sets the umask for all tests to zero, it makes it hard to detect this problem, so the test setUp() needs to set it to something else first. This extra checking is added to the setUp()/tearDown() so that it applies to all test-cases. However, any failure that occur with this approach will not be able to be known-failed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13834 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-04-08ldb: tests for <= and >= integer indexingAaron Haslett1-0/+15
Testing max, min and negative values for indexed 32 and 64 bit types. This has to be done in two different files because the 64 bit type is LDB_SYNTAX_INTEGER which is implemented at the ldb level, while the 32 bit is added in the ldb-samba module. Schema syntax binding added for ldb-samba. We also need to make sure that full scans are not invoked for LMDB. Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-04-05tests: Add test for setting min/maxPwdAgeTim Beale1-0/+38
Currently setting maxPwdAge doesn't work at all. While we're adding a test, we might as well assert that minPwdAge can't be greater than maxPwdAge as well. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13873 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-04-02Spelling fixes s/overrided/overridden/Mathieu Parent1-1/+1
Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-03-22selftests:password_hash: Raise SHA256 rounds to 5000Samuel Cabrero1-2/+2
Some crypt_r implementations like libxcrypt require a higher value. Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2019-03-21selftest: Remove mention of --extra-python from commentAndrew Bartlett1-1/+1
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>