summaryrefslogtreecommitdiffstats
path: root/source4/torture/smb2/ioctl.c
Commit message (Collapse)AuthorAgeFilesLines
* torture: add zero length FSCTL_SRV_COPYCHUNK testDavid Disseldorp2014-02-061-0/+64
| | | | | | | | | | | Windows Server 2012 returns NT_STATUS_INVALID_PARAMETER for FSCTL_SRV_COPYCHUNK requests that include a server-side copy length of zero, in line with MS-SMB2 3.3.5.15.6. We should match this behaviour, so test for it. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: test get/set compression ioctl permissionsDavid Disseldorp2013-11-221-0/+128
| | | | | | | | | | | | | Windows Server 2012[r2] exhibits some strange behaviour with regard to handling the compression fsctls. [READ/WRITE]_ATTR permissions are not required for the corresponding get/set compression ioctls. WRITE_DATA is required for set compression. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Nov 22 19:57:48 CET 2013 on sn-devel-104
* torture: split open from test_setup_create_fillDavid Disseldorp2013-11-221-12/+32
| | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: attempt to set compression via SetInfoDavid Disseldorp2013-11-221-2/+101
| | | | | | | | Doing so should give a successful SetInfo response, however the attribute should not be set in subsequent GetInfo / ioctl responses. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: test dir non-inherit in compress_inherit_disableDavid Disseldorp2013-11-221-8/+35
| | | | | | | | | | | Also add a note reguarding Windows 2008GM copy-chunk note: Windows 2008GM (non-R2) fails the copy-chunk src=dest overlap test, as it appears to use a different chunk copy algorithm to 208R2. Takeaway advice is to avoid using copy-chunk when the source and destination ranges overlap in the same file. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add FSCTL_SRV_COPYCHUNK_WRITE access testDavid Disseldorp2013-10-251-2/+51
| | | | | | | | | | | Check that FSCTL_SRV_COPYCHUNK_WRITE succeeds when the copy-chunk target is opened with SEC_RIGHTS_FILE_WRITE only. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Oct 25 22:48:59 CEST 2013 on sn-devel-104
* torture: support Windows 2k8 response for compress_invalid_bufDavid Disseldorp2013-08-151-4/+6
| | | | | | | | | Windows Server 2012 returns NT_STATUS_INVALID_USER_BUFFER, Windows Server 2008r2 returns NT_STATUS_INVALID_PARAMETER. Don't fail the test if either status is returned. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add more [no-]compress-on-open ioctl testsDavid Disseldorp2013-08-151-1/+144
| | | | | | | | | | | | compress_create_with_attr: Specifies the FILE_ATTRIBUTE_COMPRESSED attribute at create time, then checks the created file. compress_inherit_disable: Creates under a compressed directory, a file with the NTCREATEX_OPTIONS_NO_COMPRESSION option. Then checks that the newly created file doesn't inherit the parent compression state. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add file_attribs arg to file create helperDavid Disseldorp2013-08-151-24/+23
| | | | | | | Allows for the testing of file creation with FILE_ATTRIBUTE_COMPRESSED. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add compressed file attribute ioctl testDavid Disseldorp2013-08-151-0/+53
| | | | | | | | After marking a file for compression via FSCTL_SET_COMPRESSION, the FILE_ATTRIBUTE_COMPRESSED flag should be present. Test for this. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: check for filesystem compression capabilityDavid Disseldorp2013-08-151-18/+59
| | | | | | | | | Only run the compression tests if the compression capability is returned by the server in response to an SMB2_QUERY_INFO(FS attribute info) request. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: extend FSCTL_[GET/SET]_COMPRESSION testsDavid Disseldorp2013-08-151-39/+234
| | | | | | | | Check for inheritance of compression attributes from parent directories. Also, test error handling for invalid requests. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: add smb2 FSCTL_[GET/SET]_COMPRESSION testDavid Disseldorp2013-08-091-0/+84
| | | | | | | | | | | | | | | | | | This test simply creates a file and checks the compression state before and after FSCTL_SET_COMPRESSION(COMPRESSION_FORMAT_DEFAULT). The test expects the compression state to be COMPRESSION_FORMAT_LZNT1 after set, conforming to Windows Server behaviour. If the server responds to the first FSCTL_GET_COMPRESSION request with NT_STATUS_NOT_SUPPORTED or NT_STATUS_INVALID_DEVICE_REQUEST, then the test is skipped. This allows it to run during selftest. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Aug 9 22:03:39 CEST 2013 on sn-devel-104
* torture: split out ioctl test file creation helperDavid Disseldorp2013-08-091-56/+43
| | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture: copychunk test suite improvementsDavid Disseldorp2013-01-161-8/+719
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow for large files in test_setup_copy_chunk(): Write test data in 1M IOs, rather than attempting to do the whole thing in one go. Add copychunk bad resume key test: Send a copy chunk request with an intentionally bogus resume key (source key handle). Add copychunk src=dest test: Test copychunk requests where the source and destination handles refer to the same file. Add copychunk src=dest overlap test. Add desired access args to test_setup_copy_chunk(). Add copychunk_bad_access test: Open the copychunk source and destination files with differing desired_access values. Confirm copychunk response matches 2k8 and 2k12 behaviour. Add copy_chunk_src_exceed test: Attempts to copy more data than is present in the copychunk source file. Add copy_chunk_src_exceed_multi test: Test whether the first chunk in a multi-chunk copychunk request is written to disk, where the second chunk is invalid due to src file overrun. Add copy_chunk_sparse_dest test: Issue a request where the target offset exceeds the file size, resulting in a sparse region. Add copy_chunk_max_output_sz test. Reviewed by: Jeremy Allison <jra@samba.org>
* torture: replace ioctl failure returns with helper callsDavid Disseldorp2013-01-161-33/+25
| | | | | | | Also change test_ioctl_get_shadow_copy() to use torture_skip(), and clean up test output. Reviewed by: Jeremy Allison <jra@samba.org>
* torture: add locking tests for copychunkDavid Disseldorp2013-01-161-0/+228
| | | | Reviewed by: Jeremy Allison <jra@samba.org>
* torture: skip FSCTL_SRV_ENUM_SNAPS test when not supportedDavid Disseldorp2013-01-161-0/+6
| | | | | | | | If FSCTL_SRV_ENUM_SNAPS fails with NT_STATUS_NOT_SUPPORTED then skip the test, this means we can run the full ioctl test suite as part of autobuild. Reviewed by: Jeremy Allison <jra@samba.org>
* smb2_ioctl: remove ioctl error response assumptionsDavid Disseldorp2013-01-161-0/+58
| | | | | | | | | | | | MS-SMB2 3.3.4.4 documents cases where a ntstatus indicating an error should not be considered a failure. In such a case the output data buffer should be sent to the client rather than an error response packet. Add a new fsctl copy_chunk test to confirm field limits are sent back in response to an oversize chunk request. Reviewed by: Jeremy Allison <jra@samba.org>
* torture: Fix copy and paste error.Andreas Schneider2012-11-301-1/+1
| | | | Found by Coverity.
* s4:torture: avoid reporting error on failure of smb2.ioctl testsGregor Beck2012-03-061-148/+79
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s4:torture/smb2/ioctl.c - quiet format specifier warnings on 32 bitMatthias Dieter Wallnöfer2012-03-011-5/+6
| | | | Achieve this by using platform independent casts.
* s4-torture: smb2 copychunk data integrity checksDavid Disseldorp2011-10-311-0/+72
| | | | | | | | | | Perform simple integrity checks on destination file data following a successful copychunk request. Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: David Disseldorp <ddiss@samba.org> Autobuild-Date: Mon Oct 31 19:28:20 CET 2011 on sn-devel-104
* s4-torture: add smb2 copychunk ioctl testsDavid Disseldorp2011-10-311-7/+285
| | | | | | | | | | | | test_ioctl_copy_chunk_multi: Issue a copychunk request with multiple chunk descriptors. test_ioctl_copy_chunk_over: Issue a copychunk request with overlapping chunks. test_ioctl_copy_chunk_append: append data as part of a copy chunk test_ioctl_copy_chunk_tiny: issue request with sub FS block size chunk descriptors. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s4-torture: split common copychunk ioctl test code into helpersDavid Disseldorp2011-10-311-53/+112
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s4-torture: Add tests for the smb2 copychunk ioctlDavid Disseldorp2011-10-311-1/+172
| | | | | | Add idls for parsing of copychunk ioctl args. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: remove duplicate fsctl fn definitionsDavid Disseldorp2011-10-191-2/+2
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s4: add SMB2_FSCTL opcodesDavid Disseldorp2011-09-291-3/+3
| | | | | | | | Also, skip samba4.smb2.ioctl for now. Snapshots are not supported by default. Autobuild-User: David Disseldorp <ddiss@samba.org> Autobuild-Date: Thu Sep 29 14:47:05 CEST 2011 on sn-devel-104
* s4-torture: add smb2 ioctl test suiteDavid Disseldorp2011-09-291-0/+87
Currently only covers FSCTL_GET_SHADOW_COPY_DATA. Signed-off-by: Stefan Metzmacher <metze@samba.org>