summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-08-20 21:28:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:13 -0500
commit520139439ede489f94f32e4424526d9bb66fa597 (patch)
treee5545a19be7f367d82d4c5baad790d12fd7ab963 /source4
parent2069f87843369309b0496fcf3b2a4cfb66a7c33c (diff)
downloadsamba-520139439ede489f94f32e4424526d9bb66fa597.tar.gz
samba-520139439ede489f94f32e4424526d9bb66fa597.tar.bz2
samba-520139439ede489f94f32e4424526d9bb66fa597.zip
r9431: Check an error code in BASE-DELETE.
Volker (This used to be commit 71571fffc0493a5658c5980e6ebe4d8f9ada4699)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/basic/delete.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source4/torture/basic/delete.c b/source4/torture/basic/delete.c
index e28561db37..081058af42 100644
--- a/source4/torture/basic/delete.c
+++ b/source4/torture/basic/delete.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "librpc/gen_ndr/ndr_security.h"
+#include "libcli/raw/libcliraw.h"
static BOOL check_delete_on_close(struct smbcli_state *cli, int fnum,
const char *fname, BOOL expect_it)
@@ -131,6 +132,14 @@ static BOOL check_delete_on_close(struct smbcli_state *cli, int fnum,
return res;
}
+#define CHECK_STATUS(_cli, _expected) do { \
+ if (!NT_STATUS_EQUAL(_cli->tree->session->transport->error.e.nt_status, _expected)) { \
+ printf("(%d) Incorrect status %s - should be %s\n", \
+ __LINE__, nt_errstr(_cli->tree->session->transport->error.e.nt_status), nt_errstr(_expected)); \
+ correct = False; \
+ goto fail; \
+ }} while (0)
+
/*
Test delete on close semantics.
*/
@@ -383,8 +392,10 @@ BOOL torture_test_delete(void)
__location__, fname );
correct = False;
goto fail;
- } else
- printf("fourth delete on close test succeeded.\n");
+ }
+ CHECK_STATUS(cli1, NT_STATUS_DELETE_PENDING);
+
+ printf("fourth delete on close test succeeded.\n");
if (NT_STATUS_IS_ERR(smbcli_close(cli1->tree, fnum1))) {
printf("(%s) close - 2 failed (%s)\n",