r9431: Check an error code in BASE-DELETE.
authorVolker Lendecke <vlendec@samba.org>
Sat, 20 Aug 2005 21:28:30 +0000 (21:28 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:34:13 +0000 (13:34 -0500)
Volker
(This used to be commit 71571fffc0493a5658c5980e6ebe4d8f9ada4699)

source4/torture/basic/delete.c

index e28561db37937afa5571a94d6b44e3bd042d7f10..081058af425c56843d36b52559259113773e1ec2 100644 (file)
@@ -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",