s4-torture: add ndr test for spoolss_RpcSetJobNamedProperty.
authorGünther Deschner <gd@samba.org>
Thu, 31 Jan 2013 13:56:17 +0000 (14:56 +0100)
committerDavid Disseldorp <ddiss@samba.org>
Mon, 20 May 2013 16:50:00 +0000 (18:50 +0200)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
librpc/idl/spoolss.idl
source4/torture/ndr/spoolss.c

index f0ff2ff53f9feb97daf0e7896646014062f7e9e0..6a915c136601eee9eb7b756ab8931cf5bbcad1d7 100644 (file)
@@ -3380,7 +3380,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
 
        /******************/
        /* Function: 0x6f */
-       WERROR spoolss_RpcSetJobNamedProperty(
+       [public] WERROR spoolss_RpcSetJobNamedProperty(
                [in,ref] policy_handle *hPrinter,
                [in] uint32 JobId,
                [in,ref] RPC_PrintNamedProperty *pProperty
index 08d3d383c71be7db173211e7fc13f26a21a241f9..5818fdf209a308b8173d94c81118dc8e460dcbbd 100644 (file)
@@ -1740,6 +1740,34 @@ static const uint8_t getcoreprinterdrivers_64_req_data[] = {
        0x04, 0x00, 0x00, 0x00
 };
 
+static const uint8_t rpcsetjobnamedproperty_req_data[] = {
+       0x00, 0x00, 0x00, 0x00, 0x3d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0xff, 0x50, 0xdf, 0xe4, 0xce, 0x1a, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x14, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x53, 0x00, 0x70, 0x00,
+       0x6f, 0x00, 0x6f, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x46, 0x00, 0x69, 0x00,
+       0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x43, 0x00, 0x6f, 0x00, 0x6e, 0x00,
+       0x74, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x73, 0x00, 0x00, 0x00,
+       0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
+       0x54, 0x00, 0x59, 0x00, 0x50, 0x00, 0x45, 0x00, 0x5f, 0x00, 0x50, 0x00,
+       0x44, 0x00, 0x4c, 0x00, 0x5f, 0x00, 0x55, 0x00, 0x4e, 0x00, 0x4b, 0x00,
+       0x4e, 0x00, 0x4f, 0x00, 0x57, 0x00, 0x4e, 0x00, 0x00, 0x00
+};
+
+static bool rpcsetjobnamedproperty_req_check(struct torture_context *tctx,
+                                            struct spoolss_RpcSetJobNamedProperty *r)
+{
+       /* FIXME hPrinter */
+       torture_assert_int_equal(tctx, r->in.JobId, 0x00000005, "JobId");
+       torture_assert(tctx, r->in.pProperty, "pProperty");
+       torture_assert_str_equal(tctx, r->in.pProperty->propertyName, SPLFILE_CONTENT_TYPE_PROP_NAME, "propertyName");
+       torture_assert_int_equal(tctx, r->in.pProperty->propertyValue.ePropertyType, kRpcPropertyTypeString, "ePropertyType");
+       torture_assert_str_equal(tctx, r->in.pProperty->propertyValue.value.propertyString, SPLFILE_CONTENT_TYPE_PDL_UNKNOWN, "propertyString");
+
+       return true;
+}
+
 struct torture_suite *ndr_spoolss_suite(TALLOC_CTX *ctx)
 {
        struct torture_suite *suite = torture_suite_create(ctx, "spoolss");
@@ -1801,5 +1829,7 @@ struct torture_suite *ndr_spoolss_suite(TALLOC_CTX *ctx)
 
        torture_suite_add_ndr_pull_fn_test_flags(suite, spoolss_GetCorePrinterDrivers, getcoreprinterdrivers_64_req_data, NDR_IN, LIBNDR_FLAG_NDR64, NULL);
 
+       torture_suite_add_ndr_pull_fn_test(suite, spoolss_RpcSetJobNamedProperty, rpcsetjobnamedproperty_req_data, NDR_IN, rpcsetjobnamedproperty_req_check);
+
        return suite;
 }