s4:torture: Do not check if the alloc_size is 0 on empty files
authorAndreas Schneider <asn@samba.org>
Tue, 11 Dec 2018 09:34:21 +0000 (10:34 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 12 Dec 2018 08:13:23 +0000 (09:13 +0100)
The allocation size might not be zero. This depends on the file system
behavior and also on the size of the extended attributes stored on the
file. E.g. If a large user.DOSATTRIB xattr is stored on XFS/ext4 then 8
blocks are used and we will round up to several megabytes.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/torture/smb2/durable_open.c
source4/torture/smb2/durable_v2_open.c
source4/torture/smb2/lease.c
source4/torture/smb2/replay.c
source4/torture/smb2/session.c

index 17b3b217b56e8ffb6450fd5ff7a804b374c03beb..229c39dce675fa26e0f777048f3c09728d89148c 100644 (file)
@@ -60,7 +60,6 @@
 #define CHECK_CREATED(__io, __created, __attribute)                    \
        do {                                                            \
                CHECK_VAL((__io)->out.create_action, NTCREATEX_ACTION_ ## __created); \
-               CHECK_VAL((__io)->out.alloc_size, 0);                   \
                CHECK_VAL((__io)->out.size, 0);                         \
                CHECK_VAL((__io)->out.file_attr, (__attribute));        \
                CHECK_VAL((__io)->out.reserved2, 0);                    \
index 25e6d27465a1833a98a8ad31d9b2d5233043422b..7609987e31ffb7d60e8d2237632f91fa41fef6b5 100644 (file)
@@ -45,7 +45,6 @@
 #define CHECK_CREATED(__io, __created, __attribute)                    \
        do {                                                            \
                CHECK_VAL((__io)->out.create_action, NTCREATEX_ACTION_ ## __created); \
-               CHECK_VAL((__io)->out.alloc_size, 0);                   \
                CHECK_VAL((__io)->out.size, 0);                         \
                CHECK_VAL((__io)->out.file_attr, (__attribute));        \
                CHECK_VAL((__io)->out.reserved2, 0);                    \
index bf45988222aebf2ddce109b8e7ae66064f80d876..430fcd0a6e12fd6d50bb21bb80cc2c117197a7ce 100644 (file)
@@ -49,7 +49,6 @@
 #define CHECK_CREATED(__io, __created, __attribute)                    \
        do {                                                            \
                CHECK_VAL((__io)->out.create_action, NTCREATEX_ACTION_ ## __created); \
-               CHECK_VAL((__io)->out.alloc_size, 0);                   \
                CHECK_VAL((__io)->out.size, 0);                         \
                CHECK_VAL((__io)->out.file_attr, (__attribute));        \
                CHECK_VAL((__io)->out.reserved2, 0);                    \
index 2ef40445aeef3924b2736a270abcd7c1ad5b3d6f..443d372a1d7717776dcdde5b424d1328fb1418b5 100644 (file)
@@ -52,7 +52,6 @@
 #define CHECK_CREATED(__io, __created, __attribute)                    \
        do {                                                            \
                CHECK_VAL((__io)->out.create_action, NTCREATEX_ACTION_ ## __created); \
-               CHECK_VAL((__io)->out.alloc_size, 0);                   \
                CHECK_VAL((__io)->out.size, 0);                         \
                CHECK_VAL((__io)->out.file_attr, (__attribute));        \
                CHECK_VAL((__io)->out.reserved2, 0);                    \
index 3917e0c09c49cbf45ea6797b2d63f4f67d1388e7..6d5f7b8594ec24e5317971c68fbb44f09b70a6be 100644 (file)
@@ -38,8 +38,6 @@
                torture_assert_int_equal(tctx, (__io)->out.create_action,       \
                                                NTCREATEX_ACTION_ ## __created, \
                                                "out.create_action incorrect"); \
-               torture_assert_int_equal(tctx, (__io)->out.alloc_size, 0,       \
-                                               "out.alloc_size incorrect");    \
                torture_assert_int_equal(tctx, (__io)->out.size, 0,             \
                                                "out.size incorrect");          \
                torture_assert_int_equal(tctx, (__io)->out.file_attr,           \