summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-30 06:31:22 +0000
committerJeremy Allison <jra@samba.org>2001-03-30 06:31:22 +0000
commit54960b9c8d6be6646a0c0e8ef9ee6c61a4b69cf8 (patch)
tree3761989114e4b341b1842c34409015a7811abba0
parenta55ed1a91d91beafb2f199d1da530169715dbe0e (diff)
downloadsamba-54960b9c8d6be6646a0c0e8ef9ee6c61a4b69cf8.tar.gz
samba-54960b9c8d6be6646a0c0e8ef9ee6c61a4b69cf8.tar.xz
samba-54960b9c8d6be6646a0c0e8ef9ee6c61a4b69cf8.zip
Added one more test - just to make sure flag can be unset.
Jeremy.
-rw-r--r--source/utils/torture.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/source/utils/torture.c b/source/utils/torture.c
index 0869e5e0197..8588aa96106 100644
--- a/source/utils/torture.c
+++ b/source/utils/torture.c
@@ -2282,10 +2282,52 @@ static void run_deletetest(int dummy)
printf("sixth delete on close test succeeded.\n");
+ /* Test 7 ... */
cli_setatr(&cli1, fname, 0, 0);
cli_unlink(&cli1, fname);
- printf("finished delete test 1\n");
+ fnum1 = cli_nt_create_full(&cli1, fname, FILE_READ_DATA|FILE_WRITE_DATA|DELETE_ACCESS,
+ FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF, 0);
+
+ if (fnum1 == -1) {
+ printf("[7] open of %s failed (%s)\n", fname, cli_errstr(&cli1));
+ return;
+ }
+
+ if (!cli_nt_delete_on_close(&cli1, fnum1, True)) {
+ printf("[7] setting delete_on_close on file failed !\n");
+ return;
+ }
+
+ if (!cli_nt_delete_on_close(&cli1, fnum1, False)) {
+ printf("[7] unsetting delete_on_close on file failed !\n");
+ return;
+ }
+
+ if (!cli_close(&cli1, fnum1)) {
+ printf("[7] close - 2 failed (%s)\n", cli_errstr(&cli1));
+ return;
+ }
+
+ /* This next open should succeed - we reset the flag. */
+
+ fnum1 = cli_open(&cli1, fname, O_RDONLY, DENY_NONE);
+ if (fnum1 == -1) {
+ printf("[5] open of %s failed (%s)\n", fname, cli_errstr(&cli1));
+ return;
+ }
+
+ if (!cli_close(&cli1, fnum1)) {
+ printf("[7] close - 2 failed (%s)\n", cli_errstr(&cli1));
+ return;
+ }
+
+ printf("seventh delete on close test succeeded.\n");
+
+ cli_setatr(&cli1, fname, 0, 0);
+ cli_unlink(&cli1, fname);
+
+ printf("finished delete test\n");
close_connection(&cli1);
}