summaryrefslogtreecommitdiff
path: root/python/samba/tests/blackbox
AgeCommit message (Collapse)AuthorFilesLines
2026-03-30python:tests: Fix assertEqual placement in test_device_group_restrictionsAndreas Schneider1-5/+4
The assertEqual calls checking the exception attributes were incorrectly indented inside the 'with self.assertRaises()' block. When the expected NTSTATUSError is raised by verify_access(), execution exits the block immediately, so those lines were never reached. When the exception is not raised (e.g. with MIT KRB5 1.22 where a spurious FAST error was fixed), execution falls through to the assertEqual inside the block, causing AttributeError because error.exception is only available after the 'with' block exits. The exception returned is NT_STATUS_UNSUCCESSFUL with Heimdal. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2026-02-18CVE-2026-20833: python:tests: Set secure channel type for test credentialsJennifer Sutton1-0/+2
This will ensure that we use the correct salting algorithm for AES when we authenticate using gensec. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15998 Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2025-10-10mdssvc: implement elasticsearch:default_fieldsRalph Boehme1-1/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15927 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-10-10mdssvc: fix filtering by share path prefixRalph Boehme1-2/+15
To correctly filter by share path, use a filter with a prefix match. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15927 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-07-10tests: Replace PREFIX_ABS with PREFIXPavel Filipenský1-1/+1
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2025-06-05pytests: samba_dnsupdate --use-samba-tool versus existing recordsDouglas Bagnall1-0/+13
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13613 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz> Reviewed-by: Rowland Penny <rpenny@samba.org>
2024-07-17python:tests: Fix spelling in to test_samba_dnsupdate_no_changePavel Filipenský1-2/+2
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-06-11selftest: Add a python blackbox test for some misc (widelink) DFS testsNoel Power1-0/+86
On master attempting to chdir into a nested dfs link e.g. cd dfslink (works) cd dfslink/another_dfslink (fails) [1] Add a test for this scenario (nested chdir) [2] Add test for enumerating a dfs link in root of dfs share [3] Add a test to check case insensitive chdir into dfs link on widelink enabled share Add knownfails for tests 1 and 3 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=15435
2024-05-22python:tests: Ignore case for group_name comparisonAndreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-29python/samba/tests/blackbox: Add tests for Inherit-only flag propagationyuzu3671-0/+108
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15636 Signed-off-by: Anna Popova <popova.anna235@gmail.com> Reviewed-by: Noel Power <noel.power@suse.com> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-04-16python:tests: Replace deprecated method assertRaisesRegexp()Jo Sutton1-1/+1
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-09auth/credentials: Read managed_password.passwords.query_interval only after ↵Andrew Bartlett1-1/+1
parsing The code previously read the uninitialised stack not the parsed structure, and so could segfault if the stack was not zero. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jo Sutton <josutton@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Apr 9 23:59:54 UTC 2024 on atb-devel-224
2024-04-09python/samba/tests: Fix gMSA blackbox test to expect failure to get password ↵Andrew Bartlett1-4/+8
after membership change Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2024-04-08selftest: Add new test for testing non-chunk transfer encodingNoel Power1-1/+14
And add a known fail because there is a bug :-( BUG: https://bugzilla.samba.org/show_bug.cgi?id=15611 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-08selftest: fix potential reference before assigned errorNoel Power2-2/+2
This would only happen if the test failed (but the message would be incorrect as 'e' the exception to be stringified doesn't exist. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15611 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-28netcmd: auth policy: remove old user-allowed-to-authenticate-from-silo and groupRob van der Linde1-6/+6
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-28netcmd: auth policy: remove old computer-allowed-to-authenticate-to-silo and ↵Rob van der Linde1-6/+7
group Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-27libcli/http: Handle http chunked transfer encodingNoel Power1-1/+1
Also removes the knownfail for the chunked transfer test Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=15611
2024-03-27tests: add test for chunked encoding with http cli libraryNoel Power1-0/+116
Adds http test client to excercise the http client library and a blackbox test to run the client. This client is built only with selftest also adds a knownfail for the test Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=15611
2024-03-27selftest: Add basic content-lenght http testsNoel Power1-0/+95
very simple test of basic http request/response plus some checks to ensure http response doesn't exceed the response max length set by the client call. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15611 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-20tests: gmsa blackbox testsRob van der Linde1-0/+202
Signed-off-by: Rob van der Linde <rob@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): Wed Mar 20 04:53:57 UTC 2024 on atb-devel-224
2024-02-27python/tests: Add test for new krb5 keytab parserAndrew Bartlett1-0/+18
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2024-01-26python:tests/rpcd_witness_samba_only: add tests for 'net witness force-response'Stefan Metzmacher1-3/+164
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2024-01-26python:tests/rpcd_witness_samba_only: add tests for 'net witness ↵Stefan Metzmacher1-0/+34
force-unregister' Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2024-01-26python:tests/rpcd_witness_samba_only: add tests for 'net witness ↵Stefan Metzmacher1-5/+212
{client,share}-move' Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2024-01-26python:tests/rpcd_witness_samba_only: add tests for 'net witness list'Stefan Metzmacher1-0/+477
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2024-01-26python/blackbox: add rpcd_witness_samba_only.py testStefan Metzmacher1-0/+459
This tests the witness service and its interaction with ctdb. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2023-12-08python:tests: Remove leftover debugging messageJoseph Sutton1-2/+0
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-12-08python:tests: Remove unnecessary f‐stringsJoseph Sutton1-4/+4
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-30python: Correct Python2 super() calls that called the wrong classAndrew Bartlett1-1/+1
These changes have been checked as safe as skipping a superclass has no actual impact. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2023-11-30python: tests: update all super calls to python 3 style in testsRob van der Linde10-14/+14
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> [abartlet@samba.org Some python2 style super() calls remain due to being an actual, even if reasonable, behaviour change]
2023-11-30python: get rid of pointless empty overridden methodsRob van der Linde3-9/+0
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-29tests: claims blackbox: add device and server silo restrictions testRob van der Linde1-2/+124
Signed-off-by: Rob van der Linde <rob@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): Wed Nov 29 04:15:27 UTC 2023 on atb-devel-224
2023-11-29python: tests: claims blackbox tests use ntstatus constantsRob van der Linde1-2/+3
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2023-11-29tests: claims blackbox: use raw strings rather than escaping \Rob van der Linde1-5/+5
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2023-11-29tests: claims: blackbox device testsRob van der Linde1-1/+167
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2023-11-23Claims initial black box testsRob van der Linde1-0/+239
Signed-off-by: Rob van der Linde <rob@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): Thu Nov 23 00:32:33 UTC 2023 on atb-devel-224
2023-11-20python:tests: Add ndrdump test for GMSA Managed Password blobsJoseph Sutton1-0/+24
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): Mon Nov 20 22:51:17 UTC 2023 on atb-devel-224
2023-11-15python/samba/tests: Add smbcacl tests for save/restoreNoel Power1-0/+205
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-17libcli/util: let win_errstr() fallback to hresult_errstr()Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13python:tests: Remove semicolonsJoseph Sutton1-15/+15
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-21python:tests: Fix spellingJoseph Sutton4-4/+4
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-07-28librpc/idl: Remove DCOM and WMI IDLAndrew Bartlett1-59/+0
As hinted in f2416493c0c779356606aebf0aceca8fa416b55c the DCOM and WMI IDL is now unused. These generate code with PIDL, costing a small amount of build time but more importantly are fuzzed, which costs an ongoing amount of CPU time as oss-fuzz tries to find parsing issues. We do not need to continue this waste, and these can be restored if this effort is ever to start again. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-07-26mdssvc: reduce pagesize to 50Ralph Boehme1-1/+1
Lastest macOS queries additional file metadata per search result, which causes the mashalled paged result set including metadata to exceed the 64 KB result fragment buffer. Lacking fragementation support in mdssvc (it's supported by the protocol), for now just reduce the maximum number of results per search page. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15342 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-07-21CVE-2023-34968: mdscli: return share relative pathsRalph Boehme1-6/+2
The next commit will change the Samba Spotlight server to return absolute paths that start with the sharename as "/SHARENAME/..." followed by the share path relative appended. So given a share [spotlight] path = /foo/bar spotlight = yes and a file inside this share with a full path of /foo/bar/dir/file previously a search that matched this file would returns the absolute server-side pato of the file, ie /foo/bar/dir/file This will be change to /spotlight/dir/file As currently the mdscli library and hence the mdsearch tool print out these paths returned from the server, we have to change the output to accomodate these fake paths. The only way to do this sensibly is by makeing the paths relative to the containing share, so just dir/file in the example above. The client learns about the share root path prefix – real server-side of fake in the future – in an initial handshake in the "share_path" out argument of the mdssvc_open() RPC call, so the client can use this path to convert the absolute path to relative. There is however an additional twist: the macOS Spotlight server prefixes this absolute path with another prefix, typically "/System/Volumes/Data", so in the example above the full path for the same search would be /System/Volumes/Data/foo/bar/dir/file So macOS does return the full server-side path too, just prefixed with an additional path. This path prefixed can be queried by the client in the mdssvc_cmd() RPC call with an Spotlight command of "fetchPropertiesForContext:" and the path is returned in a dictionary with key "kMDSStorePathScopes". Samba just returns "/" for this. Currently the mdscli library doesn't issue this Spotlight RPC request (fetchPropertiesForContext), so this is added in this commit. In the end, all search result paths are stripped of the combined prefix kMDSStorePathScopes + share_path (from mdssvc_open). eg kMDSStorePathScopes = /System/Volumes/Data share_path = /foo/bar search result = /System/Volumes/Data/foo/bar/dir/file relative path returned by mdscli = dir/file Makes sense? :) BUG: https://bugzilla.samba.org/show_bug.cgi?id=15388 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-06-23python:samba:tests: Fix code spellingAndreas Schneider2-4/+4
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-31selftest: Add test parsing krb5 PAC claims via ndrdumpAndrew Bartlett1-0/+39
Including * compressed claims * plain (uncompressed) claims 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 Mar 31 02:50:30 UTC 2023 on atb-devel-224
2023-03-31librpc/ndr: Implement lzxpress_huffman() compression in libndr for Kerberos ↵Andrew Bartlett1-1/+1
Claims Rather than just pick the next value we re-arrange compression values in libndr to be memnonic to values in MS Windows ntifs.h This helps avoid confusing developers who compare these algorithms with local the MS Windows interface. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2023-03-31librpc/ndr: Unimplement DRSUAPI_COMPRESSION_TYPE_XPRESS and renameAndrew Bartlett1-2/+2
DRSUAPI_COMPRESSION_TYPE_XPRESS is not MS-XCA nor is it implemented by lzexpress_compress(), so disconnect from that algorithm. This avoids someone fixing lzxpress_compress() to work for DRSUAPI and breaking claims support. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2023-02-20python:tests: Tell dns.resolver to not read /etc/resolv.confAndreas Schneider1-1/+3
We explicitly set the nameserver in the next line. Also the file /etc/resolv.conf might not exist on the system (e.g in Fedora mockbuild). BUG: https://bugzilla.samba.org/show_bug.cgi?id=15308 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>