]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
torture:fruit: Test timemachine for 0 bands
authorPavel Filipenský <pfilipensky@samba.org>
Thu, 2 Jan 2025 17:32:40 +0000 (18:32 +0100)
committerPavel Filipensky <pfilipensky@samba.org>
Sat, 4 Jan 2025 19:51:32 +0000 (19:51 +0000)
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
selftest/knownfail
source4/torture/vfs/fruit.c

index 51aae99d6b48fd9ded957238ca87bafddb6d3a55..7ae2ac1bc5e0f4037723d73941cd128c7d91cfec 100644 (file)
@@ -4,6 +4,7 @@
 # "make test" will not report failures for tests listed here and will consider
 # a successful run for any of these tests an error.
 
+^samba3.vfs.fruit_timemachine # this fails as number of band==0 causes divison by 0
 ^samba3.blackbox.failure.failure # this is designed to fail, for testing our test infrastructure
 .*driver.add_driver_timestamps # we only can store dates, not timestamps
  ^samba3.smbtorture_s3.crypt_server\(nt4_dc\).SMB2-SESSION-REAUTH # expected to give ACCESS_DENIED SMB2.1 doesn't have encryption
index c748326483a7729d1a0e48857aa3cb02c4a54fdb..6bad4e409c6e7f4c2911a7ecb2fdea6aef1f5f6b 100644 (file)
@@ -8125,15 +8125,24 @@ static bool test_timemachine_volsize(struct torture_context *tctx,
        torture_assert_ntstatus_ok_goto(tctx, status, ok, done,
                                        "smb2_util_mkdir\n");
 
+       status = smb2_util_roothandle(tree, &h);
+       torture_assert_ntstatus_ok(tctx, status, "Unable to create root handle");
+
+       /* Test that smbd does not crash if number of bands is 0 */
+       ZERO_STRUCT(fsinfo);
+       fsinfo.generic.level = RAW_QFS_SIZE_INFORMATION;
+       fsinfo.generic.handle = h;
+
+       status = smb2_getinfo_fs(tree, tree, &fsinfo);
+       torture_assert_ntstatus_ok(tctx, status, "smb2_getinfo_fs failed");
+
+       /* Setup 2 bands and test again */
        ok = torture_setup_file(tctx, tree, "test.sparsebundle/bands/1", false);
        torture_assert_goto(tctx, ok, ok, done, "torture_setup_file failed\n");
 
        ok = torture_setup_file(tctx, tree, "test.sparsebundle/bands/2", false);
        torture_assert_goto(tctx, ok, ok, done, "torture_setup_file failed\n");
 
-       status = smb2_util_roothandle(tree, &h);
-       torture_assert_ntstatus_ok(tctx, status, "Unable to create root handle");
-
        ZERO_STRUCT(fsinfo);
        fsinfo.generic.level = RAW_QFS_SIZE_INFORMATION;
        fsinfo.generic.handle = h;