summaryrefslogtreecommitdiff
path: root/source4/torture/basic/delaywrite.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-03-05 21:28:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:15 -0500
commit72d88d158a6e82392116bab09ce8704115072d07 (patch)
tree784921beb62ef9299515fb6910a3de3bff4ebbc0 /source4/torture/basic/delaywrite.c
parentd18afd6aeec0831a46d75470383e7eb7bdfd8de5 (diff)
downloadsamba-72d88d158a6e82392116bab09ce8704115072d07.tar.gz
samba-72d88d158a6e82392116bab09ce8704115072d07.tar.bz2
samba-72d88d158a6e82392116bab09ce8704115072d07.zip
r21707: Finally merge my (long-living) perlselftest branch.
This changes the main selftest code to be in perl rather than in shell script. The selftest script is now no longer a black box but a regular executable that takes --help. This adds the following features: * "make test TESTS=foo" will run only the tests that match the regex "foo" * ability to deal with expected failures. the suite will not warn about tests that fail and are known to fail, but will warn about other failing tests and tests that are succeeding tests but incorrectly marked as failing. * ability to print a summary with all failures at the end of the run It also opens up the way to the following features, which I hope to implement later: * "environments", for example having a complete domains with DCs and domain members in a testenvironment * only set up smbd if necessary (not when running LOCAL tests, for example) * different mktestsetup scripts per target. except for the mktestsetup script, we can use the same infrastructure for samba 3 or windows. (This used to be commit 38f867880beb40c691e9713f854426031310629c)
Diffstat (limited to 'source4/torture/basic/delaywrite.c')
-rw-r--r--source4/torture/basic/delaywrite.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/source4/torture/basic/delaywrite.c b/source4/torture/basic/delaywrite.c
index 4c2a511721..072f15c623 100644
--- a/source4/torture/basic/delaywrite.c
+++ b/source4/torture/basic/delaywrite.c
@@ -487,6 +487,7 @@ static BOOL test_finfo_after_write(struct torture_context *tctx, struct smbcli_s
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum1 == -1) {
ret = False;
+ torture_result(tctx, TORTURE_FAIL, __location__": unable to open %s", fname);
goto done;
}
@@ -496,8 +497,8 @@ static BOOL test_finfo_after_write(struct torture_context *tctx, struct smbcli_s
status = smb_raw_fileinfo(cli->tree, tctx, &finfo1);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("fileinfo failed: %s\n", nt_errstr(status)));
ret = False;
+ torture_result(tctx, TORTURE_FAIL, __location__": fileinfo failed: %s", nt_errstr(status));
goto done;
}
@@ -506,16 +507,15 @@ static BOOL test_finfo_after_write(struct torture_context *tctx, struct smbcli_s
written = smbcli_write(cli->tree, fnum1, 0, "x", 0, 1);
if (written != 1) {
- torture_comment(tctx, "(%s) written gave %d - should have been 1\n",
- __location__, (int)written);
+ torture_result(tctx, TORTURE_FAIL, __location__": written gave %d - should have been 1", (int)written);
ret = False;
goto done;
}
fnum2 = smbcli_open(cli2->tree, fname, O_RDWR, DENY_NONE);
if (fnum2 == -1) {
- torture_comment(tctx, "(%s) failed to open 2nd time - %s\n",
- __location__, smbcli_errstr(cli2->tree));
+ torture_result(tctx, TORTURE_FAIL, __location__": failed to open 2nd time - %s",
+ smbcli_errstr(cli2->tree));
ret = False;
goto done;
}
@@ -523,8 +523,8 @@ static BOOL test_finfo_after_write(struct torture_context *tctx, struct smbcli_s
written = smbcli_write(cli2->tree, fnum2, 0, "x", 0, 1);
if (written != 1) {
- torture_comment(tctx, "(%s) written gave %d - should have been 1\n",
- __location__, (int)written);
+ torture_result(tctx, TORTURE_FAIL, __location__": written gave %d - should have been 1",
+ (int)written);
ret = False;
goto done;
}
@@ -535,30 +535,30 @@ static BOOL test_finfo_after_write(struct torture_context *tctx, struct smbcli_s
status = smb_raw_pathinfo(cli2->tree, tctx, &finfo2);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("(%s) fileinfo failed: %s\n",
- __location__, nt_errstr(status)));
+ torture_result(tctx, TORTURE_FAIL, __location__": fileinfo failed: %s",
+ nt_errstr(status));
ret = False;
goto done;
}
if (finfo1.basic_info.out.create_time !=
finfo2.basic_info.out.create_time) {
- torture_comment(tctx, "(%s) create_time changed\n", __location__);
+ torture_result(tctx, TORTURE_FAIL, __location__": create_time changed");
ret = False;
goto done;
}
if (finfo1.basic_info.out.access_time !=
finfo2.basic_info.out.access_time) {
- torture_comment(tctx, "(%s) access_time changed\n", __location__);
+ torture_result(tctx, TORTURE_FAIL, __location__": access_time changed");
ret = False;
goto done;
}
if (finfo1.basic_info.out.write_time !=
finfo2.basic_info.out.write_time) {
- torture_comment(tctx, "(%s) write_time changed\n", __location__);
- torture_comment(tctx, "write time conn 1 = %s, conn 2 = %s\n",
+ torture_result(tctx, TORTURE_FAIL, __location__": write_time changed:\n"
+ "write time conn 1 = %s, conn 2 = %s",
nt_time_string(tctx, finfo1.basic_info.out.write_time),
nt_time_string(tctx, finfo2.basic_info.out.write_time));
ret = False;
@@ -567,7 +567,7 @@ static BOOL test_finfo_after_write(struct torture_context *tctx, struct smbcli_s
if (finfo1.basic_info.out.change_time !=
finfo2.basic_info.out.change_time) {
- torture_comment(tctx, "(%s) change_time changed\n", __location__);
+ torture_result(tctx, TORTURE_FAIL, __location__": change_time changed");
ret = False;
goto done;
}
@@ -587,7 +587,7 @@ static BOOL test_finfo_after_write(struct torture_context *tctx, struct smbcli_s
status = smb_raw_pathinfo(cli->tree, tctx, &finfo2);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("fileinfo failed: %s\n", nt_errstr(status)));
+ torture_result(tctx, TORTURE_FAIL, __location__": fileinfo failed: %s", nt_errstr(status));
ret = False;
goto done;
}