summaryrefslogtreecommitdiff
path: root/source4/torture/basic
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-04 05:05:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:10 -0500
commitfee56ea90040a020cfe1938a3678effa00b772d4 (patch)
tree0ce5c2fb63ff0b65e7c21e2034f2ec5402ede7aa /source4/torture/basic
parent54fba5b1b875cdb549510ad1d218b39b2a3c6d64 (diff)
downloadsamba-fee56ea90040a020cfe1938a3678effa00b772d4.tar.gz
samba-fee56ea90040a020cfe1938a3678effa00b772d4.tar.bz2
samba-fee56ea90040a020cfe1938a3678effa00b772d4.zip
r8117: fixed a bunch more dos error code handing.
The biggest change was fixing the RAW-CONTEXT test. It was forcing capabilities to zero in an attempt to not negotiated extended security, but as a side effect it was forcing negotiation of dos error codes. This confused the hell out of the test code! Also fixed a bunch of places incorrectly using NT_STATUS_V() instead of NT_STATUS_EQUAL() and several places that had the wrong dos status codes (This used to be commit 0b22744f40804a0d6dc94bfc40ec09306f584f7e)
Diffstat (limited to 'source4/torture/basic')
-rw-r--r--source4/torture/basic/attr.c6
-rw-r--r--source4/torture/basic/delete.c4
-rw-r--r--source4/torture/basic/locking.c12
-rw-r--r--source4/torture/basic/scanner.c20
4 files changed, 21 insertions, 21 deletions
diff --git a/source4/torture/basic/attr.c b/source4/torture/basic/attr.c
index 07a36ea950..daa0f98d60 100644
--- a/source4/torture/basic/attr.c
+++ b/source4/torture/basic/attr.c
@@ -130,15 +130,15 @@ BOOL torture_openattrtest(void)
if (fnum1 == -1) {
for (l = 0; l < ARRAY_SIZE(attr_results); l++) {
if (attr_results[l].num == k) {
- printf("[%d] trunc open 0x%x -> 0x%x of %s failed - should have succeeded !(0x%x:%s)\n",
+ printf("[%d] trunc open 0x%x -> 0x%x of %s failed - should have succeeded !(%s)\n",
k, open_attrs_table[i],
open_attrs_table[j],
- fname, NT_STATUS_V(smbcli_nt_error(cli1->tree)), smbcli_errstr(cli1->tree));
+ fname, smbcli_errstr(cli1->tree));
correct = False;
CHECK_MAX_FAILURES(error_exit);
}
}
- if (NT_STATUS_V(smbcli_nt_error(cli1->tree)) != NT_STATUS_V(NT_STATUS_ACCESS_DENIED)) {
+ if (!NT_STATUS_EQUAL(smbcli_nt_error(cli1->tree), NT_STATUS_ACCESS_DENIED)) {
printf("[%d] trunc open 0x%x -> 0x%x failed with wrong error code %s\n",
k, open_attrs_table[i], open_attrs_table[j],
smbcli_errstr(cli1->tree));
diff --git a/source4/torture/basic/delete.c b/source4/torture/basic/delete.c
index f3aef08ce1..7ddd39c1cb 100644
--- a/source4/torture/basic/delete.c
+++ b/source4/torture/basic/delete.c
@@ -550,7 +550,7 @@ BOOL torture_test_delete(void)
status = smbcli_nt_delete_on_close(cli1->tree, fnum1, True);
- if (NT_STATUS_V(status) != NT_STATUS_V(NT_STATUS_CANNOT_DELETE)) {
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_CANNOT_DELETE)) {
printf("(%s) setting delete_on_close should fail with NT_STATUS_CANNOT_DELETE. Got %s instead)\n",
__location__, smbcli_errstr(cli1->tree));
correct = False;
@@ -585,7 +585,7 @@ BOOL torture_test_delete(void)
goto fail;
} else {
status = smbcli_nt_error(cli1->tree);
- if (NT_STATUS_V(status) != NT_STATUS_V(NT_STATUS_CANNOT_DELETE)) {
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_CANNOT_DELETE)) {
printf("(%s) setting delete_on_close on open should fail with NT_STATUS_CANNOT_DELETE. Got %s instead)\n",
__location__, smbcli_errstr(cli1->tree));
correct = False;
diff --git a/source4/torture/basic/locking.c b/source4/torture/basic/locking.c
index c3feaae2eb..3f395f3907 100644
--- a/source4/torture/basic/locking.c
+++ b/source4/torture/basic/locking.c
@@ -281,7 +281,7 @@ BOOL torture_locktest2(void)
correct = False;
} else {
if (!check_error(__location__, cli,
- ERRDOS, ERRlock,
+ ERRDOS, ERRnotlocked,
NT_STATUS_RANGE_NOT_LOCKED)) return False;
}
@@ -290,7 +290,7 @@ BOOL torture_locktest2(void)
correct = False;
} else {
if (!check_error(__location__, cli,
- ERRDOS, ERRlock,
+ ERRDOS, ERRnotlocked,
NT_STATUS_RANGE_NOT_LOCKED)) return False;
}
@@ -851,7 +851,7 @@ BOOL torture_locktest7(void)
if (smbcli_write(cli1->tree, fnum1, 0, buf, 130, 4) != 4) {
printf("pid1 unable to write to the range 130:4, error was %s\n", smbcli_errstr(cli1->tree));
- if (NT_STATUS_V(smbcli_nt_error(cli1->tree)) != NT_STATUS_V(NT_STATUS_FILE_LOCK_CONFLICT)) {
+ if (!NT_STATUS_EQUAL(smbcli_nt_error(cli1->tree), NT_STATUS_FILE_LOCK_CONFLICT)) {
printf("Incorrect error (should be NT_STATUS_FILE_LOCK_CONFLICT) (%s)\n",
__location__);
goto fail;
@@ -872,7 +872,7 @@ BOOL torture_locktest7(void)
if (smbcli_write(cli1->tree, fnum1, 0, buf, 130, 4) != 4) {
printf("pid2 unable to write to the range 130:4, error was %s\n", smbcli_errstr(cli1->tree));
- if (NT_STATUS_V(smbcli_nt_error(cli1->tree)) != NT_STATUS_V(NT_STATUS_FILE_LOCK_CONFLICT)) {
+ if (!NT_STATUS_EQUAL(smbcli_nt_error(cli1->tree), NT_STATUS_FILE_LOCK_CONFLICT)) {
printf("Incorrect error (should be NT_STATUS_FILE_LOCK_CONFLICT) (%s)\n",
__location__);
goto fail;
@@ -915,7 +915,7 @@ BOOL torture_locktest7(void)
if (smbcli_read(cli1->tree, fnum1, buf, 130, 4) != 4) {
printf("pid2 unable to read the range 130:4, error was %s\n",
smbcli_errstr(cli1->tree));
- if (NT_STATUS_V(smbcli_nt_error(cli1->tree)) != NT_STATUS_V(NT_STATUS_FILE_LOCK_CONFLICT)) {
+ if (!NT_STATUS_EQUAL(smbcli_nt_error(cli1->tree), NT_STATUS_FILE_LOCK_CONFLICT)) {
printf("Incorrect error (should be NT_STATUS_FILE_LOCK_CONFLICT) (%s)\n",
__location__);
goto fail;
@@ -929,7 +929,7 @@ BOOL torture_locktest7(void)
if (smbcli_write(cli1->tree, fnum1, 0, buf, 130, 4) != 4) {
printf("pid2 unable to write to the range 130:4, error was %s\n",
smbcli_errstr(cli1->tree));
- if (NT_STATUS_V(smbcli_nt_error(cli1->tree)) != NT_STATUS_V(NT_STATUS_FILE_LOCK_CONFLICT)) {
+ if (!NT_STATUS_EQUAL(smbcli_nt_error(cli1->tree), NT_STATUS_FILE_LOCK_CONFLICT)) {
printf("Incorrect error (should be NT_STATUS_FILE_LOCK_CONFLICT) (%s)\n",
__location__);
goto fail;
diff --git a/source4/torture/basic/scanner.c b/source4/torture/basic/scanner.c
index df9234feca..06dff7e72c 100644
--- a/source4/torture/basic/scanner.c
+++ b/source4/torture/basic/scanner.c
@@ -33,11 +33,11 @@ look for a partial hit
****************************************************************************/
static void trans2_check_hit(const char *format, int op, int level, NTSTATUS status)
{
- if (NT_STATUS_V(status) == NT_STATUS_V(NT_STATUS_INVALID_LEVEL) ||
- NT_STATUS_V(status) == NT_STATUS_V(NT_STATUS_NOT_IMPLEMENTED) ||
- NT_STATUS_V(status) == NT_STATUS_V(NT_STATUS_NOT_SUPPORTED) ||
- NT_STATUS_V(status) == NT_STATUS_V(NT_STATUS_UNSUCCESSFUL) ||
- NT_STATUS_V(status) == NT_STATUS_V(NT_STATUS_INVALID_INFO_CLASS)) {
+ if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_LEVEL) ||
+ NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED) ||
+ NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED) ||
+ NT_STATUS_EQUAL(status, NT_STATUS_UNSUCCESSFUL) ||
+ NT_STATUS_EQUAL(status, NT_STATUS_INVALID_INFO_CLASS)) {
return;
}
#if VERBOSE
@@ -311,11 +311,11 @@ look for a partial hit
****************************************************************************/
static void nttrans_check_hit(const char *format, int op, int level, NTSTATUS status)
{
- if (NT_STATUS_V(status) == NT_STATUS_V(NT_STATUS_INVALID_LEVEL) ||
- NT_STATUS_V(status) == NT_STATUS_V(NT_STATUS_NOT_IMPLEMENTED) ||
- NT_STATUS_V(status) == NT_STATUS_V(NT_STATUS_NOT_SUPPORTED) ||
- NT_STATUS_V(status) == NT_STATUS_V(NT_STATUS_UNSUCCESSFUL) ||
- NT_STATUS_V(status) == NT_STATUS_V(NT_STATUS_INVALID_INFO_CLASS)) {
+ if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_LEVEL) ||
+ NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED) ||
+ NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED) ||
+ NT_STATUS_EQUAL(status, NT_STATUS_UNSUCCESSFUL) ||
+ NT_STATUS_EQUAL(status, NT_STATUS_INVALID_INFO_CLASS)) {
return;
}
#if VERBOSE