summaryrefslogtreecommitdiff
path: root/python/samba/tests
AgeCommit message (Collapse)AuthorFilesLines
2020-11-09tests python krb5: Add python kerberos compatability testsGary Lockyer2-0/+175
Add new python test to document the differences between the MIT and Heimdal Kerberos implementations. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-11-06selftest: add a test for the CreateTrustedDomainRelax wrapperIsaac Boukris1-0/+131
Originally copied from 'source4/scripting/devel/createtrust' (had to drop the TRUST_AUTH_TYPE_VERSION part though, as it fails against samba DC). Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-11-06selftest: add a test for py dce transport_encryptedIsaac Boukris1-1/+22
Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-11-05Revert "cli_credentials_parse_string: fix parsing of principals"Alexander Bokovoy1-2/+2
This reverts commit eb0474d27bae4592b25ac6bf600da29c6a1cb9f8.
2020-11-04tests python krb5: Add python kerberos canonicalization testsGary Lockyer2-0/+500
Add python canonicalization tests, loosely based on the code in source4/torture/krb5/kdc-canon-heimdal.c. The long term goal is to move the integration level tests out of kdc-canon-heimdal, leaving it as a heimdal library unit test. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-11-04tests python krb5: Add canonicalize flag to ASN1Gary Lockyer2-6/+6
Add the canonicalize flag to KerberosFlags, so that it can be used in python based canonicalization tests. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-11-04tests python krb5: Make PrincipalName_create a class methodGary Lockyer1-0/+1
Make PrincipalName_create a class method, so it can be used in helper classes. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-11-04cli_credentials_parse_string: fix parsing of principalsAlexander Bokovoy1-2/+2
When parsing a principal-like name, user name was left with full principal instead of taking only the left part before '@' sign. >>> from samba import credentials >>> t = credentials.Credentials() >>> t.parse_string('admin@realm.test', credentials.SPECIFIED) >>> t.get_username() 'admin@realm.test' The issue is that cli_credentials_set_username() does a talloc_strdup() of the argument, so we need to change order of assignment to allow talloc_strdup() to copy the right part of the string. Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-11-04selftest: add test for new "samba-tool user unlock" commandBjörn Baumbach1-0/+41
Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Wed Nov 4 00:19:25 UTC 2020 on sn-devel-184
2020-10-29tests: avoid returning an already used ID in randomXid()Jule Anger1-3/+17
The error 'uidNumber xxx is already being used.' in the samba tool tests occurs when the random.randint functions returns the same value twice and therefore a user or group with an already used gid or uid should be created. Avoid this error by adding a list that stores the used IDs, so that the randomXid function can check wheter a value is already used before returning it. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Oct 29 18:54:24 UTC 2020 on sn-devel-184
2020-10-29python:tests: Add SAMR password change tests for fipsAndreas Schneider1-0/+188
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-10-21python/tests: add DynamicTestCase setUpDynamicTestCases() infrastructureStefan Metzmacher1-0/+27
This can be used in order to run a sepcific test (coded just once) with an autogenerated set of arguments. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14531 Pair-Programmed-With: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-02python2 reduction: Merge remaining compat code into commonDavid Mulder12-19/+13
The remaining compat code (get_string, get_bytes, cmp) are useful helper routines which we should simply merge into common (especially since there is some duplication here). Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): David Mulder <dmulder@samba.org> Autobuild-Date(master): Fri Oct 2 14:49:36 UTC 2020 on sn-devel-184
2020-10-02python: Move dsdb_Dn to samdbDavid Mulder1-2/+2
The import dsdb needed for dsdb_Dn causes import errors when trying to import get_bytes/get_string in some places. Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool tests: rename 'contact create' to 'contact add'Jule Anger1-5/+5
Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Thu Oct 1 02:44:09 UTC 2020 on sn-devel-184
2020-10-01samba-tool tests: rename 'group create' to 'group add'Jule Anger1-1/+1
Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool tests: rename 'computer create' to 'computer add'Jule Anger1-7/+7
Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool tests: rename 'user create' to 'user add'Jule Anger1-5/+5
Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool tests: rename 'ou create' to 'ou add'Jule Anger4-14/+14
Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool tests: add test-cases for 'contact rename'Jule Anger1-0/+126
Tests the following options: --surname --given-name --initials --force-new-cn --reset-cn --display-name --mail-address Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool tests: add test-cases for 'group rename'Jule Anger1-0/+75
Tests the following options: --samaccountname --force-new-cn --reset-cn --mail-address Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool tests: add test-cases for 'user rename'Jule Anger1-0/+234
Tests the following options: --surname --given-name --initials --force-new-cn --reset-cn --display-name --mail-address --samaccountname --upn Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-09-07python/tests/gpo: this should fix a Popen deadlockStefan Metzmacher1-11/+10
It is inspired by commit 5dc773a5b00834c7a53130a73a48f49048bd55e8 Author: Joe Guo <joeg@catalyst.net.nz> Date: Fri Sep 15 16:13:26 2017 +1200 python: use communicate to fix Popen deadlock `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. 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> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Oct 19 09:27:16 CEST 2017 on sn-devel-144 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
2020-09-02gpo: Test rsop function for successDavid Mulder1-0/+10
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-09-02samba-tool: Test creating unix user with modified template homedirDavid Mulder1-0/+8
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-31python/samba/tests/blackbox: Tests with nested DFS containerNoel Power1-0/+96
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Aug 31 19:09:24 UTC 2020 on sn-devel-184
2020-08-31python/samba/tests/blackbox: python smbcacls '--propagate-inherit' testNoel Power1-0/+1291
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-31python/samba/tests/blackbox: Preparatory change to support custom shareNoel Power1-5/+5
tearDown method doesn't handle local file deletion fallback if a share other than 'tmp' is used Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-31python/samba/tests:blackbox: Fix local file delete test tree fallbackNoel Power1-5/+5
Wrong indentation ensures the fallback where we use file system removal of test files if the test's tearDown method fails. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-31python/samba/tests/blackbox: Fix undetected deltree failNoel Power1-1/+3
With msdfs root share smbclient deltree command can fail without setting the errorcode (e.g. when do_list encounters an error it will log a warning message and continue rather than error out fatally) Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-27GPO: Test rsop output for Messages policyDavid Mulder1-2/+14
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-08-27gpo: Test Group Policy Login Prompt MessageDavid Mulder1-8/+20
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-08-27gpo: Test Group Policy Message of the dayDavid Mulder1-0/+52
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-08-27GPO: Test rsop output for smb.conf policyDavid Mulder1-2/+16
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-08-27gpo: Test Group Policy smb.conf ExtensionDavid Mulder1-0/+83
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-08-27gpo: Fix unapply failure when multiple extensions runDavid Mulder1-10/+8
When multiple Group Policy Extensions are present, only the last executed extension saves it's changes to the Group Policy Database, due to the database being loaded seperately for each extension. Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-08-27gpo: Test multiple extention unapplyDavid Mulder1-0/+81
Verify that an unapply of multiple extentions deletes the script files and policy settings. Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-08-27gpo: Cleanup sudoers policy testDavid Mulder1-0/+7
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-08-27gpo: Cleanup script policy testDavid Mulder1-0/+7
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-08-27gpo: Test rsop output for Sudoers policyDavid Mulder1-2/+16
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-08-19python:tests: Add test for SMB encrypted DCERPC connectionAndreas Schneider1-0/+82
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): Wed Aug 19 17:46:28 UTC 2020 on sn-devel-184
2020-08-19python: Add a test for SMB encryptionAndreas Schneider1-0/+37
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19s3:client: Turn off smb signing for message opAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19python:tests: Set smb ipc signing via the creds APIAndreas Schneider1-0/+4
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19python:tests: Mark libsmb connection as an IPC connectionAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19auth:creds: Add python bindings for cli_credentials_set_conf()Andreas Schneider1-0/+33
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19auth:creds: Add python bindings for (get|set)_smb_encryptionAndreas Schneider1-0/+6
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19auth:creds: Add python bindings for (get|set)_smb_ipc_signingAndreas Schneider1-0/+6
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19auth:creds: Add python bindings for (get|set)_smb_signingAndreas Schneider1-0/+6
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19auth:creds: Introduce CRED_SMB_CONFStefan Metzmacher1-2/+2
We have several places where we check '> CRED_UNINITIALISED', so we better don't use CRED_UNINITIALISED for values from our smb.conf. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>