summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-08-20 21:28:30 +0000
committerVolker Lendecke <vlendec@samba.org>2005-08-20 21:28:30 +0000
commit2efa5e70736d5eb6d5506fc9f9f1d20d22652955 (patch)
tree3a22c550496885fd474ad1d6924d2f7c2f67196d /source
parentcf9423f7ecebedcb63a673c1a284a2d21e912649 (diff)
downloadsamba-2efa5e70736d5eb6d5506fc9f9f1d20d22652955.tar.gz
samba-2efa5e70736d5eb6d5506fc9f9f1d20d22652955.tar.xz
samba-2efa5e70736d5eb6d5506fc9f9f1d20d22652955.zip
r9431: Check an error code in BASE-DELETE.
Volker
Diffstat (limited to 'source')
-rw-r--r--source/torture/basic/delete.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/torture/basic/delete.c b/source/torture/basic/delete.c
index e28561db379..081058af425 100644
--- a/source/torture/basic/delete.c
+++ b/source/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",