summaryrefslogtreecommitdiff
path: root/source4/torture/basic
AgeCommit message (Collapse)AuthorFilesLines
2025-04-18s4:libcli: pass struct loadparm_context to smb_composite_connect_send()Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: pass struct loadparm_context to smbcli_socket_connect()Stefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: remove unused ports from smbcli_socket_connect()Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: remove unused dest_ports from struct smb_composite_connectStefan Metzmacher1-1/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-03-27smbtorture: add "base.delaywrite.modern_write_time_update-1"Ralph Boehme1-1/+311
The test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.delayed update of write time 6" for ↵Ralph Boehme1-62/+69
modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.delayed update of write time 5b" for ↵Ralph Boehme1-3/+3
modern SMB delayed write No need to run the loops for so long with modern write time behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.delayed update of write time 5" for ↵Ralph Boehme1-32/+20
modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.delayed update of write time 4" for ↵Ralph Boehme1-57/+26
modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.delayed update of write time 3c" for ↵Ralph Boehme1-49/+36
modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.delayed update of write time 3b" for ↵Ralph Boehme1-61/+45
modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.delayed update of write time 3a" for ↵Ralph Boehme1-65/+35
modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.delayed update of write time 3" for ↵Ralph Boehme1-48/+37
modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.delayed update of write time using 2 ↵Ralph Boehme1-82/+40
connections" for modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.update of write time using ↵Ralph Boehme1-77/+29
SET_ALLOCATION_SIZE" for modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.update of write time using ↵Ralph Boehme1-80/+35
SET_END_OF_FILE" for modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.update of write time and SMBwrite ↵Ralph Boehme1-82/+28
truncate expand" for modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.update of write time and SMBwrite ↵Ralph Boehme1-22/+15
truncate" for modern SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.delayed update of write time" for modern ↵Ralph Boehme1-35/+7
SMB delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: adjust "base.delaywrite.finfo update on close" for modern SMB ↵Ralph Boehme1-11/+4
delayed write The adjusted test passes against Windows Server 2022. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: change variable name in SET_INFO_FILE_EX macroRalph Boehme1-9/+9
Allows using the variable name sfinfo in functions that use the macro. No change in behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2025-03-27smbtorture: whitespace in test_delayed_write_update2()Ralph Boehme1-17/+17
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-07-16s4:torture: Initialize struct smb_nttransAndreas Schneider1-1/+1
"Error: UNINIT (CWE-457): samba-4.20.0rc2/source4/torture/basic/scanner.c:368: var_decl: Declaring variable ""parms"" without initializer. samba-4.20.0rc2/source4/torture/basic/scanner.c:388: uninit_use_in_call: Using uninitialized value ""parms.in.setup"" when calling ""smb_raw_nttrans"". 386| parms.in.data = ntdata_blob; 387| 388|-> status = smb_raw_nttrans(cli->tree, mem_ctx, &parms); 389| 390| if (NT_STATUS_IS_ERR(status)) {" Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2024-07-16s4:torture: Remove tailing spaces in scanner.cAndreas Schneider1-20/+20
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2024-04-16lib: Give lib/util/util_file.c its own header fileVolker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2024-02-26source4/torture: Add SEC_STD_DELETE to enable proper cleanupAnoop C S1-1/+29
basic.maximum_allowed and smb2.maximum_allowed attempt to unlink the files created by those tests. But the restrictive SD with which they were created prohibits the deletion inside shares where vfs_acl_xattr is configured including "ignore system acls". The very same file will otherwise cause problems while progressing with remaining sub tests. SEC_STD_DELETE could be the minimum required additional access mask to successfully delete the file under the said configuration using vfs_acl_xattr and "ignore system acls" option without loosing the integrity of the overall test. Signed-off-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Feb 26 18:35:43 UTC 2024 on atb-devel-224
2023-09-27s4:torture: Initialize ‘tm’ structureJoseph Sutton1-1/+1
‘tm’ must be initialized prior to calling strptime(). Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-21s4:torture: Fix code spellingJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-14s4:torture:basic: Fix code spellingAndreas Schneider4-10/+10
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-14s4:torture: Fix code spellingJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-01s4:torture:basic: use milliseconds granularity in delayed_write_update7Amir Goldstein1-3/+4
The test sets an mtime with non zero nsec and verifies that the timestamp of pre-close matches the timestamp after close-open. This is a regression test for https://bugzilla.samba.org/show_bug.cgi?id=6529 The bug speaks of loosing the milliseconds part of the timestamp, but the test uses a value of 103*100ns for the sub-second part. Meaning that if the backing filesystem has only milliseconds granularity, the test practically checks that a value of 0 milliseconds is preserved, which will not have actually caught the bug. Also, with the default 'smbd getinfo ask sharemode = yes' the test will fail if the filesystem truncates the sub-second part to milliseconds granularity. Use a non-zero milliseconds value with zero microseconds in the test to support backing filesystems with milliseconds granularity. Signed-off-by: Amir Goldstein <amir@ctera.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Mar 1 20:55:47 UTC 2023 on atb-devel-224
2023-03-01s4:torture:basic: fix SET_INFO_* macros in delayed_write_update*Amir Goldstein1-3/+3
The macros were ignoring the finfo argument. Signed-off-by: Amir Goldstein <amir@ctera.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-01-13CI: add a test for @GMT mask in SMB1 findRalph Boehme1-0/+41
Without FLAGS2_REPARSE_PATH a path containing an @GMT token can be used to create a file including the @GMT token in the name and a directory list will also return the file as result. Verified against Windows. Samba behaves exactly the same. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jan 13 01:13:01 UTC 2023 on sn-devel-184
2023-01-04torture: Fix whitespaceVolker Lendecke1-267/+267
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-02-17source4/torture: Drop unused variable tdifMartin Schwenke1-3/+0
clang complains: ../../source4/torture/basic/denytest.c:1805:11: error: variable 'tdif' set but not used [-Werror,-Wunused-but-set-variable] int64_t tdif; ^ That is, the variable is initialised and updated but the value is never used. Perhaps it is meant to be used in the nearby torture_comment() call, but it has been this was since commit cb1cff90f165d82cbbf1dd87e475a1b13984d45e from 2004. Just drop it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
2022-02-17source4/torture: Avoid unused variableMartin Schwenke1-1/+1
clang complains: ../../source4/torture/basic/delete.c:2342:7: error: variable 'correct' set but not used [-Werror,-Wunused-but-set-variable] bool correct = true; ^ That is, the variable is initialised and updated but the value is never used. Similar functions return this variable, so try that. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
2021-12-09s4: torture: Use smbcli_unlink_wcard() in base.casetable test.Jeremy Allison1-1/+1
Avoid smbcli_unlink() calls with a wildcard path. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2021-12-09s4: torture: Use smbcli_unlink_wcard() to cleanup in base.mangle test.Jeremy Allison1-1/+1
Avoid using smbcli_unlink() calls with wildcard names. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2021-12-09s4: torture: Use smbcli_unlink_wcard() to remove wildcards in base.chkpath test.Jeremy Allison1-2/+2
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-16s4:torture: Migrate smbtorture to new cmdline option parserAndreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-10-28s4:torture: Pass buffer correctly to write()Andreas Schneider1-1/+1
../../source4/torture/basic/denytest.c: In function ‘torture_createx_specific.isra’: ../../source4/torture/basic/denytest.c:2372:9: error: ‘write’ reading 56 bytes from a region of size 8 [-Werror=stringop-overflow=] 2372 | res = write(data_file_fd, &cxd, cxd_len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUG: https://bugzilla.samba.org/show_bug.cgi?id=14555 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Oct 28 17:52:19 UTC 2020 on sn-devel-184
2020-08-28lib/util: remove extra safe_string.h fileMatthew DeVore1-0/+2
lib/util/safe_string.h is similar to source3/include/safe_string.h, but the former has fewer checks. It is missing bcopy, strcasecmp, and strncasecmp. Add the missing elements to lib/util/safe_string.h remove the other safe_string.h which is in the source3-specific path. To accomodate existing uses of str(n?)casecmp, add #undef lines to source files where they are used. Signed-off-by: Matthew DeVore <matvore@google.com> Reviewed-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Aug 28 02:18:40 UTC 2020 on sn-devel-184
2020-06-24torture4: openattr always succeedsDavid Mulder1-4/+8
Because this test returned true, it would always succeed, despite failures in the test. Make it return false if there are failures. Also, removed a stray CHECK_MAX_FAILURES introduced by commit 8773e743 that caused the test to *always* fail (but always be ignored). Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Isaac Boukris <iboukris@samba.org> Autobuild-User(master): David Mulder <dmulder@samba.org> Autobuild-Date(master): Wed Jun 24 22:13:11 UTC 2020 on sn-devel-184
2020-05-05s4: torture: Add an SMB1-specific open root of share with @GMT-path test - ↵Jeremy Allison1-0/+47
base.smb1-twrp-openroot Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-30s4:torture: Skip the deltest20 as user rootAndreas Schneider1-0/+4
The test is meant to be run as a user and not root. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14257 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Jan 30 16:54:33 UTC 2020 on sn-devel-184
2019-09-01Spelling fixes s/ upto / up to /Mathieu Parent1-4/+4
Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-03-04s4:torture: Make sure we do not create a shadow 'struct params'Andreas Schneider1-14/+16
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-01-08s4:torture:base:bench-readwrite: fix uninitialized memory causing segfaultAliaksei Karaliou1-2/+2
Allocation of 'struct smb_composite_connect' happens without zeroing so that smb_composite_connect_send() thinks that connection already exists and fails on its handling. Signed-off-by: Aliaksei Karaliou <akaraliou@panasas.com> Reviewed-by: Douglas Bagnall <dbagnall@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-11-30Fix spelling mistakesOlly Betts1-1/+1
Signed-off-by: Olly Betts <olly@survex.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-08-10s4/torture: Add new test for DELETE_ON_CLOSE on non-empty directoriesAnoop C S1-0/+87
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13204 Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>