From 2296871f0c3b2c2d874c8b33034d608b89c5fd6f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 22 Feb 2011 16:40:23 -0800 Subject: Torture test added to run_opentest() to ensure we don't regress on the previous change. Autobuild-User: Jeremy Allison Autobuild-Date: Wed Feb 23 03:00:53 CET 2011 on sn-devel-104 --- source3/torture/torture.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source3/torture') diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 893497ebbe..2670485bcc 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -4440,6 +4440,7 @@ static bool run_opentest(int dummy) SMB_OFF_T fsize; bool correct = True; char *tmp_path; + NTSTATUS status; printf("starting open test\n"); @@ -4779,6 +4780,31 @@ static bool run_opentest(int dummy) cli_unlink(cli1, fname, aSYSTEM | aHIDDEN); + printf("TEST #8 testing open without WRITE_ATTRIBUTES, updating close write time.\n"); + status = cli_ntcreate(cli1, fname, 0, FILE_WRITE_DATA, FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, + FILE_OVERWRITE_IF, 0, 0, &fnum1); + if (!NT_STATUS_IS_OK(status)) { + printf("TEST #8 open of %s failed (%s)\n", fname, nt_errstr(status)); + correct = false; + goto out; + } + + /* Write to ensure we have to update the file time. */ + if (cli_write(cli1, fnum1, 0, "TEST DATA\n", 0, 10) != 10) { + printf("TEST #8 cli_write failed: %s\n", cli_errstr(cli1)); + correct = false; + goto out; + } + + status = cli_close(cli1, fnum1); + if (!NT_STATUS_IS_OK(status)) { + printf("TEST #8 close of %s failed (%s)\n", fname, nt_errstr(status)); + correct = false; + } + + out: + if (!torture_close_connection(cli1)) { correct = False; } -- cgit