1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00
Commit Graph

69 Commits

Author SHA1 Message Date
Michael Adam
bc93c8249b s4:torture:basic: use assert in the second loop in delayed_write_update1
We can hence replace the assert after the loop by a success torture_comment.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:05 +02:00
Michael Adam
91c5940421 s4:torture:basic: add check for size after initial write to delayed_write_update1
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:05 +02:00
Michael Adam
32dee459dc s4:torture:basic: add update into past as error condition in delayed_write_update1
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:05 +02:00
Michael Adam
4808e3d3ee s4:torture:basic: make use of torture_assert macros in delayed_write_update1
No logic change except for adding early returns.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:05 +02:00
Michael Adam
5d8a498536 s4:torture:basic: whitespace fix in delayed_write_update1
No diff with git diff -w

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:05 +02:00
Michael Adam
dc9ea4f849 s4:torture:basic: remove two unused variables from delayed_write_update3c
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:05 +02:00
Michael Adam
4df94065c7 s4:torture:basic: use torture_assert macros in delayed_write_update
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:05 +02:00
Michael Adam
6cb9d976cf s4:torture:basic: whitespace cleanup in delayed_write_update
git diff -w shows no diff

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:05 +02:00
Andrew Bartlett
f45f2d0116 torture: Remove confusing reference to (1 sec == 0.25)
The write should never update the time, so the fraction of the write
time delay we use is not important.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun 24 01:44:06 CEST 2014 on sn-devel-104
2014-06-24 01:44:06 +02:00
Andrew Bartlett
f3f2b52f9f torture: tidy up whitespace for clarity
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:14 +02:00
Andrew Bartlett
00a83effc1 selftest: Run base.delaywrite against plugin_s4_dc only, and with kerberos for faster connections
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:14 +02:00
Andrew Bartlett
0e224698f7 torture-base.delaywrite: assert the for a delayed write, that it just takes longer than our configured delay
This removes the hardcoded TIMEDELAY_SECS that was then made variable
by the confusing "secs" variable

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:14 +02:00
Andrew Bartlett
f407f58fd3 torture: Only error if the write time was updated is less than the expected delay
The previous test was far, far too tight, it was in seconds 1/4 of the
fraction of the normal delay we had configured Samba to use so (1/4) *
(500 000 / 2000 000) = 1/16 (sec).  This margin appears to just be too
tight for our loaded test server.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:14 +02:00
Andrew Bartlett
24a73bb526 torture: Store writetimeupdatedelay in a double to allow easier comparison
In particular, this avoids a comparison with
double diff = timeval_elapsed() being promoted to an integer.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-23 23:30:14 +02:00
Andrew Bartlett
37e7b5a1b0 torture: convert torture_comment() -> torture_result() so we can knownfail flapping base.delaywrite tests
This only changes instances directly before a return false, ret =
false or goto fail statement.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jun 12 10:39:38 CEST 2014 on sn-devel-104
2014-06-12 10:39:38 +02:00
Andrew Bartlett
1bdc635f1d selftest: Remove reduction in time window in delaywrite test
This causes flakey autobuilds from time to time.

The reduction in the time window to 30% was added in:

commit c2df97f57c
Author: Jeremy Allison <jra@samba.org>
Date:   Thu Nov 5 15:37:26 2009 -0800

    Fix up some of the timing constants for DELAYWRITE. Add some extra tests up test_delayed_write_update6
    to investigate what happens to a sticky write handle after a second handle close.
    Jeremy.

The original reduction to 75% was set in the new code

commit 0d0fddf8ae
Author: Jeremy Allison <jra@samba.org>
Date:   Fri Sep 5 14:24:36 2008 -0700

    Added tests that show that write time update is immediate
    when changing file size using SMBwrite of size zero,
    SET_END_OF_FILE, or SET_ALLOCATION_SIZE - no 2 second
    delay in these cases.
    Jeremy.
    (This used to be commit 3aa7523d77)

and in:

commit edb3a83a06
Author: Stefan Metzmacher <metze@samba.org>
Date:   Tue Apr 8 10:25:51 2008 +0200

    BASE-DELAYWRITE: use timeval_* and make it possible to spefic the writetime update delay

    metze
    (This used to be commit 751ab2992a)

Change-Id: I8ff9fb8a8b66308f6d784351a0f43b5b234889d1
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-02 00:31:48 +02:00
Jeremy Allison
48f426b22d smbtorture: New torture test for bug #9870.
Not fetching the latest modification time on a folder if we have read locks on it.

Prove we should just rely on the mtime value from the underlying
filesystem, even with an open handle.

  BUG: https://bugzilla.samba.org/show_bug.cgi?id=9870

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Dec  5 10:05:06 CET 2013 on sn-devel-104
2013-12-05 10:05:06 +01:00
Volker Lendecke
f01013b1a4 s4-torture: Fix some nonemtpy blank lines 2012-09-25 07:22:43 -07:00
Andrew Bartlett
45082a88c7 s4-torture: Improve torture test boilerplate, use torture_assert()
This ensures that if this fails, it is reported as a subunit error correctly.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri May 18 09:35:13 CEST 2012 on sn-devel-104
2012-05-18 09:35:13 +02:00
Jeremy Allison
3e6e1aed94 Fix a bunch of "warning: variable ‘XXXX’ set but not used [-Wunused-but-set-variable]" warnings from the new gcc.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Nov 21 23:39:08 CET 2011 on sn-devel-104
2011-11-21 23:39:08 +01:00
Jelmer Vernooij
be9f1ca1c6 source4/torture/basic: Fix prototypes for all functions. 2011-03-19 03:20:04 +01:00
Jelmer Vernooij
35fbc7bbda s4-smbtorture: Make test names lowercase and dot-separated.
This is consistent with the test names used by selftest, should
make the names less confusing and easier to integrate with other tools.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Dec 11 04:16:13 CET 2010 on sn-devel-104
2010-12-11 04:16:13 +01:00
Björn Jacke
2b254c814b s3/s4: merge msleep and smb_msleep
the merged variant is renamed to smb_msleep as some platforms already have a
msleep function.
2010-09-16 21:38:20 +02:00
Jeremy Allison
c2df97f57c Fix up some of the timing constants for DELAYWRITE. Add some extra tests up test_delayed_write_update6
to investigate what happens to a sticky write handle after a second handle close.
Jeremy.
2009-11-05 15:37:26 -08:00
Jeremy Allison
f3cc05b96d Torture test for bug 6529 - Offline files conflict with Vista and Office 2003.
Ensure we don't regress.
Jeremy.
2009-09-14 18:45:16 -07:00
Jeremy Allison
9a86f26a5f Allow systems with timestamp granularity of 1sec to work with
this test.
Jeremy.
2009-08-24 18:21:23 -07:00
Jeremy Allison
0daf9a042c Note that the delaytime for update has changed betweek w2k3 and w2k8.
We must eventually parameterize this.
Jeremy.
2009-06-03 14:12:18 -07:00
Jelmer Vernooij
a61c9ded40 Properly report why a test didn't succeed (required for use with known
failures).
2008-09-18 16:05:46 +02:00
Jeremy Allison
6ce1c893fa Comment the delay write time tests so I know what they're
testing.
Jeremy.
(This used to be commit 2bf9074c77)
2008-09-12 14:59:32 -07:00
Jeremy Allison
bc731db854 A truncate write must be a smbcli_smbwrite, not a
smbcli_write.
Jeremy.
(This used to be commit 8cebd4d36c)
2008-09-09 21:24:34 -07:00
Jeremy Allison
2c2a79eefa Make it easier to see when tests start/end.
Jeremy.
(This used to be commit 6f89e72827)
2008-09-08 14:58:58 -07:00
Stefan Metzmacher
ad34034797 BASE-DELAYWRITE: test behavior of SMBwrite truncate, writeX, SMBwrite truncate and writeX again
metze
(This used to be commit 66b8c8d80e)
2008-09-08 16:22:57 +02:00
Stefan Metzmacher
f009e78864 BASE-DELAYWRITE: test behavior of writeX, SMBwrite truncate, writeX and SMBwrite again
metze
(This used to be commit 051164ba0a)
2008-09-08 16:22:57 +02:00
Stefan Metzmacher
1cf9d7e078 BASE-DELAYWRITE: demonstrate that a truncate write doesn't update the write time after SET_FILE_INFO
metze
(This used to be commit f81014db9d)
2008-09-08 16:22:53 +02:00
Stefan Metzmacher
a626b01193 BASE-DELAYWRITE: demonstrate that the time between the open and the first write doesn't matter
metze
(This used to be commit 13d051cd63)
2008-09-08 12:12:25 +02:00
Stefan Metzmacher
3ca48b015f BASE-DELAYWRITE: test more details of the truncate write time update behavior
metze
(This used to be commit 39367ef15f)
2008-09-08 08:31:34 +02:00
Jeremy Allison
56b6b4a68f Don't compare identity, it'll never be different.
Jeremy.
(This used to be commit 840369b553)
2008-09-05 21:47:06 -07:00
Jeremy Allison
0d0fddf8ae Added tests that show that write time update is immediate
when changing file size using SMBwrite of size zero,
SET_END_OF_FILE, or SET_ALLOCATION_SIZE - no 2 second
delay in these cases.
Jeremy.
(This used to be commit 3aa7523d77)
2008-09-05 14:24:36 -07:00
Andrew Tridgell
70219bee13 Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit 9d74201e46)
2008-06-03 15:11:42 -07:00
Stefan Metzmacher
6610a6c49a BASE-DELAYWRITE: fix test on filesystem without high resolution timestamps
metze
(This used to be commit fde9880f99)
2008-06-03 14:03:49 +02:00
Stefan Metzmacher
fb4c9dd5eb BASE-DELAYWRITE: add missing time checks to make sure the server has updated the write time
metze
(This used to be commit 9c004df891)
2008-06-03 11:17:17 +02:00
Andrew Tridgell
e7b30f023b remove unused macros
(This used to be commit 7a1877db15)
2008-06-02 11:04:36 +10:00
Stefan Metzmacher
4677ac6e70 BASE-DELAYWRITE: be more friendly to filesystems without high resolution timestamps
metze
(This used to be commit 9c18cf6708)
2008-04-08 19:42:06 +02:00
Stefan Metzmacher
edb3a83a06 BASE-DELAYWRITE: use timeval_* and make it possible to spefic the writetime update delay
metze
(This used to be commit 751ab2992a)
2008-04-08 16:55:16 +02:00
Jelmer Vernooij
afe3e8172d Install public header files again and include required prototypes.
(This used to be commit 47ffbbf674)
2008-04-02 04:53:27 +02:00
Stefan Metzmacher
1fbe268ec9 r26307: BASE-DELAYWRITE: only set the write time
metze
(This used to be commit b7d7a58b23)
2007-12-21 05:48:19 +01:00
Stefan Metzmacher
8036dbcf7f r26306: BASE-DELAYWRITE: print access time stamps and test fileinfo and pathinfo match
metze
(This used to be commit 58bc21a3f8)
2007-12-21 05:48:19 +01:00
Stefan Metzmacher
4ab0b47ffd r26220: BASE-DELAYWRITE: add more subtests to explore write time update details
metze
(This used to be commit 92dcc85e3a)
2007-12-21 05:46:57 +01:00
Stefan Metzmacher
c555c3fa38 r26219: BASE-DELAYWRITE: make the tests more strict about the write time update
metze
(This used to be commit c1335651d3)
2007-12-21 05:46:57 +01:00
Jelmer Vernooij
2151cde580 r25554: Convert last instances of BOOL, True and False to the standard types.
(This used to be commit 566aa14139)
2007-10-10 15:07:55 -05:00