From: Pavel Filipenský Date: Thu, 2 Jan 2025 17:32:40 +0000 (+0100) Subject: torture:fruit: Test timemachine for 0 bands X-Git-Tag: tdb-1.4.13~236 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=05d79abdc01dc58e19e62a9a6d047b3344409115;p=thirdparty%2Fsamba.git torture:fruit: Test timemachine for 0 bands Signed-off-by: Pavel Filipenský Reviewed-by: Ralph Boehme --- diff --git a/selftest/knownfail b/selftest/knownfail index 51aae99d6b4..7ae2ac1bc5e 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -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 diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c index c748326483a..6bad4e409c6 100644 --- a/source4/torture/vfs/fruit.c +++ b/source4/torture/vfs/fruit.c @@ -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;