torture/ioctl: expect dup_extents(dest=compressed) to pass
authorDavid Disseldorp <ddiss@samba.org>
Fri, 30 Sep 2016 19:35:09 +0000 (21:35 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 10 May 2017 06:22:18 +0000 (08:22 +0200)
The MS-FSCC spec doesn't mention anything about dup-extents against
compressed files.
This can't be tested against Windows, as ReFS doesn't support
compression, but COW clones of compressed files work on Btrfs.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source4/torture/smb2/ioctl.c

index bd8310d46237a5325a5810f64afecdff4471459e..81f25a79329cbfa96e83542bb050f92e38f25738 100644 (file)
@@ -5803,7 +5803,7 @@ static bool test_ioctl_dup_extents_compressed_src(struct torture_context *tctx,
 }
 
 static bool test_ioctl_dup_extents_compressed_dest(struct torture_context *tctx,
-                                              struct smb2_tree *tree)
+                                                  struct smb2_tree *tree)
 {
        struct smb2_handle src_h;
        struct smb2_handle dest_h;
@@ -5863,8 +5863,13 @@ static bool test_ioctl_dup_extents_compressed_dest(struct torture_context *tctx,
                                   "ndr_push_fsctl_dup_extents_to_file");
 
        status = smb2_ioctl(tree, tmp_ctx, &ioctl.smb2);
-       torture_assert_ntstatus_equal(tctx, status, NT_STATUS_NOT_SUPPORTED,
-                                     "FSCTL_DUP_EXTENTS_TO_FILE");
+       torture_assert_ntstatus_ok(tctx, status,
+                                  "FSCTL_DUP_EXTENTS_TO_FILE");
+
+       ok = check_pattern(tctx, tree, tmp_ctx, dest_h, 0, 4096, 0);
+       if (!ok) {
+               torture_fail(tctx, "inconsistent file data");
+       }
 
        smb2_util_close(tree, src_h);
        smb2_util_close(tree, dest_h);