From 520139439ede489f94f32e4424526d9bb66fa597 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 20 Aug 2005 21:28:30 +0000 Subject: r9431: Check an error code in BASE-DELETE. Volker (This used to be commit 71571fffc0493a5658c5980e6ebe4d8f9ada4699) --- source4/torture/basic/delete.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source4/torture/basic') 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", -- cgit