1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s4:torture/rpc: avoid checking p->last_fault_code in iremotewinspool*

Now that we check for NT_STATUS_RPC_UNSUPPORTED_TYPE, there's no
need to check for DCERPC_NCA_S_UNSUPPORTED_TYPE.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Stefan Metzmacher 2024-09-18 22:42:17 +02:00 committed by Ralph Boehme
parent 492f6a0eef
commit b0be3c8af8
3 changed files with 7 additions and 20 deletions

View File

@ -824,8 +824,7 @@ static bool test_OpenPrinter(struct torture_context *tctx,
static bool test_object_one_uuid(struct torture_context *tctx, static bool test_object_one_uuid(struct torture_context *tctx,
const struct GUID *object_uuid, const struct GUID *object_uuid,
NTSTATUS expected_status, NTSTATUS expected_status)
uint32_t expected_fault_code)
{ {
const char *printer_name; const char *printer_name;
struct spoolss_UserLevel1 client_info; struct spoolss_UserLevel1 client_info;
@ -865,7 +864,6 @@ static bool test_object_one_uuid(struct torture_context *tctx,
client_info, client_info,
expected_status, expected_status,
WERR_OK, WERR_OK,
expected_fault_code,
&server_handle), &server_handle),
"failed to open printserver"); "failed to open printserver");
if (NT_STATUS_IS_OK(expected_status)) { if (NT_STATUS_IS_OK(expected_status)) {
@ -884,41 +882,35 @@ static bool test_object_uuid(struct torture_context *tctx,
torture_assert(tctx, torture_assert(tctx,
test_object_one_uuid(tctx, NULL, test_object_one_uuid(tctx, NULL,
NT_STATUS_RPC_UNSUPPORTED_TYPE, NT_STATUS_RPC_UNSUPPORTED_TYPE),
DCERPC_NCA_S_UNSUPPORTED_TYPE),
"failed to test NULL object uuid"); "failed to test NULL object uuid");
object_uuid = GUID_zero(); object_uuid = GUID_zero();
torture_assert(tctx, torture_assert(tctx,
test_object_one_uuid(tctx, &object_uuid, test_object_one_uuid(tctx, &object_uuid,
NT_STATUS_RPC_UNSUPPORTED_TYPE, NT_STATUS_RPC_UNSUPPORTED_TYPE),
DCERPC_NCA_S_UNSUPPORTED_TYPE),
"failed to test zeroed object uuid"); "failed to test zeroed object uuid");
object_uuid = GUID_random(); object_uuid = GUID_random();
torture_assert(tctx, torture_assert(tctx,
test_object_one_uuid(tctx, &object_uuid, test_object_one_uuid(tctx, &object_uuid,
NT_STATUS_RPC_UNSUPPORTED_TYPE, NT_STATUS_RPC_UNSUPPORTED_TYPE),
DCERPC_NCA_S_UNSUPPORTED_TYPE),
"failed to test random object uuid"); "failed to test random object uuid");
GUID_from_string(IREMOTEWINSPOOL_OBJECT_GUID, &object_uuid); GUID_from_string(IREMOTEWINSPOOL_OBJECT_GUID, &object_uuid);
torture_assert(tctx, torture_assert(tctx,
test_object_one_uuid(tctx, &object_uuid, test_object_one_uuid(tctx, &object_uuid,
NT_STATUS_OK, NT_STATUS_OK),
0),
"failed to test IREMOTEWINSPOOL_OBJECT_GUID"); "failed to test IREMOTEWINSPOOL_OBJECT_GUID");
torture_assert(tctx, torture_assert(tctx,
test_object_one_uuid(tctx, &ndr_table_spoolss.syntax_id.uuid, test_object_one_uuid(tctx, &ndr_table_spoolss.syntax_id.uuid,
NT_STATUS_RPC_UNSUPPORTED_TYPE, NT_STATUS_RPC_UNSUPPORTED_TYPE),
DCERPC_NCA_S_UNSUPPORTED_TYPE),
"failed to test spoolss interface uuid"); "failed to test spoolss interface uuid");
torture_assert(tctx, torture_assert(tctx,
test_object_one_uuid(tctx, &ndr_table_iremotewinspool.syntax_id.uuid, test_object_one_uuid(tctx, &ndr_table_iremotewinspool.syntax_id.uuid,
NT_STATUS_RPC_UNSUPPORTED_TYPE, NT_STATUS_RPC_UNSUPPORTED_TYPE),
DCERPC_NCA_S_UNSUPPORTED_TYPE),
"failed to test iremotewinspool interface uuid"); "failed to test iremotewinspool interface uuid");
return true; return true;

View File

@ -59,7 +59,6 @@ bool test_AsyncOpenPrinter_byprinter_expect(struct torture_context *tctx,
struct spoolss_UserLevel1 cinfo, struct spoolss_UserLevel1 cinfo,
NTSTATUS expected_status, NTSTATUS expected_status,
WERROR expected_result, WERROR expected_result,
uint32_t expected_fault_code,
struct policy_handle *handle) struct policy_handle *handle)
{ {
struct dcerpc_binding_handle *b = p->binding_handle; struct dcerpc_binding_handle *b = p->binding_handle;
@ -86,8 +85,6 @@ bool test_AsyncOpenPrinter_byprinter_expect(struct torture_context *tctx,
torture_assert_ntstatus_equal(tctx, status, expected_status, "AsyncOpenPrinter failed"); torture_assert_ntstatus_equal(tctx, status, expected_status, "AsyncOpenPrinter failed");
torture_assert_werr_equal(tctx, r.out.result, expected_result, torture_assert_werr_equal(tctx, r.out.result, expected_result,
"AsyncOpenPrinter failed"); "AsyncOpenPrinter failed");
torture_assert_u32_equal(tctx, p->last_fault_code, expected_fault_code,
"unexpected DCERPC fault code");
return ok; return ok;
} }
@ -107,7 +104,6 @@ bool test_AsyncOpenPrinter_byprinter(struct torture_context *tctx,
cinfo, cinfo,
NT_STATUS_OK, NT_STATUS_OK,
WERR_OK, WERR_OK,
0,
handle); handle);
} }

View File

@ -82,7 +82,6 @@ bool test_AsyncOpenPrinter_byprinter_expect(struct torture_context *tctx,
struct spoolss_UserLevel1 cinfo, struct spoolss_UserLevel1 cinfo,
NTSTATUS exected_status, NTSTATUS exected_status,
WERROR exected_result, WERROR exected_result,
uint32_t expected_fault_code,
struct policy_handle *handle); struct policy_handle *handle);
bool test_get_environment(struct torture_context *tctx, bool test_get_environment(struct torture_context *tctx,
struct dcerpc_binding_handle *b, struct dcerpc_binding_handle *b,