torture/ioctl: test set_compression(format_none)
authorDavid Disseldorp <ddiss@samba.org>
Thu, 5 Jan 2017 16:10:42 +0000 (17:10 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 9 Jan 2017 18:31:20 +0000 (19:31 +0100)
This test case was overlooked in the previous bso#12144 update -
set compression requests with format=COMPRESSION_FORMAT_NONE should
succeed if the server / backing storage doesn't offer compression
support.
Confirm that Samba matches Windows Server 2016 ReFS behaviour here.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12144

Reported-by: Nick Barrett <nick@barrett.org.nz>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/smb2/ioctl.c

index 01cc1500aabe3807a8287fb80010871d91cf06a5..54a36a860363c1adef297a54cba326c606bc79e9 100644 (file)
@@ -2608,7 +2608,16 @@ static bool test_ioctl_compress_notsup_set(struct torture_context *torture,
                                         COMPRESSION_FORMAT_DEFAULT);
        torture_assert_ntstatus_equal(torture, status,
                                      NT_STATUS_NOT_SUPPORTED,
-                                     "FSCTL_GET_COMPRESSION");
+                                     "FSCTL_SET_COMPRESSION default");
+
+       /*
+        * Despite not supporting compression, we should get a successful
+        * response for set(COMPRESSION_FORMAT_NONE) - like WS2016 ReFS.
+        */
+       status = test_ioctl_compress_set(torture, tmp_ctx, tree, fh,
+                                        COMPRESSION_FORMAT_NONE);
+       torture_assert_ntstatus_ok(torture, status,
+                                  "FSCTL_SET_COMPRESSION none");
 
        smb2_util_close(tree, fh);
        talloc_free(tmp_ctx);