summaryrefslogtreecommitdiffstats
path: root/source4/torture/basic/delaywrite.c
Commit message (Collapse)AuthorAgeFilesLines
* s4:torture:basic: eliminate potential for false failures in ↵Michael Adam2014-10-031-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | delayed_write_update1c We want to test that the write did update the write time immediately. We check this by getting the file info in a loop for a few seconds. There are several result cases: - the server updated the write time immediately - success - the server updated the write time, but not immediately - failure - the server did not update the write time - failure The loop is only there to be able to discern between the two failure cases. The check for success is whether the first getinfo has reportet the updated write time. The potential for false failures was the additional timing check. So if the first fileinfo call just took too long (e.g. due to a busy system), this was reported as failure. This patch should eliminate interemittent autobuild failures. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: use assert in the second loop in delayed_write_update1bMichael Adam2014-10-031-11/+10
| | | | | | | 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>
* s4:torture:basic: add check for size after initial write in ↵Michael Adam2014-10-031-0/+3
| | | | | | | delayed_write_update1c Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: add update into past as error condition in ↵Michael Adam2014-10-031-3/+4
| | | | | | | delayed_write_update1c Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: make use of torture_assert macros in delayed_write_update1cMichael Adam2014-10-031-42/+23
| | | | | | | | This does not change the logic except for adding early returns in failure cases. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: whitespace cleanup in delayed_write_update1cMichael Adam2014-10-031-7/+7
| | | | | | | no diff with git diff -w Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: eliminate potential for false failures in ↵Michael Adam2014-10-031-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | delayed_write_update1b We want to test that the write did update the write time immediately. We check this by getting the file info in a loop for a few seconds. There are several result cases: - the server updated the write time immediately - success - the server updated the write time, but not immediately - failure - the server did not update the write time - failure The loop is only there to be able to discern between the two failure cases. The check for success is whether the first getinfo has reportet the updated write time. The potential for false failures was the additional timing check. So if the first fileinfo call just took too long (e.g. due to a busy system), this was reported as failure. This patch should eliminate interemittent autobuild failures. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: use assert in the second loop in delayed_write_update1bMichael Adam2014-10-031-11/+10
| | | | | | | 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>
* s4:torture:basic: add check for size after initial write in ↵Michael Adam2014-10-031-0/+3
| | | | | | | delayed_write_update1b Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: add update into past as error condition in ↵Michael Adam2014-10-031-3/+6
| | | | | | | delayed_write_update1b Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: make use of torture_assert macros in delayed_write_update1bMichael Adam2014-10-031-41/+24
| | | | | | | | This does not change the logic except for adding early returns in failure cases. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: whitespace cleanup in delayed_write_update1bMichael Adam2014-10-031-5/+5
| | | | | | | no diff with git diff -w Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: eliminate potential for false failures in ↵Michael Adam2014-10-031-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | delayed_write_update1a We want to test that the write did update the write time immediately. We check this by getting the file info in a loop for a few seconds. There are several result cases: - the server updated the write time immediately - success - the server updated the write time, but not immediately - failure - the server did not update the write time - failure The loop is only there to be able to discern between the two failure cases. The check for success is whether the first getinfo has reportet the updated write time. The potential for false failures was the additional timing check. So if the first fileinfo call just took too long (e.g. due to a busy system), this was reported as failure. This patch should eliminate interemittent autobuild failures. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: use assert in the second loop in delayed_write_update1aMichael Adam2014-10-031-11/+10
| | | | | | | 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>
* s4:torture:basic: add check for size after initial write in ↵Michael Adam2014-10-031-0/+3
| | | | | | | delayed_write_update1a Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: add update into past as error condition in ↵Michael Adam2014-10-031-3/+6
| | | | | | | delayed_write_update1a Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: make use of torture_assert macros in delayed_write_update1aMichael Adam2014-10-031-50/+27
| | | | | | | | | This does not change the logic except for adding early returns in failure cases. But it makes the code more compact and obvious. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: fix spacing in the delayed_write_update1a test.Michael Adam2014-10-031-6/+6
| | | | | | | No diff visible with git diff -w Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: eliminate potential for false failures in ↵Michael Adam2014-10-031-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | delayed_write_update1 We want to test that the write did update the write time immediately. We check this by getting the file info in a loop for a few seconds. There are several result cases: - the server updated the write time immediately - success - the server updated the write time, but not immediately - failure - the server did not update the write time - failure The loop is only there to be able to discern between the two failure cases. The check for success is whether the first getinfo has reportet the updated write time. The potential for false failures was the additional timing check. So if the first fileinfo call just took too long (e.g. due to a busy system), this was reported as failure. This patch should eliminate interemittent autobuild failures. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: use assert in the second loop in delayed_write_update1Michael Adam2014-10-031-11/+10
| | | | | | | 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>
* s4:torture:basic: add check for size after initial write to ↵Michael Adam2014-10-031-0/+3
| | | | | | | delayed_write_update1 Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: add update into past as error condition in ↵Michael Adam2014-10-031-3/+6
| | | | | | | delayed_write_update1 Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: make use of torture_assert macros in delayed_write_update1Michael Adam2014-10-031-56/+28
| | | | | | | No logic change except for adding early returns. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: whitespace fix in delayed_write_update1Michael Adam2014-10-031-4/+4
| | | | | | | No diff with git diff -w Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: remove two unused variables from delayed_write_update3cMichael Adam2014-10-031-4/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: use torture_assert macros in delayed_write_updateMichael Adam2014-10-031-31/+22
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture:basic: whitespace cleanup in delayed_write_updateMichael Adam2014-10-031-5/+5
| | | | | | | git diff -w shows no diff Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* torture: Remove confusing reference to (1 sec == 0.25)Andrew Bartlett2014-06-241-46/+46
| | | | | | | | | | | | | 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
* torture: tidy up whitespace for clarityAndrew Bartlett2014-06-231-2/+2
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Run base.delaywrite against plugin_s4_dc only, and with kerberos ↵Andrew Bartlett2014-06-231-6/+6
| | | | | | | for faster connections Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture-base.delaywrite: assert the for a delayed write, that it just takes ↵Andrew Bartlett2014-06-231-29/+24
| | | | | | | | | | | | 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>
* torture: Only error if the write time was updated is less than the expected ↵Andrew Bartlett2014-06-231-19/+19
| | | | | | | | | | | | | | 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>
* torture: Store writetimeupdatedelay in a double to allow easier comparisonAndrew Bartlett2014-06-231-16/+16
| | | | | | | | | | 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>
* torture: convert torture_comment() -> torture_result() so we can knownfail ↵Andrew Bartlett2014-06-121-34/+34
| | | | | | | | | | | | | 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
* selftest: Remove reduction in time window in delaywrite testAndrew Bartlett2014-04-021-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This causes flakey autobuilds from time to time. The reduction in the time window to 30% was added in: commit c2df97f57ce205935c37cd5a90cfeddb129cd92b 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 0d0fddf8ae856efd7ffb07ba8fa32d2f55d3f9c0 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 3aa7523d7750fe30d1e6bb5a75ac42b681b9e493) and in: commit edb3a83a069d39e123f18de098cfaab6deb16729 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 751ab2992afd13548af6e67a03d3ced566cb136f) Change-Id: I8ff9fb8a8b66308f6d784351a0f43b5b234889d1 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbtorture: New torture test for bug #9870.Jeremy Allison2013-12-051-0/+95
| | | | | | | | | | | | | | | 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
* s4-torture: Fix some nonemtpy blank linesVolker Lendecke2012-09-251-12/+12
|
* s4-torture: Improve torture test boilerplate, use torture_assert()Andrew Bartlett2012-05-181-48/+16
| | | | | | | | | 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
* Fix a bunch of "warning: variable ‘XXXX’ set but not used ↵Jeremy Allison2011-11-211-16/+8
| | | | | | | [-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
* source4/torture/basic: Fix prototypes for all functions.Jelmer Vernooij2011-03-191-0/+1
|
* s4-smbtorture: Make test names lowercase and dot-separated.Jelmer Vernooij2010-12-111-1/+1
| | | | | | | | 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
* s3/s4: merge msleep and smb_msleepBjörn Jacke2010-09-161-66/+66
| | | | | the merged variant is renamed to smb_msleep as some platforms already have a msleep function.
* Fix up some of the timing constants for DELAYWRITE. Add some extra tests up ↵Jeremy Allison2009-11-051-30/+114
| | | | | | | test_delayed_write_update6 to investigate what happens to a sticky write handle after a second handle close. Jeremy.
* Torture test for bug 6529 - Offline files conflict with Vista and Office 2003.Jeremy Allison2009-09-141-0/+131
| | | | | Ensure we don't regress. Jeremy.
* Allow systems with timestamp granularity of 1sec to work withJeremy Allison2009-08-241-0/+15
| | | | | this test. Jeremy.
* Note that the delaytime for update has changed betweek w2k3 and w2k8.Jeremy Allison2009-06-031-7/+11
| | | | | We must eventually parameterize this. Jeremy.
* Properly report why a test didn't succeed (required for use with knownJelmer Vernooij2008-09-181-117/+91
| | | | failures).
* Comment the delay write time tests so I know what they'reJeremy Allison2008-09-121-3/+41
| | | | | | testing. Jeremy. (This used to be commit 2bf9074c7751324483744f55b02cfb044bb0b2dd)
* A truncate write must be a smbcli_smbwrite, not aJeremy Allison2008-09-091-1/+1
| | | | | | smbcli_write. Jeremy. (This used to be commit 8cebd4d36c862dcdc6551dc6bf4dda2342dfede7)
* Make it easier to see when tests start/end.Jeremy Allison2008-09-081-15/+52
| | | | | Jeremy. (This used to be commit 6f89e728272ca14f0ed9557485e21647c0731ef2)