1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

364 Commits

Author SHA1 Message Date
Volker Lendecke
47795aef9d lib: Remove tdb_open_compat
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:51 +01:00
Michael Adam
ca9e46d130 s4:torture:basic: eliminate potential for false failures in 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>
2014-10-03 08:34:06 +02:00
Michael Adam
95d333f03d s4:torture:basic: use assert in the second loop in delayed_write_update1b
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:06 +02:00
Michael Adam
8d198769d4 s4:torture:basic: add check for size after initial write in delayed_write_update1c
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:06 +02:00
Michael Adam
874788f4ce s4:torture:basic: add update into past as error condition in delayed_write_update1c
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:06 +02:00
Michael Adam
884f747678 s4:torture:basic: make use of torture_assert macros in delayed_write_update1c
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>
2014-10-03 08:34:06 +02:00
Michael Adam
641a8a2575 s4:torture:basic: whitespace cleanup in delayed_write_update1c
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:06 +02:00
Michael Adam
970ae65a9d s4:torture:basic: eliminate potential for false failures in 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>
2014-10-03 08:34:06 +02:00
Michael Adam
2907950f13 s4:torture:basic: use assert in the second loop in delayed_write_update1b
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:06 +02:00
Michael Adam
08432cd88f s4:torture:basic: add check for size after initial write in delayed_write_update1b
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:06 +02:00
Michael Adam
339f2fb589 s4:torture:basic: add update into past as error condition in delayed_write_update1b
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-03 08:34:06 +02:00
Michael Adam
dbb3a546a5 s4:torture:basic: make use of torture_assert macros in delayed_write_update1b
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>
2014-10-03 08:34:06 +02:00
Michael Adam
c0cbad7892 s4:torture:basic: whitespace cleanup in delayed_write_update1b
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
372d91b38b s4:torture:basic: eliminate potential for false failures in 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>
2014-10-03 08:34:05 +02:00
Michael Adam
2e1cb12848 s4:torture:basic: use assert in the second loop in delayed_write_update1a
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
de8dcdef3e s4:torture:basic: add check for size after initial write in delayed_write_update1a
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
17c78b9711 s4:torture:basic: add update into past as error condition in delayed_write_update1a
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
218a14f1a3 s4:torture:basic: make use of torture_assert macros in delayed_write_update1a
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>
2014-10-03 08:34:05 +02:00
Michael Adam
e99a550ccb s4:torture:basic: fix spacing in the delayed_write_update1a test.
No diff visible 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
1d2d0bc78f s4:torture:basic: eliminate potential for false failures in 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>
2014-10-03 08:34:05 +02:00
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
Michael Adam
c7c1f6490e s4:torture:base: slightly more generous timing in the defer_open test
This copes with cases where the server is very busy and
can't provide tortures more tight time scaling..
This is an attepmt to remove the flapping character of this test.

Signed-off-by: Michael Adam <obnox@samba.org>
Revieed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep 10 21:51:42 CEST 2014 on sn-devel-104
2014-09-10 21:51:42 +02:00
Michael Adam
589344802d s4:torture:base: add torture_comments to the loop of the deferopen test.
This is to be able to better tell what went wrong if something
went wrong. This is currently one of the main flapping tests.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-10 10:49:10 +02:00
Michael Adam
485cf5654d s4:torture:base: move i++ down in loop in run_deferopen()
This is where it belongs, and it prepares
subsequent patches.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-10 10:49:10 +02:00
Michael Adam
335171ef07 s4:torture: use torture_assert instead of torture_comment and return in defer_open test
The fix missed one instance, as autobuild has just told me...

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Aug 18 17:42:00 CEST 2014 on sn-devel-104
2014-08-18 17:42:00 +02:00
Michael Adam
a6e098fb22 s4:torture: use torture_assert instead of torture_comment and return in defer_open test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Michael Adam
3f422177ce s4:torture: consistently log "pid %u: ..." in the defer_open test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Michael Adam
5c6a1da82c s4:torture: remove an unused variable and bogus check from the defer_open test
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +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
89134fa05e torture: convert torture_comment() -> torture_result() so we can knownfail flapping base.* 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>
2014-06-12 08:11:42 +02:00
David Disseldorp
d9776c65e3 torture/attr: use security_ace_equal instead of sec_ace_equal
Both offer the same functionality, sec_ace_equal() will be removed.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-29 01:08:25 +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
Richard Sharpe
10b96e3ffe Fix the maxfids test so that it does not fork lots of processes and so that it works for all cases of maxfids.
Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Feb 15 07:09:59 CET 2013 on sn-devel-104
2013-02-15 07:09:59 +01:00
Andreas Schneider
ef0a945bf8 torture: Make sure we use the correct size for cxd.
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12 15:00:02 +01:00
Volker Lendecke
f01013b1a4 s4-torture: Fix some nonemtpy blank lines 2012-09-25 07:22:43 -07:00
Jeremy Allison
5e0365dfe8 Now SEC_RIGHTS_PRIV_RESTORE and SEC_RIGHTS_PRIV_BACKUP don't include any generic bits (they're used directly in the fileserver where the generic bits have already been mapped into file specific bits) we need to add the generic bits to the test when we have these privileges.
Mark samba4.base.maximum_allowed knownfail until we implement NTCREATEX_OPTIONS_BACKUP_INTENT.
2012-08-31 20:32:37 -07:00