From: Volker Lendecke Date: Tue, 10 Dec 2019 10:48:07 +0000 (+0100) Subject: torture: Run durable_v2_reconnect_delay_msec with leases X-Git-Tag: ldb-2.1.0~294 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7535359602e8b33e38ef1e0e38dc070773a39ea8;p=thirdparty%2Fsamba.git torture: Run durable_v2_reconnect_delay_msec with leases This will show a leases.tdb record leak. If you SIGSTOP the smbtorture process while it's in the 10-second wait, you will find locking.tdb and share_entries.tdb empty after the scavenger has cleaned up. But there will be an entry in leases.tdb left. I have no clue how to test this properly, or how to have a reasonably cheap assert in smbd during normal operations. The problem is that this leak can't really be distinguished from a "normal" leak that a crashed smbd would leave behind. Possibly we need a background job walking leases.tdb to clean this up properly. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/selftest/knownfail.d/durable-v2-delay b/selftest/knownfail.d/durable-v2-delay new file mode 100644 index 00000000000..2a84749b0eb --- /dev/null +++ b/selftest/knownfail.d/durable-v2-delay @@ -0,0 +1,2 @@ +# In the ad_dc env leases are disabled +^samba3.smb2.durable-v2-delay.durable_v2_reconnect_delay_msec\(ad_dc\) diff --git a/source4/torture/smb2/durable_v2_open.c b/source4/torture/smb2/durable_v2_open.c index 0f76abd7c5b..b2c519db3f6 100644 --- a/source4/torture/smb2/durable_v2_open.c +++ b/source4/torture/smb2/durable_v2_open.c @@ -2135,6 +2135,7 @@ static bool test_durable_v2_reconnect_delay_msec( struct smb2_handle _h; struct smb2_handle *h = NULL; struct smb2_create io; + struct smb2_lease ls; struct GUID create_guid = GUID_random(); struct smbcli_options options; uint64_t previous_session_id; @@ -2152,9 +2153,13 @@ static bool test_durable_v2_reconnect_delay_msec( smb2_util_unlink(tree, fname); - smb2_oplock_create_share(&io, fname, - smb2_util_share_access(""), - smb2_util_oplock_level("b")); + smb2_lease_create( + &io, + &ls, + false /* dir */, + fname, + generate_random_u64(), + smb2_util_lease_state("RWH")); io.in.durable_open = false; io.in.durable_open_v2 = true; io.in.persistent_open = false; @@ -2166,7 +2171,7 @@ static bool test_durable_v2_reconnect_delay_msec( _h = io.out.file.handle; h = &_h; - CHECK_VAL(io.out.oplock_level, smb2_util_oplock_level("b")); + CHECK_VAL(io.out.oplock_level, SMB2_OPLOCK_LEVEL_LEASE); CHECK_VAL(io.out.durable_open_v2, true); status = smb2_util_write(tree, *h, &b, 0, 1);