diff options
author | Jeremy Allison <jra@samba.org> | 2011-02-22 16:40:23 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-02-23 03:00:53 +0100 |
commit | 2296871f0c3b2c2d874c8b33034d608b89c5fd6f (patch) | |
tree | e2270f27bcb2f073560c7a83d60a33919fce06c0 /source3 | |
parent | 7464793c9d00ac2aee40b1377477eb1e2b7c8251 (diff) | |
download | samba-2296871f0c3b2c2d874c8b33034d608b89c5fd6f.tar.gz samba-2296871f0c3b2c2d874c8b33034d608b89c5fd6f.tar.bz2 samba-2296871f0c3b2c2d874c8b33034d608b89c5fd6f.zip |
Torture test added to run_opentest() to ensure we don't regress on
the previous change.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Feb 23 03:00:53 CET 2011 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/torture/torture.c | 26 |
1 files changed, 26 insertions, 0 deletions
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; } |