summaryrefslogtreecommitdiff
path: root/python
Commit message (Collapse)AuthorAgeFilesLines
* test/source_chars: ignore testdata/compressionDouglas Bagnall2022-12-011-0/+1
| | | | | | | We are going to have all kinds of rubbish there. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* s3: Test that store_smb2_posix_info hides info for '..'David Mulder2022-11-291-1/+25
| | | | | Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tests/s3: Test file/dir permissions with SMB3 posixDavid Mulder2022-11-291-0/+56
| | | | | Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* tests/s3: Test case sensitive open with SMB3 posixDavid Mulder2022-11-291-0/+37
| | | | | | | | Disabled because we don't handle posix paths correctly yet. Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* tests/s3: Test delete on close with SMB3 posixDavid Mulder2022-11-291-0/+22
| | | | | Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* tests/s3: Test reserved chars in posix filenameDavid Mulder2022-11-291-0/+29
| | | | | | | | Disabled because we don't handle posix paths correctly yet. Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* tests/s3: Test SMB2_FIND_POSIX_INFORMATION dir queryDavid Mulder2022-11-291-0/+48
| | | | | Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Volker Lendecke <vl@samba.org>
* tests: Start testing smb2 symlink error returnsVolker Lendecke2022-11-221-0/+166
| | | | | | | | | | This still all fails, but if you run them against Windows they work. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Nov 22 19:25:34 UTC 2022 on sn-devel-184
* tests: Start testing reparsepointsVolker Lendecke2022-11-221-0/+167
| | | | | | | | | | | | | | | | | | | | | | This still all fails, but if you run them against Windows they work. How to run: PYTHONPATH=bin/python \ LOCAL_PATH=/tmp \ SMB1_SHARE=share \ SMB2_SHARE=share \ SHARENAME=share \ SERVER_IP=<server-ip> \ DOMAIN=<your-domain> \ USERNAME=Administrator \ PASSWORD=<your-password> \ SMB_CONF_PATH=/usr/local/samba/etc/smb.conf \ SERVERCONFFILE="$SMB_CONF_PATH" \ python3 -m samba.subunit.run samba.tests.reparsepoints Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tests: Fix an incorrect commentVolker Lendecke2022-11-221-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Add "DOMAIN" to authentication credsVolker Lendecke2022-11-221-0/+1
| | | | | | | | | If you want to create symlinks on Windows using reparse points, you need to authenticate as local administrator, just "administrator" is not enough. So this is required to run some tests against Windows. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: Test PAM Access with DENY_ALLDavid Mulder2022-11-211-2/+5
| | | | | | | | Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Nov 21 22:05:01 UTC 2022 on sn-devel-184
* gp: PAM Access should implicitly deny ALL w/ allowDavid Mulder2022-11-212-9/+48
| | | | | | | | | If an allow entry is specified, the PAM Access CSE should implicitly deny ALL (everyone other than the explicit allow entries). Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: samba-tool manage gpo access add don't fail w/out upnDavid Mulder2022-11-211-5/+3
| | | | | | | | | The search response for the user could possibly not include a upn (this happens with Administrator for example). Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: Make samba-tool gpo manage sudoers remove backward compatibleDavid Mulder2022-11-211-18/+46
| | | | | | | | Ensure `samba-tool gpo manage sudoers remove` is backward compatible with the GPME sudo rules. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: Test that samba-tool gpo manage removes gpme sudoersDavid Mulder2022-11-211-0/+35
| | | | | | | | | | The file format for storing the sudo rules changed in samba-tool, but these can still be added via the GPME. We should still include them here. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: Make samba-tool gpo manage sudoers list backward compatibleDavid Mulder2022-11-211-18/+42
| | | | | | | | Ensure `samba-tool gpo manage sudoers list` is backward compatible with the GPME sudo rules. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: Test that samba-tool gpo manage lists gpme sudoersDavid Mulder2022-11-211-0/+18
| | | | | | | | | | The file format for storing the sudo rules changed in samba-tool, but these can still be added via the GPME. We should still include them here. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: Fix startup scripts add not always set runonceDavid Mulder2022-11-151-1/+1
| | | | | | | | | | | The runonce is always being set because neither True nor False is ever None. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Nov 15 02:09:45 UTC 2022 on sn-devel-184
* gp: Fix startup scripts list not fail with empty argsDavid Mulder2022-11-151-1/+5
| | | | | | | | This fixes the startup scripts list command to not fail when the parameters variable is empty. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: startup scripts list enclude newline in outputDavid Mulder2022-11-151-1/+1
| | | | | | | | | The output for listing startup scripts wasn't clear because there was no newline between entries. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: startup scripts add clarify 'args' optionDavid Mulder2022-11-151-1/+1
| | | | | | | | | Make sure it is clear how to specify args for the command, and that multiple args can be passed wrapped in quotes. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: Fix startup scripts add argsDavid Mulder2022-11-151-1/+1
| | | | | | | | | The args for the command could not be parsed because samba-tool detects the '-' and thinks its part of the samba-tool command. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: Test that Password and Kerberos policies fail on unknown keyDavid Mulder2022-11-121-1/+2
| | | | | | | | Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Nov 12 01:34:17 UTC 2022 on sn-devel-184
* gp: Password and Kerberos policies fail on unknown keyDavid Mulder2022-11-121-0/+4
| | | | | | | | If unrecognized keys are set in the GptTmpl.inf, the extensions would fail to apply. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gp: Ignore crontab -l error, since it means emptyDavid Mulder2022-11-081-1/+2
| | | | | | | | | | | We should not fail when crontab -l errors, this just means the crontab is empty. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Nov 8 22:33:37 UTC 2022 on sn-devel-184
* tests/krb5: Add tests of PAC group handlingJoseph Sutton2022-11-082-0/+1204
| | | | | | | | | | | | | | | | | | | | | In which we make AS and TGS requests and verify the SIDs we expect are returned in the PAC. Example command to test against Windows Server 2019 functional level 2016 with FAST enabled: ADMIN_USERNAME=Administrator ADMIN_PASSWORD=locDCpass1 \ CLAIMS_SUPPORT=1 COMPOUND_ID_SUPPORT=1 DC_SERVER=ADDC.EXAMPLE.COM \ DOMAIN=EXAMPLE EXPECT_PAC=1 FAST_SUPPORT=1 KRB5_CONFIG=krb5.conf \ PYTHONPATH=bin/python REALM=EXAMPLE.COM SERVER=ADDC.EXAMPLE.COM \ SKIP_INVALID=1 SMB_CONF_PATH=smb.conf STRICT_CHECKING=1 \ TKT_SIG_SUPPORT=1 python3 python/samba/tests/krb5/group_tests.py Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Nov 8 03:37:37 UTC 2022 on sn-devel-184
* tests/krb5: Allow checking domain SID in PACJoseph Sutton2022-11-081-0/+9
| | | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests/krb5: Overhaul PAC logon info group checkingJoseph Sutton2022-11-082-36/+142
| | | | | | | | | | | | | | | | | We can now verify attributes of SIDs and the PAC locations in which SIDs are placed. We also gain the ability to assert that no SIDs are present in the PAC other than the ones we expect. We lighten somewhat the requirement that no duplicates are present among the SIDs, as such a situation may arise even with Windows, especially if group types are changed. For example, if a Universal group containing a user is changed to a Domain-Local group in between an AS-REQ and a TGS-REQ, the group's SID will be added to the PAC once for each request. We only verify that there are no exact duplicates (SID, attributes, and PAC location all being identical). Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests/krb5: Add (un)expected group parameters to get_service_ticket() and ↵Joseph Sutton2022-11-081-0/+14
| | | | | | | get_tgt() Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests/krb5: Allow creating accounts without Resource SID compression supportJoseph Sutton2022-11-081-0/+5
| | | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests/krb5: Allow adding multiple members to a groupJoseph Sutton2022-11-081-4/+11
| | | | | | | | As well as passing in a single 'str', we can now choose to pass a collection of member DN strings. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests/krb5: Allow creating groups with a specified typeJoseph Sutton2022-11-081-2/+4
| | | | | | | This will be useful for testing the handling of Domain-Local groups. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests/krb5: Fix bits_to_etypes() to not fail on Resource SID compression bitJoseph Sutton2022-11-081-1/+4
| | | | | | | It's not an encryption type bit, so we should ignore it here. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests/krb5: Remember to pass in expected_groups parameterJoseph Sutton2022-11-081-0/+1
| | | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests/krb5: Remove unused copy-and-paste remnantJoseph Sutton2022-11-081-6/+0
| | | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Add Heimdal test file test_base.c to bi-directional encoding ignore listAndrew Bartlett2022-11-021-0/+1
| | | | | | | | Heimdal commit c6a46f0c96dde73ef4f3a247a1e904d4cf15aeb2 introduces test data that triggers our LTR and RTL detection code. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* tests: Use samba.tests.libsmb.LibsmbTests in smb3unix.pyVolker Lendecke2022-10-271-26/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tests: Use samba.tests.libsmb.LibsmbTests in libsmb-basic.pyVolker Lendecke2022-10-271-33/+22
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tests: Factor out libsmb environment setupVolker Lendecke2022-10-271-0/+43
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tests: Rename python/samba/tests/libsmb.pyVolker Lendecke2022-10-271-0/+0
| | | | | | | | | samba/libsmb.py will become a common file to do the library initialization for our tests. We already have two copies in smb3unix.py and libsmb.py, and there might be more soon. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gpo: Fix startup scripts to not fail w/out paramsDavid Mulder2022-10-251-2/+10
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=15212 Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): David Mulder <dmulder@samba.org> Autobuild-Date(master): Tue Oct 25 15:21:08 UTC 2022 on sn-devel-184
* gpo: Test to ensure startup scripts don't crash w/out paramsDavid Mulder2022-10-251-1/+48
| | | | | | | | | | Startup scripts were failing to execute when no parameters were provided to the script. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15212 Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/tests: fix samba.tests.auth_log_pass_change for later gnutlsNoel Power2022-10-251-4/+16
| | | | | | | | | | | | | later gnutls that support GNUTLS_PBKDF2 currently fail, we need to conditionally switch test data to reflect use of 'samr_ChangePasswordUser3' or 'samr_ChangePasswordUser4' depending on whether GNUTLS_PBKDF2 is supported or not Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Oct 25 10:30:59 UTC 2022 on sn-devel-184
* python: Remove unused imports in auth_log testsJoseph Sutton2022-10-212-2/+0
| | | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* python: Fix invalid escape by using a raw stringJoseph Sutton2022-10-211-1/+1
| | | | | | | | These escapes are meant for the regular expression engine not the string parser. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* python: Use list comprehension in string_to_byte_array()Joseph Sutton2022-10-211-6/+1
| | | | | | | | Samba is now a mature user of Python and can cope with a list comprehension from time to time. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* samba-tool: Fix double-word in samba-tool domain passwordsettingsJoseph Sutton2022-10-211-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14034 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s4-join: Fix typos in recent GET_ANC patch setJoseph Sutton2022-10-211-1/+1
| | | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* tests/krb5: Add test requesting a TGT expiring post-2038Joseph Sutton2022-10-201-2/+11
| | | | | | | | | | | | | | This demonstrates the behaviour of Windows 11 22H2 over Kerberos, which changed to use a year 9999 date for a forever timetime in tickets. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15197 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Oct 20 05:00:23 UTC 2022 on sn-devel-184