summaryrefslogtreecommitdiff
path: root/source3
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
commit9874ebc3d3355465f884f3aad4d69914a4e1f0c5 (patch)
treedbbf444f6a7523755b845baa1658123bd4cc568a /source3
parent0be5f29179440e3c9035c0b898af2f0856b2541f (diff)
downloadsamba-9874ebc3d3355465f884f3aad4d69914a4e1f0c5.tar.gz
samba-9874ebc3d3355465f884f3aad4d69914a4e1f0c5.tar.bz2
samba-9874ebc3d3355465f884f3aad4d69914a4e1f0c5.zip
Added one more test - just to make sure flag can be unset.
Jeremy. (This used to be commit 54960b9c8d6be6646a0c0e8ef9ee6c61a4b69cf8)
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/torture.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/source3/utils/torture.c b/source3/utils/torture.c
index 0869e5e019..8588aa9610 100644
--- a/source3/utils/torture.c
+++ b/source3/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);
}